diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-20 14:56:40 +0000 |
commit | e308faf24f68e262d92d294a01ddca7a17e76762 (patch) | |
tree | 22c47cb315811834861f013067878ff664e95abd /include/linux | |
parent | 30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff) |
Sync with Linux 2.1.46.
Diffstat (limited to 'include/linux')
44 files changed, 852 insertions, 311 deletions
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index eb91dd0fa..adf4278e6 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -19,12 +19,11 @@ struct linux_binprm{ unsigned long p; int sh_bang; int java; /* Java binary, prevent recursive invocation */ - struct inode * inode; + struct dentry * dentry; int e_uid, e_gid; int argc, envc; char * filename; /* Name of binary */ unsigned long loader, exec; - int dont_iput; /* binfmt handler has put inode */ }; /* @@ -42,15 +41,16 @@ struct linux_binfmt { extern int register_binfmt(struct linux_binfmt *); extern int unregister_binfmt(struct linux_binfmt *); -extern int read_exec(struct inode *inode, unsigned long offset, +extern int read_exec(struct dentry *, unsigned long offset, char * addr, unsigned long count, int to_kmem); -extern int open_inode(struct inode * inode, int mode); +extern int open_dentry(struct dentry *, int mode); extern int init_elf_binfmt(void); extern int init_elf32_binfmt(void); extern int init_irix_binfmt(void); extern int init_aout_binfmt(void); +extern int init_aout32_binfmt(void); extern int init_script_binfmt(void); extern int init_java_binfmt(void); extern int init_em86_binfmt(void); diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index e9ef418f7..99ed0e347 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -4,6 +4,8 @@ * Data structure and defines shared between console.c, vga.c and tga.c */ +#include <linux/config.h> + #define NPAR 16 struct vc_data { @@ -17,12 +19,17 @@ struct vc_data { unsigned char vc_halfcolor; /* Colour for half intensity mode */ unsigned long vc_origin; /* Used for EGA/VGA fast scroll */ unsigned long vc_scr_end; /* Used for EGA/VGA fast scroll */ - unsigned long vc_pos; unsigned long vc_x,vc_y; unsigned long vc_top,vc_bottom; unsigned long vc_state; unsigned long vc_npar,vc_par[NPAR]; +#ifdef CONFIG_FB_CONSOLE + unsigned short *vc_video_mem_start; /* Start of video RAM */ + unsigned short *vc_pos; +#else + unsigned long vc_pos; unsigned long vc_video_mem_start; /* Start of video RAM */ +#endif unsigned long vc_video_mem_end; /* End of video RAM (sort of) */ unsigned long vc_saved_x; unsigned long vc_saved_y; diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 9386c17f0..0b22c2e30 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -1,4 +1,4 @@ -/* $Revision: 1.7 $$Date: 1997/03/26 10:30:00 $ +/* $Revision: 2.0 $$Date: 1997/06/30 10:30:00 $ * linux/include/linux/cyclades.h * * This file is maintained by Marcio Saito <marcio@cyclades.com> and @@ -6,6 +6,9 @@ * * This file contains the general definitions for the cyclades.c driver *$Log: cyclades.h,v $ + *Revision 1.1.1.1 1997/06/01 03:17:04 ralf + *Initial import of Linux/MIPS pre-2.1.40. + * *Revision 1.7 1997/03/26 10:30:00 daniel *new entries at the end of cyclades_port struct to reallocate *variables illegally allocated within card memory. @@ -86,6 +89,8 @@ typedef unsigned char ucchar; /* 8 bits, unsigned */ */ #define DP_WINDOW_SIZE (0x00080000) /* window size 512 Kb */ +#define ZE_DP_WINDOW_SIZE (0x00100000) /* window size 1 Mb (Ze and + 8Zo V.2 */ #define CTRL_WINDOW_SIZE (0x00000100) /* runtime regs 256 bytes */ /* @@ -183,6 +188,7 @@ struct RUNTIME_9060 { #define ID_ADDRESS 0x00000180L /* signature/pointer address */ #define ZFIRM_ID 0x5557465AL /* ZFIRM/U signature */ +#define ZFIRM_HLT 0x59505B5CL /* ZFIRM needs external power supply */ struct FIRM_ID { uclong signature; /* ZFIRM/U signature */ uclong zfwctrl_addr; /* pointer to ZFW_CTRL structure */ @@ -238,7 +244,10 @@ struct FIRM_ID { #define C_IN_RXBRK 0x00001000 /* Break received */ #define C_IN_PR_ERROR 0x00002000 /* parity error */ #define C_IN_FR_ERROR 0x00004000 /* frame error */ - +#define C_IN_OVR_ERROR 0x00008000 /* overrun error */ +#define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ +#define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ + /* flow control */ #define C_FL_OXX 0x00000001 /* output Xon/Xoff flow control */ @@ -294,6 +303,8 @@ struct FIRM_ID { #define C_CM_RXBRK 0x84 /* Break received */ #define C_CM_PR_ERROR 0x85 /* Parity error */ #define C_CM_FR_ERROR 0x86 /* Frame error */ +#define C_CM_OVR_ERROR 0x87 /* Overrun error */ +#define C_CM_RXOFL 0x88 /* RX buffer overflow */ #define C_CM_CMDERROR 0x90 /* command error */ #define C_CM_FATAL 0x91 /* fatal error */ #define C_CM_HW_RESET 0x92 /* reset board */ @@ -468,9 +479,10 @@ struct cyclades_port { #define CyMaxChipsPerCard 8 -#define CyPCI_Ywin 0x4000 -#define CyPCI_Zctl 0x100 -#define CyPCI_Zwin 0x80000 +#define CyPCI_Ywin 0x4000 +#define CyPCI_Zctl 0x100 +#define CyPCI_Zwin 0x80000 +#define CyPCI_Ze_win (2 * CyPCI_Zwin) /**** CD1400 registers ****/ diff --git a/include/linux/dcache.h b/include/linux/dcache.h new file mode 100644 index 000000000..1ca8af0d7 --- /dev/null +++ b/include/linux/dcache.h @@ -0,0 +1,122 @@ +#ifndef __LINUX_DCACHE_H +#define __LINUX_DCACHE_H + +/* + * linux/include/linux/dcache.h + * + * Directory cache data structures + */ + +#define D_MAXLEN 1024 + +#define IS_ROOT(x) ((x) == (x)->d_parent) + +/* + * "quick string" -- eases parameter passing, but more importantly + * saves "metadata" about the string (ie length and the hash). + */ +struct qstr { + const unsigned char * name; + unsigned int len, hash; +}; + +/* Name hashing routines. Initial hash value */ +#define init_name_hash() 0 + +/* partial hash update function. Assume roughly 4 bits per character */ +static inline unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) +{ + prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4)); + return prevhash ^ c; +} + +/* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ +static inline unsigned long end_name_hash(unsigned long hash) +{ + if (sizeof(hash) > sizeof(unsigned int)) + hash += hash >> 4*sizeof(hash); + return (unsigned int) hash; +} + +struct dentry { + int d_count; + unsigned int d_flags; + struct inode * d_inode; /* Where the name belongs to - NULL is negative */ + struct dentry * d_parent; /* parent directory */ + struct dentry * d_mounts; /* mount information */ + struct dentry * d_covers; + struct list_head d_hash; /* lookup hash list */ + struct list_head d_alias; /* inode alias list */ + struct list_head d_lru; /* d_count = 0 LRU list */ + struct qstr d_name; + struct dentry * (*d_revalidate)(struct dentry *); +}; + +/* + * d_drop() unhashes the entry from the parent + * dentry hashes, so that it won't be found through + * a VFS lookup any more. Note that this is different + * from deleting the dentry - d_delete will try to + * mark the dentry negative if possible, giving a + * successful _negative_ lookup, while d_drop will + * just make the cache lookup fail. + * + * d_drop() is used mainly for stuff that wants + * to invalidate a dentry for some reason (NFS + * timeouts or autofs deletes). + */ +static inline void d_drop(struct dentry * dentry) +{ + list_del(&dentry->d_hash); + INIT_LIST_HEAD(&dentry->d_hash); +} + +/* + * These are the low-level FS interfaces to the dcache.. + */ +extern void d_instantiate(struct dentry *, struct inode *); +extern void d_delete(struct dentry *); + + +/* allocate/de-allocate */ +extern void d_free(struct dentry *); +extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name); +extern void shrink_dcache(void); + +/* only used at mount-time */ +extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root); + +/* + * This adds the entry to the hash queues and initializes "d_inode". + * The entry was actually filled in earlier during "d_alloc()" + */ +extern void d_add(struct dentry * entry, struct inode * inode); + +/* used for rename() and baskets */ +extern void d_move(struct dentry * entry, struct dentry * newparent, struct qstr * newname); + +/* appendix may either be NULL or be used for transname suffixes */ +extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name); + +/* write full pathname into buffer and return length */ +extern int d_path(struct dentry * entry, struct dentry * chroot, char * buf); + +/* Allocation counts.. */ +static inline struct dentry * dget(struct dentry *dentry) +{ + if (dentry) + dentry->d_count++; + return dentry; +} + +extern void dput(struct dentry *); + +/* + * This is ugly. The inode:dentry relationship is a 1:n + * relationship, so we have to return one (random) dentry + * from the alias list. We select the first one.. + */ +#define i_dentry(inode) \ + list_entry((inode)->i_dentry.next, struct dentry, d_alias) + +#endif /* __LINUX_DCACHE_H */ diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 9c66cfc29..2831b1850 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -483,6 +483,7 @@ extern int ext2_getcluster (struct inode * inode, long block); extern void ext2_read_inode (struct inode *); extern void ext2_write_inode (struct inode *); extern void ext2_put_inode (struct inode *); +extern void ext2_delete_inode (struct inode *); extern int ext2_sync_inode (struct inode *); extern void ext2_discard_prealloc (struct inode *); @@ -492,17 +493,15 @@ extern int ext2_ioctl (struct inode *, struct file *, unsigned int, /* namei.c */ extern void ext2_release (struct inode *, struct file *); -extern int ext2_lookup (struct inode *,const char *, int, struct inode **); -extern int ext2_create (struct inode *,const char *, int, int, - struct inode **); -extern int ext2_mkdir (struct inode *, const char *, int, int); -extern int ext2_rmdir (struct inode *, const char *, int); -extern int ext2_unlink (struct inode *, const char *, int); -extern int ext2_symlink (struct inode *, const char *, int, const char *); -extern int ext2_link (struct inode *, struct inode *, const char *, int); -extern int ext2_mknod (struct inode *, const char *, int, int, int); -extern int ext2_rename (struct inode *, const char *, int, - struct inode *, const char *, int); +extern int ext2_lookup (struct inode *, struct dentry *); +extern int ext2_create (struct inode *,struct dentry *,int); +extern int ext2_mkdir (struct inode *,struct dentry *,int); +extern int ext2_rmdir (struct inode *,struct dentry *); +extern int ext2_unlink (struct inode *,struct dentry *); +extern int ext2_symlink (struct inode *,struct dentry *,const char *); +extern int ext2_link (struct inode *, struct inode *, struct dentry *); +extern int ext2_mknod (struct inode *, struct dentry *, int, int); +extern int ext2_rename (struct inode *, struct dentry *,struct inode *, struct dentry *); /* super.c */ extern void ext2_error (struct super_block *, const char *, const char *, ...) @@ -517,7 +516,7 @@ extern void ext2_write_super (struct super_block *); extern int ext2_remount (struct super_block *, int *, char *); extern struct super_block * ext2_read_super (struct super_block *,void *,int); extern int init_ext2_fs(void); -extern void ext2_statfs (struct super_block *, struct statfs *, int); +extern int ext2_statfs (struct super_block *, struct statfs *, int); /* truncate.c */ extern void ext2_truncate (struct inode *); diff --git a/include/linux/file.h b/include/linux/file.h index 0cb531c0c..b8cc01f0a 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -12,7 +12,7 @@ extern inline struct file * fget(unsigned long fd) return file; } -extern int __fput(struct file *, struct inode *); +extern int __fput(struct file *); extern void insert_file_free(struct file *file); /* It does not matter which list it is on. */ @@ -23,13 +23,13 @@ extern inline void remove_filp(struct file *file) *file->f_pprev = file->f_next; } -extern inline int fput(struct file *file, struct inode *inode) +extern inline int fput(struct file *file) { int count = file->f_count-1; int error = 0; if (!count) { - error = __fput(file, inode); + error = __fput(file); file->f_count = 0; remove_filp(file); insert_file_free(file); diff --git a/include/linux/fs.h b/include/linux/fs.h index 76fa53a7e..b459e966c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -15,12 +15,13 @@ #include <linux/net.h> #include <linux/kdev_t.h> #include <linux/ioctl.h> +#include <linux/list.h> +#include <linux/dcache.h> + #include <asm/atomic.h> +#include <asm/bitops.h> + -/* Prefixes for routines (having no effect), but indicate what - * the routine may do. This can greatly ease reasoning about routines... - */ -#define blocking /*routine may schedule()*/ /* * It's silly to have NR_OPEN bigger than NR_FILE, but I'll fix @@ -74,9 +75,6 @@ extern int max_files, nr_files; */ #define FS_IBASKET 8 /* FS does callback to free_ibasket() if space gets low. */ -/* public flags for i_status */ -#define ST_MODIFIED 1024 - /* * These are the fs-independent mount-flags: up to 16 flags are supported */ @@ -104,13 +102,6 @@ extern int max_files, nr_files; #define MS_MGC_MSK 0xffff0000 /* magic flag number mask */ /* - * Public flags for namei() - */ -#define NAM_PLAIN 0 /* Retrieve last component of pathname as is. */ -#define NAM_FOLLOW_LINK 2 /* If last component of path is a symlink, follow it */ -#define NAM_FOLLOW_TRAILSLASH 4 /* Follow last symlink only if trailed by slash. */ - -/* * Note that read-only etc flags are inode-specific: setting some file-system * flags just means all the inodes inherit those flags by default. It might be * possible to override it selectively if you really wanted to with some @@ -129,7 +120,12 @@ extern int max_files, nr_files; #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME) -#define DO_UPDATE_ATIME(inode) (!IS_NOATIME(inode) && !IS_RDONLY(inode)) + +#define UPDATE_ATIME(inode) \ + if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \ + inode->i_atime = CURRENT_TIME; \ + mark_inode_dirty(inode); \ + } /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ @@ -155,7 +151,7 @@ extern int max_files, nr_files; extern void buffer_init(void); extern void inode_init(void); extern void file_table_init(void); -extern unsigned long name_cache_init(unsigned long start, unsigned long end); +extern void dcache_init(void); typedef char buffer_block[BLOCK_SIZE]; @@ -183,18 +179,16 @@ typedef char buffer_block[BLOCK_SIZE]; */ struct buffer_head { /* First cache line: */ + struct buffer_head * b_next; /* Hash queue list */ unsigned long b_blocknr; /* block number */ + unsigned long b_size; /* block size */ kdev_t b_dev; /* device (B_FREE = free) */ kdev_t b_rdev; /* Real device */ unsigned long b_rsector; /* Real buffer location on disk */ - struct buffer_head * b_next; /* Hash queue list */ struct buffer_head * b_this_page; /* circular list of buffers in one page */ - - /* Second cache line: */ unsigned long b_state; /* buffer state bitmap (see above) */ struct buffer_head * b_next_free; unsigned int b_count; /* users using this block */ - unsigned long b_size; /* block size */ /* Non-performance-critical data follows. */ char * b_data; /* pointer to data block (1024 bytes) */ @@ -305,14 +299,12 @@ struct iattr { #include <linux/quota.h> struct inode { - struct inode *i_hash_next; - struct inode *i_hash_prev; - struct inode *i_next; - struct inode *i_prev; + struct list_head i_hash; + struct list_head i_list; unsigned long i_ino; kdev_t i_dev; - atomic_t i_count; + unsigned short i_count; umode_t i_mode; nlink_t i_nlink; uid_t i_uid; @@ -335,28 +327,14 @@ struct inode { struct page *i_pages; struct dquot *i_dquot[MAXQUOTAS]; - struct inode *i_lru_next; - struct inode *i_lru_prev; + struct list_head i_dentry; - struct inode *i_basket_next; - struct inode *i_basket_prev; - struct dentry *i_dentry; + unsigned long i_state; - short i_ddir_count; - short i_dent_count; - unsigned short i_status; - unsigned short i_reuse_count; - - struct inode *i_mount; unsigned int i_flags; - unsigned char i_lock; - unsigned char i_dirt; unsigned char i_pipe; unsigned char i_sock; - unsigned char i_level; - unsigned short i_fill; - int i_writecount; unsigned int i_attr_flags; union { @@ -377,9 +355,21 @@ struct inode { } u; }; +/* Inode state bits.. */ +#define I_DIRTY 0 +#define I_LOCK 1 +#define I_FREEING 2 + +extern void __mark_inode_dirty(struct inode *); +static inline void mark_inode_dirty(struct inode *inode) +{ + if (!test_and_set_bit(I_DIRTY, &inode->i_state)) + __mark_inode_dirty(inode); +} + struct file { struct file *f_next, **f_pprev; - struct inode *f_inode; + struct dentry *f_dentry; struct file_operations *f_op; mode_t f_mode; loff_t f_pos; @@ -395,6 +385,8 @@ struct file { void *private_data; }; +extern int init_private_file(struct file *, struct dentry *, int); + #define FL_POSIX 1 #define FL_FLOCK 2 #define FL_BROKEN 4 /* broken flock() emulation */ @@ -503,8 +495,7 @@ struct super_block { unsigned long s_flags; unsigned long s_magic; unsigned long s_time; - struct inode *s_covered; - struct inode *s_mounted; + struct dentry *s_root; struct wait_queue *s_wait; struct inode *s_ibasket; @@ -553,16 +544,17 @@ struct file_operations { struct inode_operations { struct file_operations * default_file_ops; - int (*create) (struct inode *,const char *,int,int,struct inode **); - int (*lookup) (struct inode *,const char *,int,struct inode **); - int (*link) (struct inode *,struct inode *,const char *,int); - int (*unlink) (struct inode *,const char *,int); - int (*symlink) (struct inode *,const char *,int,const char *); - int (*mkdir) (struct inode *,const char *,int,int); - int (*rmdir) (struct inode *,const char *,int); - int (*mknod) (struct inode *,const char *,int,int,int); - int (*rename) (struct inode *,const char *,int,struct inode *,const char *,int); + int (*create) (struct inode *,struct dentry *,int); + int (*lookup) (struct inode *,struct dentry *); + int (*link) (struct inode *,struct inode *,struct dentry *); + int (*unlink) (struct inode *,struct dentry *); + int (*symlink) (struct inode *,struct dentry *,const char *); + int (*mkdir) (struct inode *,struct dentry *,int); + int (*rmdir) (struct inode *,struct dentry *); + int (*mknod) (struct inode *,struct dentry *,int,int); + int (*rename) (struct inode *,struct dentry *,struct inode *,struct dentry *); int (*readlink) (struct inode *,char *,int); + struct dentry * (*follow_link) (struct inode *, struct dentry *); int (*readpage) (struct inode *, struct page *); int (*writepage) (struct inode *, struct page *); int (*bmap) (struct inode *,int); @@ -576,12 +568,13 @@ struct inode_operations { struct super_operations { void (*read_inode) (struct inode *); - int (*notify_change) (struct inode *, struct iattr *); void (*write_inode) (struct inode *); void (*put_inode) (struct inode *); + void (*delete_inode) (struct inode *); + int (*notify_change) (struct inode *, struct iattr *); void (*put_super) (struct super_block *); void (*write_super) (struct super_block *); - void (*statfs) (struct super_block *, struct statfs *, int); + int (*statfs) (struct super_block *, struct statfs *, int); int (*remount_fs) (struct super_block *, int *, char *); }; @@ -610,7 +603,7 @@ asmlinkage int sys_close(unsigned int); /* yes, it's really unsigned */ extern void kill_fasync(struct fasync_struct *fa, int sig); -extern int getname(const char * filename, char **result); +extern char * getname(const char * filename); extern void putname(char * name); extern int do_truncate(struct inode *, unsigned long); extern int register_blkdev(unsigned int, const char *, struct file_operations *); @@ -640,8 +633,8 @@ extern struct file_operations rdwr_pipe_fops; extern struct file_system_type *get_fs_type(const char *name); extern int fs_may_mount(kdev_t dev); -extern int fs_may_umount(kdev_t dev, struct inode * mount_root); -extern int fs_may_remount_ro(kdev_t dev); +extern int fs_may_umount(struct super_block *, struct dentry * root); +extern int fs_may_remount_ro(struct super_block *); extern struct file *inuse_filps; extern struct super_block super_blocks[NR_SUPER]; @@ -689,15 +682,31 @@ extern int fsync_dev(kdev_t dev); extern void sync_supers(kdev_t dev); extern int bmap(struct inode * inode,int block); extern int notify_change(struct inode *, struct iattr *); -extern int namei(int retr_mode, const char *pathname, struct inode **res_inode); extern int permission(struct inode * inode,int mask); extern int get_write_access(struct inode *inode); extern void put_write_access(struct inode *inode); -extern int open_namei(const char * pathname, int flag, int mode, - struct inode ** res_inode, struct inode * base); -extern int do_mknod(const char * filename, int mode, dev_t dev); +extern struct dentry * open_namei(const char * pathname, int flag, int mode); +extern struct dentry * do_mknod(const char * filename, int mode, dev_t dev); extern int do_pipe(int *); +/* + * Kernel pointers have redundant information, so we can use a + * scheme where we can return either an error code or a dentry + * pointer with the same return value. + * + * This should be a per-architecture thing, to allow different + * error and pointer decisions. + */ +#define ERR_PTR(err) ((void *)((long)(err))) +#define PTR_ERR(ptr) ((long)(ptr)) +#define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000)) + +extern struct dentry * lookup_dentry(const char *, struct dentry *, int); +extern struct dentry * __namei(const char *, int); + +#define namei(pathname) __namei(pathname, 1) +#define lnamei(pathname) __namei(pathname, 0) + #include <asm/semaphore.h> /* Intended for short locks of the global data structures in inode.c. @@ -726,87 +735,19 @@ extern inline void vfs_unlock(void) /* Not to be used by ordinary vfs users */ extern void _get_inode(struct inode * inode); -extern blocking void __iput(struct inode * inode); - -/* This must not be called if the inode is not in use (i.e. given - * back with iput(). The atomic inc assumes that the inode is - * already in use, and just has to be incremented higher. - * Please do not directly manipulate i_count any more. - * Use iget, iinc and iput. - * You may test i_count for zero if you are aware that it - * might change under you. - */ -extern inline void iinc(struct inode * inode) -{ - atomic_inc(&inode->i_count); -} - -/* The same, but the inode may not be in use. This must be called - * with vfslock() held, and be asure that the inode argument is - * valid (i.e. not out of cache). So the vfs_lock() must span the - * retrieval method of the inode. - */ -extern inline void iinc_zero(struct inode * inode) -{ - if(!atomic_read(&inode->i_count)) { - atomic_inc(&inode->i_count); - _get_inode(inode); - } else - atomic_inc(&inode->i_count); -} - -extern blocking void _iput(struct inode * inode); -extern inline blocking void iput(struct inode * inode) -{ - if(inode) { - extern void wake_up_interruptible(struct wait_queue **q); +extern void iput(struct inode * inode); - if(inode->i_pipe) - wake_up_interruptible(&inode->u.pipe_i.wait); +extern struct inode * iget(struct super_block * sb, unsigned long nr); +extern void clear_inode(struct inode * inode); +extern struct inode * get_empty_inode(void); - /* It does not matter if somebody re-increments it in between, - * only the _last_ user needs to call _iput(). - */ - if(atomic_dec_and_test(&inode->i_count) && inode->i_ddir_count <= 0) - _iput(inode); - } -} - -extern blocking struct inode * __iget(struct super_block * sb, unsigned long nr, int crsmnt); -extern blocking void _clear_inode(struct inode * inode, int external, int verbose); -extern blocking inline void clear_inode(struct inode * inode) -{ - vfs_lock(); - _clear_inode(inode, 1, 1); - vfs_unlock(); -} -extern blocking struct inode * _get_empty_inode(void); -extern inline blocking struct inode * get_empty_inode(void) -{ - struct inode * inode; - vfs_lock(); - inode = _get_empty_inode(); - vfs_unlock(); - return inode; -} /* Please prefer to use this function in future, instead of using * a get_empty_inode()/insert_inode_hash() combination. * It allows for better checking and less race conditions. */ -blocking struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino); - -extern inline blocking int free_ibasket(struct super_block * sb) -{ - extern blocking int _free_ibasket(struct super_block * sb); - int res; - vfs_lock(); - res = _free_ibasket(sb); - vfs_unlock(); - return res; -} +extern struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino); extern void insert_inode_hash(struct inode *); -extern blocking struct inode * get_pipe_inode(void); extern int get_unused_fd(void); extern void put_unused_fd(int); extern struct file * get_empty_filp(void); @@ -872,12 +813,6 @@ extern int dcache_lookup(struct inode *, const char *, int, unsigned long *); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); -extern inline blocking -struct inode * iget(struct super_block * sb, unsigned long nr) -{ - return __iget(sb, nr, 1); -} - /* kludge to get SCSI modules working */ #include <linux/minix_fs.h> #include <linux/minix_fs_sb.h> diff --git a/include/linux/ghash.h b/include/linux/ghash.h new file mode 100644 index 000000000..278f6c2f6 --- /dev/null +++ b/include/linux/ghash.h @@ -0,0 +1,218 @@ +/* + * include/linux/ghash.h -- generic hashing with fuzzy retrieval + * + * (C) 1997 Thomas Schoebel-Theuer + * + * The algorithms implemented here seem to be a completely new invention, + * and I'll publish the fundamentals in a paper. + */ + +#ifndef _GHASH_H +#define _GHASH_H +/* HASHSIZE _must_ be a power of two!!! */ + + +#define DEF_HASH_FUZZY_STRUCTS(NAME,HASHSIZE,TYPE) \ +\ +struct NAME##_table {\ + TYPE * hashtable[HASHSIZE];\ + TYPE * sorted_list;\ + int nr_entries;\ +};\ +\ +struct NAME##_ptrs {\ + TYPE * next_hash;\ + TYPE * prev_hash;\ + TYPE * next_sorted;\ + TYPE * prev_sorted;\ +}; + +#define DEF_HASH_FUZZY(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ +\ +LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + int ix = HASHFN(elem->KEY);\ + TYPE ** base = &tbl->hashtable[ix];\ + TYPE * ptr = *base;\ + TYPE * prev = NULL;\ +\ + tbl->nr_entries++;\ + while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ + base = &ptr->PTRS.next_hash;\ + prev = ptr;\ + ptr = *base;\ + }\ + elem->PTRS.next_hash = ptr;\ + elem->PTRS.prev_hash = prev;\ + if(ptr) {\ + ptr->PTRS.prev_hash = elem;\ + }\ + *base = elem;\ +\ + ptr = prev;\ + if(!ptr) {\ + ptr = tbl->sorted_list;\ + prev = NULL;\ + } else {\ + prev = ptr->PTRS.prev_sorted;\ + }\ + while(ptr) {\ + TYPE * next = ptr->PTRS.next_hash;\ + if(next && KEYCMP(next->KEY, elem->KEY)) {\ + prev = ptr;\ + ptr = next;\ + } else if(KEYCMP(ptr->KEY, elem->KEY)) {\ + prev = ptr;\ + ptr = ptr->PTRS.next_sorted;\ + } else\ + break;\ + }\ + elem->PTRS.next_sorted = ptr;\ + elem->PTRS.prev_sorted = prev;\ + if(ptr) {\ + ptr->PTRS.prev_sorted = elem;\ + }\ + if(prev) {\ + prev->PTRS.next_sorted = elem;\ + } else {\ + tbl->sorted_list = elem;\ + }\ +}\ +\ +LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + TYPE * next = elem->PTRS.next_hash;\ + TYPE * prev = elem->PTRS.prev_hash;\ +\ + tbl->nr_entries--;\ + if(next)\ + next->PTRS.prev_hash = prev;\ + if(prev)\ + prev->PTRS.next_hash = next;\ + else {\ + int ix = HASHFN(elem->KEY);\ + tbl->hashtable[ix] = next;\ + }\ +\ + next = elem->PTRS.next_sorted;\ + prev = elem->PTRS.prev_sorted;\ + if(next)\ + next->PTRS.prev_sorted = prev;\ + if(prev)\ + prev->PTRS.next_sorted = next;\ + else\ + tbl->sorted_list = next;\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix = hashfn(pos);\ + TYPE * ptr = tbl->hashtable[ix];\ + while(ptr && KEYCMP(ptr->KEY, pos))\ + ptr = ptr->PTRS.next_hash;\ + if(ptr && !KEYEQ(ptr->KEY, pos))\ + ptr = NULL;\ + return ptr;\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash_fuzzy(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix;\ + int offset;\ + TYPE * ptr;\ + TYPE * next;\ +\ + ptr = tbl->sorted_list;\ + if(!ptr || KEYCMP(pos, ptr->KEY))\ + return NULL;\ + ix = HASHFN(pos);\ + offset = HASHSIZE;\ + do {\ + offset >>= 1;\ + next = tbl->hashtable[(ix+offset) & ((HASHSIZE)-1)];\ + if(next && (KEYCMP(next->KEY, pos) || KEYEQ(next->KEY, pos))\ + && KEYCMP(ptr->KEY, next->KEY))\ + ptr = next;\ + } while(offset);\ +\ + for(;;) {\ + next = ptr->PTRS.next_hash;\ + if(next) {\ + if(KEYCMP(next->KEY, pos)) {\ + ptr = next;\ + continue;\ + }\ + }\ + next = ptr->PTRS.next_sorted;\ + if(next && KEYCMP(next->KEY, pos)) {\ + ptr = next;\ + continue;\ + }\ + return ptr;\ + }\ + return NULL;\ +} + +#define DEF_HASH_STRUCTS(NAME,HASHSIZE,TYPE) \ +\ +struct NAME##_table {\ + TYPE * hashtable[HASHSIZE];\ + int nr_entries;\ +};\ +\ +struct NAME##_ptrs {\ + TYPE * next_hash;\ + TYPE * prev_hash;\ +}; + +#define DEF_HASH(LINKAGE,NAME,HASHSIZE,TYPE,PTRS,KEYTYPE,KEY,KEYCMP,KEYEQ,HASHFN)\ +\ +LINKAGE void insert_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + int ix = HASHFN(elem->KEY);\ + TYPE ** base = &tbl->hashtable[ix];\ + TYPE * ptr = *base;\ + TYPE * prev = NULL;\ +\ + tbl->nr_entries++;\ + while(ptr && KEYCMP(ptr->KEY, elem->KEY)) {\ + base = &ptr->PTRS.next_hash;\ + prev = ptr;\ + ptr = *base;\ + }\ + elem->PTRS.next_hash = ptr;\ + elem->PTRS.prev_hash = prev;\ + if(ptr) {\ + ptr->PTRS.prev_hash = elem;\ + }\ + *base = elem;\ +}\ +\ +LINKAGE void remove_##NAME##_hash(struct NAME##_table * tbl, TYPE * elem)\ +{\ + TYPE * next = elem->PTRS.next_hash;\ + TYPE * prev = elem->PTRS.prev_hash;\ +\ + tbl->nr_entries--;\ + if(next)\ + next->PTRS.prev_hash = prev;\ + if(prev)\ + prev->PTRS.next_hash = next;\ + else {\ + int ix = HASHFN(elem->KEY);\ + tbl->hashtable[ix] = next;\ + }\ +}\ +\ +LINKAGE TYPE * find_##NAME##_hash(struct NAME##_table * tbl, KEYTYPE pos)\ +{\ + int ix = hashfn(pos);\ + TYPE * ptr = tbl->hashtable[ix];\ + while(ptr && KEYCMP(ptr->KEY, pos))\ + ptr = ptr->PTRS.next_hash;\ + if(ptr && !KEYEQ(ptr->KEY, pos))\ + ptr = NULL;\ + return ptr;\ +} + +#endif diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 5f18a049a..c93764cb7 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -47,6 +47,8 @@ #define ARPHRD_ROSE 270 #define ARPHRD_X25 271 /* CCITT X.25 */ #define ARPHRD_PPP 512 +#define ARPHRD_HDLC 513 /* (Cisco) HDLC */ +#define ARPHRD_LAPB 516 /* LAPB */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */ diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h new file mode 100644 index 000000000..abb6198af --- /dev/null +++ b/include/linux/if_shaper.h @@ -0,0 +1,61 @@ +#ifndef __LINUX_SHAPER_H +#define __LINUX_SHAPER_H + +#ifdef __KERNEL__ + +#define SHAPER_QLEN 10 +/* + * This is a bit speed dependant (read it shouldnt be a constant!) + * + * 5 is about right for 28.8 upwards. Below that double for every + * halving of speed or so. - ie about 20 for 9600 baud. + */ +#define SHAPER_LATENCY (5*HZ) +#define SHAPER_MAXSLIP 2 +#define SHAPER_BURST (HZ/50) /* Good for >128K then */ + +struct shaper +{ + struct sk_buff_head sendq; + __u32 bytespertick; + __u32 shapelatency; + __u32 shapeclock; + __u32 recovery; /* Time we can next clock a packet out on + an empty queue */ + char locked; + struct device *dev; + int (*hard_start_xmit) (struct sk_buff *skb, + struct device *dev); + int (*hard_header) (struct sk_buff *skb, + struct device *dev, + unsigned short type, + void *daddr, + void *saddr, + unsigned len); + int (*rebuild_header)(struct sk_buff *skb); + int (*hard_header_cache)(struct dst_entry *dst, struct neighbour *neigh, + struct hh_cache *hh); + void (*header_cache_update)(struct hh_cache *hh, struct device *dev, unsigned char * haddr); + struct net_device_stats* (*get_stats)(struct device *dev); + struct wait_queue *wait_queue; + struct timer_list timer; +}; + +#endif + +#define SHAPER_SET_DEV 0x0001 +#define SHAPER_SET_SPEED 0x0002 + +struct shaperconf +{ + __u16 ss_cmd; + union + { + char ssu_name[14]; + __u32 ssu_speed; + } ss_u; +#define ss_speed ss_u.ssu_speed +#define ss_name ss_u.ssu_name +}; + +#endif diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 03239cfc3..011edfe6f 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -152,8 +152,7 @@ extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inod extern int isofs_open(struct inode * inode, struct file * filp); extern void isofs_release(struct inode * inode, struct file * filp); -extern int isofs_lookup(struct inode * dir,const char * name, int len, - struct inode ** result); +extern int isofs_lookup(struct inode * dir, struct dentry *); extern unsigned long isofs_count_free_inodes(struct super_block *sb); extern int isofs_new_block(int dev); extern int isofs_free_block(int dev, int block); @@ -164,7 +163,7 @@ extern struct super_block *isofs_read_super(struct super_block *,void *,int); extern int init_iso9660_fs(void); extern void isofs_read_inode(struct inode *); extern void isofs_put_inode(struct inode *); -extern void isofs_statfs(struct super_block *, struct statfs *, int); +extern int isofs_statfs(struct super_block *, struct statfs *, int); extern int isofs_lseek(struct inode *, struct file *, off_t, int); extern int isofs_read(struct inode *, struct file *, char *, int); diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h index d8065500f..a1343a636 100644 --- a/include/linux/iso_fs_i.h +++ b/include/linux/iso_fs_i.h @@ -6,7 +6,6 @@ */ struct iso_inode_info { unsigned int i_first_extent; - unsigned int i_backlink; unsigned char i_file_format; }; diff --git a/include/linux/joystick.h b/include/linux/joystick.h new file mode 100644 index 000000000..a9a56273d --- /dev/null +++ b/include/linux/joystick.h @@ -0,0 +1,61 @@ +#ifndef _LINUX_JOYSTICK_H +#define _LINUX_JOYSTICK_H + +#define JS_RETURN sizeof(struct js_status) /*number of bytes returned by js_read*/ +#define JS_TRUE 1 +#define JS_FALSE 0 +#define JS_PORT 0x201 /*io port for joystick operations*/ +#define JS_DEF_TIMEOUT 0x1300 /*default timeout value for js_read()*/ +#define JS_DEF_CORR 0 /*default correction factor*/ +#define JS_DEF_TIMELIMIT 10L /*default data valid time =10 jiffies == 100ms*/ +#define JS_X_0 0x01 /*bit mask for x-axis js0*/ +#define JS_Y_0 0x02 /*bit mask for y-axis js0*/ +#define JS_X_1 0x04 /*bit mask for x-axis js1*/ +#define JS_Y_1 0x08 /*bit mask for y-axis js1*/ +#define JS_MAX 2 /*Max number of joysticks*/ +#define PIT_MODE 0x43 /*io port for timer 0*/ +#define PIT_COUNTER_0 0x40 /*io port for timer 0*/ +#define JSIOCSCAL 0x01 /*ioctl cmd to set joystick correction factor*/ +#define JSIOCGCAL 0x02 /*ioctl cmd to get joystick correction factor*/ +#define JSIOCSTIMEOUT 0x03 /*ioctl cmd to set maximum number of iterations + to wait for a timeout*/ +#define JSIOCGTIMEOUT 0x04 /*as above, to get*/ +#define JSIOCSTIMELIMIT 0x05 /*set data retention time*/ +#define JSIOCGTIMELIMIT 0x06 /*get data retention time*/ +#define JSIOCGCONFIG 0x07 /*get the whole js_data[minor] struct*/ +#define JSIOCSCONFIG 0x08 /*set the whole js_data[minor] struct + except js_busy!*/ + +/* + * This union is used for the ioctl to set the scaling factor and to + * return the current values for a joystick. 'buttons' is ignored on + * the ioctl call + */ + +struct js_status +{ + int buttons; + int x; + int y; +}; + +/* + * This struct is used for misc data about the joystick + */ + +struct js_config +{ + int js_timeout; /*timeout*/ + int busy; /*joystick is in use*/ + long js_expiretime; /*Time when stick after which stick must be re-read*/ + long js_timelimit; /*Max time before data is invalid*/ + struct js_status js_save; /*last read data*/ + struct js_status js_corr; /*correction factor*/ +}; + +#define LATCH (1193180L/HZ) /*initial timer 0 value*/ +#define DELTA_TIME(X,Y) ((X)-(Y)+(((X)>=(Y))?0:LATCH)) + +extern int joystick_init(void); + +#endif /* _LINUX_JOYSTICK_H */ diff --git a/include/linux/list.h b/include/linux/list.h new file mode 100644 index 000000000..84a0ecef6 --- /dev/null +++ b/include/linux/list.h @@ -0,0 +1,63 @@ +#ifndef _LINUX_LIST_H +#define _LINUX_LIST_H + +/* + * Simple doubly linked list implementation. + */ +struct list_head { + struct list_head *next, *prev; +}; + +#define LIST_HEAD(name) \ + struct list_head name = { &name, &name } + +#define INIT_LIST_HEAD(ptr) do { \ + (ptr)->next = (ptr); (ptr)->prev = (ptr); \ +} while (0) + +static inline void list_add(struct list_head *new, struct list_head *head) +{ + struct list_head *next = head->next; + next->prev = new; + new->next = next; + new->prev = head; + head->next = new; +} + +static inline void list_del(struct list_head *entry) +{ + struct list_head *next, *prev; + next = entry->next; + prev = entry->prev; + next->prev = prev; + prev->next = next; +} + +static inline int list_empty(struct list_head *head) +{ + return head->next == head; +} + +/* + * Splice in "list" into "head" + */ +static inline void list_splice(struct list_head *list, struct list_head *head) +{ + struct list_head *first = list->next; + + if (first != list) { + struct list_head *last = list->prev; + struct list_head *at = head->next; + + first->prev = head; + head->next = first; + + last->next = at; + at->prev = last; + } +} + +#define list_entry(ptr, type, member) \ + ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) + +#endif diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 72035cc5c..5c1d0e4cc 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -166,7 +166,7 @@ void nlmsvc_free_host_resources(struct nlm_host *); extern __inline__ struct inode * nlmsvc_file_inode(struct nlm_file *file) { - return file->f_file.f_inode; + return file->f_file.f_dentry->d_inode; } /* diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 069686fff..8c75cc3c5 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -88,19 +88,17 @@ struct minix_dir_entry { #ifdef __KERNEL__ -extern int minix_lookup(struct inode * dir,const char * name, int len, - struct inode ** result); -extern int minix_create(struct inode * dir,const char * name, int len, int mode, - struct inode ** result); -extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode); -extern int minix_rmdir(struct inode * dir, const char * name, int len); -extern int minix_unlink(struct inode * dir, const char * name, int len); -extern int minix_symlink(struct inode * inode, const char * name, int len, +extern int minix_lookup(struct inode * dir, struct dentry *dentry); +extern int minix_create(struct inode * dir, struct dentry *dentry, int mode); +extern int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode); +extern int minix_rmdir(struct inode * dir, struct dentry *dentry); +extern int minix_unlink(struct inode * dir, struct dentry *dentry); +extern int minix_symlink(struct inode * inode, struct dentry *dentry, const char * symname); -extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len); -extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev); -extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len, - struct inode * new_dir, const char * new_name, int new_len); +extern int minix_link(struct inode * oldinode, struct inode * dir, struct dentry *dentry); +extern int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev); +extern int minix_rename(struct inode * old_dir, struct dentry *old_dentry, + struct inode * new_dir, struct dentry *new_dentry); extern struct inode * minix_new_inode(const struct inode * dir); extern void minix_free_inode(struct inode * inode); extern unsigned long minix_count_free_inodes(struct super_block *sb); @@ -121,8 +119,7 @@ extern void minix_write_super(struct super_block *); extern int minix_remount (struct super_block * sb, int * flags, char * data); extern void minix_read_inode(struct inode *); extern void minix_write_inode(struct inode *); -extern void minix_put_inode(struct inode *); -extern void minix_statfs(struct super_block *, struct statfs *, int); +extern int minix_statfs(struct super_block *, struct statfs *, int); extern int minix_sync_inode(struct inode *); extern int minix_sync_file(struct inode *, struct file *); diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 471caa0b7..8f4bde9ab 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -8,6 +8,7 @@ #define AMIGAMOUSE_MINOR 4 #define ATARIMOUSE_MINOR 5 #define SUN_MOUSE_MINOR 6 +#define PC110PAD_MINOR 9 #define RTC_MINOR 135 #define SUN_OPENPROM_MINOR 139 #define MISC_DYNAMIC_MINOR 255 diff --git a/include/linux/mm.h b/include/linux/mm.h index c8b9046a7..bfde668c7 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -48,7 +48,7 @@ struct vm_area_struct { struct vm_operations_struct * vm_ops; unsigned long vm_offset; - struct inode * vm_inode; + struct dentry * vm_dentry; unsigned long vm_pte; /* shared mem */ }; @@ -118,7 +118,7 @@ typedef struct page { unsigned long offset; struct page *next_hash; atomic_t count; - unsigned flags; /* atomic flags, some possibly updated asynchronously */ + unsigned long flags; /* atomic flags, some possibly updated asynchronously */ unsigned dirty:16, age:8; struct wait_queue *wait; diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 36ed2a890..0badd9ebe 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -215,7 +215,7 @@ extern void fat_put_super(struct super_block *sb); extern void fat_read_inode(struct inode *inode, struct inode_operations *dir_ops); extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent); extern void msdos_put_super(struct super_block *sb); -extern void fat_statfs(struct super_block *sb,struct statfs *buf, int); +extern int fat_statfs(struct super_block *sb,struct statfs *buf, int); extern void fat_write_inode(struct inode *inode); /* dir.c */ diff --git a/include/linux/net.h b/include/linux/net.h index bd30d7804..82a4b7570 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -136,5 +136,8 @@ extern int sock_sendmsg(struct socket *, struct msghdr *m, int len); extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); extern int sock_readv_writev(int type, struct inode * inode, struct file * file, const struct iovec * iov, long count, long size); + +int net_ratelimit(void); + #endif /* __KERNEL__ */ #endif /* _LINUX_NET_H */ diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 489762a36..75c2c91b2 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -57,7 +57,7 @@ struct knfs_fh { typedef struct svc_fh { struct knfs_fh fh_handle; /* FH data */ struct svc_export * fh_export; /* export pointer */ - struct inode * fh_inode; /* inode */ + struct dentry * fh_dentry; /* file */ size_t fh_pre_size; /* size before operation */ time_t fh_pre_mtime; /* mtime before oper */ time_t fh_pre_ctime; /* ctime before oper */ @@ -98,7 +98,7 @@ fh_init(struct svc_fh *fhp) static inline void fh_lock(struct svc_fh *fhp) { - struct inode *inode = fhp->fh_inode; + struct inode *inode = fhp->fh_dentry->d_inode; /* dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n", @@ -118,7 +118,7 @@ fh_lock(struct svc_fh *fhp) static inline void fh_unlock(struct svc_fh *fhp) { - struct inode *inode = fhp->fh_inode; + struct inode *inode = fhp->fh_dentry->d_inode; if (fhp->fh_locked) { if (!fhp->fh_post_version) @@ -135,9 +135,9 @@ fh_unlock(struct svc_fh *fhp) static inline void fh_put(struct svc_fh *fhp) { - if (fhp->fh_inode) { + if (fhp->fh_dentry) { fh_unlock(fhp); - iput(fhp->fh_inode); + dput(fhp->fh_dentry); } } #else @@ -146,19 +146,19 @@ fh_put(struct svc_fh *fhp) static inline void __fh_put(struct svc_fh *fhp, char *file, int line) { - struct inode *inode; + struct dentry *dentry; - if (!(inode = fhp->fh_inode)) + if (!(dentry = fhp->fh_dentry)) return; - if (!atomic_read(&inode->i_count)) { - printk("nfsd: trying to free free inode in %s:%d\n" - " dev %04x ino %ld, mode %07o\n", - file, line, inode->i_dev, - inode->i_ino, inode->i_mode); + if (!dentry->d_count) { + printk("nfsd: trying to free free dentry in %s:%d\n" + " file %s/%s\n", + file, line, + dentry->d_parent->d_name.name, dentry->d_name.name); } else { fh_unlock(fhp); - iput(inode); + dput(dentry); } } #endif diff --git a/include/linux/omirr.h b/include/linux/omirr.h deleted file mode 100644 index 379867423..000000000 --- a/include/linux/omirr.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * fs/proc/omirr.c - online mirror support - * - * (C) 1997 Thomas Schoebel-Theuer - */ - -#ifndef OMIRR_H -#define OMIRR_H -#include <linux/fs.h> -#include <linux/dalloc.h> - -extern int omirr_print(struct dentry * ent1, struct dentry * ent2, - struct qstr * suffix, const char * fmt, ...); - -extern int omirr_printall(struct inode * inode, const char * fmt, ...); - -#endif diff --git a/include/linux/pci.h b/include/linux/pci.h index b13929d6a..138e67bfe 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -497,7 +497,7 @@ #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 #define PCI_DEVICE_ID_VIA_82C576 0x0576 #define PCI_DEVICE_ID_VIA_82C585 0x0585 -#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 +#define PCI_DEVICE_ID_VIA_82C586 0x0586 #define PCI_DEVICE_ID_VIA_82C416 0x1571 #define PCI_VENDOR_ID_VORTEX 0x1119 diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 21b39d628..3a847d72c 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -5,7 +5,6 @@ struct pipe_inode_info { struct wait_queue * wait; char * base; unsigned int start; - unsigned int len; unsigned int lock; unsigned int rd_openers; unsigned int wr_openers; @@ -16,7 +15,7 @@ struct pipe_inode_info { #define PIPE_WAIT(inode) ((inode).u.pipe_i.wait) #define PIPE_BASE(inode) ((inode).u.pipe_i.base) #define PIPE_START(inode) ((inode).u.pipe_i.start) -#define PIPE_LEN(inode) ((inode).u.pipe_i.len) +#define PIPE_LEN(inode) ((inode).i_size) #define PIPE_RD_OPENERS(inode) ((inode).u.pipe_i.rd_openers) #define PIPE_WR_OPENERS(inode) ((inode).u.pipe_i.wr_openers) #define PIPE_READERS(inode) ((inode).u.pipe_i.readers) diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index b0e33a0c6..80cdf71a7 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -310,10 +310,11 @@ static inline int proc_scsi_unregister(struct proc_dir_entry *driver, int x) extern struct super_block *proc_read_super(struct super_block *,void *,int); extern int init_proc_fs(void); extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_entry *); -extern void proc_statfs(struct super_block *, struct statfs *, int); +extern int proc_statfs(struct super_block *, struct statfs *, int); extern void proc_read_inode(struct inode *); extern void proc_write_inode(struct inode *); -extern int proc_match(int, const char *, struct proc_dir_entry *); + +extern int proc_match(int, const char *,struct proc_dir_entry *); /* * These are generic /proc routines that use the internal @@ -323,7 +324,7 @@ extern int proc_match(int, const char *, struct proc_dir_entry *); * of the /proc/<pid> subdirectories. */ extern int proc_readdir(struct inode *, struct file *, void *, filldir_t); -extern int proc_lookup(struct inode *, const char *, int, struct inode **); +extern int proc_lookup(struct inode *, struct dentry *); struct openpromfs_dev { struct openpromfs_dev *next; @@ -335,7 +336,7 @@ struct openpromfs_dev { }; extern struct inode_operations * proc_openprom_register(int (*readdir)(struct inode *, struct file *, void *, filldir_t), - int (*lookup)(struct inode *, const char *, int, struct inode **), + int (*lookup)(struct inode *, struct qstr *, struct inode **), void (*use)(struct inode *, int), struct openpromfs_dev ***); extern void proc_openprom_deregister(void); @@ -363,9 +364,6 @@ extern struct inode_operations proc_ringbuf_inode_operations; #endif extern struct inode_operations proc_omirr_inode_operations; -/* Not sure whether this belongs here */ -int proc_arbitrary_lookup(struct inode * dir, const char * name, - int len, struct inode ** result); #endif /* diff --git a/include/linux/random.h b/include/linux/random.h index b2706ce03..7be5e9898 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -55,6 +55,8 @@ extern void get_random_bytes(void *buf, int nbytes); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); +extern __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, + __u16 sport, __u16 dport, __u32 sseq, __u32 count); #ifndef MODULE extern struct file_operations random_fops, urandom_fops; diff --git a/include/linux/rose.h b/include/linux/rose.h index 2ca68dbaa..cd82c95c3 100644 --- a/include/linux/rose.h +++ b/include/linux/rose.h @@ -8,8 +8,9 @@ #define ROSE_KERNEL_H #define PF_ROSE AF_ROSE -#define ROSE_MTU 128 +#define ROSE_MTU 251 +#define ROSE_DEFER 1 #define ROSE_T1 2 #define ROSE_T2 3 #define ROSE_T3 4 @@ -17,7 +18,22 @@ #define ROSE_QBITINCL 6 #define ROSE_HOLDBACK 7 +#define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0) +#define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1) #define SIOCRSL2CALL (SIOCPROTOPRIVATE+2) +#define SIOCRSACCEPT (SIOCPROTOPRIVATE+3) +#define SIOCRSCLRRT (SIOCPROTOPRIVATE+4) + +#define ROSE_DTE_ORIGINATED 0x00 +#define ROSE_NUMBER_BUSY 0x01 +#define ROSE_INVALID_FACILITY 0x03 +#define ROSE_NETWORK_CONGESTION 0x05 +#define ROSE_OUT_OF_ORDER 0x09 +#define ROSE_ACCESS_BARRED 0x0B +#define ROSE_NOT_OBTAINABLE 0x0D +#define ROSE_REMOTE_PROCEDURE 0x11 +#define ROSE_LOCAL_PROCEDURE 0x13 +#define ROSE_SHIP_ABSENT 0x39 typedef struct { char rose_addr[5]; @@ -40,4 +56,9 @@ struct rose_route_struct { ax25_address digipeaters[AX25_MAX_DIGIS]; }; +struct rose_cause_struct { + unsigned char cause; + unsigned char diagnostic; +}; + #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index 189194a49..361498ead 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -130,7 +130,7 @@ struct files_struct { struct fs_struct { int count; int umask; - struct inode * root, * pwd; + struct dentry * root, * pwd; }; #define INIT_FS { \ @@ -519,12 +519,10 @@ extern inline void __remove_wait_queue(struct wait_queue ** p, struct wait_queue { struct wait_queue * next = wait->next; struct wait_queue * head = next; + struct wait_queue * tmp; - for (;;) { - struct wait_queue * nextlist = head->next; - if (nextlist == wait) - break; - head = nextlist; + while ((tmp = head->next) != wait) { + head = tmp; } head->next = next; } diff --git a/include/linux/sdla_fr.h b/include/linux/sdla_fr.h index bcca8d58d..c66ee0ec3 100644 --- a/include/linux/sdla_fr.h +++ b/include/linux/sdla_fr.h @@ -281,7 +281,7 @@ typedef struct fr_dlc_conf } fr_dlc_conf_t; /*---------------------------------------------------------------------------- - * S502 Interrupt mode control block. + * S502 interrupt mode control block. * This structure is passed to the FR_SET_INTR_FLAGS and returned by the * FR_READ_INTR_FLAGS commands. */ @@ -292,7 +292,7 @@ typedef struct fr502_intr_ctl } fr502_intr_ctl_t; /*---------------------------------------------------------------------------- - * S508 Interrupt mode control block. + * S508 interrupt mode control block. * This structure is passed to the FR_SET_INTR_FLAGS and returned by the * FR_READ_INTR_FLAGS commands. */ @@ -306,10 +306,10 @@ typedef struct fr508_intr_ctl } fr508_intr_ctl_t; /*---------------------------------------------------------------------------- - * Channel Status. + * Channel status. * This structure is returned by the FR_READ_STATUS command. */ -typedef struct frDLCStatus +typedef struct fr_dlc_Status { unsigned char status PACKED; /* 00h: link/DLCI status */ struct @@ -317,7 +317,7 @@ typedef struct frDLCStatus unsigned short dlci PACKED; /* 01h: DLCI number */ unsigned char status PACKED; /* 03h: DLCI status */ } circuit[1] PACKED; -} frDLCStatus_t; +} fr_dlc_status_t; /* 'status' defines */ #define FR_LINK_INOPER 0x00 /* for global status (DLCI == 0) */ @@ -333,7 +333,7 @@ typedef struct frDLCStatus * This structure is returned by the FR_READ_STATISTICS command when * dcli == 0. */ -typedef struct frLinkStat +typedef struct fr_link_stat { unsigned short rx_too_long PACKED; /* 00h: */ unsigned short rx_dropped PACKED; /* 02h: */ @@ -363,14 +363,14 @@ typedef struct frLinkStat unsigned short current_T392 PACKED; /* 32h: */ unsigned short current_N392 PACKED; /* 34h: */ unsigned short current_N393 PACKED; /* 36h: */ -} frLinkStat_t; +} fr_link_stat_t; /*---------------------------------------------------------------------------- - * DLCI Statistics. + * DLCI statistics. * This structure is returned by the FR_READ_STATISTICS command when * dlci != 0. */ -typedef struct frDLCIStat +typedef struct fr_dlci_stat { unsigned long tx_frames PACKED; /* 00h: */ unsigned long tx_bytes PACKED; /* 04h: */ @@ -384,13 +384,13 @@ typedef struct frDLCIStat unsigned long tx_calc_timer PACKED; /* 24h: */ unsigned long rx_throughput PACKED; /* 28h: */ unsigned long rx_calc_timer PACKED; /* 2Ch: */ -} frDLCIStat_t; +} fr_dlci_stat_t; /*---------------------------------------------------------------------------- - * Communications Error Statistics. + * Communications error statistics. * This structure is returned by the FR_READ_ERROR_STATS command. */ -typedef struct frCommStat +typedef struct fr_comm_stat { unsigned char rx_overruns PACKED; /* 00h: */ unsigned char rx_bad_crc PACKED; /* 01h: */ @@ -401,7 +401,7 @@ typedef struct frCommStat unsigned char tx_missed_undr PACKED; /* 06h: */ unsigned char dcd_dropped PACKED; /* 07h: */ unsigned char cts_dropped PACKED; /* 08h: */ -} frCommStat_t; +} fr_comm_stat_t; /*---------------------------------------------------------------------------- * Defines for the FR_ISSUE_IS_FRAME command. diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h index 424e9fe6a..0cff58224 100644 --- a/include/linux/sdla_x25.h +++ b/include/linux/sdla_x25.h @@ -480,7 +480,7 @@ typedef struct X25Stats unsigned short rxRR PACKED; /* 3Ah: RR */ unsigned short txRNR PACKED; /* 3Ch: RNR */ unsigned short rxRNR PACKED; /* 3Eh: RNR */ -} X25Stats; +} TX25Stats; /*---------------------------------------------------------------------------- * X25_READ_HISTORY_TABLE Command. diff --git a/include/linux/selection.h b/include/linux/selection.h index d6f1248f0..cad2a29b0 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -23,11 +23,11 @@ extern unsigned long get_video_size_row(unsigned int console); #define get_video_num_columns(dummy) video_num_columns #define get_video_num_lines(dummy) video_num_lines #define get_video_size_row(dummy) video_size_row -#endif - extern unsigned long video_num_columns; extern unsigned long video_num_lines; extern unsigned long video_size_row; +#endif + extern unsigned char video_type; extern unsigned long video_mem_base; extern unsigned long video_mem_term; @@ -73,6 +73,8 @@ extern void putconsxy(int currcons, char *p); /* how to access screen memory */ +#include <linux/config.h> + #if defined(CONFIG_TGA_CONSOLE) extern int tga_blitc(unsigned int, unsigned long); diff --git a/include/linux/simp.h b/include/linux/simp.h new file mode 100644 index 000000000..bf838f815 --- /dev/null +++ b/include/linux/simp.h @@ -0,0 +1,39 @@ +/* + * include/linux/simp.h -- simple allocator for cached objects + * + * This is meant as a faster and simpler (not full-featured) replacement + * for SLAB, thus the name "simp" :-) + * + * (C) 1997 Thomas Schoebel-Theuer + */ + +#ifndef SIMP_H +#define SIMP_H + +/* used for constructors / destructors */ +typedef void (*structor)(void *); + +/* create an object cache */ +/* positive clearable_offset means the next two pointers at that offset + * can be internally used for freelist pointers when the object is + * deallocated / not in use; + * if there is no space inside the element that can be reused for + * this purpose, supply -1. Using positive offsets is essential for + * saving space with very small-sized objects. + * + * Note for big-sized objects in the range of whole pages, use + * the fast Linux page allocator instead, directly. + */ +extern struct simp * simp_create(char * name, long size, + structor first_ctor, + structor again_ctor, + structor dtor); + +/* alloc / dealloc routines */ +extern void * simp_alloc(struct simp * simp); +extern void simp_free(void * objp); + +/* garbage collection */ +extern long simp_garbage(void); + +#endif diff --git a/include/linux/slab.h b/include/linux/slab.h index 08be13221..decb1e747 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -32,7 +32,7 @@ typedef struct kmem_cache_s kmem_cache_t; #define SLAB_DEBUG_FREE 0x00000100UL /* Peform (expensive) checks on free */ #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ -#define SLAB_POISION 0x00000800UL /* Poision objects */ +#define SLAB_POISON 0x00000800UL /* Poison objects */ #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ #if 0 @@ -56,8 +56,8 @@ extern void *kmem_cache_alloc(kmem_cache_t *, int); extern void kmem_cache_free(kmem_cache_t *, void *); extern void *kmalloc(size_t, int); -extern void kfree(void *); -extern void kfree_s(void *, size_t); +extern void kfree(const void *); +extern void kfree_s(const void *, size_t); extern int kmem_cache_reap(int, int, int); extern int get_slabinfo(char *); diff --git a/include/linux/swap.h b/include/linux/swap.h index 56fef7a21..7faaccf75 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -19,8 +19,7 @@ struct swap_info_struct { unsigned int flags; kdev_t swap_device; - char *swap_filename; - struct inode * swap_file; + struct dentry * swap_file; unsigned char * swap_map; unsigned char * swap_lockmap; unsigned int lowest_bit; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 2ec41aa05..75fdf6c3d 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -173,6 +173,7 @@ enum NET_IPV4_IGMP_AGE_THRESHOLD, NET_TCP_SYNCOOKIES, NET_TCP_ALWAYS_SYNCOOKIE, + NET_TCP_STDURG, }; diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index e68f5d5f1..53ead0c99 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -372,8 +372,8 @@ extern int sysv_symlink(struct inode * inode, const char * name, int len, const char * symname); extern int sysv_link(struct inode * oldinode, struct inode * dir, const char * name, int len); extern int sysv_mknod(struct inode * dir, const char * name, int len, int mode, int rdev); -extern int sysv_rename(struct inode * old_dir, const char * old_name, int old_len, - struct inode * new_dir, const char * new_name, int new_len); +extern int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, + struct inode * new_dir, struct dentry * new_dentry); extern struct inode * sysv_new_inode(const struct inode * dir); extern void sysv_free_inode(struct inode * inode); extern unsigned long sysv_count_free_inodes(struct super_block *sb); @@ -396,7 +396,7 @@ extern void sysv_read_inode(struct inode *); extern int sysv_notify_change(struct inode *, struct iattr *); extern void sysv_write_inode(struct inode *); extern void sysv_put_inode(struct inode *); -extern void sysv_statfs(struct super_block *, struct statfs *, int); +extern int sysv_statfs(struct super_block *, struct statfs *, int); extern int sysv_sync_inode(struct inode *); extern int sysv_sync_file(struct inode *, struct file *); extern int sysv_mmap(struct inode *, struct file *, struct vm_area_struct *); diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index de88d20d1..a2e1cb369 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -42,7 +42,7 @@ struct tq_struct { struct tq_struct *next; /* linked list of active bh's */ - int sync; /* must be initialized to zero */ + unsigned long sync; /* must be initialized to zero */ void (*routine)(void *); /* function to call */ void *data; /* argument to function */ }; diff --git a/include/linux/tty.h b/include/linux/tty.h index 109955a8d..589fc6b88 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -96,13 +96,19 @@ extern struct screen_info screen_info; struct tty_flip_buffer { struct tq_struct tqueue; - unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; - char flag_buf[2*TTY_FLIPBUF_SIZE]; + struct semaphore pty_sem; char *char_buf_ptr; unsigned char *flag_buf_ptr; int count; int buf_num; + unsigned char char_buf[2*TTY_FLIPBUF_SIZE]; + char flag_buf[2*TTY_FLIPBUF_SIZE]; + unsigned char slop[4]; /* N.B. bug overwrites buffer by 1 */ }; +/* + * The pty uses char_buf and flag_buf as a contiguous buffer + */ +#define PTY_BUF_SIZE 4*TTY_FLIPBUF_SIZE /* * When a break, frame error, or parity error happens, these codes are @@ -204,7 +210,7 @@ struct tty_flip_buffer { * most often used by a windowing system, which will set the correct * size each time the window is created or resized anyway. * IMPORTANT: since this structure is dynamically allocated, it must - * be no larger than 4096 bytes. Changing TTY_BUF_SIZE will change + * be no larger than 4096 bytes. Changing TTY_FLIPBUF_SIZE will change * the size of this structure, and it needs to be done with care. * - TYT, 9/14/92 */ diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index af856645d..3afea01ad 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -6,7 +6,7 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_fs.h,v 1.7 1996/08/13 19:27:59 ecd Exp $ + * $Id: ufs_fs.h,v 1.1.1.1 1997/06/01 03:17:06 ralf Exp $ * */ @@ -225,7 +225,7 @@ extern void ufs_put_inode(struct inode * inode); extern void ufs_print_inode (struct inode *); /* ufs_namei.c */ -extern int ufs_lookup (struct inode *, const char *, int, struct inode **); +extern int ufs_lookup (struct inode *, struct qstr *, struct inode **); /* ufs_super.c */ extern void ufs_warning (struct super_block *, const char *, const char *, ...) diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index fcc6ad09f..40072ab47 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -17,6 +17,8 @@ struct vm_struct * get_vm_area(unsigned long size); void vfree(void * addr); void * vmalloc(unsigned long size); int vread(char *buf, char *addr, int count); +void vmfree_area_pages(unsigned long address, unsigned long size); +int vmalloc_area_pages(unsigned long address, unsigned long size); extern inline void set_pgdir(unsigned long address, pgd_t entry) { @@ -34,3 +36,4 @@ extern inline void set_pgdir(unsigned long address, pgd_t entry) } #endif + diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index f36642161..922a76961 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -11,6 +11,8 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* Jan 15, 1997 Gene Kozin Version 3.1.0 +* o added UDP management stuff * Jan 02, 1997 Gene Kozin Version 3.0.0 *****************************************************************************/ #ifndef _WANPIPE_H @@ -19,6 +21,11 @@ #include <linux/wanrouter.h> /* Defines */ + +#ifndef PACKED +#define PACKED __attribute__((packed)) +#endif + #define WANPIPE_MAGIC 0x414C4453L /* signatire: 'SDLA' reversed */ /* IOCTL numbers (up to 16) */ @@ -44,6 +51,22 @@ typedef struct sdla_exec /* WANPIPE_EXEC */ void* data; /* -> data buffer */ } sdla_exec_t; +/* UDP management stuff */ + +typedef struct wum_header +{ + unsigned char signature[8]; /* 00h: signature */ + unsigned char type; /* 08h: request/reply */ + unsigned char command; /* 09h: commnand */ + unsigned char reserved[6]; /* 0Ah: reserved */ +} wum_header_t; + +#define WUM_SIGNATURE_L 0x50495046 +#define WUM_SIGNATURE_H 0x444E3845 + +#define WUM_KILL 0x50 +#define WUM_EXEC 0x51 + #ifdef __KERNEL__ /****** Kernel Interface ****************************************************/ @@ -77,6 +100,7 @@ typedef struct sdla wan_device_t wandev; /* WAN device data space */ unsigned open_cnt; /* number of open interfaces */ unsigned long state_tick; /* link state timestamp */ +/* unsigned tx_int_enabled; */ /* tranmit interrupt enabled or not */ char in_isr; /* interrupt-in-service flag */ void* mbox; /* -> mailbox */ void* rxmb; /* -> receive mailbox */ diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 444608afb..accb9c9ee 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -1,5 +1,5 @@ /***************************************************************************** -* wanrouter.h Definitions for the WAN Multiprotocol Router Module. +* router.h Definitions for the WAN Multiprotocol Router Module. * This module provides API and common services for WAN Link * Drivers and is completely hardware-independent. * @@ -12,6 +12,10 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' tp 'wan_device_t' +* May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t' +* Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t' +* Jan 16, 1997 Gene Kozin router_devlist made public * Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h). *****************************************************************************/ #ifndef _ROUTER_H @@ -128,7 +132,8 @@ typedef struct wandev_conf int dma; /* DMA request level */ unsigned bps; /* data transfer rate */ unsigned mtu; /* maximum transmit unit size */ - char interface; /* RS-232/V.35, etc. */ + unsigned udp_port; /* UDP port for management */ + char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ char station; /* DTE/DCE, primary/secondary, etc. */ @@ -283,6 +288,8 @@ typedef struct wan_device int dma; /* DMA request level */ unsigned bps; /* data transfer rate */ unsigned mtu; /* max physical transmit unit size */ + unsigned udp_port; /* UDP port for management */ + unsigned tx_int_enabled; /* Transmit Interrupt enabled or not */ char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ @@ -311,22 +318,24 @@ typedef struct wan_device struct proc_dir_entry dent; /* proc filesystem entry */ } wan_device_t; -/* Init Point */ -extern void wanrouter_init(void); - /* Public functions available for device drivers */ -extern int register_wan_device (wan_device_t* wandev); -extern int unregister_wan_device (char* name); -unsigned short wanrouter_type_trans (struct sk_buff* skb, struct device* dev); -int wanrouter_encapsulate (struct sk_buff* skb, struct device* dev); +extern int register_wandev (wan_device_t* wandev); +extern int unregister_wandev (char* name); +unsigned short wan_type_trans (struct sk_buff* skb, struct device* dev); +int wan_encapsulate (struct sk_buff* skb, struct device* dev); /* Proc interface functions. These must not be called by the drivers! */ extern int wanrouter_proc_init (void); extern void wanrouter_proc_cleanup (void); extern int wanrouter_proc_add (wan_device_t* wandev); extern int wanrouter_proc_delete (wan_device_t* wandev); -extern int wanrouter_ioctl(struct inode* inode, struct file* file, - unsigned int cmd, unsigned long arg); +extern int wanrouter_ioctl( + struct inode* inode, struct file* file, + unsigned int cmd, unsigned long arg) +; + +/* Public Data */ +extern wan_device_t* router_devlist; /* list of registered devices */ #endif /* __KERNEL__ */ #endif /* _ROUTER_H */ diff --git a/include/linux/wrapper.h b/include/linux/wrapper.h index 750b97084..2d6d4719f 100644 --- a/include/linux/wrapper.h +++ b/include/linux/wrapper.h @@ -20,9 +20,9 @@ #define module_unregister_blkdev unregister_blkdev #define inode_get_rdev(i) i->i_rdev -#define inode_get_count(i) atomic_read(&((i)->i_count)) -#define inode_inc_count(i) atomic_inc(&((i)->i_count)) -#define inode_dec_count(i) atomic_dec(&((i)->i_count)) +#define inode_get_count(i) i->i_count +#define inode_inc_count(i) i->i_count++ +#define inode_dec_count(i) i->i_count-- #define file_get_flags(f) f->f_flags diff --git a/include/linux/x25.h b/include/linux/x25.h index 6af8e9a5b..0435e9701 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h @@ -13,6 +13,7 @@ #define SIOCX25SFACILITIES (SIOCPROTOPRIVATE + 3) #define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4) #define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5) +#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6) /* * Values for {get,set}sockopt. @@ -33,42 +34,11 @@ #define X25_PS4096 12 /* - * X.25 Reset error and diagnostic codes. - */ -#define X25_ERR_RESET 100 /* Call Reset */ -#define X25_ERR_ROUT 101 /* Out of Order */ -#define X25_ERR_RRPE 102 /* Remote Procedure Error */ -#define X25_ERR_RLPE 103 /* Local Procedure Error */ -#define X25_ERR_RNCG 104 /* Network Congestion */ -#define X25_ERR_RRDO 105 /* Remote DTE Operational */ -#define X25_ERR_RNOP 106 /* Network Operational */ -#define X25_ERR_RINV 107 /* Invalid Call */ -#define X25_ERR_RNOO 108 /* Network Out of Order */ - -/* - * X.25 Clear error and diagnostic codes. - */ -#define X25_ERR_CLEAR 110 /* Call Cleared */ -#define X25_ERR_CBUSY 111 /* Number Busy */ -#define X25_ERR_COUT 112 /* Out of Order */ -#define X25_ERR_CRPE 113 /* Remote Procedure Error */ -#define X25_ERR_CRRC 114 /* Collect Call Refused */ -#define X25_ERR_CINV 115 /* Invalid Call */ -#define X25_ERR_CNFS 116 /* Invalid Fast Select */ -#define X25_ERR_CSA 117 /* Ship Absent */ -#define X25_ERR_CIFR 118 /* Invalid Facility Request */ -#define X25_ERR_CAB 119 /* Access Barred */ -#define X25_ERR_CLPE 120 /* Local Procedure Error */ -#define X25_ERR_CNCG 121 /* Network Congestion */ -#define X25_ERR_CNOB 122 /* Not Obtainable */ -#define X25_ERR_CROO 123 /* RPOA Out of Order */ - -/* * An X.121 address, it is held as ASCII text, null terminated, up to 15 * digits and a null terminator. */ typedef struct { - char x25_addr[16]; + char x25_addr[16]; } x25_address; /* @@ -114,4 +84,12 @@ struct x25_calluserdata { unsigned char cuddata[128]; }; +/* + * Call clearing Cause and Diagnostic structure. + */ +struct x25_causediag { + unsigned char cause; + unsigned char diagnostic; +}; + #endif |