diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 05:27:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-10 05:27:25 +0000 |
commit | c9c06167e7933d93a6e396174c68abf242294abb (patch) | |
tree | d9a8bb30663e9a3405a1ef37ffb62bc14b9f019f /include/linux | |
parent | f79e8cc3c34e4192a3e5ef4cc9c6542fdef703c0 (diff) |
Merge with Linux 2.4.0-test12.
Diffstat (limited to 'include/linux')
54 files changed, 810 insertions, 323 deletions
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index 7457cd114..d18b71dc7 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h @@ -207,7 +207,7 @@ typedef struct _agp_file_private { struct _agp_file_private *next; struct _agp_file_private *prev; pid_t my_pid; - u32 access_flags; + long access_flags; /* long req'd for set_bit --RR */ } agp_file_private; struct agp_front_data { diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 69ea9cf48..9dba26eeb 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h @@ -38,7 +38,7 @@ struct apm_bios_info { unsigned short dseg_len; }; - /* Results of APM Installation Check */ +/* Results of APM Installation Check */ #define APM_16_BIT_SUPPORT 0x0001 #define APM_32_BIT_SUPPORT 0x0002 #define APM_IDLE_SLOWS_CLOCK 0x0004 @@ -46,6 +46,15 @@ struct apm_bios_info { #define APM_BIOS_DISENGAGED 0x0010 /* + * Data for APM that is persistant across module unload/load + */ +struct apm_info { + struct apm_bios_info bios; + unsigned short connection_version; + int get_power_status_broken; +}; + +/* * The APM function codes */ #define APM_FUNC_INST_CHECK 0x5300 @@ -91,12 +100,9 @@ struct apm_bios_info { #define APM_FUNC_TIMER_GET 2 /* - * in init/main.c + * in arch/i386/kernel/setup.c */ -extern struct apm_bios_info apm_bios_info; - -extern int apm_register_callback(int (*callback)(apm_event_t)); -extern void apm_unregister_callback(int (*callback)(apm_event_t)); +extern struct apm_info apm_info; #endif /* __KERNEL__ */ @@ -176,7 +182,7 @@ extern void apm_unregister_callback(int (*callback)(apm_event_t)); /* * This is the "All Devices" ID communicated to the BIOS */ -#define APM_DEVICE_BALL ((apm_bios_info.version > 0x0100) ? \ +#define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \ APM_DEVICE_ALL : APM_DEVICE_OLD_ALL) #endif diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 4d5ada52b..d169bf7f2 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -257,7 +257,7 @@ enum { #define ATM_ATMOPT_CLP 1 /* set CLP bit */ -typedef struct { unsigned int bits; } atm_vcc_flags_t; +typedef struct { unsigned long bits; } atm_vcc_flags_t; struct atm_vcc { diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index afe274a4c..a4ffcbb75 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h @@ -1,6 +1,6 @@ /* * include/linux/bfs_fs.h - BFS data structures on disk. - * Copyright (C) 1999 Tigran Aivazian <tigran@ocston.org> + * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> */ #ifndef _LINUX_BFS_FS_H diff --git a/include/linux/bfs_fs_i.h b/include/linux/bfs_fs_i.h index 647352882..e939b229e 100644 --- a/include/linux/bfs_fs_i.h +++ b/include/linux/bfs_fs_i.h @@ -1,6 +1,6 @@ /* * include/linux/bfs_fs_i.h - * Copyright (C) 1999 Tigran Aivazian <tigran@ocston.org> + * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> */ #ifndef _LINUX_BFS_FS_I diff --git a/include/linux/bfs_fs_sb.h b/include/linux/bfs_fs_sb.h index 5f927f35b..efdc30ec7 100644 --- a/include/linux/bfs_fs_sb.h +++ b/include/linux/bfs_fs_sb.h @@ -1,6 +1,6 @@ /* * include/linux/bfs_fs_sb.h - * Copyright (C) 1999 Tigran Aivazian <tigran@ocston.org> + * Copyright (C) 1999 Tigran Aivazian <tigran@veritas.com> */ #ifndef _LINUX_BFS_FS_SB diff --git a/include/linux/compatmac.h b/include/linux/compatmac.h index 07d8356d0..72f9151b8 100644 --- a/include/linux/compatmac.h +++ b/include/linux/compatmac.h @@ -104,7 +104,6 @@ static inline void *ioremap(unsigned long base, long length) #define capable(x) suser() -#define queue_task queue_task_irq_off #define tty_flip_buffer_push(tty) queue_task(&tty->flip.tqueue, &tq_timer) #define signal_pending(current) (current->signal & ~current->blocked) #define schedule_timeout(to) do {current->timeout = jiffies + (to);schedule ();} while (0) diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index af962e94f..dd9fdcfaf 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -549,9 +549,10 @@ extern int ext2_write (struct inode *, struct file *, char *, int); /* fsync.c */ extern int ext2_sync_file (struct file *, struct dentry *, int); +extern int ext2_fsync_inode (struct inode *, int); /* ialloc.c */ -extern struct inode * ext2_new_inode (const struct inode *, int, int *); +extern struct inode * ext2_new_inode (const struct inode *, int); extern void ext2_free_inode (struct inode *); extern unsigned long ext2_count_free_inodes (struct super_block *); extern void ext2_check_inodes_bitmap (struct super_block *); diff --git a/include/linux/fs.h b/include/linux/fs.h index 470186804..2ef374aa1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -243,6 +243,9 @@ struct buffer_head { unsigned long b_rsector; /* Real buffer location on disk */ wait_queue_head_t b_wait; + + struct inode * b_inode; + struct list_head b_inode_buffers; /* doubly linked list of inode dirty buffers */ }; typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); @@ -349,7 +352,7 @@ struct page; struct address_space; struct address_space_operations { - int (*writepage)(struct file *, struct page *); + int (*writepage)(struct page *); int (*readpage)(struct file *, struct page *); int (*sync_page)(struct page *); int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); @@ -382,6 +385,8 @@ struct inode { struct list_head i_hash; struct list_head i_list; struct list_head i_dentry; + + struct list_head i_dirty_buffers; unsigned long i_ino; atomic_t i_count; @@ -452,16 +457,25 @@ struct inode { }; /* Inode state bits.. */ -#define I_DIRTY 1 -#define I_LOCK 2 -#define I_FREEING 4 -#define I_CLEAR 8 +#define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ +#define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ +#define I_LOCK 4 +#define I_FREEING 8 +#define I_CLEAR 16 + +#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC) -extern void __mark_inode_dirty(struct inode *); +extern void __mark_inode_dirty(struct inode *, int); static inline void mark_inode_dirty(struct inode *inode) { - if (!(inode->i_state & I_DIRTY)) - __mark_inode_dirty(inode); + if ((inode->i_state & I_DIRTY) != I_DIRTY) + __mark_inode_dirty(inode, I_DIRTY); +} + +static inline void mark_inode_dirty_sync(struct inode *inode) +{ + if (!(inode->i_state & I_DIRTY_SYNC)) + __mark_inode_dirty(inode, I_DIRTY_SYNC); } struct fown_struct { @@ -1025,10 +1039,18 @@ static inline void buffer_IO_error(struct buffer_head * bh) bh->b_end_io(bh, 0); } +extern void buffer_insert_inode_queue(struct buffer_head *, struct inode *); +static inline void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode) +{ + mark_buffer_dirty(bh); + buffer_insert_inode_queue(bh, inode); +} + extern void balance_dirty(kdev_t); extern int check_disk_change(kdev_t); extern int invalidate_inodes(struct super_block *); extern void invalidate_inode_pages(struct inode *); +extern void invalidate_inode_buffers(struct inode *); #define invalidate_buffers(dev) __invalidate_buffers((dev), 0) #define destroy_buffers(dev) __invalidate_buffers((dev), 1) extern void __invalidate_buffers(kdev_t dev, int); @@ -1036,10 +1058,14 @@ extern void sync_inodes(kdev_t); extern void write_inode_now(struct inode *, int); extern void sync_dev(kdev_t); extern int fsync_dev(kdev_t); +extern int fsync_inode_buffers(struct inode *); +extern int osync_inode_buffers(struct inode *); +extern int inode_has_buffers(struct inode *); extern void sync_supers(kdev_t); extern int bmap(struct inode *, int); extern int notify_change(struct dentry *, struct iattr *); extern int permission(struct inode *, int); +extern int vfs_permission(struct inode *, int); extern int get_write_access(struct inode *); extern int deny_write_access(struct file *); static inline void put_write_access(struct inode * inode) @@ -1167,6 +1193,7 @@ extern void file_moveto(struct file *new, struct file *old); extern struct buffer_head * get_hash_table(kdev_t, int, int); extern struct buffer_head * getblk(kdev_t, int, int); extern void ll_rw_block(int, int, struct buffer_head * bh[]); +extern void submit_bh(int, struct buffer_head *); extern int is_read_only(kdev_t); extern void __brelse(struct buffer_head *); static inline void brelse(struct buffer_head *buf) @@ -1183,7 +1210,6 @@ static inline void bforget(struct buffer_head *buf) extern void set_blocksize(kdev_t, int); extern unsigned int get_hardblocksize(kdev_t); extern struct buffer_head * bread(kdev_t, int, int); -extern struct buffer_head * breada(kdev_t, int, int, unsigned int, unsigned int); extern void wakeup_bdflush(int wait); extern int brw_page(int, struct page *, kdev_t, int [], int); @@ -1249,6 +1275,7 @@ extern ssize_t block_write(struct file *, const char *, size_t, loff_t *); extern int file_fsync(struct file *, struct dentry *, int); extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start_idx, unsigned long end_idx); +extern int generic_osync_inode(struct inode *, int); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index 2a55e6018..99a5444da 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -199,7 +199,7 @@ struct hdlcdrv_state { struct hdlcdrv_hdlcrx { struct hdlcdrv_hdlcbuffer hbuf; - int in_hdlc_rx; + long in_hdlc_rx; /* 0 = sync hunt, != 0 receiving */ int rx_state; unsigned int bitstream; diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 9cac7759a..eb5405d33 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -13,8 +13,6 @@ extern struct page *highmem_start_page; /* declarations for linux/mm/highmem.c */ FASTCALL(unsigned int nr_free_highpages(void)); -extern struct page * prepare_highmem_swapout(struct page *); -extern struct page * replace_with_highmem(struct page *); extern struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig); @@ -31,8 +29,6 @@ static inline void bh_kunmap(struct buffer_head *bh) #else /* CONFIG_HIGHMEM */ static inline unsigned int nr_free_highpages(void) { return 0; } -#define prepare_highmem_swapout(page) page -#define replace_with_highmem(page) page static inline void *kmap(struct page *page) { return page_address(page); } diff --git a/include/linux/highuid.h b/include/linux/highuid.h index 5d287bbb3..d5a9ff5d0 100644 --- a/include/linux/highuid.h +++ b/include/linux/highuid.h @@ -41,14 +41,14 @@ extern int overflowgid; #ifdef CONFIG_UID16 /* prevent uid mod 65536 effect by returning a default value for high UIDs */ -#define high2lowuid(uid) ((uid) > 65535) ? (old_uid_t)overflowuid : (old_uid_t)(uid) -#define high2lowgid(gid) ((gid) > 65535) ? (old_gid_t)overflowgid : (old_gid_t)(gid) +#define high2lowuid(uid) ((uid) > 65535 ? (old_uid_t)overflowuid : (old_uid_t)(uid)) +#define high2lowgid(gid) ((gid) > 65535 ? (old_gid_t)overflowgid : (old_gid_t)(gid)) /* * -1 is different in 16 bits than it is in 32 bits * these macros are used by chown(), setreuid(), ..., */ -#define low2highuid(uid) ((uid) == (old_uid_t)-1) ? (uid_t)-1 : (uid_t)(uid) -#define low2highgid(gid) ((gid) == (old_gid_t)-1) ? (gid_t)-1 : (gid_t)(gid) +#define low2highuid(uid) ((uid) == (old_uid_t)-1 ? (uid_t)-1 : (uid_t)(uid)) +#define low2highgid(gid) ((gid) == (old_gid_t)-1 ? (gid_t)-1 : (gid_t)(gid)) /* Avoid extra ifdefs with these macros */ @@ -67,13 +67,13 @@ extern int overflowgid; #define SET_UID16(var, uid) do { ; } while (0) #define SET_GID16(var, gid) do { ; } while (0) -#define NEW_TO_OLD_UID(uid) uid -#define NEW_TO_OLD_GID(gid) gid +#define NEW_TO_OLD_UID(uid) (uid) +#define NEW_TO_OLD_GID(gid) (gid) -#define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = uid -#define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = gid -#define SET_STAT_UID(stat, uid) (stat).st_uid = uid -#define SET_STAT_GID(stat, gid) (stat).st_gid = gid +#define SET_OLDSTAT_UID(stat, uid) (stat).st_uid = (uid) +#define SET_OLDSTAT_GID(stat, gid) (stat).st_gid = (gid) +#define SET_STAT_UID(stat, uid) (stat).st_uid = (uid) +#define SET_STAT_GID(stat, gid) (stat).st_gid = (gid) #endif /* CONFIG_UID16 */ @@ -97,10 +97,10 @@ extern int fs_overflowgid; * Since these macros are used in architectures that only need limited * 16-bit UID back compatibility, we won't use old_uid_t and old_gid_t */ -#define fs_high2lowuid(uid) (uid > 65535) ? (uid16_t)fs_overflowuid : (uid16_t)uid -#define fs_high2lowgid(gid) (gid > 65535) ? (gid16_t)fs_overflowgid : (gid16_t)gid +#define fs_high2lowuid(uid) ((uid) > 65535 ? (uid16_t)fs_overflowuid : (uid16_t)(uid)) +#define fs_high2lowgid(gid) ((gid) > 65535 ? (gid16_t)fs_overflowgid : (gid16_t)(gid)) -#define low_16_bits(x) x & 0xFFFF -#define high_16_bits(x) (x & 0xFFFF0000) >> 16 +#define low_16_bits(x) ((x) & 0xFFFF) +#define high_16_bits(x) (((x) & 0xFFFF0000) >> 16) #endif /* _LINUX_HIGHUID_H */ diff --git a/include/linux/icmp.h b/include/linux/icmp.h index 292888923..49e3e931d 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h @@ -84,11 +84,6 @@ struct icmphdr { #include <linux/ip.h> -struct icmp_err { - int errno; - unsigned fatal:1; -}; - /* * Build xmit assembly blocks */ diff --git a/include/linux/ioport.h b/include/linux/ioport.h index a24e7770a..7c3569949 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -19,6 +19,12 @@ struct resource { struct resource *parent, *sibling, *child; }; +struct resource_list { + struct resource_list *next; + struct resource *res; + struct pci_dev *dev; +}; + /* * IO resources have these defined flags. */ @@ -34,6 +40,7 @@ struct resource { #define IORESOURCE_CACHEABLE 0x00004000 #define IORESOURCE_RANGELENGTH 0x00008000 #define IORESOURCE_SHADOWABLE 0x00010000 +#define IORESOURCE_BUS_HAS_VGA 0x00080000 #define IORESOURCE_UNSET 0x20000000 #define IORESOURCE_AUTO 0x40000000 diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 51c06aec7..23cf7ed73 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,4 @@ -/* $Id: isdn.h,v 1.110 2000/11/01 17:54:01 detabc Exp $ +/* $Id: isdn.h,v 1.111 2000/11/25 17:01:02 kai Exp $ * Main header for the Linux ISDN subsystem (linklevel). * @@ -684,10 +684,8 @@ typedef struct isdn_devt { extern isdn_dev *dev; - /* Utility-Macros */ #define MIN(a,b) ((a<b)?a:b) #define MAX(a,b) ((a>b)?a:b) - #endif /* __KERNEL__ */ #endif /* isdn_h */ diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index 15ebaffcb..1d5d4f85b 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h @@ -1,4 +1,4 @@ -/* $Id: isdnif.h,v 1.35 2000/06/16 13:19:38 keil Exp $ +/* $Id: isdnif.h,v 1.37 2000/11/19 17:01:54 kai Exp $ * Linux ISDN subsystem * @@ -53,6 +53,7 @@ #define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */ #define ISDN_PROTO_L2_MODEM 10 /* Analog Modem on Board */ #define ISDN_PROTO_L2_FAX 11 /* Fax Group 2/3 */ +#define ISDN_PROTO_L2_HDLC_56K 12 /* HDLC 56k */ #define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */ /* @@ -253,6 +254,7 @@ typedef struct #define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038) #define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM) #define ISDN_FEATURE_L2_FAX (0x0001 << ISDN_PROTO_L2_FAX) +#define ISDN_FEATURE_L2_HDLC_56K (0x0001 << ISDN_PROTO_L2_HDLC_56K) #define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */ #define ISDN_FEATURE_L2_SHIFT (0) diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 471c9af2c..e664eed06 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -185,8 +185,6 @@ int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct i int get_acorn_filename(struct iso_directory_record *, char *, struct inode *); extern struct dentry *isofs_lookup(struct inode *, struct dentry *); -extern int isofs_get_block(struct inode *, long, struct buffer_head *, int); -extern int isofs_bmap(struct inode *, int); extern struct buffer_head *isofs_bread(struct inode *, unsigned int, unsigned int); extern struct inode_operations isofs_dir_inode_operations; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index beb41bfa3..50ee12471 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -56,17 +56,34 @@ NORET_TYPE void up_and_exit(struct semaphore *, long) ATTRIB_NORET; extern unsigned long simple_strtoul(const char *,char **,unsigned int); extern long simple_strtol(const char *,char **,unsigned int); +extern unsigned long long simple_strtoull(const char *,char **,unsigned int); +extern long long simple_strtoll(const char *,char **,unsigned int); extern int sprintf(char * buf, const char * fmt, ...); extern int vsprintf(char *buf, const char *, va_list); extern int get_option(char **str, int *pint); extern char *get_options(char *str, int nints, int *ints); extern unsigned long memparse(char *ptr, char **retptr); +extern void dev_probe_lock(void); +extern void dev_probe_unlock(void); extern int session_of_pgrp(int pgrp); asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))); +extern int console_loglevel; + +static inline void console_silent(void) +{ + console_loglevel = 0; +} + +static inline void console_verbose(void) +{ + if (console_loglevel) + console_loglevel = 15; +} + #if DEBUG #define pr_debug(fmt,arg...) \ printk(KERN_DEBUG fmt,##arg) diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index acbdea338..2677f9646 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -1,5 +1,5 @@ /* - * $Id: kernelcapi.h,v 1.8 2000/08/22 10:11:00 calle Exp $ + * $Id: kernelcapi.h,v 1.8.6.1 2000/11/28 09:36:56 kai Exp $ * * Kernel CAPI 2.0 Interface for Linux * diff --git a/include/linux/mm.h b/include/linux/mm.h index 70ffe28e4..37bc9a4a1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -204,7 +204,7 @@ typedef struct page { */ #define UnlockPage(page) do { \ smp_mb__before_clear_bit(); \ - clear_bit(PG_locked, &(page)->flags); \ + if (!test_and_clear_bit(PG_locked, &(page)->flags)) BUG(); \ smp_mb__after_clear_bit(); \ if (waitqueue_active(&page->wait)) \ wake_up(&page->wait); \ @@ -454,11 +454,9 @@ extern unsigned long page_unuse(struct page *); extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ -extern int filemap_swapout(struct page * page, struct file *file); -extern int filemap_sync(struct vm_area_struct * vma, unsigned long address, - size_t size, unsigned int flags); -extern struct page *filemap_nopage(struct vm_area_struct * area, - unsigned long address, int no_share); +extern int filemap_swapout(struct page *, struct file *); +extern int filemap_sync(struct vm_area_struct *, unsigned long, size_t, unsigned int); +extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int); /* * GFP bitmasks.. diff --git a/include/linux/module.h b/include/linux/module.h index 249cb0163..7f416d7fb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -168,6 +168,7 @@ struct module_info * Keith Owens <kaos@ocs.com.au> 28 Oct 2000. */ +#ifdef __KERNEL__ #define HAVE_INTER_MODULE extern void inter_module_register(const char *, struct module *, const void *); extern void inter_module_unregister(const char *); @@ -183,6 +184,7 @@ struct inter_module_entry { }; extern int try_inc_mod_count(struct module *mod); +#endif /* __KERNEL__ */ #if defined(MODULE) && !defined(__GENKSYMS__) @@ -345,7 +347,7 @@ __attribute__((section("__ksymtab"))) = \ #endif /* MODULE */ #ifdef CONFIG_MODULES -#define SET_MODULE_OWNER(some_struct) do { some_struct->owner = THIS_MODULE; } while (0) +#define SET_MODULE_OWNER(some_struct) do { (some_struct)->owner = THIS_MODULE; } while (0) #else #define SET_MODULE_OWNER(some_struct) do { } while (0) #endif diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index c8bdd1cd7..4ce69eee8 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -91,8 +91,9 @@ struct cfi_private { must be of the same type. */ int numchips; unsigned long chipshift; /* Because they're of the same type */ - struct flchip chips[0]; /* per-chip data structure for each chip */ const char *im_name; /* inter_module name for cmdset_setup */ + struct flchip chips[0]; /* per-chip data structure for each chip */ + /* do not add extra fields after "chips" */ }; #define MAX_CFI_CHIPS 8 /* Entirely arbitrary to avoid realloc() */ diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 0ed87cdb4..696938aa1 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h @@ -2,7 +2,7 @@ /* Linux driver for Disk-On-Chip 2000 */ /* (c) 1999 Machine Vision Holdings, Inc. */ /* Author: David Woodhouse <dwmw2@mvhi.com> */ -/* $Id: doc2000.h,v 1.8 2000/07/10 15:46:29 dwmw2 Exp $ */ +/* $Id: doc2000.h,v 1.12 2000/11/03 12:43:43 dwmw2 Exp $ */ #ifndef __MTD_DOC2000_H__ #define __MTD_DOC2000_H__ @@ -44,16 +44,24 @@ * Others use readb/writeb */ #if defined(__arm__) -#define ReadDOC(adr, reg) ((unsigned char)(*(__u32 *)(((unsigned long)adr)+(DoC_##reg<<2)))) -#define WriteDOC(d, adr, reg) do{ *(__u32 *)(((unsigned long)adr)+(DoC_##reg<<2)) = (__u32)d} while(0) +#define ReadDOC_(adr, reg) ((unsigned char)(*(__u32 *)(((unsigned long)adr)+(reg<<2)))) +#define WriteDOC_(d, adr, reg) do{ *(__u32 *)(((unsigned long)adr)+(reg<<2)) = (__u32)d} while(0) #elif defined(__ppc__) -#define ReadDOC(adr, reg) ((unsigned char)(*(__u16 *)(((unsigned long)adr)+(DoC_##reg<<1)))) -#define WriteDOC(d, adr, reg) do{ *(__u16 *)(((unsigned long)adr)+(DoC_##reg<<1)) = (__u16)d} while(0) +#define ReadDOC_(adr, reg) ((unsigned char)(*(__u16 *)(((unsigned long)adr)+(reg<<1)))) +#define WriteDOC_(d, adr, reg) do{ *(__u16 *)(((unsigned long)adr)+(reg<<1)) = (__u16)d} while(0) #else -#define ReadDOC(adr, reg) readb(((unsigned long)adr) + DoC_##reg) -#define WriteDOC(d, adr, reg) writeb(d, ((unsigned long)adr) + DoC_##reg) +#define ReadDOC_(adr, reg) readb(((unsigned long)adr) + reg) +#define WriteDOC_(d, adr, reg) writeb(d, ((unsigned long)adr) + reg) #endif +#if defined(__i386__) +#define USE_MEMCPY +#endif + +/* These are provided to directly use the DoC_xxx defines */ +#define ReadDOC(adr, reg) ReadDOC_(adr,DoC_##reg) +#define WriteDOC(d, adr, reg) WriteDOC_(d,adr,DoC_##reg) + #define DOC_MODE_RESET 0 #define DOC_MODE_NORMAL 1 #define DOC_MODE_RESERVED1 2 @@ -80,9 +88,10 @@ #define DOC_TOGGLE_BIT 0x04 #define DOC_ECC_RESV 0x02 #define DOC_ECC_IGNORE 0x01 + /* We have to also set the reserved bit 1 for enable */ #define DOC_ECC_EN (DOC_ECC__EN | DOC_ECC_RESV) -#define DOC_ECC_DIS (DOC_ECC_IGNORE | DOC_ECC_RESV) +#define DOC_ECC_DIS (DOC_ECC_RESV) struct Nand { char floor, chip; @@ -97,15 +106,23 @@ struct Nand { #define MAX_FLOORS_MIL 4 #define MAX_CHIPS_MIL 1 +#define ADDR_COLUMN 1 +#define ADDR_PAGE 2 +#define ADDR_COLUMN_PAGE 3 + struct DiskOnChip { unsigned long physadr; unsigned long virtadr; unsigned long totlen; char ChipID; /* Type of DiskOnChip */ + int ioreg; unsigned long mfr; /* Flash IDs - only one type of flash per device */ unsigned long id; int chipshift; + char page256; + char pageadrlen; + unsigned long erasesize; int curfloor; int curchip; @@ -115,5 +132,6 @@ struct DiskOnChip { struct mtd_info *nextdoc; }; +int doc_decode_ecc(unsigned char sector[512], unsigned char ecc1[6]); #endif /* __MTD_DOC2000_H__ */ diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index ebb41c973..705169800 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -1,6 +1,6 @@ /* Overhauled routines for dealing with different mmap regions of flash */ -/* $Id: map.h,v 1.5 2000/06/26 16:18:58 dwmw2 Exp $ */ +/* $Id: map.h,v 1.10 2000/12/04 13:18:33 dwmw2 Exp $ */ #ifndef __LINUX_MTD_MAP_H__ #define __LINUX_MTD_MAP_H__ @@ -42,6 +42,8 @@ struct map_info { void (*write16)(struct map_info *, __u16, unsigned long); void (*write32)(struct map_info *, __u32, unsigned long); void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t); + + void (*set_vpp)(int); /* We put these two here rather than a single void *map_priv, because we want mappers to be able to have quickly-accessible cache for the 'currently-mapped page' without the _extra_ @@ -54,6 +56,7 @@ struct map_info { const char *im_name; }; +#ifdef CONFIG_MODULES /* * Probe for the contents of a map device and make an MTD structure * if anything is recognised. Doesn't register it because the calling @@ -78,6 +81,18 @@ static inline struct mtd_info *do_map_probe(struct map_info *map, const char *fu #define do_jedec_probe(x) do_map_probe(x, "jedec_probe", "jedec_probe") #define do_ram_probe(x) do_map_probe(x, "map_ram_probe", "map_ram") #define do_rom_probe(x) do_map_probe(x, "map_rom_probe", "map_rom") +#else + /* without module support, call probe function directly */ +extern struct mtd_info *cfi_probe(struct map_info *); +extern struct mtd_info *jedec_probe(struct map_info *); +extern struct mtd_info *map_ram_probe(struct map_info *); +extern struct mtd_info *map_rom_probe(struct map_info *); + +#define do_cfi_probe(x) cfi_probe(x) +#define do_jedec_probe(x) jedec_probe(x) +#define do_ram_probe(x) map_ram_probe(x) +#define do_rom_probe(x) map_rom_probe(x) +#endif /* * Destroy an MTD device which was created for a map device. @@ -92,5 +107,7 @@ static inline void map_destroy(struct mtd_info *mtd) kfree(mtd); } +#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(1); } while(0) +#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(0); } while(0) #endif /* __LINUX_MTD_MAP_H__ */ diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index a7bc521c2..708f4f203 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -1,5 +1,5 @@ -/* $Id: mtd.h,v 1.17 2000/07/04 07:24:49 jgg Exp $ */ +/* $Id: mtd.h,v 1.26 2000/10/30 17:18:04 sjhill Exp $ */ #ifndef __MTD_MTD_H__ #define __MTD_MTD_H__ @@ -10,6 +10,7 @@ #include <linux/types.h> #include <linux/mtd/compatmac.h> #include <linux/module.h> +#include <linux/uio.h> #endif /* __KERNEL__ */ @@ -61,7 +62,8 @@ struct mtd_oob_buf { // Types of automatic ECC/Checksum available #define MTD_ECC_NONE 0 // No automatic ECC available -#define MTD_ECC_RS_DiskOnChip 1 // Automatic ECC on DiskOnChip +#define MTD_ECC_RS_DiskOnChip 1 // Automatic ECC on DiskOnChip +#define MTD_ECC_SW 2 // SW ECC for Toshiba & Samsung devices struct mtd_info_user { u_char type; @@ -78,6 +80,8 @@ struct mtd_info_user { #define MEMERASE _IOW('M', 2, struct erase_info_user) #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) +#define MEMLOCK _IOW('M', 5, struct erase_info_user) +#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) #ifndef __KERNEL__ @@ -123,6 +127,7 @@ struct mtd_info { // Kernel-only stuff starts here. char *name; + int index; u_long bank_size; @@ -144,9 +149,22 @@ struct mtd_info { int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); - + + /* iovec-based read/write methods. We need these especially for NAND flash, + with its limited number of write cycles per erase. + NB: The 'count' parameter is the number of _vectors_, each of + which contains an (ofs, len) tuple. + */ + int (*readv) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, size_t *retlen); + int (*writev) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen); + + /* Sync */ void (*sync) (struct mtd_info *mtd); + /* Chip-supported device locking */ + int (*lock) (struct mtd_info *mtd, loff_t ofs, size_t len); + int (*unlock) (struct mtd_info *mtd, loff_t ofs, size_t len); + /* Power Management functions */ int (*suspend) (struct mtd_info *mtd); void (*resume) (struct mtd_info *mtd); @@ -198,20 +216,32 @@ extern int unregister_mtd_user (struct mtd_notifier *old); #define MTD_UNPOINT(mtd, arg) (*(mtd->unpoint))(mtd, (u_char *)arg) #define MTD_READ(mtd, args...) (*(mtd->read))(mtd, args) #define MTD_WRITE(mtd, args...) (*(mtd->write))(mtd, args) +#define MTD_READV(mtd, args...) (*(mtd->readv))(mtd, args) +#define MTD_WRITEV(mtd, args...) (*(mtd->writev))(mtd, args) +#define MTD_READECC(mtd, args...) (*(mtd->read_ecc))(mtd, args) +#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) #define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) #endif /* MTDC */ -/* Debugging macros */ - -#ifdef DEBUGLVL -#define DEBUG(n, args...) if (DEBUGLVL>(n)) printk(KERN_DEBUG args) -#else +/* + * Debugging macro and defines + */ +#define MTD_DEBUG_LEVEL0 (0) /* Quiet */ +#define MTD_DEBUG_LEVEL1 (1) /* Audible */ +#define MTD_DEBUG_LEVEL2 (2) /* Loud */ +#define MTD_DEBUG_LEVEL3 (3) /* Noisy */ + +#ifdef CONFIG_MTD_DEBUG +#define DEBUG(n, args...) \ + if (n <= CONFIG_MTD_DEBUG_VERBOSE) { \ + printk(KERN_INFO args); \ + } +#else /* CONFIG_MTD_DEBUG */ #define DEBUG(n, args...) -#endif +#endif /* CONFIG_MTD_DEBUG */ #endif /* __KERNEL__ */ - #endif /* __MTD_MTD_H__ */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 79ca1843c..8c678ab97 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -1,31 +1,154 @@ +/* + * linux/include/linux/mtd/nand.h + * + * Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com> + * Steven J. Hill <sjhill@cotw.com> + * + * $Id: nand.h,v 1.8 2000/10/30 17:16:17 sjhill Exp $ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Info: + * Contains standard defines and IDs for NAND flash devices + * + * Changelog: + * 01-31-2000 DMW Created + * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers + * so it can be used by other NAND flash device + * drivers. I also changed the copyright since none + * of the original contents of this file are specific + * to DoC devices. David can whack me with a baseball + * bat later if I did something naughty. + * 10-11-2000 SJH Added private NAND flash structure for driver + * 10-24-2000 SJH Added prototype for 'nand_scan' function + */ +#ifndef __LINUX_MTD_NAND_H +#define __LINUX_MTD_NAND_H -/* Defines for NAND flash devices */ -/* (c) 1999 Machine Vision Holdings, Inc. */ -/* Author: David Woodhouse <dwmw2@mvhi.com> */ -/* $Id: nand.h,v 1.2 1999/08/17 22:57:08 dwmw2 Exp $ */ +#include <linux/config.h> +#include <linux/sched.h> -#ifndef __MTD_NAND_H__ -#define __MTD_NAND_H__ - -#define NAND_CMD_READ0 0 -#define NAND_CMD_READ1 1 -#define NAND_CMD_PAGEPROG 0x10 -#define NAND_CMD_READOOB 0x50 -#define NAND_CMD_ERASE1 0x60 -#define NAND_CMD_STATUS 0x70 -#define NAND_CMD_SEQIN 0x80 -#define NAND_CMD_READID 0x90 -#define NAND_CMD_ERASE2 0xd0 -#define NAND_CMD_RESET 0xff - -#define NAND_MFR_TOSHIBA 0x98 -#define NAND_MFR_SAMSUNG 0xec - - -#endif /* __MTD_NAND_H__ */ +/* + * Searches for a NAND device + */ +extern int nand_scan (struct mtd_info *mtd); +/* + * Standard NAND flash commands + */ +#define NAND_CMD_READ0 0 +#define NAND_CMD_READ1 1 +#define NAND_CMD_PAGEPROG 0x10 +#define NAND_CMD_READOOB 0x50 +#define NAND_CMD_ERASE1 0x60 +#define NAND_CMD_STATUS 0x70 +#define NAND_CMD_SEQIN 0x80 +#define NAND_CMD_READID 0x90 +#define NAND_CMD_ERASE2 0xd0 +#define NAND_CMD_RESET 0xff +/* + * Enumeration for NAND flash chip state + */ +typedef enum { + FL_READY, + FL_READING, + FL_WRITING, + FL_ERASING, + FL_SYNCING +} nand_state_t; +/* + * NAND Private Flash Chip Data + * + * Structure overview: + * + * IO_ADDR - address to access the 8 I/O lines to the flash device + * + * CTRL_ADDR - address where ALE, CLE and CE control bits are accessed + * + * CLE - location in control word for Command Latch Enable bit + * + * ALE - location in control word for Address Latch Enable bit + * + * NCE - location in control word for nChip Enable bit + * + * chip_lock - spinlock used to protect access to this structure + * + * wq - wait queue to sleep on if a NAND operation is in progress + * + * state - give the current state of the NAND device + * + * page_shift - number of address bits in a page (column address bits) + * + * data_buf - data buffer passed to/from MTD user modules + * + * ecc_code_buf - used only for holding calculated or read ECCs for + * a page read or written when ECC is in use + * + * reserved - padding to make structure fall on word boundary if + * when ECC is in use + */ +struct nand_chip { + unsigned long IO_ADDR; + unsigned long CTRL_ADDR; + unsigned int CLE; + unsigned int ALE; + unsigned int NCE; + spinlock_t chip_lock; + wait_queue_head_t wq; + nand_state_t state; + int page_shift; + u_char *data_buf; +#ifdef CONFIG_MTD_NAND_ECC + u_char ecc_code_buf[6]; + u_char reserved[2]; +#endif +}; +/* + * NAND Flash Manufacturer ID Codes + */ +#define NAND_MFR_TOSHIBA 0x98 +#define NAND_MFR_SAMSUNG 0xec +/* + * NAND Flash Device ID Structure + * + * Structure overview: + * + * name - Complete name of device + * + * manufacture_id - manufacturer ID code of device. + * + * model_id - model ID code of device. + * + * chipshift - total number of address bits for the device which + * is used to calculate address offsets and the total + * number of bytes the device is capable of. + * + * page256 - denotes if flash device has 256 byte pages or not. + * + * pageadrlen - number of bytes minus one needed to hold the + * complete address into the flash array. Keep in + * mind that when a read or write is done to a + * specific address, the address is input serially + * 8 bits at a time. This structure member is used + * by the read/write routines as a loop index for + * shifting the address out 8 bits at a time. + * + * erasesize - size of an erase block in the flash device. + */ +struct nand_flash_dev { + char * name; + int manufacture_id; + int model_id; + int chipshift; + char page256; + char pageadrlen; + unsigned long erasesize; +}; +#endif /* __LINUX_MTD_NAND_H */ diff --git a/include/linux/mtd/nand_ids.h b/include/linux/mtd/nand_ids.h new file mode 100644 index 000000000..0918b8c1e --- /dev/null +++ b/include/linux/mtd/nand_ids.h @@ -0,0 +1,52 @@ +/* + * linux/include/linux/mtd/nand_ids.h + * + * Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com> + * Steven J. Hill <sjhill@cotw.com> + * + * $Id: nand_ids.h,v 1.1 2000/10/13 16:16:26 mdeans Exp $ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Info: + * Contains standard defines and IDs for NAND flash devices + * + * Changelog: + * 01-31-2000 DMW Created + * 09-18-2000 SJH Moved structure out of the Disk-On-Chip drivers + * so it can be used by other NAND flash device + * drivers. I also changed the copyright since none + * of the original contents of this file are specific + * to DoC devices. David can whack me with a baseball + * bat later if I did something naughty. + * 10-11-2000 SJH Added private NAND flash structure for driver + * 2000-10-13 BE Moved out of 'nand.h' - avoids duplication. + */ + +#ifndef __LINUX_MTD_NAND_IDS_H +#define __LINUX_MTD_NAND_IDS_H + +static struct nand_flash_dev nand_flash_ids[] = { + {"Toshiba TC5816BDC", NAND_MFR_TOSHIBA, 0x64, 21, 1, 2, 0x1000}, + {"Toshiba TC5832DC", NAND_MFR_TOSHIBA, 0x6b, 22, 0, 2, 0x2000}, + {"Toshiba TH58V128DC", NAND_MFR_TOSHIBA, 0x73, 24, 0, 2, 0x4000}, + {"Toshiba TC58256FT/DC", NAND_MFR_TOSHIBA, 0x75, 25, 0, 2, 0x4000}, + {"Toshiba TH58512FT", NAND_MFR_TOSHIBA, 0x76, 26, 0, 3, 0x4000}, + {"Toshiba TC58V32DC", NAND_MFR_TOSHIBA, 0xe5, 22, 0, 2, 0x2000}, + {"Toshiba TC58V64AFT/DC", NAND_MFR_TOSHIBA, 0xe6, 23, 0, 2, 0x2000}, + {"Toshiba TC58V16BDC", NAND_MFR_TOSHIBA, 0xea, 21, 1, 2, 0x1000}, + {"Samsung KM29N16000", NAND_MFR_SAMSUNG, 0x64, 21, 1, 2, 0x1000}, + {"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0x6b, 22, 0, 2, 0x2000}, + {"Samsung KM29U128T", NAND_MFR_SAMSUNG, 0x73, 24, 0, 2, 0x4000}, + {"Samsung KM29U256T", NAND_MFR_SAMSUNG, 0x75, 25, 0, 2, 0x4000}, + {"Samsung unknown 64Mb", NAND_MFR_SAMSUNG, 0x76, 26, 0, 3, 0x4000}, + {"Samsung KM29W32000", NAND_MFR_SAMSUNG, 0xe3, 22, 0, 2, 0x2000}, + {"Samsung unknown 4Mb", NAND_MFR_SAMSUNG, 0xe5, 22, 0, 2, 0x2000}, + {"Samsung KM29U64000", NAND_MFR_SAMSUNG, 0xe6, 23, 0, 2, 0x2000}, + {"Samsung KM29W16000", NAND_MFR_SAMSUNG, 0xea, 21, 1, 2, 0x1000}, + {NULL,} +}; + +#endif /* __LINUX_MTD_NAND_IDS_H */ diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h index 153fa5c6a..ae00ceb0b 100644 --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/nftl.h @@ -2,18 +2,21 @@ /* Defines for NAND Flash Translation Layer */ /* (c) 1999 Machine Vision Holdings, Inc. */ /* Author: David Woodhouse <dwmw2@mvhi.com> */ -/* $Id: nftl.h,v 1.6 2000/03/31 15:12:20 dwmw2 Exp $ */ +/* $Id: nftl.h,v 1.9 2000/11/07 05:48:49 ollie Exp $ */ #ifndef __MTD_NFTL_H__ #define __MTD_NFTL_H__ +#ifndef __BOOT__ #include <linux/mtd/mtd.h> +#endif /* Block Control Information */ struct nftl_bci { unsigned char ECCSig[6]; - __u16 Status; + __u8 Status; + __u8 Status1; }__attribute__((packed)); /* Unit Control Information */ @@ -32,7 +35,8 @@ struct nftl_uci1 { } __attribute__((packed)); struct nftl_uci2 { - __u32 WriteInh; + __u16 FoldMark; + __u16 FoldMark1; __u32 unused; } __attribute__((packed)); @@ -60,10 +64,12 @@ struct NFTLMediaHeader { #define MAX_ERASE_ZONES (8192 - 512) #define ERASE_MARK 0x3c69 -#define BLOCK_FREE 0xffff -#define BLOCK_USED 0x5555 -#define BLOCK_IGNORE 0x1111 -#define BLOCK_DELETED 0x0000 +#define SECTOR_FREE 0xff +#define SECTOR_USED 0x55 +#define SECTOR_IGNORE 0x11 +#define SECTOR_DELETED 0x00 + +#define FOLD_MARK_IN_PROGRESS 0x5555 #define ZONE_GOOD 0xff #define ZONE_BAD_ORIGINAL 0 @@ -71,6 +77,11 @@ struct NFTLMediaHeader { #ifdef __KERNEL__ +/* these info are used in ReplUnitTable */ +#define BLOCK_NIL 0xffff /* last block of a chain */ +#define BLOCK_FREE 0xfffe /* free block */ +#define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */ +#define BLOCK_RESERVED 0xfffc /* bios block or bad block */ struct NFTLrecord { struct mtd_info *mtd; @@ -83,18 +94,27 @@ struct NFTLrecord { unsigned char sectors; unsigned short cylinders; __u16 numvunits; - __u16 lastEUN; + __u16 lastEUN; /* should be suppressed */ __u16 numfreeEUNs; - __u16 LastFreeEUN; /* To speed up finding a free EUN */ + __u16 LastFreeEUN; /* To speed up finding a free EUN */ __u32 long nr_sects; int head,sect,cyl; - __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */ - __u16 *VirtualUnitTable; /* [numEUNs]: VirtualUnitNumber for each */ - __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */ + __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */ + __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */ + unsigned int nb_blocks; /* number of physical blocks */ + unsigned int nb_boot_blocks; /* number of blocks used by the bios */ + struct erase_info instr; }; +int NFTL_mount(struct NFTLrecord *s); +int NFTL_formatblock(struct NFTLrecord *s, int block); + +#ifndef NFTL_MAJOR #define NFTL_MAJOR 93 +#endif + #define MAX_NFTLS 16 +#define MAX_SECTORS_PER_UNIT 32 #endif /* __KERNEL__ */ diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h new file mode 100644 index 000000000..a92023886 --- /dev/null +++ b/include/linux/mtd/partitions.h @@ -0,0 +1,50 @@ +/* + * MTD partitioning layer definitions + * + * (C) 2000 Nicolas Pitre <nico@cam.org> + * + * This code is GPL + * + * $Id: partitions.h,v 1.3 2000/11/10 23:35:12 nico Exp $ + */ + +#ifndef MTD_PARTITIONS_H +#define MTD_PARTITIONS_H + +#include <linux/types.h> + + +/* + * Partition definition structure: + * + * An array of struct partition is passed along with a MTD object to + * add_mtd_partitions() to create them. + * + * For each partition, these fields are available: + * name: string that will be used to label the partition's MTD device. + * size: the partition size; if 0, the partition will extend to the end of the + * master MTD device. + * offset: absolute starting position within the master MTD device; if 0, + * partition will start where the previous one ended. + * mask_flags: contains flags that have to be masked (removed) from the + * master MTD flag set for the corresponding MTD partition. + * For example, to force a read-only partition, simply adding + * MTD_WRITEABLE to the mask_flags will do the trick. + * + * Note: writeable partitions require their size and offset be + * erasesize aligned. + */ + +struct mtd_partition { + char *name; /* identifier string */ + u_long size; /* partition size */ + u_long offset; /* offset within the master MTD space */ + u_long mask_flags; /* master MTD flags to mask out for this partition */ +}; + + +int add_mtd_partitions(struct mtd_info *, struct mtd_partition *, int); +int del_mtd_partitions(struct mtd_info *); + +#endif + diff --git a/include/linux/mtd/pmc551.h b/include/linux/mtd/pmc551.h index 05c506516..144eb922a 100644 --- a/include/linux/mtd/pmc551.h +++ b/include/linux/mtd/pmc551.h @@ -1,5 +1,5 @@ /* - * $Id: pmc551.h,v 1.2 2000/03/31 14:40:42 dwmw2 Exp $ + * $Id: pmc551.h,v 1.3 2000/10/30 20:03:23 major Exp $ * * PMC551 PCI Mezzanine Ram Device * @@ -17,6 +17,9 @@ #include <linux/mtd/mtd.h> +#define PMC551_VERSION "$Id: pmc551.h,v 1.3 2000/10/30 20:03:23 major Exp $\n"\ + "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" + /* * Our personal and private information */ @@ -54,68 +57,25 @@ static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_cha #define PMC551_PCI_MEM_MAP1 0x54 #define PMC551_PCI_MEM_MAP_MAP_ADDR_MASK 0x3ff00000 #define PMC551_PCI_MEM_MAP_APERTURE_MASK 0x000000f0 -#define PMC551_PCI_MEM_MAP_1MB_APERTURE 0x00000000 -#define PMC551_PCI_MEM_MAP_2MB_APERTURE 0x00000010 -#define PMC551_PCI_MEM_MAP_REG_EN 0x00000002 -#define PMC551_PCI_MEM_MAP_ENABLE 0x00000001 - -#define PMC551_SDRAM_MA 0x60 -#define PMC551_SDRAM_CMD 0x62 -#define PMC551_DRAM_CFG 0x64 - -#define PMC551_DRAM_BLK0 0x68 -#define PMC551_DRAM_BLK1 0x6c -#define PMC551_DRAM_BLK2 0x70 -#define PMC551_DRAM_BLK3 0x74 -#define PMC551_DRAM_BLK_GET_SIZE(x) ((512 * 1024) << ((x >> 4) & 0xf)) -#define PMC551_DRAM_BLK_SET_COL_MUX(x,v) (((x) & ~0x00007000) | (((v) & 0x7) << 12)) -#define PMC551_DRAM_BLK_SET_ROW_MUX(x,v) (((x) & ~0x00000f00) | (((v) & 0xf) << 8)) - - -/* Use a 1MB apeture into the card. */ -#define PMC551_APERTURE_SIZE 0x00100000 -#define PMC551_ADDR_HIGH_MASK 0x3ff00000 -#define PMC551_ADDR_LOW_MASK 0x000fffff -#define PMC551_APERTURE_VAL PMC551_PCI_MEM_MAP_1MB_APERTURE -/* - * Define the PCI ID's if the kernel doesn't define them for us - */ -#ifndef PCI_VENDOR_ID_V3_SEMI -#define PCI_VENDOR_ID_V3_SEMI 0x11b0 -#endif - -#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC -#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 -#endif - - -#define PMC551_PCI_MEM_MAP0 0x50 -#define PMC551_PCI_MEM_MAP1 0x54 -#define PMC551_PCI_MEM_MAP_MAP_ADDR_MASK 0x3ff00000 -#define PMC551_PCI_MEM_MAP_APERTURE_MASK 0x000000f0 -#define PMC551_PCI_MEM_MAP_1MB_APERTURE 0x00000000 -#define PMC551_PCI_MEM_MAP_2MB_APERTURE 0x00000010 #define PMC551_PCI_MEM_MAP_REG_EN 0x00000002 #define PMC551_PCI_MEM_MAP_ENABLE 0x00000001 #define PMC551_SDRAM_MA 0x60 #define PMC551_SDRAM_CMD 0x62 #define PMC551_DRAM_CFG 0x64 +#define PMC551_SYS_CTRL_REG 0x78 #define PMC551_DRAM_BLK0 0x68 #define PMC551_DRAM_BLK1 0x6c #define PMC551_DRAM_BLK2 0x70 #define PMC551_DRAM_BLK3 0x74 -#define PMC551_DRAM_BLK_GET_SIZE(x) ((512 * 1024) << ((x >> 4) & 0xf)) +#define PMC551_DRAM_BLK_GET_SIZE(x) (524288<<((x>>4)&0x0f)) #define PMC551_DRAM_BLK_SET_COL_MUX(x,v) (((x) & ~0x00007000) | (((v) & 0x7) << 12)) #define PMC551_DRAM_BLK_SET_ROW_MUX(x,v) (((x) & ~0x00000f00) | (((v) & 0xf) << 8)) -/* Use a 1MB apeture into the card. */ -#define PMC551_APERTURE_SIZE 0x00100000 #define PMC551_ADDR_HIGH_MASK 0x3ff00000 #define PMC551_ADDR_LOW_MASK 0x000fffff -#define PMC551_APERTURE_VAL PMC551_PCI_MEM_MAP_1MB_APERTURE #endif /* __MTD_PMC551_H__ */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 2c2bfd4d5..462091674 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -51,11 +51,11 @@ struct divert_blk; /* Backlog congestion levels */ #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ -#define NET_RX_CN_LOW 1 /* storm alert, just in case */ -#define NET_RX_CN_MOD 2 /* Storm on its way! */ -#define NET_RX_CN_HIGH 5 /* The storm is here */ -#define NET_RX_DROP -1 /* packet dropped */ -#define NET_RX_BAD -2 /* packet dropped due to kernel error */ +#define NET_RX_DROP 1 /* packet dropped */ +#define NET_RX_CN_LOW 2 /* storm alert, just in case */ +#define NET_RX_CN_MOD 3 /* Storm on its way! */ +#define NET_RX_CN_HIGH 4 /* The storm is here */ +#define NET_RX_BAD 5 /* packet dropped due to kernel error */ #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) @@ -333,11 +333,17 @@ struct net_device atomic_t refcnt; /* The flag marking that device is unregistered, but held by an user */ int deadbeaf; - /* New style devices allow asynchronous destruction; - netdevice_unregister for old style devices blocks until - the last user will dereference this device. - */ - int new_style; + + /* Net device features */ + int features; +#define NETIF_F_SG 1 /* Scatter/gather IO. */ +#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ +#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ +#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ +#define NETIF_F_DYNALLOC 16 /* Self-dectructable device. */ +#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ +#define NETIF_F_FRAGLIST 1 /* Scatter/gather IO. */ + /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); /* Called after last user reference disappears. */ diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index b61722b15..cc8abab1f 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -63,8 +63,7 @@ */ #define NFS_SUPER_MAGIC 0x6969 -#define NFS_FH(dentry) ((struct nfs_fh *) ((dentry)->d_fsdata)) -#define NFS_DSERVER(dentry) (&(dentry)->d_sb->u.nfs_sb.s_server) +#define NFS_FH(inode) (&(inode)->u.nfs_i.fh) #define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server) #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) #define NFS_PROTO(inode) (NFS_SERVER(inode)->rpc_ops) @@ -93,6 +92,7 @@ do { \ #define NFS_FLAGS(inode) ((inode)->u.nfs_i.flags) #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING) +#define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE) #define NFS_FILEID(inode) ((inode)->u.nfs_i.fileid) #define NFS_FSID(inode) ((inode)->u.nfs_i.fsid) @@ -139,13 +139,16 @@ unsigned long page_index(struct page *page) extern struct super_block *nfs_read_super(struct super_block *, void *, int); extern int init_nfs_fs(void); extern void nfs_zap_caches(struct inode *); +extern int nfs_inode_is_stale(struct inode *, struct nfs_fh *, + struct nfs_fattr *); extern struct inode *nfs_fhget(struct dentry *, struct nfs_fh *, struct nfs_fattr *); extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); extern int nfs_revalidate(struct dentry *); +extern int nfs_permission(struct inode *, int); extern int nfs_open(struct inode *, struct file *); extern int nfs_release(struct inode *, struct file *); -extern int __nfs_revalidate_inode(struct nfs_server *, struct dentry *); +extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); extern int nfs_notify_change(struct dentry *, struct iattr *); /* @@ -192,7 +195,7 @@ extern void nfs_complete_unlink(struct dentry *); /* * linux/fs/nfs/write.c */ -extern int nfs_writepage(struct file *file, struct page *); +extern int nfs_writepage(struct page *); extern int nfs_flush_incompatible(struct file *file, struct page *page); extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); /* @@ -264,12 +267,11 @@ extern int nfs3_mount(struct sockaddr_in *, char *, struct nfs_fh *); * inline functions */ static inline int -nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry) +nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) { - struct inode *inode = dentry->d_inode; if (time_before(jiffies, NFS_READTIME(inode)+NFS_ATTRTIMEO(inode))) - return 0; - return __nfs_revalidate_inode(server, dentry); + return NFS_STALE(inode) ? -ESTALE : 0; + return __nfs_revalidate_inode(server, inode); } static inline loff_t diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index 2e10b1963..f14f3d8d9 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h @@ -3,6 +3,7 @@ #include <asm/types.h> #include <linux/list.h> +#include <linux/nfs.h> /* * nfs fs inode data in memory @@ -15,6 +16,11 @@ struct nfs_inode_info { __u64 fileid; /* + * NFS file handle + */ + struct nfs_fh fh; + + /* * Various flags */ unsigned short flags; @@ -72,6 +78,7 @@ struct nfs_inode_info { /* * Legal inode flag values */ +#define NFS_INO_STALE 0x0001 /* possible stale inode */ #define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */ #define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */ #define NFS_IS_SNAPSHOT 0x0010 /* a snapshot file */ diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index f6c35dc01..2f37a4b19 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -26,7 +26,7 @@ struct nfs_page { wb_list, /* Defines state of page: */ *wb_list_head; /* read/write/commit */ struct file *wb_file; - struct dentry *wb_dentry; + struct inode *wb_inode; struct rpc_cred *wb_cred; struct page *wb_page; /* page to read in/write out */ wait_queue_head_t wb_wait; /* wait queue */ @@ -41,6 +41,7 @@ struct nfs_page { #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) extern struct nfs_page *nfs_create_request(struct file *file, + struct inode *inode, struct page *page, unsigned int offset, unsigned int count); diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 9863c06af..1ee4dd616 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -316,39 +316,41 @@ struct nfs_rpc_ops { int (*getroot) (struct nfs_server *, struct nfs_fh *, struct nfs_fattr *); - int (*getattr) (struct dentry *, struct nfs_fattr *); - int (*setattr) (struct dentry *, struct nfs_fattr *, + int (*getattr) (struct inode *, struct nfs_fattr *); + int (*setattr) (struct inode *, struct nfs_fattr *, struct iattr *); - int (*lookup) (struct dentry *, struct qstr *, + int (*lookup) (struct inode *, struct qstr *, struct nfs_fh *, struct nfs_fattr *); - int (*access) (struct dentry *, int , int); - int (*readlink)(struct dentry *, void *, unsigned int); - int (*read) (struct file *, struct nfs_fattr *, + int (*access) (struct inode *, int , int); + int (*readlink)(struct inode *, void *, unsigned int); + int (*read) (struct inode *, struct rpc_cred *, + struct nfs_fattr *, int, loff_t, unsigned int, void *buffer, int *eofp); - int (*write) (struct file *, struct nfs_fattr *, + int (*write) (struct inode *, struct rpc_cred *, + struct nfs_fattr *, int, loff_t, unsigned int, void *buffer, struct nfs_writeverf *verfp); - int (*commit) (struct dentry *, struct nfs_fattr *, + int (*commit) (struct inode *, struct nfs_fattr *, unsigned long, unsigned int); - int (*create) (struct dentry *, struct qstr *, struct iattr *, + int (*create) (struct inode *, struct qstr *, struct iattr *, int, struct nfs_fh *, struct nfs_fattr *); - int (*remove) (struct dentry *, struct qstr *); + int (*remove) (struct inode *, struct qstr *); int (*unlink_setup) (struct rpc_message *, struct dentry *, struct qstr *); void (*unlink_done) (struct dentry *, struct rpc_message *); - int (*rename) (struct dentry *, struct qstr *, - struct dentry *, struct qstr *); - int (*link) (struct dentry *, struct dentry *, struct qstr *); - int (*symlink) (struct dentry *, struct qstr *, struct qstr *, + int (*rename) (struct inode *, struct qstr *, + struct inode *, struct qstr *); + int (*link) (struct inode *, struct inode *, struct qstr *); + int (*symlink) (struct inode *, struct qstr *, struct qstr *, struct iattr *, struct nfs_fh *, struct nfs_fattr *); - int (*mkdir) (struct dentry *, struct qstr *, struct iattr *, + int (*mkdir) (struct inode *, struct qstr *, struct iattr *, struct nfs_fh *, struct nfs_fattr *); - int (*rmdir) (struct dentry *, struct qstr *); - int (*readdir) (struct file *, u64 cookie, void *, unsigned int, - int); - int (*mknod) (struct dentry *, struct qstr *, struct iattr *, + int (*rmdir) (struct inode *, struct qstr *); + int (*readdir) (struct inode *, struct rpc_cred *, + u64, void *, unsigned int, int); + int (*mknod) (struct inode *, struct qstr *, struct iattr *, dev_t, struct nfs_fh *, struct nfs_fattr *); int (*statfs) (struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); diff --git a/include/linux/pci.h b/include/linux/pci.h index 0c2dc46ae..d98a3a01a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -530,12 +530,13 @@ void pci_set_master(struct pci_dev *dev); int pci_set_power_state(struct pci_dev *dev, int state); int pci_assign_resource(struct pci_dev *dev, int i); -/* Helper functions for low-level code (drivers/pci/setup.c) */ +/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ int pci_claim_resource(struct pci_dev *, int); void pci_assign_unassigned_resources(void); -void pdev_assign_unassigned_resources(struct pci_dev *dev); -void pci_set_bus_ranges(void); +void pdev_enable_device(struct pci_dev *); +void pdev_sort_resources(struct pci_dev *, struct resource_list *, u32); +unsigned long pci_bridge_check_io(struct pci_dev *); void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), int (*)(struct pci_dev *, u8, u8)); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7a89c6525..60aef94ee 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -119,6 +119,15 @@ /* Vendors and devices. Sort key: vendor first, device next. */ +#define PCI_VENDOR_ID_DYNALINK 0x0675 +#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 + +#define PCI_VENDOR_ID_BERKOM 0x0871 +#define PCI_DEVICE_ID_BERKOM_A1T 0xffa1 +#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xffa2 +#define PCI_DEVICE_ID_BERKOM_A4T 0xffa4 +#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xffa8 + #define PCI_VENDOR_ID_COMPAQ 0x0e11 #define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 #define PCI_DEVICE_ID_COMPAQ_1280 0x3033 @@ -191,8 +200,8 @@ #define PCI_VENDOR_ID_NS 0x100b #define PCI_DEVICE_ID_NS_87415 0x0002 -#define PCI_DEVICE_ID_NS_87560_LIO 0x000e -#define PCI_DEVICE_ID_NS_87560_USB 0x0012 +#define PCI_DEVICE_ID_NS_87560_LIO 0x000e +#define PCI_DEVICE_ID_NS_87560_USB 0x0012 #define PCI_DEVICE_ID_NS_87410 0xd001 #define PCI_VENDOR_ID_TSENG 0x100c @@ -254,9 +263,17 @@ #define PCI_DEVICE_ID_IBM_405GP 0x0156 #define PCI_DEVICE_ID_IBM_MPIC_2 0xffff +#define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)" +#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 + #define PCI_VENDOR_ID_WD 0x101c #define PCI_DEVICE_ID_WD_7197 0x3296 +#define PCI_VENDOR_ID_AMI 0x101e +#define PCI_DEVICE_ID_AMI_MEGARAID3 0x1960 +#define PCI_DEVICE_ID_AMI_MEGARAID 0x9010 +#define PCI_DEVICE_ID_AMI_MEGARAID2 0x9060 + #define PCI_VENDOR_ID_AMD 0x1022 #define PCI_DEVICE_ID_AMD_LANCE 0x2000 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 @@ -272,6 +289,8 @@ #define PCI_DEVICE_ID_AMD_VIPER_740C 0x740C #define PCI_VENDOR_ID_TRIDENT 0x1023 +#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 +#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 #define PCI_DEVICE_ID_TRIDENT_9320 0x9320 #define PCI_DEVICE_ID_TRIDENT_9388 0x9388 #define PCI_DEVICE_ID_TRIDENT_9397 0x9397 @@ -298,10 +317,10 @@ #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b #define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 -#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 -#define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001 -#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 -#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 +#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 +#define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001 +#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 +#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 #define PCI_DEVICE_ID_MATROX_G400 0x0525 #define PCI_DEVICE_ID_MATROX_VIA 0x4536 @@ -366,8 +385,11 @@ #define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010 #define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 -#define PCI_VENDOR_ID_DPT 0x1044 -#define PCI_DEVICE_ID_DPT 0xa400 +#define PCI_VENDOR_ID_ASUSTEK 0x1043 +#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675 + +#define PCI_VENDOR_ID_DPT 0x1044 +#define PCI_DEVICE_ID_DPT 0xa400 #define PCI_VENDOR_ID_OPTI 0x1045 #define PCI_DEVICE_ID_OPTI_92C178 0xc178 @@ -381,6 +403,10 @@ #define PCI_DEVICE_ID_OPTI_82C861 0xc861 #define PCI_DEVICE_ID_OPTI_82C825 0xd568 +#define PCI_VENDOR_ID_ELSA 0x1048 +#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 +#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 + #define PCI_VENDOR_ID_SGS 0x104a #define PCI_DEVICE_ID_SGS_2000 0x0008 #define PCI_DEVICE_ID_SGS_1764 0x0009 @@ -407,6 +433,8 @@ #define PCI_DEVICE_ID_TI_1251B 0xac1f #define PCI_DEVICE_ID_TI_1420 0xac51 +#define PCI_VENDOR_ID_SONY 0x104d +#define PCI_DEVICE_ID_SONY_CXD3222 0x8039 #define PCI_VENDOR_ID_OAK 0x104e #define PCI_DEVICE_ID_OAK_OTI107 0x0107 @@ -415,7 +443,11 @@ #define PCI_VENDOR_ID_WINBOND2 0x1050 #define PCI_DEVICE_ID_WINBOND2_89C940 0x0940 #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a +#define PCI_DEVICE_ID_WINBOND2_6692 0x6692 +#define PCI_VENDOR_ID_ANIGMA 0x1051 +#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100 + #define PCI_VENDOR_ID_EFAR 0x1055 #define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460 @@ -504,9 +536,10 @@ #define PCI_VENDOR_ID_LEADTEK 0x107d #define PCI_DEVICE_ID_LEADTEK_805 0x0000 -#define PCI_VENDOR_ID_INTERPHASE 0x107e +#define PCI_VENDOR_ID_INTERPHASE 0x107e #define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 #define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 +#define PCI_DEVICE_ID_INTERPHASE_5575 0x0008 #define PCI_VENDOR_ID_CONTAQ 0x1080 #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 @@ -545,8 +578,8 @@ #define PCI_VENDOR_ID_BROOKTREE 0x109e #define PCI_DEVICE_ID_BROOKTREE_848 0x0350 #define PCI_DEVICE_ID_BROOKTREE_849A 0x0351 -#define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e -#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 +#define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e +#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 #define PCI_DEVICE_ID_BROOKTREE_8474 0x8474 #define PCI_VENDOR_ID_SIERRA 0x10a8 @@ -567,10 +600,13 @@ #define PCI_DEVICE_ID_DATABOOK_87144 0xb106 #define PCI_VENDOR_ID_PLX 0x10b5 -#define PCI_VENDOR_ID_PLX_ROMULUS 0x106a +#define PCI_DEVICE_ID_PLX_R685 0x1030 +#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a #define PCI_DEVICE_ID_PLX_SPCOM800 0x1076 #define PCI_DEVICE_ID_PLX_1077 0x1077 #define PCI_DEVICE_ID_PLX_SPCOM200 0x1103 +#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 +#define PCI_DEVICE_ID_PLX_R753 0x1152 #define PCI_DEVICE_ID_PLX_9050 0x9050 #define PCI_DEVICE_ID_PLX_9060 0x9060 #define PCI_DEVICE_ID_PLX_9060ES 0x906E @@ -618,6 +654,7 @@ #define PCI_DEVICE_ID_AL_M5229 0x5229 #define PCI_DEVICE_ID_AL_M5237 0x5237 #define PCI_DEVICE_ID_AL_M5243 0x5243 +#define PCI_DEVICE_ID_AL_M5451 0x5451 #define PCI_DEVICE_ID_AL_M7101 0x7101 #define PCI_VENDOR_ID_MITSUBISHI 0x10ba @@ -625,7 +662,7 @@ #define PCI_VENDOR_ID_SURECOM 0x10bd #define PCI_DEVICE_ID_SURECOM_NE34 0x0e34 -#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 +#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003 @@ -693,6 +730,12 @@ #define PCI_DEVICE_ID_INIT_320P 0x9100 #define PCI_DEVICE_ID_INIT_360P 0x9500 +#define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA +#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 + +#define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE +#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 + #define PCI_VENDOR_ID_TTI 0x1103 #define PCI_DEVICE_ID_TTI_HPT343 0x0003 #define PCI_DEVICE_ID_TTI_HPT366 0x0004 @@ -747,8 +790,8 @@ #define PCI_DEVICE_ID_VIA_8633_1 0xB091 #define PCI_DEVICE_ID_VIA_8367_1 0xB099 -#define PCI_VENDOR_ID_SMC2 0x1113 -#define PCI_DEVICE_ID_SMC2_1211TX 0x1211 +#define PCI_VENDOR_ID_SMC2 0x1113 +#define PCI_DEVICE_ID_SMC2_1211TX 0x1211 #define PCI_VENDOR_ID_VORTEX 0x1119 #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 @@ -788,6 +831,9 @@ #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 #define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002 +#define PCI_VENDOR_ID_IDT 0x111d +#define PCI_DEVICE_ID_IDT_IDT77201 0x0001 + #define PCI_VENDOR_ID_FORE 0x1127 #define PCI_DEVICE_ID_FORE_PCA200PC 0x0210 #define PCI_DEVICE_ID_FORE_PCA200E 0x0300 @@ -800,6 +846,17 @@ #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 +#define PCI_VENDOR_ID_EICON 0x1133 +#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001 +#define PCI_DEVICE_ID_EICON_DIVA20 0xe002 +#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003 +#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 +#define PCI_DEVICE_ID_EICON_DIVA201 0xe005 +#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010 +#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012 +#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 +#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 + #define PCI_VENDOR_ID_CYCLONE 0x113c #define PCI_DEVICE_ID_CYCLONE_SDK 0x0001 @@ -826,6 +883,10 @@ #define PCI_DEVICE_ID_DIGI_XRJ 0x0009 #define PCI_DEVICE_ID_DIGI_EPCJ 0x000a #define PCI_DEVICE_ID_DIGI_XR_920 0x0027 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 +#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 +#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072 +#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073 #define PCI_VENDOR_ID_MUTECH 0x1159 #define PCI_DEVICE_ID_MUTECH_MV1000 0x0001 @@ -839,8 +900,8 @@ #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 #define PCI_DEVICE_ID_SERVERWORKS_CIOB30 0x0010 #define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011 -#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 -#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 +#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 +#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 @@ -866,6 +927,13 @@ #define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 #define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 #define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 +#define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002 +#define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010 +#define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020 +#define PCI_DEVICE_ID_ARTOP_AEC7612S 0x8030 +#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040 +#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050 +#define PCI_DEVICE_ID_ARTOP_8060 0x8060 #define PCI_VENDOR_ID_ZEITNET 0x1193 #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 @@ -920,16 +988,16 @@ #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 #define PCI_DEVICE_ID_COMPEX_RL2000 0x1401 -#define PCI_VENDOR_ID_RP 0x11fe -#define PCI_DEVICE_ID_RP32INTF 0x0001 -#define PCI_DEVICE_ID_RP8INTF 0x0002 -#define PCI_DEVICE_ID_RP16INTF 0x0003 -#define PCI_DEVICE_ID_RP4QUAD 0x0004 -#define PCI_DEVICE_ID_RP8OCTA 0x0005 -#define PCI_DEVICE_ID_RP8J 0x0006 -#define PCI_DEVICE_ID_RPP4 0x000A -#define PCI_DEVICE_ID_RPP8 0x000B -#define PCI_DEVICE_ID_RP8M 0x000C +#define PCI_VENDOR_ID_RP 0x11fe +#define PCI_DEVICE_ID_RP32INTF 0x0001 +#define PCI_DEVICE_ID_RP8INTF 0x0002 +#define PCI_DEVICE_ID_RP16INTF 0x0003 +#define PCI_DEVICE_ID_RP4QUAD 0x0004 +#define PCI_DEVICE_ID_RP8OCTA 0x0005 +#define PCI_DEVICE_ID_RP8J 0x0006 +#define PCI_DEVICE_ID_RPP4 0x000A +#define PCI_DEVICE_ID_RPP8 0x000B +#define PCI_DEVICE_ID_RP8M 0x000C #define PCI_VENDOR_ID_CYCLADES 0x120e #define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100 @@ -957,7 +1025,7 @@ #define PCI_VENDOR_ID_3DFX 0x121a #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 #define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002 -#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003 +#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003 #define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 #define PCI_VENDOR_ID_SIGMADES 0x1236 @@ -966,7 +1034,10 @@ #define PCI_VENDOR_ID_CCUBE 0x123f #define PCI_VENDOR_ID_AVM 0x1244 +#define PCI_DEVICE_ID_AVM_B1 0x0700 +#define PCI_DEVICE_ID_AVM_C4 0x0800 #define PCI_DEVICE_ID_AVM_A1 0x0a00 +#define PCI_DEVICE_ID_AVM_T1 0x1200 #define PCI_VENDOR_ID_DIPIX 0x1246 @@ -983,9 +1054,12 @@ #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 #define PCI_VENDOR_ID_ESS 0x125d +#define PCI_DEVICE_ID_ESS_ESS1968 0x1968 #define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969 +#define PCI_DEVICE_ID_ESS_ESS1978 0x1978 #define PCI_VENDOR_ID_SATSAGEM 0x1267 +#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 #define PCI_DEVICE_ID_SATSAGEM_PCR2101 0x5352 #define PCI_DEVICE_ID_SATSAGEM_TELSATTURBO 0x5a4b @@ -994,10 +1068,14 @@ #define PCI_VENDOR_ID_ENSONIQ 0x1274 #define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000 -#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 +#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 #define PCI_VENDOR_ID_ROCKWELL 0x127A +/* formerly Platform Tech */ +#define PCI_VENDOR_ID_ESS_OLD 0x1285 +#define PCI_DEVICE_ID_ESS_ESS0100 0x0100 + #define PCI_VENDOR_ID_ALTEON 0x12ae #define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001 @@ -1031,6 +1109,10 @@ #define PCI_SUBDEVICE_ID_CHASE_PCIRAS4 0xF001 #define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010 +#define PCI_VENDOR_ID_AUREAL 0x12eb +#define PCI_DEVICE_ID_AUREAL_VORTEX_1 0x0001 +#define PCI_DEVICE_ID_AUREAL_VORTEX_2 0x0002 + #define PCI_VENDOR_ID_CBOARDS 0x1307 #define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 @@ -1073,6 +1155,9 @@ #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 +#define PCI_VENDOR_ID_DOMEX 0x134a +#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 + #define PCI_VENDOR_ID_QUATECH 0x135C #define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 @@ -1089,12 +1174,56 @@ #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 +#define PCI_VENDOR_ID_HYPERCOPE 0x1365 +#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050 +#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104 +#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106 +#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 +#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 +#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109 + +#define PCI_VENDOR_ID_LMC 0x1376 +#define PCI_DEVICE_ID_LMC_HSSI 0x0003 +#define PCI_DEVICE_ID_LMC_DS3 0x0004 +#define PCI_DEVICE_ID_LMC_SSI 0x0005 +#define PCI_DEVICE_ID_LMC_T1 0x0006 + #define PCI_VENDOR_ID_NETGEAR 0x1385 #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a +#define PCI_VENDOR_ID_APPLICOM 0x1389 +#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001 +#define PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN 0x0002 +#define PCI_DEVICE_ID_APPLICOM_PCI2000PFB 0x0003 + +#define PCI_VENDOR_ID_MOXA 0x1393 +#define PCI_DEVICE_ID_MOXA_C104 0x1040 +#define PCI_DEVICE_ID_MOXA_C168 0x1680 +#define PCI_DEVICE_ID_MOXA_CP204J 0x2040 +#define PCI_DEVICE_ID_MOXA_C218 0x2180 +#define PCI_DEVICE_ID_MOXA_C320 0x3200 + +#define PCI_VENDOR_ID_CCD 0x1397 +#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 +#define PCI_DEVICE_ID_CCD_B000 0xb000 +#define PCI_DEVICE_ID_CCD_B006 0xb006 +#define PCI_DEVICE_ID_CCD_B007 0xb007 +#define PCI_DEVICE_ID_CCD_B008 0xb008 +#define PCI_DEVICE_ID_CCD_B009 0xb009 +#define PCI_DEVICE_ID_CCD_B00A 0xb00a +#define PCI_DEVICE_ID_CCD_B00B 0xb00b +#define PCI_DEVICE_ID_CCD_B00C 0xb00c +#define PCI_DEVICE_ID_CCD_B100 0xb100 + #define PCI_VENDOR_ID_3WARE 0x13C1 #define PCI_DEVICE_ID_3WARE_1000 0x1000 +#define PCI_VENDOR_ID_CMEDIA 0x13f6 +#define PCI_DEVICE_ID_CMEDIA_CM8338A 0x0100 +#define PCI_DEVICE_ID_CMEDIA_CM8338B 0x0101 +#define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111 +#define PCI_DEVICE_ID_CMEDIA_CM8738B 0x0112 + #define PCI_VENDOR_ID_LAVA 0x1407 #define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ #define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ @@ -1112,11 +1241,16 @@ #define PCI_VENDOR_ID_TIMEDIA 0x1409 #define PCI_DEVICE_ID_TIMEDIA_1889 0x7168 -#define PCI_VENDOR_ID_OXSEMI 0x1415 -#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501 +#define PCI_VENDOR_ID_OXSEMI 0x1415 +#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501 #define PCI_DEVICE_ID_OXSEMI_16PCI952 0x950A #define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511 +#define PCI_VENDOR_ID_AIRONET 0x14b9 +#define PCI_DEVICE_ID_AIRONET_4800_1 0x0001 +#define PCI_DEVICE_ID_AIRONET_4800 0x4500 // values switched? see +#define PCI_DEVICE_ID_AIRONET_4500 0x4800 // drivers/net/aironet4500_card.c + #define PCI_VENDOR_ID_TITAN 0x14D2 #define PCI_DEVICE_ID_TITAN_100 0xA001 #define PCI_DEVICE_ID_TITAN_200 0xA005 @@ -1137,6 +1271,9 @@ #define PCI_VENDOR_ID_MORETON 0x15aa #define PCI_DEVICE_ID_RASTEL_2PORT 0x2000 +#define PCI_VENDOR_ID_ZOLTRIX 0x15b0 +#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0 + #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 @@ -1212,6 +1349,7 @@ #define PCI_DEVICE_ID_INTEL_82441 0x1237 #define PCI_DEVICE_ID_INTEL_82380FB 0x124b #define PCI_DEVICE_ID_INTEL_82439 0x1250 +#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960 #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 @@ -1330,6 +1468,7 @@ #define PCI_VENDOR_ID_TIGERJET 0xe159 #define PCI_DEVICE_ID_TIGERJET_300 0x0001 +#define PCI_DEVICE_ID_TIGERJET_100 0x0002 #define PCI_VENDOR_ID_ARK 0xedd8 #define PCI_DEVICE_ID_ARK_STING 0xa091 diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 41d729e16..8c260c63d 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -59,7 +59,6 @@ typedef struct mdk_rdev_s mdk_rdev_t; #error MD doesnt handle bigger kdev yet #endif -#define MAX_REAL 12 /* Max number of disks per md dev */ #define MAX_MD_DEVS (1<<MINORBITS) /* Max number of md dev */ /* @@ -166,8 +165,7 @@ struct mdk_rdev_s mddev_t *mddev; /* RAID array if running */ unsigned long last_events; /* IO event timestamp */ - struct inode *inode; /* Lock inode */ - struct file filp; /* Lock file */ + struct block_device *bdev; /* block device handle */ mdp_super_t *sb; unsigned long sb_offset; @@ -207,6 +205,7 @@ struct mddev_s struct semaphore reconfig_sem; struct semaphore recovery_sem; struct semaphore resync_sem; + atomic_t active; atomic_t recovery_active; /* blocks scheduled, but not written */ md_wait_queue_head_t recovery_wait; diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h index a27234f67..0b9372957 100644 --- a/include/linux/raid/raid0.h +++ b/include/linux/raid/raid0.h @@ -9,7 +9,7 @@ struct strip_zone unsigned long dev_offset; /* Zone offset in real dev */ unsigned long size; /* Zone size */ int nb_dev; /* # of devices attached to the zone */ - mdk_rdev_t *dev[MAX_REAL]; /* Devices attached to the zone */ + mdk_rdev_t *dev[MD_SB_DISKS]; /* Devices attached to the zone */ }; struct raid0_hash diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index aa17b8472..a9a9d3e8e 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -7,7 +7,6 @@ struct mirror_info { int number; int raid_disk; kdev_t dev; - int next; int sect_limit; int head_position; diff --git a/include/linux/sched.h b/include/linux/sched.h index a58b23c86..0622510fc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -149,7 +149,10 @@ extern void update_one_process(struct task_struct *p, unsigned long user, extern signed long FASTCALL(schedule_timeout(signed long timeout)); asmlinkage void schedule(void); -extern void schedule_task(struct tq_struct *task); +extern int schedule_task(struct tq_struct *task); +extern void flush_scheduled_tasks(void); +extern int start_context_thread(void); +extern int current_is_keventd(void); /* * The default fd array needs to be at least BITS_PER_LONG, @@ -174,18 +177,19 @@ struct files_struct { struct file * fd_array[NR_OPEN_DEFAULT]; }; -#define INIT_FILES { \ - ATOMIC_INIT(1), \ - RW_LOCK_UNLOCKED, \ - NR_OPEN_DEFAULT, \ - __FD_SETSIZE, \ - 0, \ - &init_files.fd_array[0], \ - &init_files.close_on_exec_init, \ - &init_files.open_fds_init, \ - { { 0, } }, \ - { { 0, } }, \ - { NULL, } \ +#define INIT_FILES \ +{ \ + count: ATOMIC_INIT(1), \ + file_lock: RW_LOCK_UNLOCKED, \ + max_fds: NR_OPEN_DEFAULT, \ + max_fdset: __FD_SETSIZE, \ + next_fd: 0, \ + fd: &init_files.fd_array[0], \ + close_on_exec: &init_files.close_on_exec_init, \ + open_fds: &init_files.open_fds_init, \ + close_on_exec_init: { { 0, } }, \ + open_fds_init: { { 0, } }, \ + fd_array: { NULL, } \ } /* Maximum number of active map areas.. This is a random (large) number */ @@ -220,18 +224,19 @@ struct mm_struct { void * segments; }; -#define INIT_MM(name) { \ - &init_mmap, NULL, NULL, \ - swapper_pg_dir, \ - ATOMIC_INIT(2), ATOMIC_INIT(1), 1, \ - __MUTEX_INITIALIZER(name.mmap_sem), \ - SPIN_LOCK_UNLOCKED, \ - 0, \ - 0, 0, 0, 0, \ - 0, 0, 0, \ - 0, 0, 0, 0, \ - 0, 0, 0, \ - 0, 0, 0, 0, NULL } +#define INIT_MM(name) \ +{ \ + mmap: &init_mmap, \ + mmap_avl: NULL, \ + mmap_cache: NULL, \ + pgd: swapper_pg_dir, \ + mm_users: ATOMIC_INIT(2), \ + mm_count: ATOMIC_INIT(1), \ + map_count: 1, \ + mmap_sem: __MUTEX_INITIALIZER(name.mmap_sem), \ + page_table_lock: SPIN_LOCK_UNLOCKED, \ + segments: NULL \ +} struct signal_struct { atomic_t count; @@ -240,10 +245,11 @@ struct signal_struct { }; -#define INIT_SIGNALS { \ - ATOMIC_INIT(1), \ - { {{0,}}, }, \ - SPIN_LOCK_UNLOCKED } +#define INIT_SIGNALS { \ + count: ATOMIC_INIT(1), \ + action: { {{0,}}, }, \ + siglock: SPIN_LOCK_UNLOCKED \ +} /* * Some day this will be a full-fledged user tracking system.. diff --git a/include/linux/signal.h b/include/linux/signal.h index f2d0766ef..c4e6eb3bd 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -193,7 +193,7 @@ static inline void siginitset(sigset_t *set, unsigned long mask) memset(&set->sig[1], 0, sizeof(long)*(_NSIG_WORDS-1)); break; case 2: set->sig[1] = 0; - case 1: + case 1: ; } } @@ -205,7 +205,7 @@ static inline void siginitsetinv(sigset_t *set, unsigned long mask) memset(&set->sig[1], -1, sizeof(long)*(_NSIG_WORDS-1)); break; case 2: set->sig[1] = -1; - case 1: + case 1: ; } } diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index c67f8c85a..17e48d0e9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -65,8 +65,7 @@ struct sk_buff { struct sk_buff_head * list; /* List we are on */ struct sock *sk; /* Socket we are owned by */ struct timeval stamp; /* Time we arrived */ - struct net_device *dev; /* Device we arrived on/are leaving by */ - struct net_device *rx_dev; + struct net_device *dev; /* Device we arrived on/are leaving by */ /* Transport layer header */ union @@ -110,8 +109,7 @@ struct sk_buff { unsigned int len; /* Length of actual data */ unsigned int csum; /* Checksum */ volatile char used; /* Data moved to user and not MSG_PEEK */ - unsigned char is_clone, /* We are a clone */ - cloned, /* head may be cloned (check refcnt to be sure). */ + unsigned char cloned, /* head may be cloned (check refcnt to be sure). */ pkt_type, /* Packet class */ ip_summed; /* Driver fed us an IP checksum */ __u32 priority; /* Packet queueing priority */ diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index e475057fc..501ea4b96 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -126,8 +126,8 @@ int smb_errno(struct smb_sb_info *); int smb_close(struct inode *); int smb_close_fileid(struct dentry *, __u16); int smb_open(struct dentry *, int); -int smb_proc_read(struct dentry *, off_t, int, char *); -int smb_proc_write(struct dentry *, off_t, int, const char *); +int smb_proc_read(struct inode *, off_t, int, char *); +int smb_proc_write(struct inode *, off_t, int, const char *); int smb_proc_create(struct dentry *, __u16, time_t, __u16 *); int smb_proc_mv(struct dentry *, struct dentry *); int smb_proc_mkdir(struct dentry *); diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h index 4bad7e928..0d14b83ae 100644 --- a/include/linux/smb_fs_sb.h +++ b/include/linux/smb_fs_sb.h @@ -14,8 +14,9 @@ #include <linux/types.h> #include <linux/smb.h> -/* Get the server for the specified dentry */ -#define server_from_dentry(dentry) &dentry->d_sb->u.smbfs_sb +/* structure access macros */ +#define server_from_inode(inode) (&(inode)->i_sb->u.smbfs_sb) +#define server_from_dentry(dentry) (&(dentry)->d_sb->u.smbfs_sb) #define SB_of(server) ((struct super_block *) ((char *)(server) - \ (unsigned long)(&((struct super_block *)0)->u.smbfs_sb))) diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 8ba581f5b..8bb2d1c5d 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -65,7 +65,7 @@ #elif (DEBUG_SPINLOCKS < 2) typedef struct { - volatile unsigned int lock; + volatile unsigned long lock; } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } @@ -80,7 +80,7 @@ typedef struct { #else /* (DEBUG_SPINLOCKS >= 2) */ typedef struct { - volatile unsigned int lock; + volatile unsigned long lock; volatile unsigned int babble; const char *module; } spinlock_t; diff --git a/include/linux/stallion.h b/include/linux/stallion.h index a4f6e2278..072f89508 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h @@ -75,7 +75,7 @@ typedef struct stlport { int ioaddr; int uartaddr; int pagenr; - int istate; + long istate; int flags; int baud_base; int custom_divisor; diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index f3e9ad2be..c6e6e40e0 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -43,7 +43,7 @@ struct rpc_task { struct rpc_task * tk_prev_task; /* global list of tasks */ struct rpc_clnt * tk_client; /* RPC client */ struct rpc_rqst * tk_rqstp; /* RPC request */ - volatile int tk_status; /* result of last operation */ + int tk_status; /* result of last operation */ struct rpc_wait_queue * tk_rpcwait; /* RPC wait queue we're on */ /* diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index dd27162ff..b204387c5 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -138,8 +138,7 @@ struct rpc_xprt { struct rpc_wait_queue reconn; /* waiting for reconnect */ struct rpc_rqst * free; /* free slots */ struct rpc_rqst slot[RPC_MAXREQS]; - volatile unsigned char connected : 1, /* TCP: connected */ - write_space: 1; /* TCP: can send */ + unsigned int sockstate; /* Socket state */ unsigned char shutdown : 1, /* being shut down */ nocong : 1, /* no congestion control */ stream : 1, /* TCP */ @@ -190,6 +189,18 @@ void __rpciod_tcp_dispatcher(void); extern struct list_head rpc_xprt_pending; +#define XPRT_WSPACE 0 +#define XPRT_CONNECT 1 + +#define xprt_wspace(xp) (test_bit(XPRT_WSPACE, &(xp)->sockstate)) +#define xprt_test_and_set_wspace(xp) (test_and_set_bit(XPRT_WSPACE, &(xp)->sockstate)) +#define xprt_clear_wspace(xp) (clear_bit(XPRT_WSPACE, &(xp)->sockstate)) + +#define xprt_connected(xp) (!(xp)->stream || test_bit(XPRT_CONNECT, &(xp)->sockstate)) +#define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) +#define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) +#define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) + static inline int xprt_tcp_pending(void) { diff --git a/include/linux/swap.h b/include/linux/swap.h index 87364f298..1390490f9 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -82,8 +82,6 @@ struct vm_area_struct; struct sysinfo; struct zone_t; -/* linux/ipc/shm.c */ -extern int shm_swap(int, int); /* linux/mm/swap.c */ extern int memory_pressure; diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index 3eb8f14ae..a0363ffa6 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -14,6 +14,7 @@ #define _LINUX_TQUEUE_H #include <linux/spinlock.h> +#include <linux/list.h> #include <asm/bitops.h> #include <asm/system.h> @@ -29,37 +30,33 @@ * used as a bottom half handler. This is for example useful for bottom * halfs, which want to be delayed until the next clock tick. * - * Problems: - * - The queue_task_irq() inline function is only atomic with respect to itself. - * Problems can occur, when queue_task_irq() is called from a normal system - * call, and an interrupt comes in. No problems occur, when queue_task_irq() - * is called from an interrupt or bottom half, and interrupted, as run_task_queue() - * will not be executed/continued before the last interrupt returns. If in - * doubt, use queue_task(), not queue_task_irq(). + * Notes: * - Bottom halfs are called in the reverse order that they were linked into * the list. */ struct tq_struct { - struct tq_struct *next; /* linked list of active bh's */ + struct list_head list; /* linked list of active bh's */ unsigned long sync; /* must be initialized to zero */ void (*routine)(void *); /* function to call */ void *data; /* argument to function */ }; -typedef struct tq_struct * task_queue; +typedef struct list_head task_queue; -#define DECLARE_TASK_QUEUE(q) task_queue q = NULL +#define DECLARE_TASK_QUEUE(q) LIST_HEAD(q) +#define TQ_ACTIVE(q) (!list_empty(&q)) -extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk; +extern task_queue tq_timer, tq_immediate, tq_disk; /* * To implement your own list of active bottom halfs, use the following * two definitions: * - * struct tq_struct *my_bh = NULL; + * DECLARE_TASK_QUEUE(my_bh); * struct tq_struct run_my_bh = { - * 0, 0, (void (*)(void *)) run_task_queue, &my_bh + * routine: (void (*)(void *)) run_task_queue, + * data: &my_bh * }; * * To activate a bottom half on your list, use: @@ -78,18 +75,21 @@ extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk; extern spinlock_t tqueue_lock; /* - * queue_task + * Queue a task on a tq. Return non-zero if it was successfully + * added. */ -static inline void queue_task(struct tq_struct *bh_pointer, +static inline int queue_task(struct tq_struct *bh_pointer, task_queue *bh_list) { + int ret = 0; if (!test_and_set_bit(0,&bh_pointer->sync)) { unsigned long flags; spin_lock_irqsave(&tqueue_lock, flags); - bh_pointer->next = *bh_list; - *bh_list = bh_pointer; + list_add_tail(&bh_pointer->list, bh_list); spin_unlock_irqrestore(&tqueue_lock, flags); + ret = 1; } + return ret; } /* @@ -97,28 +97,29 @@ static inline void queue_task(struct tq_struct *bh_pointer, */ static inline void run_task_queue(task_queue *list) { - if (*list) { + while (!list_empty(list)) { unsigned long flags; - struct tq_struct *p; + struct list_head *next; spin_lock_irqsave(&tqueue_lock, flags); - p = *list; - *list = NULL; - spin_unlock_irqrestore(&tqueue_lock, flags); - - while (p) { + next = list->next; + if (next != list) { void *arg; void (*f) (void *); - struct tq_struct *save_p; - arg = p -> data; - f = p -> routine; - save_p = p; - p = p -> next; - smp_mb(); - save_p -> sync = 0; + struct tq_struct *p; + + list_del(next); + p = list_entry(next, struct tq_struct, list); + arg = p->data; + f = p->routine; + p->sync = 0; + spin_unlock_irqrestore(&tqueue_lock, flags); + if (f) - (*f)(arg); + f(arg); + continue; } + spin_unlock_irqrestore(&tqueue_lock, flags); } } diff --git a/include/linux/tty.h b/include/linux/tty.h index bb5bebde0..642c8bd7e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -360,7 +360,6 @@ extern int rp_init(void); extern int cy_init(void); extern int stl_init(void); extern int stli_init(void); -extern int riscom8_init(void); extern int specialix_init(void); extern int espserial_init(void); extern int macserial_init(void); diff --git a/include/linux/usb.h b/include/linux/usb.h index 2828238ac..39e9f2eed 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -412,7 +412,7 @@ typedef struct urb struct usb_device *dev; // pointer to associated USB device unsigned int pipe; // pipe information int status; // returned status - unsigned int transfer_flags; // USB_DISABLE_SPD | USB_ISO_ASAP | USB_URB_EARLY_COMPLETE + unsigned int transfer_flags; // USB_DISABLE_SPD | USB_ISO_ASAP | etc. void *transfer_buffer; // associated data buffer int transfer_buffer_length; // data buffer length int actual_length; // actual data buffer length @@ -428,7 +428,7 @@ typedef struct urb void *context; // context for completion routine usb_complete_t complete; // pointer to completion routine // - iso_packet_descriptor_t iso_frame_desc[0]; + iso_packet_descriptor_t iso_frame_desc[0]; } urb_t, *purb_t; #define FILL_CONTROL_URB(a,aa,b,c,d,e,f,g) \ @@ -545,7 +545,7 @@ struct usb_bus { struct list_head inodes; }; -#define USB_MAXCHILDREN (8) /* This is arbitrary */ +#define USB_MAXCHILDREN (16) /* This is arbitrary */ struct usb_device { int devnum; /* Device number on USB bus */ diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 736493d1d..415454f5f 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -442,7 +442,7 @@ typedef struct wan_device char api_status; /* device api status */ struct net_device_stats stats; /* interface statistics */ unsigned reserved[16]; /* reserved for future use */ - unsigned critical; /* critical section flag */ + unsigned long critical; /* critical section flag */ /****** device management methods ***/ int (*setup) (struct wan_device *wandev, wandev_conf_t *conf); int (*shutdown) (struct wan_device *wandev); |