diff options
Diffstat (limited to 'include/linux')
94 files changed, 1437 insertions, 769 deletions
diff --git a/include/linux/b1lli.h b/include/linux/b1lli.h index f564ae898..71ad74f6e 100644 --- a/include/linux/b1lli.h +++ b/include/linux/b1lli.h @@ -1,11 +1,33 @@ /* - * $Id: b1lli.h,v 1.3 1998/01/31 10:54:37 calle Exp $ + * $Id: b1lli.h,v 1.6 1999/04/15 19:49:36 calle Exp $ * * ISDN lowlevel-module for AVM B1-card. * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1lli.h,v $ + * Revision 1.6 1999/04/15 19:49:36 calle + * fix fuer die B1-PCI. Jetzt geht z.B. auch IRQ 17 ... + * + * Revision 1.5 1998/10/25 14:50:28 fritz + * Backported from MIPS (Cobalt). + * + * Revision 1.4 1998/03/29 16:05:02 calle + * changes from 2.0 tree merged. + * + * Revision 1.1.2.9 1998/03/20 14:30:02 calle + * added cardnr to detect if you try to add same T1 to different io address. + * change number of nccis depending on number of channels. + * + * Revision 1.1.2.8 1998/03/04 17:32:33 calle + * Changes for T1. + * + * Revision 1.1.2.7 1998/02/27 15:38:29 calle + * T1 running with slow link. + * + * Revision 1.1.2.6 1998/02/24 17:57:36 calle + * changes for T1. + * * Revision 1.3 1998/01/31 10:54:37 calle * include changes for PCMCIA cards from 2.0 version * @@ -70,15 +92,17 @@ typedef struct avmb1_carddef { int irq; } avmb1_carddef; -#define AVM_CARDTYPE_B1 0 -#define AVM_CARDTYPE_T1 1 -#define AVM_CARDTYPE_M1 2 -#define AVM_CARDTYPE_M2 3 +#define AVM_CARDTYPE_B1 0 +#define AVM_CARDTYPE_T1 1 +#define AVM_CARDTYPE_M1 2 +#define AVM_CARDTYPE_M2 3 +#define AVM_CARDTYPE_B1PCI 4 typedef struct avmb1_extcarddef { int port; int irq; int cardtype; + int cardnr; /* for HEMA/T1 */ } avmb1_extcarddef; #define AVMB1_LOAD 0 /* load image to card */ @@ -87,6 +111,7 @@ typedef struct avmb1_extcarddef { #define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */ #define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */ #define AVMB1_GET_CARDINFO 5 /* get cardtype */ +#define AVMB1_REMOVECARD 6 /* remove a card (usefull for T1) */ @@ -103,14 +128,12 @@ typedef struct avmb1_extcarddef { #ifdef __KERNEL__ -#define AVMB1_PORTLEN 0x1f +#define AVMB1_PORTLEN 0x1f -#define AVM_MAXVERSION 8 -#define AVM_NBCHAN 2 +#define AVM_MAXVERSION 8 -#define AVM_NAPPS 30 -#define AVM_NPLCI 5 -#define AVM_NNCCI 6 +#define AVM_NAPPS 30 +#define AVM_NNCCI_PER_CHANNEL 4 /* * Main driver data @@ -119,9 +142,10 @@ typedef struct avmb1_extcarddef { typedef struct avmb1_card { struct avmb1_card *next; int cnr; - unsigned short port; + unsigned int port; unsigned irq; int cardtype; + int cardnr; /* for T1-HEMA */ volatile unsigned short cardstate; int interrupt; int blocked; @@ -149,23 +173,26 @@ typedef struct avmb1_card { /* b1lli.c */ -int B1_detect(unsigned short base, int cardtype); -void B1_reset(unsigned short base); -int B1_load_t4file(unsigned short base, avmb1_t4file * t4file); -int B1_load_config(unsigned short base, avmb1_t4file * config); -int B1_loaded(unsigned short base); -unsigned char B1_assign_irq(unsigned short base, unsigned irq, int cardtype); -unsigned char B1_enable_irq(unsigned short base); -unsigned char B1_disable_irq(unsigned short base); +int B1_detect(unsigned int base, int cardtype); +int T1_detectandinit(unsigned int base, unsigned irq, int cardnr); +void B1_reset(unsigned int base); +void T1_reset(unsigned int base); +int B1_load_t4file(unsigned int base, avmb1_t4file * t4file); +int B1_load_config(unsigned int base, avmb1_t4file * config); +int B1_loaded(unsigned int base); +void B1_setinterrupt(unsigned int base, unsigned irq, int cardtype); +unsigned char B1_disable_irq(unsigned int base); +void T1_disable_irq(unsigned int base); int B1_valid_irq(unsigned irq, int cardtype); +int B1_valid_port(unsigned port, int cardtype); void B1_handle_interrupt(avmb1_card * card); -void B1_send_init(unsigned short port, +void B1_send_init(unsigned int port, unsigned int napps, unsigned int nncci, unsigned int cardnr); -void B1_send_register(unsigned short port, +void B1_send_register(unsigned int port, __u16 appid, __u32 nmsg, __u32 nb3conn, __u32 nb3blocks, __u32 b3bsize); -void B1_send_release(unsigned short port, __u16 appid); -void B1_send_message(unsigned short port, struct sk_buff *skb); +void B1_send_release(unsigned int port, __u16 appid); +void B1_send_message(unsigned int port, struct sk_buff *skb); /* b1capi.c */ void avmb1_handle_new_ncci(avmb1_card * card, diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 0d34d35ba..dd4ef3603 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -19,7 +19,7 @@ struct linux_binprm{ char buf[128]; unsigned long page[MAX_ARG_PAGES]; - unsigned long p; + unsigned long p; /* current top of mem */ int sh_bang; int java; /* Java binary, prevent recursive invocation */ struct dentry * dentry; @@ -64,14 +64,16 @@ extern int prepare_binprm(struct linux_binprm *); extern void remove_arg_zero(struct linux_binprm *); extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); extern int flush_old_exec(struct linux_binprm * bprm); -extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm); -extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page, - unsigned long p, int from_kmem); - +extern int setup_arg_pages(struct linux_binprm * bprm); +extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm); +extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); extern void compute_creds(struct linux_binprm *binprm); -/* this eventually goes away */ + +#if 0 +/* this went away now */ #define change_ldt(a,b) setup_arg_pages(a,b) +#endif #endif /* __KERNEL__ */ #endif /* _LINUX_BINFMTS_H */ diff --git a/include/linux/blk.h b/include/linux/blk.h index e0d904fc1..3974bc23b 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -85,12 +85,6 @@ void initrd_init(void); #endif -#define RO_IOCTLS(dev,where) \ - case BLKROSET: { int __val; if (!capable(CAP_SYS_ADMIN)) return -EACCES; \ - if (get_user(__val, (int *)(where))) return -EFAULT; \ - set_device_ro((dev),__val); return 0; } \ - case BLKROGET: { int __val = (is_read_only(dev) != 0) ; \ - return put_user(__val,(int *) (where)); } #if defined(MAJOR_NR) || defined(IDE_DRIVER) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f2d143359..03ce66426 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -55,7 +55,7 @@ struct sec_size { extern struct sec_size * blk_sec[MAX_BLKDEV]; extern struct blk_dev_struct blk_dev[MAX_BLKDEV]; -extern struct wait_queue * wait_for_request; +extern wait_queue_head_t wait_for_request; extern void resetup_one_dev(struct gendisk *dev, int drive); extern void unplug_device(void * data); extern void make_request(int major,int rw, struct buffer_head * bh); diff --git a/include/linux/busmouse.h b/include/linux/busmouse.h index eb71550d3..ccbf0f8b6 100644 --- a/include/linux/busmouse.h +++ b/include/linux/busmouse.h @@ -94,7 +94,7 @@ struct mouse_status { int present; int ready; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct fasync_struct *fasyncptr; }; diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 2de8ff1ff..77d2c4ebe 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -23,7 +23,7 @@ struct coda_sb_info /* communication pending/processing queues */ struct venus_comm { u_long vc_seq; - struct wait_queue *vc_waitq; /* Venus wait queue */ + wait_queue_head_t vc_waitq; /* Venus wait queue */ struct list_head vc_pending; struct list_head vc_processing; int vc_inuse; @@ -93,7 +93,7 @@ struct upc_req { u_short uc_outSize; u_short uc_opcode; /* copied from data to save lookup */ int uc_unique; - struct wait_queue *uc_sleep; /* process' wait queue */ + wait_queue_head_t uc_sleep; /* process' wait queue */ unsigned long uc_posttime; }; diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index 0f373ff5b..2c127526c 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -557,7 +557,8 @@ struct cyclades_port { unsigned long event; unsigned long last_active; int count; /* # of fd on device */ - int x_break; + int breakon; + int breakoff; int blocked_open; /* # of blocked opens */ long session; /* Session of opening process */ long pgrp; /* pgrp of opening process */ @@ -570,9 +571,9 @@ struct cyclades_port { struct tq_struct tqueue; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *shutdown_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t shutdown_wait; struct cyclades_monitor mon; unsigned long jiffies[3]; unsigned long rflush_count; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 84e1376b3..825dfd28d 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -12,8 +12,6 @@ * with heavy changes by Linus Torvalds */ -#define D_MAXLEN 1024 - #define IS_ROOT(x) ((x) == (x)->d_parent) /* @@ -132,7 +130,7 @@ extern void d_instantiate(struct dentry *, struct inode *); extern void d_delete(struct dentry *); /* allocate/de-allocate */ -extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name); +extern struct dentry * d_alloc(struct dentry *, const struct qstr *); extern void prune_dcache(int); extern void shrink_dcache_sb(struct super_block *); extern void shrink_dcache_parent(struct dentry *); @@ -147,7 +145,7 @@ extern void check_dcache_memory(void); extern void free_inode_memory(int); /* defined in fs/inode.c */ /* only used at mount-time */ -extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root); +extern struct dentry * d_alloc_root(struct inode *); /* test whether root is busy without destroying dcache */ extern int is_root_busy(struct dentry *); @@ -155,7 +153,7 @@ extern int is_root_busy(struct dentry *); /* * This adds the entry to the hash queues. */ -extern void d_rehash(struct dentry * entry); +extern void d_rehash(struct dentry *); /* * This adds the entry to the hash queues and initializes "d_inode". * The entry was actually filled in earlier during "d_alloc()" @@ -167,17 +165,16 @@ static __inline__ void d_add(struct dentry * entry, struct inode * inode) } /* used for rename() and baskets */ -extern void d_move(struct dentry * entry, struct dentry * newdentry); +extern void d_move(struct dentry *, struct dentry *); /* appendix may either be NULL or be used for transname suffixes */ -extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name); +extern struct dentry * d_lookup(struct dentry *, struct qstr *); /* validate "insecure" dentry pointer */ -extern int d_validate(struct dentry *dentry, struct dentry *dparent, - unsigned int hash, unsigned int len); +extern int d_validate(struct dentry *, struct dentry *, unsigned int, unsigned int); /* write full pathname into buffer and return start of pathname */ -extern char * d_path(struct dentry * entry, char * buf, int buflen); +extern char * d_path(struct dentry *, char *, int); /* Allocation counts.. */ static __inline__ struct dentry * dget(struct dentry *dentry) diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index 1e5fd23cd..a36f9d6fd 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h @@ -9,7 +9,7 @@ #ifndef __EFS_FS_H__ #define __EFS_FS_H__ -#define EFS_VERSION "1.0b" +#define EFS_VERSION "1.0a" static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aeschi.ch.eu.org>"; diff --git a/include/linux/efs_fs_i.h b/include/linux/efs_fs_i.h index 453d706ca..de55021ad 100644 --- a/include/linux/efs_fs_i.h +++ b/include/linux/efs_fs_i.h @@ -29,8 +29,7 @@ typedef union extent_u { typedef struct edevs { short odev; - short dev_filler; /* force ndev to start */ - unsigned int ndev; /* on a 32-bit boundary */ + unsigned int ndev; } efs_devs; /* diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h index 95476663c..21d01d0d4 100644 --- a/include/linux/efs_fs_sb.h +++ b/include/linux/efs_fs_sb.h @@ -31,7 +31,6 @@ struct efs_super { short fs_heads; /* heads per cylinder */ short fs_ncg; /* # of cylinder groups in filesystem */ short fs_dirty; /* fs needs to be fsck'd */ - short fs_filler; /* force fs_time to start 2bytes later*/ int32_t fs_time; /* last super-block update */ int32_t fs_magic; /* magic number */ char fs_fname[6]; /* file system name */ diff --git a/include/linux/epca.h b/include/linux/epca.h index 504948149..18cedf37c 100644 --- a/include/linux/epca.h +++ b/include/linux/epca.h @@ -140,8 +140,8 @@ struct channel struct tty_struct *tty; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct tq_struct tqueue; volatile struct global_data *mailbox; }; diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index b1352dc02..dcd36e63c 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -238,7 +238,7 @@ struct ext2_inode { } masix1; } osd1; /* OS dependent 1 */ __u32 i_block[EXT2_N_BLOCKS];/* Pointers to blocks */ - __u32 i_version; /* File version (for NFS) */ + __u32 i_generation; /* File version (for NFS) */ __u32 i_file_acl; /* File ACL */ __u32 i_dir_acl; /* Directory ACL */ __u32 i_faddr; /* Fragment address */ diff --git a/include/linux/ext2_fs_i.h b/include/linux/ext2_fs_i.h index 8f01f8ad9..72bcd5c06 100644 --- a/include/linux/ext2_fs_i.h +++ b/include/linux/ext2_fs_i.h @@ -29,7 +29,7 @@ struct ext2_inode_info { __u32 i_file_acl; __u32 i_dir_acl; __u32 i_dtime; - __u32 i_version; + __u32 not_used_1; /* FIX: not used/ 2.2 placeholder */ __u32 i_block_group; __u32 i_next_alloc_block; __u32 i_next_alloc_goal; diff --git a/include/linux/file.h b/include/linux/file.h index 05f388f08..0125f9087 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -44,7 +44,7 @@ extern inline struct file * fget(unsigned int fd) /* * Install a file pointer in the fd array. */ -extern inline void fd_install(unsigned int fd, struct file *file) +extern inline void fd_install(unsigned int fd, struct file * file) { current->files->fd[fd] = file; } @@ -65,7 +65,7 @@ extern inline void fd_install(unsigned int fd, struct file *file) * I suspect there are many other similar "optimizations" across the * kernel... */ -extern void fput(struct file *file); -extern void put_filp(struct file *file); +extern void fput(struct file *); +extern void put_filp(struct file *); -#endif +#endif /* __LINUX_FILE_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index e4ea5197f..c7a67e9fd 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -103,7 +103,8 @@ extern int max_super_blocks, nr_super_blocks; /* * Flags that can be altered by MS_REMOUNT */ -#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME) +#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|\ + MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME) /* * Magic mount flag number. Has to be or-ed to the flag values. @@ -112,7 +113,7 @@ extern int max_super_blocks, nr_super_blocks; #define MS_MGC_MSK 0xffff0000 /* magic flag number mask */ /* - * Note that read-only etc flags are inode-specific: setting some file-system + * Note that nosuid 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 * ioctl() that is not currently implemented. @@ -140,6 +141,7 @@ extern int max_super_blocks, nr_super_blocks; #define IS_NOATIME(inode) __IS_FLG(inode, MS_NOATIME) #define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) + /* 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. */ @@ -154,7 +156,13 @@ extern int max_super_blocks, nr_super_blocks; #define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */ #define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */ #define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */ -#define BLKSSZGET _IO(0x12,104)/* get block device sector size (reserved for) */ +#define BLKSSZGET _IO(0x12,104)/* get block device sector size */ +#if 0 +#define BLKPG _IO(0x12,105)/* See blkpg.h */ +/* This was here just to show that the number is taken - + probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */ +#endif + #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ #define FIBMAP _IO(0x00,1) /* bmap access */ @@ -164,9 +172,8 @@ extern int max_super_blocks, nr_super_blocks; #include <asm/semaphore.h> #include <asm/byteorder.h> -#include <asm/bitops.h> -extern void update_atime (struct inode *inode); +extern void update_atime (struct inode *); #define UPDATE_ATIME(inode) update_atime (inode) extern void buffer_init(unsigned long); @@ -213,7 +220,7 @@ struct buffer_head { unsigned int b_list; /* List that this buffer appears */ unsigned long b_flushtime; /* Time when this (dirty) buffer * should be written */ - struct wait_queue * b_wait; + wait_queue_head_t b_wait; struct buffer_head ** b_pprev; /* doubly linked list of hash-queue */ struct buffer_head * b_prev_free; /* doubly linked list of buffers */ struct buffer_head * b_reqnext; /* request queue */ @@ -226,8 +233,7 @@ struct buffer_head { }; typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); -void init_buffer(struct buffer_head *bh, kdev_t dev, int block, - bh_end_io_t *handler, void *dev_id); +void init_buffer(struct buffer_head *, kdev_t, int, bh_end_io_t *, void *); static inline int buffer_uptodate(struct buffer_head * bh) { @@ -354,7 +360,7 @@ struct inode { struct semaphore i_atomic_write; struct inode_operations *i_op; struct super_block *i_sb; - struct wait_queue *i_wait; + wait_queue_head_t i_wait; struct file_lock *i_flock; struct vm_area_struct *i_mmap; struct page *i_pages; @@ -382,7 +388,7 @@ struct inode { struct sysv_inode_info sysv_i; struct affs_inode_info affs_i; struct ufs_inode_info ufs_i; - struct efs_inode_info efs_i; + struct efs_inode_info efs_i; struct romfs_inode_info romfs_i; struct coda_inode_info coda_i; struct smb_inode_info smbfs_i; @@ -455,7 +461,7 @@ struct file_lock { struct file_lock *fl_prevblock; fl_owner_t fl_owner; unsigned int fl_pid; - struct wait_queue *fl_wait; + wait_queue_head_t fl_wait; struct file *fl_file; unsigned char fl_flags; unsigned char fl_type; @@ -473,19 +479,17 @@ extern struct file_lock *file_lock_table; #include <linux/fcntl.h> -extern int fcntl_getlk(unsigned int fd, struct flock *l); -extern int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l); +extern int fcntl_getlk(unsigned int, struct flock *); +extern int fcntl_setlk(unsigned int, unsigned int, struct flock *); /* fs/locks.c */ -extern void locks_remove_posix(struct file *, fl_owner_t id); +extern void locks_remove_posix(struct file *, fl_owner_t); extern void locks_remove_flock(struct file *); extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); extern int posix_lock_file(struct file *, struct file_lock *, unsigned int); extern void posix_block_lock(struct file_lock *, struct file_lock *); extern void posix_unblock_lock(struct file_lock *); -#include <linux/stat.h> - struct fasync_struct { int magic; int fa_fd; @@ -532,7 +536,7 @@ struct super_block { unsigned long s_magic; unsigned long s_time; struct dentry *s_root; - struct wait_queue *s_wait; + wait_queue_head_t s_wait; struct inode *s_ibasket; short int s_ibasket_count; @@ -550,7 +554,7 @@ struct super_block { struct sysv_sb_info sysv_sb; struct affs_sb_info affs_sb; struct ufs_sb_info ufs_sb; - struct efs_sb_info efs_sb; + struct efs_sb_info efs_sb; struct romfs_sb_info romfs_sb; struct smb_sb_info smbfs_sb; struct hfs_sb_info hfs_sb; @@ -618,7 +622,7 @@ struct inode_operations { void (*truncate) (struct inode *); int (*permission) (struct inode *, int); int (*smap) (struct inode *,int); - int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int, int); + int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int); int (*revalidate) (struct dentry *); }; @@ -660,10 +664,8 @@ extern int unregister_filesystem(struct file_system_type *); #define FLOCK_VERIFY_READ 1 #define FLOCK_VERIFY_WRITE 2 -extern int locks_mandatory_locked(struct inode *inode); -extern int locks_mandatory_area(int read_write, struct inode *inode, - struct file *filp, loff_t offset, - size_t count); +extern int locks_mandatory_locked(struct inode *); +extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t); extern inline int locks_verify_locked(struct inode *inode) { @@ -702,35 +704,35 @@ extern void put_unused_fd(unsigned int); extern struct file *filp_open(const char *, int, int); extern int filp_close(struct file *, fl_owner_t id); -extern char * getname(const char * filename); +extern char * getname(const char *); #define __getname() ((char *) __get_free_page(GFP_KERNEL)) #define putname(name) free_page((unsigned long)(name)) -extern void kill_fasync(struct fasync_struct *fa, int sig); +extern void kill_fasync(struct fasync_struct *, int); extern int register_blkdev(unsigned int, const char *, struct file_operations *); -extern int unregister_blkdev(unsigned int major, const char * name); -extern int blkdev_open(struct inode * inode, struct file * filp); -extern int blkdev_release (struct inode * inode); +extern int unregister_blkdev(unsigned int, const char *); +extern int blkdev_open(struct inode *, struct file *); +extern int blkdev_release (struct inode *); extern struct file_operations def_blk_fops; extern struct inode_operations blkdev_inode_operations; /* fs/devices.c */ extern int register_chrdev(unsigned int, const char *, struct file_operations *); -extern int unregister_chrdev(unsigned int major, const char * name); -extern int chrdev_open(struct inode * inode, struct file * filp); +extern int unregister_chrdev(unsigned int, const char *); +extern int chrdev_open(struct inode *, struct file *); extern struct file_operations def_chr_fops; extern struct inode_operations chrdev_inode_operations; -extern char * bdevname(kdev_t dev); -extern char * cdevname(kdev_t dev); -extern char * kdevname(kdev_t dev); - +extern char * bdevname(kdev_t); +extern char * cdevname(kdev_t); +extern char * kdevname(kdev_t); +extern void init_special_inode(struct inode *, umode_t, int); -extern void init_fifo(struct inode * inode); +extern void init_fifo(struct inode *); extern struct inode_operations fifo_inode_operations; /* Invalid inode operations -- fs/bad_inode.c */ -extern void make_bad_inode(struct inode * inode); -extern int is_bad_inode(struct inode * inode); +extern void make_bad_inode(struct inode *); +extern int is_bad_inode(struct inode *); extern struct file_operations connecting_fifo_fops; extern struct file_operations read_fifo_fops; @@ -740,15 +742,15 @@ extern struct file_operations read_pipe_fops; extern struct file_operations write_pipe_fops; extern struct file_operations rdwr_pipe_fops; -extern struct file_system_type *get_fs_type(const char *name); +extern struct file_system_type *get_fs_type(const char *); extern int fs_may_remount_ro(struct super_block *); -extern int fs_may_mount(kdev_t dev); +extern int fs_may_mount(kdev_t); extern struct file *inuse_filps; -extern void refile_buffer(struct buffer_head * buf); -extern void set_writetime(struct buffer_head * buf, int flag); +extern void refile_buffer(struct buffer_head *); +extern void set_writetime(struct buffer_head *, int); extern int try_to_free_buffers(struct page *); extern int nr_buffers; @@ -760,7 +762,7 @@ extern int nr_buffer_heads; #define BUF_DIRTY 2 /* Dirty buffers, not yet scheduled for write */ #define NR_LIST 3 -void mark_buffer_uptodate(struct buffer_head * bh, int on); +void mark_buffer_uptodate(struct buffer_head *, int); extern inline void mark_buffer_clean(struct buffer_head * bh) { @@ -779,23 +781,23 @@ extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag) } } -extern int check_disk_change(kdev_t dev); -extern int invalidate_inodes(struct super_block * sb); +extern int check_disk_change(kdev_t); +extern int invalidate_inodes(struct super_block *); extern void invalidate_inode_pages(struct inode *); -extern void invalidate_buffers(kdev_t dev); -extern int floppy_is_wp(int minor); -extern void sync_inodes(kdev_t dev); -extern void write_inode_now(struct inode *inode); -extern void sync_dev(kdev_t dev); -extern int fsync_dev(kdev_t dev); -extern void sync_supers(kdev_t dev); -extern int bmap(struct inode * inode,int block); +extern void invalidate_buffers(kdev_t); +extern int floppy_is_wp(int); +extern void sync_inodes(kdev_t); +extern void write_inode_now(struct inode *); +extern void sync_dev(kdev_t); +extern int fsync_dev(kdev_t); +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 * inode,int mask); -extern int get_write_access(struct inode *inode); -extern void put_write_access(struct inode *inode); -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 permission(struct inode *, int); +extern int get_write_access(struct inode *); +extern void put_write_access(struct inode *); +extern struct dentry * open_namei(const char *, int, int); +extern struct dentry * do_mknod(const char *, int, dev_t); extern int do_pipe(int *); /* fs/dcache.c -- generic fs support functions */ @@ -833,6 +835,8 @@ extern struct dentry * __namei(const char *, unsigned int); #define lnamei(pathname) __namei(pathname, 0) extern void iput(struct inode *); +extern struct inode * igrab(struct inode *); +extern ino_t iunique(struct super_block *, ino_t); extern struct inode * iget(struct super_block *, unsigned long); extern void clear_inode(struct inode *); extern struct inode * get_empty_inode(void); @@ -842,7 +846,7 @@ extern void remove_inode_hash(struct inode *); extern struct file * get_empty_filp(void); extern struct buffer_head * get_hash_table(kdev_t, int, int); extern struct buffer_head * getblk(kdev_t, int, int); -extern struct buffer_head * find_buffer(kdev_t dev, int block, int size); +extern struct buffer_head * find_buffer(kdev_t, int, int); extern void ll_rw_block(int, int, struct buffer_head * bh[]); extern int is_read_only(kdev_t); extern void __brelse(struct buffer_head *); @@ -851,29 +855,30 @@ extern inline void brelse(struct buffer_head *buf) if (buf) __brelse(buf); } -extern void __bforget(struct buffer_head *buf); +extern void __bforget(struct buffer_head *); extern inline void bforget(struct buffer_head *buf) { if (buf) __bforget(buf); } -extern void set_blocksize(kdev_t dev, int size); -extern unsigned int get_hardblocksize(kdev_t dev); -extern struct buffer_head * bread(kdev_t dev, int block, int size); -extern struct buffer_head * breada(kdev_t dev,int block, int size, - unsigned int pos, unsigned int filesize); +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 int brw_page(int, struct page *, kdev_t, int [], int, int); +typedef long (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *); + extern int generic_readpage(struct file *, struct page *); extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); -extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*); +extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *, writepage_t); -extern struct super_block *get_super(kdev_t dev); -extern void put_super(kdev_t dev); -unsigned long generate_cluster(kdev_t dev, int b[], int size); -unsigned long generate_cluster_swab32(kdev_t dev, int b[], int size); +extern struct super_block *get_super(kdev_t); +extern void put_super(kdev_t); +unsigned long generate_cluster(kdev_t, int b[], int); +unsigned long generate_cluster_swab32(kdev_t, int b[], int); extern kdev_t ROOT_DEV; extern void show_buffers(void); @@ -881,7 +886,7 @@ extern void mount_root(void); #ifdef CONFIG_BLK_DEV_INITRD extern kdev_t real_root_dev; -extern int change_root(kdev_t new_root_dev,const char *put_old); +extern int change_root(kdev_t, const char *); #endif extern ssize_t char_read(struct file *, char *, size_t, loff_t *); @@ -891,8 +896,8 @@ extern int read_ahead[]; extern ssize_t char_write(struct file *, const char *, size_t, loff_t *); extern ssize_t block_write(struct file *, const char *, size_t, loff_t *); -extern int block_fsync(struct file *, struct dentry *dir); -extern int file_fsync(struct file *, struct dentry *dir); +extern int block_fsync(struct file *, struct dentry *); +extern int file_fsync(struct file *, struct dentry *); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); @@ -903,4 +908,4 @@ extern void inode_setattr(struct inode *, struct iattr *); #endif /* __KERNEL__ */ -#endif +#endif /* _LINUX_FS_H */ diff --git a/include/linux/genhd.h b/include/linux/genhd.h index fdd93a0b4..85bbf3422 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -22,7 +22,7 @@ #define CONFIG_SUN_PARTITION 1 #endif -#if defined(CONFIG_SGI) +#if defined(CONFIG_SGI) || defined(CONFIG_SGI_DISKLABEL) #define CONFIG_SGI_PARTITION 1 #endif @@ -39,7 +39,7 @@ #endif #define DM6_PARTITION 0x54 /* has DDO: use xlated geom & offset */ -#define EZD_PARTITION 0x55 /* EZ-DRIVE: same as DM6 (we think) */ +#define EZD_PARTITION 0x55 /* EZ-DRIVE */ #define DM6_AUX1PARTITION 0x51 /* no DDO: use xlated geom */ #define DM6_AUX3PARTITION 0x53 /* no DDO: use xlated geom */ @@ -70,8 +70,8 @@ struct gendisk { int max_nr; /* maximum number of real devices */ void (*init)(struct gendisk *); /* Initialization called before we do our thing */ - struct hd_struct *part; /* partition table */ - int *sizes; /* device size in blocks, copied to blk_size[] */ + struct hd_struct *part; /* [indexed by minor] */ + int *sizes; /* [idem], device size in blocks */ int nr_real; /* number of real devices */ void *real_devices; /* internal use */ @@ -226,14 +226,12 @@ struct unixware_disklabel { #endif /* CONFIG_UNIXWARE_DISKLABEL */ +#ifdef __KERNEL__ extern struct gendisk *gendisk_head; /* linked list of disks */ -/* - * disk_name() is used by genhd.c and md.c. - * It formats the devicename of the indicated disk - * into the supplied buffer, and returns a pointer - * to that same buffer (for convenience). - */ char *disk_name (struct gendisk *hd, int minor, char *buf); +int get_hardsect_size(kdev_t dev); +#endif + #endif diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h index 2ed3903af..7efc5e31d 100644 --- a/include/linux/hayesesp.h +++ b/include/linux/hayesesp.h @@ -106,10 +106,10 @@ struct esp_struct { struct tq_struct tqueue_hangup; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *delta_msr_wait; - struct wait_queue *break_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t delta_msr_wait; + wait_queue_head_t break_wait; struct async_icount icount; /* kernel counters for the 4 input interrupts */ struct hayes_esp_config config; /* port configuration */ struct esp_struct *next_port; /* For the linked list */ diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index e467ae9b6..2fee75fec 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h @@ -93,7 +93,43 @@ #define SMART_STATUS 0xda #define SMART_AUTO_OFFLINE 0xdb +/* WIN_SETFEATURES sub-commands */ + +#define SETFEATURES_EN_WCACHE 0x02 /* Enable write cache */ +#define SETFEATURES_XFER 0x03 /* Set transfer mode */ +# define XFER_UDMA_4 0x44 /* 0100|0100 */ +# define XFER_UDMA_3 0x43 /* 0100|0011 */ +# define XFER_UDMA_2 0x42 /* 0100|0010 */ +# define XFER_UDMA_1 0x41 /* 0100|0001 */ +# define XFER_UDMA_0 0x40 /* 0100|0000 */ +# define XFER_MW_DMA_2 0x22 /* 0010|0010 */ +# define XFER_MW_DMA_1 0x21 /* 0010|0001 */ +# define XFER_MW_DMA_0 0x20 /* 0010|0000 */ +# define XFER_SW_DMA_2 0x12 /* 0001|0010 */ +# define XFER_SW_DMA_1 0x11 /* 0001|0001 */ +# define XFER_SW_DMA_0 0x10 /* 0001|0000 */ +# define XFER_PIO_4 0x0C /* 0000|1100 */ +# define XFER_PIO_3 0x0B /* 0000|1011 */ +# define XFER_PIO_2 0x0A /* 0000|1010 */ +# define XFER_PIO_1 0x09 /* 0000|1001 */ +# define XFER_PIO_0 0x08 /* 0000|1000 */ +# define XFER_PIO_SLOW 0x00 /* 0000|0000 */ +#define SETFEATURES_EN_APM 0x05 /* Enable advanced power management */ +#define SETFEATURES_DIS_MSN 0x31 /* Disable Media Status Notification */ +#define SETFEATURES_DIS_RLA 0x55 /* Disable read look-ahead feature */ +#define SETFEATURES_EN_RI 0x5D /* Enable release interrupt */ +#define SETFEATURES_EN_SI 0x5E /* Enable SERVICE interrupt */ +#define SETFEATURES_DIS_RPOD 0x66 /* Disable reverting to power on defaults */ +#define SETFEATURES_DIS_WCACHE 0x82 /* Disable write cache */ +#define SETFEATURES_DIS_APM 0x85 /* Disable advanced power management */ +#define SETFEATURES_EN_MSN 0x95 /* Enable Media Status Notification */ +#define SETFEATURES_EN_RLA 0xAA /* Enable read look-ahead feature */ +#define SETFEATURES_EN_RPOD 0xCC /* Enable reverting to power on defaults */ +#define SETFEATURES_DIS_RI 0xDD /* Disable release interrupt */ +#define SETFEATURES_DIS_SI 0xDE /* Disable SERVICE interrupt */ + /* WIN_SECURITY sub-commands */ + #define SECURITY_SET_PASSWORD 0xBA /* 0xF1 */ #define SECURITY_UNLOCK 0xBB /* 0xF2 */ #define SECURITY_ERASE_PREPARE 0xBC /* 0xF3 */ diff --git a/include/linux/hfmodem.h b/include/linux/hfmodem.h index 7b35f1169..d23108ee9 100644 --- a/include/linux/hfmodem.h +++ b/include/linux/hfmodem.h @@ -155,7 +155,7 @@ struct hfmodem_state { } clk; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct { __s16 *kbuf; diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h index eaae0ecc5..ef2bc4105 100644 --- a/include/linux/hfs_fs.h +++ b/include/linux/hfs_fs.h @@ -82,17 +82,22 @@ #define HFS_SGL_DINF HFS_ITYPE_1 /* %DirInfo for directory */ /* IDs for elements of an AppleDouble or AppleSingle header */ -#define HFS_HDR_DATA 1 -#define HFS_HDR_RSRC 2 -#define HFS_HDR_FNAME 3 -#define HFS_HDR_COMNT 4 -#define HFS_HDR_BWICN 5 -#define HFS_HDR_CICON 6 -#define HFS_HDR_OLDI 7 -#define HFS_HDR_DATES 8 -#define HFS_HDR_FINFO 9 -#define HFS_HDR_MACI 10 -#define HFS_HDR_MAX 10 +#define HFS_HDR_DATA 1 /* data fork */ +#define HFS_HDR_RSRC 2 /* resource fork */ +#define HFS_HDR_FNAME 3 /* full (31-character) name */ +#define HFS_HDR_COMNT 4 /* comment */ +#define HFS_HDR_BWICN 5 /* b/w icon */ +#define HFS_HDR_CICON 6 /* color icon info */ +#define HFS_HDR_OLDI 7 /* old file info */ +#define HFS_HDR_DATES 8 /* file dates info */ +#define HFS_HDR_FINFO 9 /* Finder info */ +#define HFS_HDR_MACI 10 /* Macintosh info */ +#define HFS_HDR_PRODOSI 11 /* ProDOS info */ +#define HFS_HDR_MSDOSI 12 /* MSDOS info */ +#define HFS_HDR_SNAME 13 /* short name */ +#define HFS_HDR_AFPI 14 /* AFP file info */ +#define HFS_HDR_DID 15 /* directory id */ +#define HFS_HDR_MAX 16 /* * There are three time systems. All three are based on seconds since @@ -136,26 +141,7 @@ struct hfs_hdr_layout { }; /* - * Default header layout for Netatalk - */ -struct hfs_nat_hdr { - hfs_lword_t magic; - hfs_lword_t version; - hfs_byte_t homefs[16]; - hfs_word_t entries; - hfs_byte_t descrs[60]; - hfs_byte_t real_name[255]; /* id=3 */ - hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */ - hfs_lword_t create_time; /* \ */ - hfs_lword_t modify_time; /* | */ - hfs_lword_t backup_time; /* | id=7 */ - hfs_word_t filler; /* | */ - hfs_word_t attr; /* / */ - hfs_byte_t finderinfo[32]; /* id=9 */ -}; - -/* - * Default header layout for AppleDouble + * Default header layout for Netatalk and AppleDouble */ struct hfs_dbl_hdr { hfs_lword_t magic; @@ -163,23 +149,37 @@ struct hfs_dbl_hdr { hfs_byte_t filler[16]; hfs_word_t entries; hfs_byte_t descrs[12*HFS_HDR_MAX]; - hfs_u32 create_time; /* \ */ - hfs_u32 modify_time; /* | id=8 */ - hfs_u32 backup_time; /* | */ - hfs_u32 access_time; /* / */ + hfs_byte_t real_name[255]; /* id=3 */ + hfs_byte_t comment[200]; /* id=4 XXX: not yet implemented */ + hfs_u32 create_time; /* \ */ + hfs_u32 modify_time; /* | id=8 (or 7) */ + hfs_u32 backup_time; /* | */ + hfs_u32 access_time; /* / (attributes with id=7) */ hfs_u8 finderinfo[32]; /* id=9 */ hfs_u32 fileinfo; /* id=10 */ - hfs_u8 real_name[32]; /* id=3 */ - hfs_u8 comment[200]; /* id=4 XXX: not yet implemented */ + hfs_u32 cnid; /* id=15 */ + hfs_u8 short_name[12]; /* id=13 */ + hfs_u8 prodosi[8]; /* id=11 */ }; + /* finder metadata for CAP */ struct hfs_cap_info { hfs_byte_t fi_fndr[32]; /* Finder's info */ - hfs_word_t fi_attr; /* AFP attributes */ -#define HFS_AFP_WRI 0x020 /* Write inhibit bit */ -#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (AFP >= 2.0) */ -#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (AFP >= 2.0) */ + hfs_word_t fi_attr; /* AFP attributes (f=file/d=dir) */ +#define HFS_AFP_INV 0x001 /* Invisible bit (f/d) */ +#define HFS_AFP_EXPFOLDER 0x002 /* exported folder (d) */ +#define HFS_AFP_MULTI 0x002 /* Multiuser bit (f) */ +#define HFS_AFP_SYS 0x004 /* System bit (f/d) */ +#define HFS_AFP_DOPEN 0x008 /* data fork already open (f) */ +#define HFS_AFP_MOUNTED 0x008 /* mounted folder (d) */ +#define HFS_AFP_ROPEN 0x010 /* resource fork already open (f) */ +#define HFS_AFP_INEXPFOLDER 0x010 /* folder in shared area (d) */ +#define HFS_AFP_WRI 0x020 /* Write inhibit bit (readonly) (f) */ +#define HFS_AFP_BACKUP 0x040 /* backup needed bit (f/d) */ +#define HFS_AFP_RNI 0x080 /* Rename inhibit bit (f/d) */ +#define HFS_AFP_DEI 0x100 /* Delete inhibit bit (f/d) */ +#define HFS_AFP_NOCOPY 0x400 /* Copy protect bit (f) */ #define HFS_AFP_RDONLY ( HFS_AFP_WRI|HFS_AFP_RNI|HFS_AFP_DEI) hfs_byte_t fi_magic1; /* Magic number: */ #define HFS_CAP_MAGIC1 0xFF @@ -225,7 +225,6 @@ extern hfs_rwret_t hfs_dir_read(struct file *, char *, hfs_rwarg_t, loff_t *); extern int hfs_create(struct inode *, struct dentry *, int); extern int hfs_mkdir(struct inode *, struct dentry *, int); -extern int hfs_mknod(struct inode *, struct dentry *, int, int); extern int hfs_unlink(struct inode *, struct dentry *); extern int hfs_rmdir(struct inode *, struct dentry *); extern int hfs_rename(struct inode *, struct dentry *, @@ -273,6 +272,7 @@ extern struct inode_operations hfs_hdr_inode_operations; extern const struct hfs_hdr_layout hfs_dbl_fil_hdr_layout; extern const struct hfs_hdr_layout hfs_dbl_dir_hdr_layout; extern const struct hfs_hdr_layout hfs_nat_hdr_layout; +extern const struct hfs_hdr_layout hfs_nat2_hdr_layout; extern const struct hfs_hdr_layout hfs_sngl_hdr_layout; /* inode.c */ @@ -280,10 +280,10 @@ extern void hfs_put_inode(struct inode *); extern int hfs_notify_change(struct dentry *, struct iattr *); extern struct inode *hfs_iget(struct hfs_cat_entry *, ino_t, struct dentry *); -extern void hfs_cap_ifill(struct inode *, ino_t); -extern void hfs_dbl_ifill(struct inode *, ino_t); -extern void hfs_nat_ifill(struct inode *, ino_t); -extern void hfs_sngl_ifill(struct inode *, ino_t); +extern void hfs_cap_ifill(struct inode *, ino_t, const int); +extern void hfs_dbl_ifill(struct inode *, ino_t, const int); +extern void hfs_nat_ifill(struct inode *, ino_t, const int); +extern void hfs_sngl_ifill(struct inode *, ino_t, const int); /* super.c */ extern struct super_block *hfs_read_super(struct super_block *,void *,int); diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h index c5279b201..826f388c5 100644 --- a/include/linux/hfs_fs_sb.h +++ b/include/linux/hfs_fs_sb.h @@ -16,7 +16,7 @@ struct hfs_name; typedef int (*hfs_namein_fn) (char *, const struct hfs_name *); typedef void (*hfs_nameout_fn) (struct hfs_name *, const char *, int); -typedef void (*hfs_ifill_fn) (struct inode *, ino_t); +typedef void (*hfs_ifill_fn) (struct inode *, ino_t, const int); /* * struct hfs_sb_info @@ -30,6 +30,7 @@ struct hfs_sb_info { changing owner or mode? */ int s_lowercase; /* Map names to lowercase? */ int s_afpd; /* AFPD compatible mode? */ + int s_version; /* version info */ hfs_namein_fn s_namein; /* The function used to map Mac filenames to Linux filenames */ diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h index 00cc64008..c3b866f25 100644 --- a/include/linux/hfs_sysdep.h +++ b/include/linux/hfs_sysdep.h @@ -93,10 +93,10 @@ extern inline hfs_u32 hfs_time(void) { /* * hfs_wait_queue */ -typedef struct wait_queue *hfs_wait_queue; +typedef wait_queue_head_t hfs_wait_queue; extern inline void hfs_init_waitqueue(hfs_wait_queue *queue) { - init_waitqueue(queue); + init_waitqueue_head(queue); } extern inline void hfs_sleep_on(hfs_wait_queue *queue) { diff --git a/include/linux/hpfs_fs_i.h b/include/linux/hpfs_fs_i.h index d9aa8f34d..7dea10b41 100644 --- a/include/linux/hpfs_fs_i.h +++ b/include/linux/hpfs_fs_i.h @@ -1,7 +1,17 @@ #ifndef _HPFS_FS_I #define _HPFS_FS_I +#if ANALWARNINGS +#warning Fix the FIFO stuff! +#warning Fix the FIFO stuff! +#warning Fix the FIFO stuff! +#endif + struct hpfs_inode_info { + union { /* Linux sometimes destroys this structure */ + struct pipe_inode_info bla; /* due to a bug. Linus doesn't want to fix */ + struct socket ble; /* it so I had to write this workaround :-) */ + } dummy; ino_t i_parent_dir; /* (directories) gives fnode of parent dir */ unsigned i_dno; /* (directories) root dnode */ unsigned i_dpos; /* (directories) temp for readdir */ @@ -9,7 +19,14 @@ struct hpfs_inode_info { unsigned i_file_sec; /* (files) minimalist cache of alloc info */ unsigned i_disk_sec; /* (files) minimalist cache of alloc info */ unsigned i_n_secs; /* (files) minimalist cache of alloc info */ + unsigned i_ea_size; /* size of extended attributes */ unsigned i_conv : 2; /* (files) crlf->newline hackery */ + unsigned i_ea_mode : 1; /* file's permission is stored in ea */ + unsigned i_ea_uid : 1; /* file's uid is stored in ea */ + unsigned i_ea_gid : 1; /* file's gid is stored in ea */ + unsigned i_dirty : 1; + struct semaphore i_sem; /* semaphore */ + loff_t **i_rddir_off; }; #define i_hpfs_dno u.hpfs_i.i_dno @@ -19,6 +36,15 @@ struct hpfs_inode_info { #define i_hpfs_disk_sec u.hpfs_i.i_disk_sec #define i_hpfs_dpos u.hpfs_i.i_dpos #define i_hpfs_dsubdno u.hpfs_i.i_dsubdno +#define i_hpfs_ea_size u.hpfs_i.i_ea_size #define i_hpfs_conv u.hpfs_i.i_conv +#define i_hpfs_ea_mode u.hpfs_i.i_ea_mode +#define i_hpfs_ea_uid u.hpfs_i.i_ea_uid +#define i_hpfs_ea_gid u.hpfs_i.i_ea_gid +/*#define i_hpfs_lock u.hpfs_i.i_lock*/ +/*#define i_hpfs_queue u.hpfs_i.i_queue*/ +#define i_hpfs_sem u.hpfs_i.i_sem +#define i_hpfs_rddir_off u.hpfs_i.i_rddir_off +#define i_hpfs_dirty u.hpfs_i.i_dirty #endif diff --git a/include/linux/hpfs_fs_sb.h b/include/linux/hpfs_fs_sb.h index a383e16ba..9059054cf 100644 --- a/include/linux/hpfs_fs_sb.h +++ b/include/linux/hpfs_fs_sb.h @@ -5,6 +5,7 @@ struct hpfs_sb_info { ino_t sb_root; /* inode number of root dir */ unsigned sb_fs_size; /* file system size, sectors */ unsigned sb_bitmaps; /* sector number of bitmap list */ + unsigned sb_dirband_start; /* directory band start sector */ unsigned sb_dirband_size; /* directory band size, dnodes */ unsigned sb_dmap; /* sector number of dnode bit map */ unsigned sb_n_free; /* free blocks for statfs, or -1 */ @@ -12,13 +13,34 @@ struct hpfs_sb_info { uid_t sb_uid; /* uid from mount options */ gid_t sb_gid; /* gid from mount options */ umode_t sb_mode; /* mode from mount options */ - unsigned sb_lowercase : 1; /* downcase filenames hackery */ unsigned sb_conv : 2; /* crlf->newline hackery */ + unsigned sb_eas : 2; /* eas: 0-ignore, 1-ro, 2-rw */ + unsigned sb_err : 2; /* on errs: 0-cont, 1-ro, 2-panic */ + unsigned sb_chk : 2; /* checks: 0-no, 1-normal, 2-strict */ + unsigned sb_lowercase : 1; /* downcase filenames hackery */ + unsigned sb_was_error : 1; /* there was an error, set dirty flag */ + unsigned sb_chkdsk : 2; /* chkdsk: 0-no, 1-on errs, 2-allways */ + unsigned sb_rd_fnode : 2; /* read fnode 0-no 1-dirs 2-all */ + unsigned sb_rd_inode : 2; /* lookup tells read_inode: 1-read fnode + 2-don't read fnode, file + 3-don't read fnode, direcotry */ + wait_queue_head_t sb_iget_q; + unsigned char *sb_cp_table; /* code page tables: */ + /* 128 bytes uppercasing table & */ + /* 128 bytes lowercasing table */ + unsigned *sb_bmp_dir; /* main bitmap directory */ + unsigned sb_c_bitmap; /* current bitmap */ + wait_queue_head_t sb_creation_de;/* when creating dirents, nobody else + can alloc blocks */ + unsigned sb_creation_de_lock : 1; + /*unsigned sb_mounting : 1;*/ + int sb_timeshift; }; #define s_hpfs_root u.hpfs_sb.sb_root #define s_hpfs_fs_size u.hpfs_sb.sb_fs_size #define s_hpfs_bitmaps u.hpfs_sb.sb_bitmaps +#define s_hpfs_dirband_start u.hpfs_sb.sb_dirband_start #define s_hpfs_dirband_size u.hpfs_sb.sb_dirband_size #define s_hpfs_dmap u.hpfs_sb.sb_dmap #define s_hpfs_uid u.hpfs_sb.sb_uid @@ -28,5 +50,20 @@ struct hpfs_sb_info { #define s_hpfs_n_free_dnodes u.hpfs_sb.sb_n_free_dnodes #define s_hpfs_lowercase u.hpfs_sb.sb_lowercase #define s_hpfs_conv u.hpfs_sb.sb_conv +#define s_hpfs_eas u.hpfs_sb.sb_eas +#define s_hpfs_err u.hpfs_sb.sb_err +#define s_hpfs_chk u.hpfs_sb.sb_chk +#define s_hpfs_was_error u.hpfs_sb.sb_was_error +#define s_hpfs_chkdsk u.hpfs_sb.sb_chkdsk +/*#define s_hpfs_rd_fnode u.hpfs_sb.sb_rd_fnode*/ +#define s_hpfs_rd_inode u.hpfs_sb.sb_rd_inode +#define s_hpfs_cp_table u.hpfs_sb.sb_cp_table +#define s_hpfs_bmp_dir u.hpfs_sb.sb_bmp_dir +#define s_hpfs_c_bitmap u.hpfs_sb.sb_c_bitmap +#define s_hpfs_creation_de u.hpfs_sb.sb_creation_de +#define s_hpfs_creation_de_lock u.hpfs_sb.sb_creation_de_lock +#define s_hpfs_iget_q u.hpfs_sb.sb_iget_q +/*#define s_hpfs_mounting u.hpfs_sb.sb_mounting*/ +#define s_hpfs_timeshift u.hpfs_sb.sb_timeshift #endif diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 129e1ed58..29e9766ea 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -22,6 +22,8 @@ * */ +#include <linux/version.h> + #define I2C_BUS_MAX 4 /* max # of bus drivers */ #define I2C_DRIVER_MAX 8 /* max # of chip drivers */ #define I2C_DEVICE_MAX 8 /* max # if devices per bus/driver */ @@ -35,6 +37,7 @@ struct i2c_device; #define I2C_DRIVERID_VIDEOTEXT 3 #define I2C_BUSID_BT848 1 /* I2C bus on a BT848 */ +#define I2C_BUSID_PARPORT 2 /* Bit banging on a parallel port */ /* * struct for a driver for a i2c chip (tuner, soundprocessor, diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 39007c8bf..867320549 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -49,6 +49,7 @@ #define ARPHRD_PPP 512 #define ARPHRD_HDLC 513 /* (Cisco) HDLC */ #define ARPHRD_LAPB 516 /* LAPB */ +#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */ #define ARPHRD_TUNNEL 768 /* IPIP tunnel */ #define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */ diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 3fae9a9de..99bb97fa2 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -9,7 +9,7 @@ * * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Donald Becker, <becker@super.org> - * Alan Cox, <alan@cymru.net> + * Alan Cox, <alan@redhat.com> * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> * * This program is free software; you can redistribute it and/or diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 30bde75d9..221796362 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h @@ -12,7 +12,7 @@ * if_fddi.h is based on previous if_ether.h and if_tr.h work by * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Donald Becker, <becker@super.org> - * Alan Cox, <alan@cymru.net> + * Alan Cox, <alan@redhat.com> * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> * diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index 4ed065939..52c4a80ba 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h @@ -9,7 +9,7 @@ * * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Donald Becker, <becker@super.org> - * Alan Cox, <alan@cymru.net> + * Alan Cox, <alan@redhat.com> * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk> * Jes Sorensen, <Jes.Sorensen@cern.ch> * diff --git a/include/linux/if_pppvar.h b/include/linux/if_pppvar.h index d6cd0c25b..e01e4d23f 100644 --- a/include/linux/if_pppvar.h +++ b/include/linux/if_pppvar.h @@ -109,7 +109,7 @@ struct ppp { __u16 rfcs; /* FCS so far of rpkt */ /* Queues for select() functionality */ - struct wait_queue *read_wait; /* queue for reading processes */ + wait_queue_head_t read_wait; /* queue for reading processes */ /* info for detecting idle channels */ unsigned long last_xmit; /* time of last transmission */ diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index 8a3cbce1b..da449f7e4 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h @@ -37,7 +37,7 @@ struct shaper int (*hard_header_cache)(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; + wait_queue_head_t wait_queue; struct timer_list timer; }; diff --git a/include/linux/igmp.h b/include/linux/igmp.h index c13afde28..f3f6c2363 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -101,19 +101,7 @@ struct ip_mc_list char loaded; }; -extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr) -{ - struct in_device *in_dev = dev->ip_ptr; - struct ip_mc_list *im; - - if (in_dev) { - for (im=in_dev->mc_list; im; im=im->next) - if (im->multiaddr == mc_addr) - return 1; - } - return 0; -} - +extern int ip_check_mc(struct device *dev, u32 mc_addr); extern int igmp_rcv(struct sk_buff *, unsigned short); extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); diff --git a/include/linux/inet.h b/include/linux/inet.h index acb93765f..6a8e27bcd 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h @@ -46,6 +46,7 @@ extern void inet_proto_init(struct net_proto *pro); extern char *in_ntoa(__u32 in); +extern char *in_ntoa2(__u32 in, char *buf); extern __u32 in_aton(const char *str); #endif diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 25c449598..d4de5b918 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -74,7 +74,7 @@ extern int devinet_ioctl(unsigned int cmd, void *); extern void devinet_init(void); extern struct in_device *inetdev_init(struct device *dev); extern struct in_device *inetdev_by_index(int); -extern u32 inet_select_addr(struct device *dev, u32 dst, int scope); +extern u32 inet_select_addr(const struct device *dev, u32 dst, int scope); extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); extern void inet_forward_change(void); diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index aa157d4a5..3e3edd8b1 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -35,6 +35,7 @@ enum { SERIAL_BH, RISCOM8_BH, SPECIALIX_BH, + AURORA_BH, ESP_BH, NET_BH, SCSI_BH, diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 0b61899c0..c0a3ba309 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,4 @@ -/* $Id: isdn.h,v 1.37 1998/02/22 19:45:24 fritz Exp $ +/* $Id: isdn.h,v 1.64 1999/04/18 14:57:14 fritz Exp $ * * Main header for the Linux ISDN subsystem (linklevel). * @@ -20,11 +20,102 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * Note: This file differs from the corresponding revision as present in the - * isdn4linux CVS repository because some later bug fixes have been extracted - * from the repository and merged into this file. -- Henner Eisen - * * $Log: isdn.h,v $ + * Revision 1.64 1999/04/18 14:57:14 fritz + * Removed TIMRU stuff + * + * Revision 1.63 1999/04/18 14:07:18 fritz + * Removed TIMRU stuff. + * + * Revision 1.62 1999/04/12 13:16:54 fritz + * Changes from 2.0 tree. + * + * Revision 1.61 1999/03/02 11:43:21 armin + * Added variable to store connect-message of Modem. + * Added Timer-define for RegS7 (Wait for Carrier). + * + * Revision 1.60 1998/10/25 14:50:29 fritz + * Backported from MIPS (Cobalt). + * + * Revision 1.59 1998/10/23 10:18:55 paul + * Implementation of "dialmode" (successor of "status") + * You also need current isdnctrl for this! + * + * Revision 1.58 1998/10/23 10:10:06 fritz + * Test-Checkin + * + * Revision 1.57 1998/08/31 21:10:01 he + * new ioctl IIOCNETGPN for /dev/isdninfo (get network interface' + * peer phone number) + * + * Revision 1.56 1998/07/26 18:46:52 armin + * Added silence detection in voice receive mode. + * + * Revision 1.55 1998/06/26 15:13:17 fritz + * Added handling of STAT_ICALL with incomplete CPN. + * Added AT&L for ttyI emulator. + * Added more locking stuff in tty_write. + * + * Revision 1.54 1998/06/18 23:32:01 fritz + * Replaced cli()/restore_flags() in isdn_tty_write() by locking. + * Removed direct-senddown feature in isdn_tty_write because it will + * never succeed with locking and is useless anyway. + * + * Revision 1.53 1998/06/17 19:51:51 he + * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) + * brute force fix to avoid Ugh's in isdn_tty_write() + * cleaned up some dead code + * + * Revision 1.52 1998/06/12 11:42:18 detabc + * cleanup abc + * + * Revision 1.51 1998/06/02 12:10:30 detabc + * wegen einer einstweiliger verfuegung gegen DW ist zur zeit + * die abc-extension bis zur klaerung der rechtslage nicht verfuegbar + * + * Revision 1.50 1998/05/05 23:11:51 detabc + * add Item to stop icmp-unreach (max. 6 times of dialwait delay) + * + * Revision 1.49 1998/05/03 17:45:00 detabc + * Add Item to send icmp-host-unreach to all packets + * + * Revision 1.48 1998/04/26 19:58:14 detabc + * include the new abc-extension-items from 2.0.xx kernels + * remove some unused code + * + * Revision 1.47 1998/04/21 18:00:25 detabc + * Add items for secure-callback (abc-extension only) + * + * Revision 1.46 1998/04/14 16:28:59 he + * Fixed user space access with interrupts off and remaining + * copy_{to,from}_user() -> -EFAULT return codes + * + * Revision 1.45 1998/03/24 16:33:12 hipp + * More CCP changes. BSD compression now "works" on a local loopback link. + * Moved some isdn_ppp stuff from isdn.h to isdn_ppp.h + * + * Revision 1.44 1998/03/22 18:50:56 hipp + * Added BSD Compression for syncPPP .. UNTESTED at the moment + * + * Revision 1.43 1998/03/09 17:46:44 he + * merged in 2.1.89 changes + * + * Revision 1.42 1998/03/08 13:53:46 detabc + * add ABC-variables in structur isdn_devt + * + * Revision 1.41 1998/03/08 13:14:37 detabc + * abc-extension support for kernels > 2.1.x + * first try (sorry experimental) + * + * Revision 1.40 1998/03/08 01:08:29 fritz + * Increased NET_DV because of TIMRU + * + * Revision 1.39 1998/03/07 22:42:49 fritz + * Starting generic module support (Nothing usable yet). + * + * Revision 1.38 1998/03/07 18:21:29 cal + * Dynamic Timeout-Rule-Handling vs. 971110 included + * * Revision 1.37 1998/02/22 19:45:24 fritz * Some changes regarding V.110 * @@ -163,6 +254,7 @@ #ifndef isdn_h #define isdn_h +#include <linux/config.h> #include <linux/ioctl.h> #define ISDN_TTY_MAJOR 43 @@ -174,14 +266,20 @@ * the correspondent code in isdn.c */ +#ifdef CONFIG_COBALT_MICRO_SERVER +/* Save memory */ +#define ISDN_MAX_DRIVERS 2 +#define ISDN_MAX_CHANNELS 8 +#else #define ISDN_MAX_DRIVERS 32 #define ISDN_MAX_CHANNELS 64 +#endif #define ISDN_MINOR_B 0 #define ISDN_MINOR_BMAX (ISDN_MAX_CHANNELS-1) -#define ISDN_MINOR_CTRL ISDN_MAX_CHANNELS -#define ISDN_MINOR_CTRLMAX (2*ISDN_MAX_CHANNELS-1) -#define ISDN_MINOR_PPP (2*ISDN_MAX_CHANNELS) -#define ISDN_MINOR_PPPMAX (3*ISDN_MAX_CHANNELS-1) +#define ISDN_MINOR_CTRL 64 +#define ISDN_MINOR_CTRLMAX (64 + (ISDN_MAX_CHANNELS-1)) +#define ISDN_MINOR_PPP 128 +#define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1)) #define ISDN_MINOR_STATUS 255 /* New ioctl-codes */ @@ -192,8 +290,8 @@ #define IIOCNETANM _IO('I',5) #define IIOCNETDNM _IO('I',6) #define IIOCNETGNM _IO('I',7) -#define IIOCGETSET _IO('I',8) -#define IIOCSETSET _IO('I',9) +#define IIOCGETSET _IO('I',8) /* no longer supported */ +#define IIOCSETSET _IO('I',9) /* no longer supported */ #define IIOCSETVER _IO('I',10) #define IIOCNETHUP _IO('I',11) #define IIOCSETGST _IO('I',12) @@ -211,6 +309,8 @@ #define IIOCNETALN _IO('I',32) #define IIOCNETDLN _IO('I',33) +#define IIOCNETGPN _IO('I',34) + #define IIOCDBGVAR _IO('I',127) #define IIOCDRVCTL _IO('I',128) @@ -238,6 +338,8 @@ #define ISDN_MODEM_ANZREG 23 /* Number of Modem-Registers */ #define ISDN_MSNLEN 20 +#define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */ +#define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */ typedef struct { char drvid[25]; @@ -256,8 +358,9 @@ typedef struct { int outgoing; } isdn_net_ioctl_phone; -#define NET_DV 0x04 /* Data version for net_cfg */ -#define TTY_DV 0x04 /* Data version for iprofd etc. */ +#define NET_DV 0x05 /* Data version for net_cfg */ +#define TTY_DV 0x05 /* Data version for iprofd etc. */ +#define INF_DV 0x01 /* Data version for /dev/isdninfo */ typedef struct { char name[10]; /* Name of interface */ @@ -282,8 +385,17 @@ typedef struct { int pppbind; /* ippp device for bindings */ int chargeint; /* Use fixed charge interval length */ int triggercps; /* BogoCPS needed for triggering slave */ + int dialtimeout; /* Dial-Timeout */ + int dialwait; /* Time to wait after failed dial */ + int dialmode; /* Flag: off / on / auto */ } isdn_net_ioctl_cfg; +#define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */ +#define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */ +#define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */ +#define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */ +#define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK) + #ifdef __KERNEL__ #ifndef STANDALONE @@ -331,6 +443,7 @@ typedef struct { #include <linux/isdnif.h> + #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */ /* Until now unused */ @@ -372,14 +485,17 @@ typedef struct { #define ISDN_TIMER_NETHANGUP 32 #define ISDN_TIMER_IPPP 64 #define ISDN_TIMER_KEEPALIVE 128 /* Cisco-Keepalive */ +#define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */ #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \ ISDN_TIMER_MODEMXMIT) #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \ - ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE) + ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE | \ + ISDN_TIMER_CARRIER) /* Timeout-Values for isdn_net_dial() */ #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1))) #define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1))) +#define ISDN_TIMER_DTIMEOUT60 (60*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1))) /* GLOBAL_FLAGS */ #define ISDN_GLOBAL_STOPPED 1 @@ -398,6 +514,7 @@ typedef struct { #define ISDN_NET_TMP 0x10 /* tmp interface until getting an IP */ #define ISDN_NET_DYNAMIC 0x20 /* this link is dynamically allocated */ #endif + #define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */ /* Phone-list-element */ @@ -488,6 +605,11 @@ typedef struct isdn_net_local_s { struct device *, unsigned char *); int pppbind; /* ippp device for bindings */ + int dialtimeout; /* How long shall we try on dialing? (jiffies) */ + int dialwait; /* How long shall we wait after failed attempt? (jiffies) */ + ulong dialstarted; /* jiffies of first dialing-attempt */ + ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */ + int huptimeout; /* How long will the connection be up? (seconds) */ #ifdef CONFIG_ISDN_X25 struct concap_device_ops *dops; /* callbacks used by encapsulator */ #endif @@ -496,18 +618,6 @@ typedef struct isdn_net_local_s { ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */ } isdn_net_local; -#ifdef CONFIG_ISDN_PPP -struct ippp_bundle { - int mp_mrru; /* unused */ - struct mpqueue *last; /* currently defined in isdn_net_dev */ - int min; /* currently calculated 'on the fly' */ - long next_num; /* we wanna see this seq.-number next */ - struct sqqueue *sq; - int modify:1; /* set to 1 while modifying sqqueue */ - int bundled:1; /* bundle active ? */ -}; -#endif - /* the interface itself */ typedef struct isdn_net_dev_s { isdn_net_local *local; @@ -567,6 +677,10 @@ typedef struct atemu { u_char mdmreg[ISDN_MODEM_ANZREG]; /* Modem-Registers */ char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */ char msn[ISDN_MSNLEN]; /* EAZ/MSN */ + char plmsn[ISDN_LMSNLEN]; /* Listening MSNs Profile 0 */ + char lmsn[ISDN_LMSNLEN]; /* Listening MSNs */ + char cpn[ISDN_MSNLEN]; /* CalledPartyNumber on incoming call */ + char connmsg[ISDN_CMSGLEN]; /* CONNECT-Msg from HL-Driver */ #ifdef CONFIG_ISDN_AUDIO u_char vpar[10]; /* Voice-parameters */ int lastDLE; /* Flag for voice-coding: DLE seen */ @@ -574,6 +688,7 @@ typedef struct atemu { int mdmcmdl; /* Length of Modem-Commandbuffer */ int pluscount; /* Counter for +++ sequence */ int lastplus; /* Timestamp of last + */ + int carrierwait; /* Seconds of carrier waiting */ char mdmcmd[255]; /* Modem-Commandbuffer */ unsigned int charge; /* Charge units of current connection */ } atemu; @@ -593,7 +708,7 @@ typedef struct modem_info { long pgrp; /* pgrp of opening process */ int online; /* 1 = B-Channel is up, drop data */ /* 2 = B-Channel is up, deliver d.*/ - int dialing; /* Dial in progress */ + int dialing; /* Dial in progress or ATA */ int rcvsched; /* Receive needs schedule */ int isdn_driver; /* Index to isdn-driver */ int isdn_channel; /* Index to isdn-channel */ @@ -612,6 +727,7 @@ typedef struct modem_info { int xmit_count; /* # of chars in xmit_buf */ unsigned char *xmit_buf; /* transmit buffer */ struct sk_buff_head xmit_queue; /* transmit queue */ + atomic_t xmit_lock; /* Semaphore for isdn_tty_write */ #ifdef CONFIG_ISDN_AUDIO int vonline; /* Voice-channel status */ /* Bit 0 = recording */ @@ -621,13 +737,19 @@ typedef struct modem_info { void *adpcms; /* state for adpcm decompression */ void *adpcmr; /* state for adpcm compression */ void *dtmf_state; /* state for dtmf decoder */ + void *silence_state; /* state for silence detection */ #endif struct tty_struct *tty; /* Pointer to corresponding tty */ atemu emu; /* AT-emulator data */ struct termios normal_termios; /* For saving termios structs */ struct termios callout_termios; +#if LINUX_VERSION_CODE < 131841 struct wait_queue *open_wait; struct wait_queue *close_wait; +#else + wait_queue_head_t open_wait, close_wait; +#endif + struct semaphore write_sem; } modem_info; #define ISDN_MODEM_WINSIZE 8 @@ -645,72 +767,6 @@ typedef struct { /*======================= End of ISDN-tty stuff ============================*/ -/*======================= Start of sync-ppp stuff ==========================*/ - - -#define NUM_RCV_BUFFS 64 -#define PPP_HARD_HDR_LEN 4 - -#ifdef CONFIG_ISDN_PPP - -struct sqqueue { - struct sqqueue *next; - long sqno_start; - long sqno_end; - struct sk_buff *skb; - long timer; -}; - -struct mpqueue { - struct mpqueue *next; - struct mpqueue *last; - long sqno; - struct sk_buff *skb; - int BEbyte; - unsigned long time; -}; - -struct ippp_buf_queue { - struct ippp_buf_queue *next; - struct ippp_buf_queue *last; - char *buf; /* NULL here indicates end of queue */ - int len; -}; - -struct ippp_struct { - struct ippp_struct *next_link; - int state; - struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */ - struct ippp_buf_queue *first; /* pointer to (current) first packet */ - struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */ - struct wait_queue *wq; - struct wait_queue *wq1; - struct task_struct *tk; - unsigned int mpppcfg; - unsigned int pppcfg; - unsigned int mru; - unsigned int mpmru; - unsigned int mpmtu; - unsigned int maxcid; - isdn_net_local *lp; - int unit; - int minor; - long last_link_seqno; - long mp_seqno; - long range; -#ifdef CONFIG_ISDN_PPP_VJ - unsigned char *cbuf; - struct slcompress *slcomp; -#endif - unsigned long debug; - struct isdn_ppp_compressor *compressor,*link_compressor; - void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat; -}; - -#endif - -/*======================== End of sync-ppp stuff ===========================*/ - /*======================== Start of V.110 stuff ============================*/ #define V110_BUFSIZE 1024 @@ -743,69 +799,103 @@ typedef struct { char *private; } infostruct; +typedef struct isdn_module { + struct isdn_module *prev; + struct isdn_module *next; + char *name; + int (*get_free_channel)(int, int, int, int, int); + int (*free_channel)(int, int, int); + int (*status_callback)(isdn_ctrl *); + int (*command)(isdn_ctrl *); + int (*receive_callback)(int, int, struct sk_buff *); + int (*writebuf_skb)(int, int, int, struct sk_buff *); + int (*net_start_xmit)(struct sk_buff *, struct device *); + int (*net_receive)(struct device *, struct sk_buff *); + int (*net_open)(struct device *); + int (*net_close)(struct device *); + int priority; +} isdn_module; + +#define DRV_FLAG_RUNNING 1 +#define DRV_FLAG_REJBUS 2 +#define DRV_FLAG_LOADED 4 + /* Description of hardware-level-driver */ typedef struct { - ulong flags; /* Flags */ - int channels; /* Number of channels */ - int reject_bus; /* Flag: Reject rejected call on bus*/ - struct wait_queue *st_waitq; /* Wait-Queue for status-read's */ - int maxbufsize; /* Maximum Buffersize supported */ - unsigned long pktcount; /* Until now: unused */ - int running; /* Flag: Protocolcode running */ - int loaded; /* Flag: Driver loaded */ - int stavail; /* Chars avail on Status-device */ - isdn_if *interface; /* Interface to driver */ - int *rcverr; /* Error-counters for B-Ch.-receive */ - int *rcvcount; /* Byte-counters for B-Ch.-receive */ + ulong online; /* Channel-Online flags */ + ulong flags; /* Misc driver Flags */ + int locks; /* Number of locks for this driver */ + int channels; /* Number of channels */ +#if LINUX_VERSION_CODE < 131841 + struct wait_queue *st_waitq; /* Wait-Queue for status-read's */ +#else + wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */ +#endif + int maxbufsize; /* Maximum Buffersize supported */ + unsigned long pktcount; /* Until now: unused */ + int stavail; /* Chars avail on Status-device */ + isdn_if *interface; /* Interface to driver */ + int *rcverr; /* Error-counters for B-Ch.-receive */ + int *rcvcount; /* Byte-counters for B-Ch.-receive */ #ifdef CONFIG_ISDN_AUDIO - unsigned long DLEflag; /* Flags: Insert DLE at next read */ + unsigned long DLEflag; /* Flags: Insert DLE at next read */ +#endif + struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */ +#if LINUX_VERSION_CODE < 131841 + struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */ + struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */ +#else + wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */ + wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */ #endif - struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */ - struct wait_queue **rcv_waitq; /* Wait-Queues for B-Channel-Reads */ - struct wait_queue **snd_waitq; /* Wait-Queue for B-Channel-Send's */ - char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */ + char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */ } driver; /* Main driver-data */ typedef struct isdn_devt { - unsigned short flags; /* Bitmapped Flags: */ - /* */ - int drivers; /* Current number of drivers */ - int channels; /* Current number of channels */ - int net_verbose; /* Verbose-Flag */ - int modempoll; /* Flag: tty-read active */ - int tflags; /* Timer-Flags: */ - /* see ISDN_TIMER_..defines */ - int global_flags; - infostruct *infochain; /* List of open info-devs. */ - struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */ - struct timer_list timer; /* Misc.-function Timer */ - int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */ - int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */ - int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */ - char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN]; - /* Remote number of active ch.*/ - int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */ - driver *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */ - isdn_net_dev *netdev; /* Linked list of net-if's */ - char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */ - struct task_struct *profd; /* For iprofd */ - modem mdm; /* tty-driver-data */ - isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */ - isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */ - ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */ - ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */ - int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */ - atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */ - isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ - struct semaphore sem; /* serialize list access*/ + unsigned short flags; /* Bitmapped Flags: */ + /* */ + int drivers; /* Current number of drivers */ + int channels; /* Current number of channels */ + int net_verbose; /* Verbose-Flag */ + int modempoll; /* Flag: tty-read active */ + int tflags; /* Timer-Flags: */ + /* see ISDN_TIMER_..defines */ + int global_flags; + infostruct *infochain; /* List of open info-devs. */ +#if LINUX_VERSION_CODE < 131841 + struct wait_queue *info_waitq; /* Wait-Queue for isdninfo */ +#else + wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */ +#endif + struct timer_list timer; /* Misc.-function Timer */ + int chanmap[ISDN_MAX_CHANNELS];/* Map minor->device-channel */ + int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */ + int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */ + char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN]; + /* Remote number of active ch.*/ + int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */ + driver *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */ + isdn_net_dev *netdev; /* Linked list of net-if's */ + char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */ + struct task_struct *profd; /* For iprofd */ + modem mdm; /* tty-driver-data */ + isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */ + isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */ + ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */ + ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */ + int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */ + atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */ + isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ + struct semaphore sem; /* serialize list access*/ + isdn_module *modules; } isdn_dev; 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/isdn_ppp.h b/include/linux/isdn_ppp.h index 177646520..39c63d5cb 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h @@ -1,19 +1,22 @@ +/* -*- mode: c; c-basic-offset: 2 -*- */ + #ifndef _LINUX_ISDN_PPP_H #define _LINUX_ISDN_PPP_H -extern int isdn_ppp_dial_slave(char *); -extern int isdn_ppp_hangup_slave(char *); +#include <linux/config.h> #define CALLTYPE_INCOMING 0x1 #define CALLTYPE_OUTGOING 0x2 #define CALLTYPE_CALLBACK 0x4 +#define IPPP_VERSION "2.2.0" + struct pppcallinfo { - int calltype; - unsigned char local_num[64]; - unsigned char remote_num[64]; - int charge_units; + int calltype; + unsigned char local_num[64]; + unsigned char remote_num[64]; + int charge_units; }; #define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo) @@ -22,48 +25,216 @@ struct pppcallinfo #define PPPIOCSMPFLAGS _IOW('t',131,int) #define PPPIOCSMPMTU _IOW('t',132,int) #define PPPIOCSMPMRU _IOW('t',133,int) -#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long) +#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long [8]) #define PPPIOCSCOMPRESSOR _IOW('t',135,int) +#define PPPIOCGIFNAME _IOR('t',136, char [IFNAMSIZ] ) #define PPP_MP 0x003d #define PPP_LINK_COMP 0x00fb +#define PPP_LINK_CCP 0x80fb #define SC_MP_PROT 0x00000200 #define SC_REJ_MP_PROT 0x00000400 #define SC_OUT_SHORT_SEQ 0x00000800 #define SC_IN_SHORT_SEQ 0x00004000 +#define SC_DECOMP_ON 0x01 +#define SC_COMP_ON 0x02 +#define SC_DECOMP_DISCARD 0x04 +#define SC_COMP_DISCARD 0x08 +#define SC_LINK_DECOMP_ON 0x10 +#define SC_LINK_COMP_ON 0x20 +#define SC_LINK_DECOMP_DISCARD 0x40 +#define SC_LINK_COMP_DISCARD 0x80 + +#define DECOMP_ERR_NOMEM (-10) + #define MP_END_FRAG 0x40 #define MP_BEGIN_FRAG 0x80 +#define ISDN_PPP_COMP_MAX_OPTIONS 16 + +#define IPPP_COMP_FLAG_XMIT 0x1 +#define IPPP_COMP_FLAG_LINK 0x2 + +struct isdn_ppp_comp_data { + int num; + unsigned char options[ISDN_PPP_COMP_MAX_OPTIONS]; + int optlen; + int flags; +}; + #ifdef __KERNEL__ + +/* + * We need a way for the decompressor to influence the generation of CCP + * Reset-Requests in a variety of ways. The decompressor is already returning + * a lot of information (generated skb length, error conditions) so we use + * another parameter. This parameter is a pointer to a structure which is + * to be marked valid by the decompressor and only in this case is ever used. + * Furthermore, the only case where this data is used is when the decom- + * pressor returns DECOMP_ERROR. + * + * We use this same struct for the reset entry of the compressor to commu- + * nicate to its caller how to deal with sending of a Reset Ack. In this + * case, expra is not used, but other options still apply (supressing + * sending with rsend, appending arbitrary data, etc). + */ + +#define IPPP_RESET_MAXDATABYTES 32 + +struct isdn_ppp_resetparams { + unsigned char valid:1; /* rw Is this structure filled at all ? */ + unsigned char rsend:1; /* rw Should we send one at all ? */ + unsigned char idval:1; /* rw Is the id field valid ? */ + unsigned char dtval:1; /* rw Is the data field valid ? */ + unsigned char expra:1; /* rw Is an Ack expected for this Req ? */ + unsigned char id; /* wo Send CCP ResetReq with this id */ + unsigned short maxdlen; /* ro Max bytes to be stored in data field */ + unsigned short dlen; /* rw Bytes stored in data field */ + unsigned char *data; /* wo Data for ResetReq info field */ +}; + /* * this is an 'old friend' from ppp-comp.h under a new name * check the original include for more information */ struct isdn_ppp_compressor { - struct isdn_ppp_compressor *next,*prev; - int num; /* CCP compression protocol number */ - void *(*comp_alloc) (unsigned char *options, int opt_len); - void (*comp_free) (void *state); - int (*comp_init) (void *state, unsigned char *options, int opt_len, - int unit, int opthdr, int debug); - void (*comp_reset) (void *state); - int (*compress) (void *state,struct sk_buff *in, struct sk_buff *skb_out, - int proto); - void (*comp_stat) (void *state, struct compstat *stats); - void *(*decomp_alloc) (unsigned char *options, int opt_len); - void (*decomp_free) (void *state); - int (*decomp_init) (void *state, unsigned char *options, - int opt_len, int unit, int opthdr, int mru, int debug); - void (*decomp_reset) (void *state); - int (*decompress) (void *state, unsigned char *ibuf, int isize, unsigned char *obuf, int osize); - void (*incomp) (void *state, unsigned char *ibuf, int icnt); - void (*decomp_stat) (void *state, struct compstat *stats); + struct isdn_ppp_compressor *next, *prev; + int num; /* CCP compression protocol number */ + + void *(*alloc) (struct isdn_ppp_comp_data *); + void (*free) (void *state); + int (*init) (void *state, struct isdn_ppp_comp_data *, + int unit,int debug); + + /* The reset entry needs to get more exact information about the + ResetReq or ResetAck it was called with. The parameters are + obvious. If reset is called without a Req or Ack frame which + could be handed into it, code MUST be set to 0. Using rsparm, + the reset entry can control if and how a ResetAck is returned. */ + + void (*reset) (void *state, unsigned char code, unsigned char id, + unsigned char *data, unsigned len, + struct isdn_ppp_resetparams *rsparm); + + int (*compress) (void *state, struct sk_buff *in, + struct sk_buff *skb_out, int proto); + + int (*decompress) (void *state,struct sk_buff *in, + struct sk_buff *skb_out, + struct isdn_ppp_resetparams *rsparm); + + void (*incomp) (void *state, struct sk_buff *in,int proto); + void (*stat) (void *state, struct compstat *stats); }; extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *); extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *); +extern int isdn_ppp_dial_slave(char *); +extern int isdn_ppp_hangup_slave(char *); + +struct ippp_bundle { + int mp_mrru; /* unused */ + struct mpqueue *last; /* currently defined in isdn_net_dev */ + int min; /* currently calculated 'on the fly' */ + long next_num; /* we wanna see this seq.-number next */ + struct sqqueue *sq; + int modify:1; /* set to 1 while modifying sqqueue */ + int bundled:1; /* bundle active ? */ +}; + +#define NUM_RCV_BUFFS 64 + +struct sqqueue { + struct sqqueue *next; + long sqno_start; + long sqno_end; + struct sk_buff *skb; + long timer; +}; + +struct mpqueue { + struct mpqueue *next; + struct mpqueue *last; + long sqno; + struct sk_buff *skb; + int BEbyte; + unsigned long time; +}; + +struct ippp_buf_queue { + struct ippp_buf_queue *next; + struct ippp_buf_queue *last; + char *buf; /* NULL here indicates end of queue */ + int len; +}; + +/* The data structure for one CCP reset transaction */ +enum ippp_ccp_reset_states { + CCPResetIdle, + CCPResetSentReq, + CCPResetRcvdReq, + CCPResetSentAck, + CCPResetRcvdAck +}; + +struct ippp_ccp_reset_state { + enum ippp_ccp_reset_states state; /* State of this transaction */ + struct ippp_struct *is; /* Backlink to device stuff */ + unsigned char id; /* Backlink id index */ + unsigned char ta:1; /* The timer is active (flag) */ + unsigned char expra:1; /* We expect a ResetAck at all */ + int dlen; /* Databytes stored in data */ + struct timer_list timer; /* For timeouts/retries */ + /* This is a hack but seems sufficient for the moment. We do not want + to have this be yet another allocation for some bytes, it is more + memory management overhead than the whole mess is worth. */ + unsigned char data[IPPP_RESET_MAXDATABYTES]; +}; + +/* The data structure keeping track of the currently outstanding CCP Reset + transactions. */ +struct ippp_ccp_reset { + struct ippp_ccp_reset_state *rs[256]; /* One per possible id */ + unsigned char lastid; /* Last id allocated by the engine */ +}; + +struct ippp_struct { + struct ippp_struct *next_link; + int state; + struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */ + struct ippp_buf_queue *first; /* pointer to (current) first packet */ + struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */ +#if LINUX_VERSION_CODE < 131841 + struct wait_queue *wq; +#else + wait_queue_head_t wq; +#endif + struct task_struct *tk; + unsigned int mpppcfg; + unsigned int pppcfg; + unsigned int mru; + unsigned int mpmru; + unsigned int mpmtu; + unsigned int maxcid; + struct isdn_net_local_s *lp; + int unit; + int minor; + long last_link_seqno; + long mp_seqno; + long range; +#ifdef CONFIG_ISDN_PPP_VJ + unsigned char *cbuf; + struct slcompress *slcomp; +#endif + unsigned long debug; + struct isdn_ppp_compressor *compressor,*decompressor; + struct isdn_ppp_compressor *link_compressor,*link_decompressor; + void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat; + struct ippp_ccp_reset *reset; /* Allocated on demand, may never be needed */ + unsigned long compflags; +}; #endif /* __KERNEL__ */ diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index e7a7f247c..5f1fcacaa 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h @@ -1,8 +1,4 @@ -/* X25 changes: - Added constants ISDN_PROTO_L2_X25DTE/DCE and corresponding ISDN_FEATURE_.. - */ - -/* $Id: isdnif.h,v 1.23 1998/02/20 17:36:52 fritz Exp $ +/* $Id: isdnif.h,v 1.25 1998/06/17 19:51:55 he Exp $ * * Linux ISDN subsystem * @@ -26,6 +22,15 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnif.h,v $ + * Revision 1.25 1998/06/17 19:51:55 he + * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) + * brute force fix to avoid Ugh's in isdn_tty_write() + * cleaned up some dead code + * + * Revision 1.24 1998/03/19 13:18:57 keil + * Start of a CAPI like interface for supplementary Service + * first service: SUSPEND + * * Revision 1.23 1998/02/20 17:36:52 fritz * Added L2-protocols for V.110, changed FEATURE-Flag-constants. * @@ -139,6 +144,7 @@ #define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */ #define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */ #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_MAX 15 /* Max. 16 Protocols */ /* @@ -173,6 +179,7 @@ #define ISDN_CMD_UNLOCK 15 /* Release usage-lock */ #define ISDN_CMD_SUSPEND 16 /* Suspend connection */ #define ISDN_CMD_RESUME 17 /* Resume connection */ +#define CAPI_PUT_MESSAGE 18 /* CAPI message send down or up */ /* * Status-Values delivered from lowlevel to linklevel via @@ -216,6 +223,7 @@ #define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096) #define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019) #define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038) +#define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM) #define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */ #define ISDN_FEATURE_L2_SHIFT (0) @@ -236,14 +244,37 @@ #define ISDN_FEATURE_P_SHIFT (24) typedef struct setup_parm { - char phone[32]; /* Remote Phone-Number */ - char eazmsn[32]; /* Local EAZ or MSN */ + unsigned char phone[32]; /* Remote Phone-Number */ + unsigned char eazmsn[32]; /* Local EAZ or MSN */ unsigned char si1; /* Service Indicator 1 */ unsigned char si2; /* Service Indicator 2 */ unsigned char plan; /* Numbering plan */ unsigned char screen; /* Screening info */ } setup_parm; +/* CAPI structs */ + +/* this is compatible to the old union size */ +#define MAX_CAPI_PARA_LEN 50 + +typedef struct { + /* Header */ + __u16 Length; + __u16 ApplId; + __u8 Command; + __u8 Subcommand; + __u16 Messagenumber; + + /* Parameter */ + union { + __u32 Controller; + __u32 PLCI; + __u32 NCCI; + } adr; + __u8 para[MAX_CAPI_PARA_LEN]; +} capi_msg; + + /* * Structure for exchanging above infos * @@ -255,8 +286,9 @@ typedef struct { union { ulong errcode; /* Type of error with STAT_L1ERR */ int length; /* Amount of bytes sent with STAT_BSENT */ - char num[50]; /* Additional Data */ - setup_parm setup; + u_char num[50]; /* Additional Data */ + setup_parm setup; /* For SETUP msg */ + capi_msg cmsg; /* For CAPI like messages */ } parm; } isdn_ctrl; diff --git a/include/linux/isicom.h b/include/linux/isicom.h index 82325a9b8..7f929b895 100644 --- a/include/linux/isicom.h +++ b/include/linux/isicom.h @@ -144,8 +144,8 @@ struct isi_port { long pgrp; struct isi_board * card; struct tty_struct * tty; - struct wait_queue * close_wait; - struct wait_queue * open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t open_wait; struct tq_struct hangup_tq; struct tq_struct bh_tqueue; unsigned char * xmit_buf; diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 269ef88ba..cc9831b44 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h @@ -70,9 +70,9 @@ typedef struct { long pgrp; unsigned int rxmarkmsk; struct tty_struct *tty; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *raw_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t raw_wait; struct tq_struct tqhangup; struct termios normaltermios; struct termios callouttermios; diff --git a/include/linux/joystick.h b/include/linux/joystick.h index c1794ca29..996babd51 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h @@ -217,7 +217,7 @@ struct js_dev { struct js_dev *next; struct js_list *list; struct js_port *port; - struct wait_queue *wait; + wait_queue_head_t wait; struct js_data cur; struct js_data new; struct js_corr *corr; diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index 6829c6536..37cf120ae 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h @@ -1,6 +1,8 @@ #ifndef __LINUX_KEYBOARD_H #define __LINUX_KEYBOARD_H +#include <linux/wait.h> + #define KG_SHIFT 0 #define KG_CTRL 2 #define KG_ALT 3 @@ -24,7 +26,7 @@ extern const int NR_TYPES; extern const int max_vals[]; extern unsigned short *key_maps[MAX_NR_KEYMAPS]; extern unsigned short plain_map[NR_KEYS]; -extern struct wait_queue * keypress_wait; +extern wait_queue_head_t keypress_wait; extern unsigned char keyboard_type; #endif diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 384e14689..fbc861f24 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -44,7 +44,7 @@ struct nlm_host { unsigned short h_reclaiming : 1, h_inuse : 1, h_monitored : 1; - struct wait_queue * h_gracewait; /* wait while reclaiming */ + wait_queue_head_t h_gracewait; /* wait while reclaiming */ u32 h_state; /* pseudo-state counter */ u32 h_nsmstate; /* true remote NSM state */ unsigned int h_count; /* reference count */ diff --git a/include/linux/lp.h b/include/linux/lp.h index a60d29860..83e4d7739 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -7,12 +7,6 @@ * Interrupt support added 1993 Nigel Gamble */ -/* Magic numbers for defining port-device mappings */ -#define LP_PARPORT_UNSPEC -4 -#define LP_PARPORT_AUTO -3 -#define LP_PARPORT_OFF -2 -#define LP_PARPORT_NONE -1 - /* * Per POSIX guidelines, this module reserves the LP and lp prefixes * These are the lp_table[minor].flags flags... @@ -87,6 +81,14 @@ #define LP_TIMEOUT_INTERRUPT (60 * HZ) #define LP_TIMEOUT_POLLED (10 * HZ) +#ifdef __KERNEL__ + +/* Magic numbers for defining port-device mappings */ +#define LP_PARPORT_UNSPEC -4 +#define LP_PARPORT_AUTO -3 +#define LP_PARPORT_OFF -2 +#define LP_PARPORT_NONE -1 + #define LP_F(minor) lp_table[(minor)].flags /* flags for busy, etc. */ #define LP_CHAR(minor) lp_table[(minor)].chars /* busy timeout */ #define LP_TIME(minor) lp_table[(minor)].time /* wait time */ @@ -123,7 +125,7 @@ struct lp_struct { unsigned int runchars; struct lp_stats stats; #endif - struct wait_queue *wait_q; + wait_queue_head_t wait_q; unsigned int last_error; volatile unsigned int irq_detected:1; volatile unsigned int irq_missed:1; @@ -182,3 +184,5 @@ struct lp_struct { extern int lp_init(void); #endif + +#endif diff --git a/include/linux/lp_m68k.h b/include/linux/lp_m68k.h index cddecc98d..22bdc5ce2 100644 --- a/include/linux/lp_m68k.h +++ b/include/linux/lp_m68k.h @@ -116,7 +116,7 @@ struct lp_struct { unsigned int chars; /*busy timeout */ unsigned int time; /*wait time */ unsigned int wait; - struct wait_queue *lp_wait_q; /*strobe wait */ + struct wait_queue_head_t lp_wait_q; /*strobe wait */ void *base; /* hardware drivers internal use*/ enum lp_type type; char lp_buffer[LP_BUFFER_SIZE]; diff --git a/include/linux/major.h b/include/linux/major.h index cdff8ea74..cfefdf0ac 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -91,9 +91,17 @@ #define SCSI_DISK6_MAJOR 70 #define SCSI_DISK7_MAJOR 71 + #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 +#define I2O_MAJOR 80 /* 80->87 */ + +#define IDE6_MAJOR 88 +#define IDE7_MAJOR 89 + +#define AURORA_MAJOR 79 + #define UNIX98_PTY_MASTER_MAJOR 128 #define UNIX98_PTY_MAJOR_COUNT 8 #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) diff --git a/include/linux/md.h b/include/linux/md.h index f4f4f5486..654b67717 100644 --- a/include/linux/md.h +++ b/include/linux/md.h @@ -274,7 +274,7 @@ struct md_dev struct md_thread { void (*run) (void *data); void *data; - struct wait_queue *wqueue; + wait_queue_head_t wqueue; unsigned long flags; struct semaphore *sem; struct task_struct *tsk; diff --git a/include/linux/mm.h b/include/linux/mm.h index ed4eeca0c..3a1963887 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -126,7 +126,7 @@ typedef struct page { struct page *next_hash; atomic_t count; unsigned long flags; /* atomic flags, some possibly updated asynchronously */ - struct wait_queue *wait; + wait_queue_head_t wait; struct page **pprev_hash; struct buffer_head * buffers; } mem_map_t; @@ -314,6 +314,7 @@ extern unsigned long get_unmapped_area(unsigned long, unsigned long); extern unsigned long do_mmap(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); extern int do_munmap(unsigned long, size_t); +extern unsigned long do_brk(unsigned long, unsigned long); /* filemap.c */ extern void remove_inode_page(struct page *); @@ -393,6 +394,8 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m return vma; } +extern struct vm_area_struct *find_extend_vma(struct task_struct *tsk, unsigned long addr); + #define buffer_under_min() ((buffermem >> PAGE_SHIFT) * 100 < \ buffer_mem.min_percent * num_physpages) #define pgcache_under_min() (page_cache_size * 100 < \ diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 7e27f1ac6..f9ef19e8c 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -183,12 +183,9 @@ struct vfat_slot_info { #ifdef __KERNEL__ -typedef int (*fat_filldir_t)(filldir_t filldir, void *, const char *, - int, int, off_t, off_t, int, ino_t); - struct fat_cache { kdev_t device; /* device number. 0 means unused. */ - int ino; /* inode number. */ + int start_cluster; /* first cluster of the chain. */ int file_cluster; /* cluster number in the file. */ int disk_cluster; /* cluster number on disk. */ struct fat_cache *next; /* next cache entry */ @@ -199,15 +196,29 @@ extern int fat_is_binary(char conversion,char *extension); extern void lock_fat(struct super_block *sb); extern void unlock_fat(struct super_block *sb); extern int fat_add_cluster(struct inode *inode); +extern struct buffer_head *fat_add_cluster1(struct inode *inode); extern int date_dos2unix(__u16 time, __u16 date); extern void fat_fs_panic(struct super_block *s,const char *msg); extern void fat_lock_creation(void); extern void fat_unlock_creation(void); extern void fat_date_unix2dos(int unix_date,__u16 *time, __u16 *date); -extern int fat_get_entry(struct inode *dir,loff_t *pos,struct buffer_head **bh, - struct msdos_dir_entry **de); +extern int fat__get_entry(struct inode *dir,loff_t *pos,struct buffer_head **bh, + struct msdos_dir_entry **de,int *ino); +static __inline__ int fat_get_entry(struct inode *dir,loff_t *pos, + struct buffer_head **bh,struct msdos_dir_entry **de,int *ino) +{ + /* Fast stuff first */ + if (*bh && *de && + (*de - (struct msdos_dir_entry *)(*bh)->b_data) < MSDOS_DPB-1) { + *pos += sizeof(struct msdos_dir_entry); + (*de)++; + (*ino)++; + return 0; + } + return fat__get_entry(dir,pos,bh,de,ino); +} extern int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_bh, - struct msdos_dir_entry **res_de,int *ino,char scantype); + struct msdos_dir_entry **res_de,int *ino); extern int fat_parent_ino(struct inode *dir,int locked); extern int fat_subdirs(struct inode *dir); void fat_clusters_flush(struct super_block *sb); @@ -224,26 +235,32 @@ void fat_cache_add(struct inode *inode,int f_clu,int d_clu); int fat_get_cluster(struct inode *inode,int cluster); /* inode.c */ +extern void fat_hash_init(void); extern int fat_bmap(struct inode *inode,int block); extern int fat_notify_change(struct dentry *, struct iattr *); -extern void fat_put_inode(struct inode *inode); +extern void fat_clear_inode(struct inode *inode); extern void fat_delete_inode(struct inode *inode); 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 fat_attach(struct inode *inode, int ino); +extern void fat_detach(struct inode *inode); +extern struct inode *fat_iget(struct super_block*,int); +extern struct inode *fat_build_inode(struct super_block*,struct msdos_dir_entry*,int,int*); +extern struct super_block *fat_read_super(struct super_block *s, void *data, int silent, struct inode_operations *dir_ops); extern void msdos_put_super(struct super_block *sb); extern int fat_statfs(struct super_block *sb,struct statfs *buf, int); extern void fat_write_inode(struct inode *inode); /* dir.c */ extern struct file_operations fat_dir_operations; -extern int fat_readdirx(struct inode *inode, struct file *filp, void *dirent, - fat_filldir_t fat_filldir, filldir_t filldir, - int shortnames, int longnames, int both); +extern int fat_search_long(struct inode *dir, const char *name, int len, + int anycase, loff_t *spos, loff_t *lpos); extern int fat_readdir(struct file *filp, void *dirent, filldir_t); extern int fat_dir_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, unsigned long arg); +int fat_add_entries(struct inode *dir,int slots, struct buffer_head **bh, + struct msdos_dir_entry **de, int *ino); +int fat_dir_empty(struct inode *dir); /* file.c */ extern struct inode_operations fat_file_inode_operations; @@ -276,7 +293,6 @@ extern int msdos_create(struct inode *dir,struct dentry *dentry,int mode); extern int msdos_rmdir(struct inode *dir,struct dentry *dentry); extern int msdos_mkdir(struct inode *dir,struct dentry *dentry,int mode); extern int msdos_unlink(struct inode *dir,struct dentry *dentry); -extern int msdos_unlink_umsdos(struct inode *dir,struct dentry *dentry); extern int msdos_rename(struct inode *old_dir,struct dentry *old_dentry, struct inode *new_dir,struct dentry *new_dentry); @@ -303,12 +319,10 @@ extern int init_fat_nls(void); /* vfat/namei.c - these are for dmsdos */ extern int vfat_create(struct inode *dir,struct dentry *dentry,int mode); extern int vfat_unlink(struct inode *dir,struct dentry *dentry); -extern int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry); extern int vfat_mkdir(struct inode *dir,struct dentry *dentry,int mode); extern int vfat_rmdir(struct inode *dir,struct dentry *dentry); extern int vfat_rename(struct inode *old_dir,struct dentry *old_dentry, struct inode *new_dir,struct dentry *new_dentry); -extern void vfat_put_super(struct super_block *sb); extern struct super_block *vfat_read_super(struct super_block *sb,void *data, int silent); extern void vfat_read_inode(struct inode *inode); diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h index 1e677d5c7..fcb746552 100644 --- a/include/linux/msdos_fs_i.h +++ b/include/linux/msdos_fs_i.h @@ -32,6 +32,9 @@ struct msdos_inode_info { int i_busy; /* file is either deleted but still open, or inconsistent (mkdir) */ int i_binary; /* file contains non-text data */ + int i_location; /* on-disk position of directory entry or 0 */ + struct inode *i_fat_inode; /* struct inode of this one */ + struct list_head i_fat_hash; /* hash by i_location */ }; #endif diff --git a/include/linux/msdos_fs_sb.h b/include/linux/msdos_fs_sb.h index 4497eeedb..a44bd960b 100644 --- a/include/linux/msdos_fs_sb.h +++ b/include/linux/msdos_fs_sb.h @@ -43,7 +43,7 @@ struct msdos_sb_info { unsigned long clusters; /* number of clusters */ unsigned long root_cluster; /* first cluster of the root directory */ unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */ - struct wait_queue *fat_wait; + wait_queue_head_t fat_wait; int fat_lock; int prev_free; /* previously returned free cluster number */ int free_clusters; /* -1 if undefined */ @@ -51,7 +51,9 @@ struct msdos_sb_info { struct nls_table *nls_disk; /* Codepage used on disk */ struct nls_table *nls_io; /* Charset used for input and display */ struct cvf_format* cvf_format; - void* private_data; + void *dir_ops; /* Opaque; default directory operations */ + void (*put_super_callback)(struct super_block *); + void *private_data; }; #endif diff --git a/include/linux/msg.h b/include/linux/msg.h index 2be627198..48c33aca7 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h @@ -19,8 +19,8 @@ struct msqid_ds { __kernel_time_t msg_stime; /* last msgsnd time */ __kernel_time_t msg_rtime; /* last msgrcv time */ __kernel_time_t msg_ctime; /* last change time */ - struct wait_queue *wwait; - struct wait_queue *rwait; + wait_queue_head_t wwait; + wait_queue_head_t rwait; unsigned short msg_cbytes; /* current number of bytes on queue */ unsigned short msg_qnum; /* number of messages in queue */ unsigned short msg_qbytes; /* max number of bytes on queue */ diff --git a/include/linux/ncp.h b/include/linux/ncp.h index 666ffff0f..229618db0 100644 --- a/include/linux/ncp.h +++ b/include/linux/ncp.h @@ -72,9 +72,6 @@ struct ncp_volume_info { #define aDELETEINHIBIT (ntohl(1L<<(18-8))) #define aDONTCOMPRESS (nothl(1L<<(27-24))) -#define NCP_MIN_SYMLINK_SIZE 8 -#define NCP_MAX_SYMLINK_SIZE 512 - #define AR_READ (ntohs(0x0100)) #define AR_WRITE (ntohs(0x0200)) #define AR_EXCLUSIVE (ntohs(0x2000)) diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index b30fd0610..9c5df5342 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h @@ -248,7 +248,11 @@ void ncp_date_unix2dos(int unix_date, __u16 * time, __u16 * date); int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); /* linux/fs/ncpfs/sock.c */ -int ncp_request(struct ncp_server *server, int function); +int ncp_request2(struct ncp_server *server, int function, + void* reply, int max_reply_size); +static int inline ncp_request(struct ncp_server *server, int function) { + return ncp_request2(server, function, server->packet, server->packet_size); +} int ncp_connect(struct ncp_server *server); int ncp_disconnect(struct ncp_server *server); void ncp_lock_server(struct ncp_server *server); diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index adf1eef66..43f902bed 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h @@ -8,6 +8,7 @@ #ifndef _NCP_FS_SB #define _NCP_FS_SB +#include <asm/semaphore.h> #include <linux/ncp_mount.h> #include <linux/types.h> @@ -44,7 +45,7 @@ struct ncp_server { receive replies */ int lock; /* To prevent mismatch in protocols. */ - struct wait_queue *wait; + struct semaphore sem; int current_size; /* for packet preparation */ int has_subfunction; diff --git a/include/linux/net.h b/include/linux/net.h index 63e996f9d..906c83dce 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -19,6 +19,7 @@ #define _LINUX_NET_H #include <linux/socket.h> +#include <linux/wait.h> struct poll_table_struct; @@ -68,7 +69,7 @@ struct socket struct fasync_struct *fasync_list; /* Asynchronous wake up list */ struct file *file; /* File back pointer for gc */ struct sock *sk; - struct wait_queue *wait; + wait_queue_head_t wait; short type; unsigned char passcred; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 18e7fde28..5fbcbad86 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -152,6 +152,7 @@ struct hh_cache struct hh_cache *hh_next; /* Next entry */ atomic_t hh_refcnt; /* number of users */ unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP */ + int hh_len; /* length of header */ int (*hh_output)(struct sk_buff *skb); rwlock_t hh_lock; /* cached hardware header; allow for machine alignment needs. */ @@ -260,12 +261,23 @@ struct device void *atalk_ptr; /* AppleTalk link */ void *ip_ptr; /* IPv4 specific data */ void *dn_ptr; /* DECnet specific data */ + void *ip6_ptr; /* IPv6 specific data */ struct Qdisc *qdisc; struct Qdisc *qdisc_sleeping; struct Qdisc *qdisc_list; unsigned long tx_queue_len; /* Max frames per queue allowed */ + /* hard_start_xmit synchronizer */ + spinlock_t xmit_lock; + /* cpu id of processor entered to hard_start_xmit or -1, + if nobody entered there. + */ + int xmit_lock_owner; + /* device queue lock */ + spinlock_t queue_lock; + atomic_t refcnt; + /* Pointers to interface service routines. */ int (*open)(struct device *dev); int (*stop)(struct device *dev); @@ -331,7 +343,7 @@ struct packet_type extern struct device loopback_dev; /* The loopback */ extern struct device *dev_base; /* All devices */ -extern struct packet_type *ptype_base[16]; /* Hashed types */ +extern rwlock_t dev_base_lock; /* Device list lock */ extern int netdev_dropping; extern int net_cpu_congestion; @@ -405,7 +417,7 @@ extern __inline__ void dev_unlock_list(void) extern __inline__ void dev_lock_wait(void) { while (atomic_read(&dev_lockct)) { - current->counter = 0; + current->policy |= SCHED_YIELD; schedule(); } } diff --git a/include/linux/nfs.h b/include/linux/nfs.h index 7936d5a71..4f7d3230e 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h @@ -158,6 +158,11 @@ struct nfs_diropargs { const char * name; }; +struct nfs_readlinkargs { + struct nfs_fh * fh; + const void * buffer; +}; + struct nfs_readargs { struct nfs_fh * fh; __u32 offset; @@ -195,7 +200,7 @@ struct nfs_readdirargs { struct nfs_fh * fh; __u32 cookie; void * buffer; - unsigned int bufsiz; + int bufsiz; }; struct nfs_diropok { @@ -208,16 +213,10 @@ struct nfs_readres { unsigned int count; }; -struct nfs_readlinkres { - char ** string; - unsigned int * lenp; - unsigned int maxlen; - void * buffer; -}; - struct nfs_readdirres { void * buffer; - unsigned int bufsiz; + int bufsiz; + u32 cookie; }; #endif /* NFS_NEED_XDR_TYPES */ diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index af9615066..613eb6872 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -79,6 +79,8 @@ do { \ #define NFS_FLAGS(inode) ((inode)->u.nfs_i.flags) #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATE) #define NFS_WRITEBACK(inode) ((inode)->u.nfs_i.writeback) +#define NFS_COOKIES(inode) ((inode)->u.nfs_i.cookies) +#define NFS_DIREOF(inode) ((inode)->u.nfs_i.direof) /* * These are the default flags for swap requests @@ -100,7 +102,7 @@ struct nfs_wreq { struct rpc_task wb_task; /* RPC task */ struct file * wb_file; /* dentry referenced */ struct page * wb_page; /* page to be written */ - struct wait_queue * wb_wait; /* wait for completion */ + wait_queue_head_t wb_wait; /* wait for completion */ unsigned int wb_offset; /* offset within page */ unsigned int wb_bytes; /* dirty range */ unsigned int wb_count; /* user count */ @@ -139,9 +141,6 @@ extern int nfs_proc_setattr(struct nfs_server *server, struct nfs_fh *fhandle, extern int nfs_proc_lookup(struct nfs_server *server, struct nfs_fh *dir, const char *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr); -extern int nfs_proc_readlink(struct nfs_server *server, struct nfs_fh *fhandle, - void **p0, char **string, unsigned int *len, - unsigned int maxlen); extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle, int swap, unsigned long offset, unsigned int count, void *buffer, struct nfs_fattr *fattr); @@ -166,8 +165,6 @@ extern int nfs_proc_mkdir(struct nfs_server *server, struct nfs_fh *dir, struct nfs_fh *fhandle, struct nfs_fattr *fattr); extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir, const char *name); -extern int nfs_proc_readdir(struct nfs_server *server, struct nfs_fh *fhandle, - u32 cookie, unsigned int size, __u32 *entry); extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fsinfo *res); @@ -195,9 +192,7 @@ extern struct inode_operations nfs_file_inode_operations; */ extern struct inode_operations nfs_dir_inode_operations; extern struct dentry_operations nfs_dentry_operations; -extern void nfs_free_dircache(void); extern void nfs_invalidate_dircache(struct inode *); -extern void nfs_invalidate_dircache_sb(struct super_block *); /* * linux/fs/nfs/symlink.c @@ -228,7 +223,7 @@ extern int nfs_wb_file(struct inode *, struct file *); * back first.. */ extern void nfs_inval(struct inode *); -extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int, int); +extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int); /* * linux/fs/nfs/read.c diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index 885f21f01..d21f0078f 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h @@ -47,6 +47,10 @@ struct nfs_inode_info { * pages. */ struct nfs_wreq * writeback; + + /* Readdir caching information. */ + void *cookies; + u32 direof; }; /* diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index dc16282e1..5c0d673f2 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -33,6 +33,7 @@ struct nfs_fhbase { __u32 fb_dev; /* our device */ __u32 fb_xdev; __u32 fb_xino; + __u32 fb_generation; }; #define NFS_FH_PADDING (NFS_FHSIZE - sizeof(struct nfs_fhbase)) @@ -47,6 +48,7 @@ struct knfs_fh { #define fh_dev fh_base.fb_dev #define fh_xdev fh_base.fb_xdev #define fh_xino fh_base.fb_xino +#define fh_generation fh_base.fb_generation #ifdef __KERNEL__ diff --git a/include/linux/nfsiod.h b/include/linux/nfsiod.h index fdd07a2d0..206441c56 100644 --- a/include/linux/nfsiod.h +++ b/include/linux/nfsiod.h @@ -26,7 +26,7 @@ typedef int (*nfsiod_callback_t)(int result, struct nfsiod_req *); struct nfsiod_req { struct nfsiod_req * rq_next; struct nfsiod_req * rq_prev; - struct wait_queue * rq_wait; + wait_queue_head_t rq_wait; struct rpc_ioreq rq_rpcreq; nfsiod_callback_t rq_callback; struct nfs_server * rq_server; diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 3e1e89b44..218098416 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -14,7 +14,7 @@ static inline unsigned long page_address(struct page * page) { - return PAGE_OFFSET + PAGE_SIZE * (page - mem_map); + return PAGE_OFFSET + ((page - mem_map) << PAGE_SHIFT); } /* @@ -28,6 +28,7 @@ static inline unsigned long page_address(struct page * page) #define PAGE_CACHE_SHIFT PAGE_SHIFT #define PAGE_CACHE_SIZE PAGE_SIZE #define PAGE_CACHE_MASK PAGE_MASK +#define PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK) #define page_cache_alloc() __get_free_page(GFP_USER) #define page_cache_free(x) free_page(x) diff --git a/include/linux/parport.h b/include/linux/parport.h index 3adbc5ab3..d95c5a856 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -103,9 +103,6 @@ struct parport_operations { void (*change_mode)(struct parport *, int); - void (*release_resources)(struct parport *); - int (*claim_resources)(struct parport *); - void (*epp_write_data)(struct parport *, unsigned char); unsigned char (*epp_read_data)(struct parport *); void (*epp_write_addr)(struct parport *, unsigned char); @@ -163,12 +160,13 @@ struct pardevice { struct pardevice *next; struct pardevice *prev; struct parport_state *state; /* saved status over preemption */ - struct wait_queue *wait_q; + wait_queue_head_t wait_q; unsigned long int time; unsigned long int timeslice; unsigned int waiting; struct pardevice *waitprev; struct pardevice *waitnext; + void * sysctl_table; }; /* Directory information for the /proc interface */ @@ -184,6 +182,7 @@ struct parport_dir { /* A parallel port */ struct parport { unsigned long base; /* base address */ + unsigned long base_hi; /* base address (ECR) */ unsigned int size; /* IO extent */ const char *name; int irq; /* interrupt (or -1 for none) */ @@ -209,6 +208,14 @@ struct parport { spinlock_t pardevice_lock; spinlock_t waitlist_lock; rwlock_t cad_lock; + void * sysctl_table; +}; + +struct parport_driver { + const char *name; + void (*attach) (struct parport *); + void (*detach) (struct parport *); + struct parport_driver *next; }; /* parport_register_port registers a new parallel port at the given address (if @@ -219,21 +226,30 @@ struct parport { struct parport *parport_register_port(unsigned long base, int irq, int dma, struct parport_operations *ops); +/* Once a registered port is ready for high-level drivers to use, the + low-level driver that registered it should announce it. This will + call the high-level drivers' attach() functions (after things like + determining the IEEE 1284.3 topology of the port and collecting + DeviceIDs). */ +void parport_announce_port (struct parport *port); + /* Unregister a port. */ extern void parport_unregister_port(struct parport *port); /* parport_in_use returns nonzero if there are devices attached to a port. */ #define parport_in_use(x) ((x)->devices != NULL) -/* Put a parallel port to sleep; release its hardware resources. Only possible - * if no devices are registered. */ -extern void parport_quiesce(struct parport *); - /* parport_enumerate returns a pointer to the linked list of all the ports * in this machine. */ struct parport *parport_enumerate(void); +/* Register a new high-level driver. */ +extern int parport_register_driver (struct parport_driver *); + +/* Unregister a high-level driver. */ +extern void parport_unregister_driver (struct parport_driver *); + /* parport_register_device declares that a device is connected to a port, and * tells the kernel all it needs to know. * pf is the preemption function (may be NULL for no callback) @@ -318,19 +334,22 @@ extern __inline__ void parport_generic_irq(int irq, struct parport *port, #define PARPORT_DEV_LURK (1<<0) /* WARNING !! DEPRECATED !! */ #define PARPORT_DEV_EXCL (1<<1) /* Need exclusive access. */ -#define PARPORT_FLAG_COMA (1<<0) +#define PARPORT_FLAG_COMA_ (1<<0) /* No longer used. */ #define PARPORT_FLAG_EXCL (1<<1) /* EXCL driver registered. */ -extern void parport_parse_irqs(int, const char *[], int irqval[]); +extern int parport_parse_irqs(int, const char *[], int irqval[]); +extern int parport_parse_dmas(int, const char *[], int irqval[]); extern int parport_ieee1284_nibble_mode_ok(struct parport *, unsigned char); extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned char); /* Prototypes from parport_procfs */ -extern int parport_proc_init(void); -extern void parport_proc_cleanup(void); extern int parport_proc_register(struct parport *pp); extern int parport_proc_unregister(struct parport *pp); +extern int parport_device_proc_register(struct pardevice *device); +extern int parport_device_proc_unregister(struct pardevice *device); +extern int parport_default_proc_register(void); +extern int parport_default_proc_unregister(void); extern void dec_parport_count(void); extern void inc_parport_count(void); diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index a74c7a121..cf93bb008 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -5,14 +5,14 @@ /* --- register definitions ------------------------------- */ -#define ECONTROL 0x402 -#define CONFIGB 0x401 -#define CONFIGA 0x400 -#define EPPDATA 0x4 -#define EPPADDR 0x3 -#define CONTROL 0x2 -#define STATUS 0x1 -#define DATA 0 +#define ECONTROL(p) ((p)->base_hi + 0x02) +#define CONFIGB(p) ((p)->base_hi + 0x01) +#define CONFIGA(p) ((p)->base_hi + 0x00) +#define EPPDATA(p) ((p)->base + 0x04) +#define EPPADDR(p) ((p)->base + 0x03) +#define CONTROL(p) ((p)->base + 0x02) +#define STATUS(p) ((p)->base + 0x01) +#define DATA(p) ((p)->base + 0x00) /* Private data for PC low-level driver. */ struct parport_pc_private { @@ -26,27 +26,27 @@ extern volatile unsigned char parport_pc_ctr; extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d) { - outb(d, p->base+EPPDATA); + outb(d, EPPDATA(p)); } extern __inline__ unsigned char parport_pc_read_epp(struct parport *p) { - return inb(p->base+EPPDATA); + return inb(EPPDATA(p)); } extern __inline__ void parport_pc_write_epp_addr(struct parport *p, unsigned char d) { - outb(d, p->base+EPPADDR); + outb(d, EPPADDR(p)); } extern __inline__ unsigned char parport_pc_read_epp_addr(struct parport *p) { - return inb(p->base+EPPADDR); + return inb(EPPADDR(p)); } extern __inline__ int parport_pc_check_epp_timeout(struct parport *p) { - if (!(inb(p->base+STATUS) & 1)) + if (!(inb(STATUS(p)) & 1)) return 0; parport_pc_epp_clear_timeout(p); return 1; @@ -54,24 +54,24 @@ extern __inline__ int parport_pc_check_epp_timeout(struct parport *p) extern __inline__ unsigned char parport_pc_read_configb(struct parport *p) { - return inb(p->base+CONFIGB); + return inb(CONFIGB(p)); } extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) { - outb(d, p->base+DATA); + outb(d, DATA(p)); } extern __inline__ unsigned char parport_pc_read_data(struct parport *p) { - return inb(p->base+DATA); + return inb(DATA(p)); } extern __inline__ void parport_pc_write_control(struct parport *p, unsigned char d) { struct parport_pc_private *priv = p->private_data; priv->ctr = d;/* update soft copy */ - outb(d, p->base+CONTROL); + outb(d, CONTROL(p)); } extern __inline__ unsigned char parport_pc_read_control(struct parport *p) @@ -85,34 +85,34 @@ extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, unsig struct parport_pc_private *priv = p->private_data; unsigned char ctr = priv->ctr; ctr = (ctr & ~mask) ^ val; - outb (ctr, p->base+CONTROL); + outb (ctr, CONTROL(p)); return priv->ctr = ctr; /* update soft copy */ } extern __inline__ void parport_pc_write_status(struct parport *p, unsigned char d) { - outb(d, p->base+STATUS); + outb(d, STATUS(p)); } extern __inline__ unsigned char parport_pc_read_status(struct parport *p) { - return inb(p->base+STATUS); + return inb(STATUS(p)); } extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned char d) { - outb(d, p->base+ECONTROL); + outb(d, ECONTROL(p)); } extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p) { - return inb(p->base+ECONTROL); + return inb(ECONTROL(p)); } extern __inline__ unsigned char parport_pc_frob_econtrol(struct parport *p, unsigned char mask, unsigned char val) { - unsigned char old = inb(p->base+ECONTROL); - outb(((old & ~mask) ^ val), p->base+ECONTROL); + unsigned char old = inb(ECONTROL(p)); + outb(((old & ~mask) ^ val), ECONTROL(p)); return old; } diff --git a/include/linux/pc_keyb.h b/include/linux/pc_keyb.h index 29ccd3956..22e00989c 100644 --- a/include/linux/pc_keyb.h +++ b/include/linux/pc_keyb.h @@ -124,7 +124,7 @@ extern unsigned char aux_device_present; struct aux_queue { unsigned long head; unsigned long tail; - struct wait_queue *proc_list; + wait_queue_head_t proc_list; struct fasync_struct *fasync; unsigned char buf[AUX_BUF_SIZE]; }; diff --git a/include/linux/pci.h b/include/linux/pci.h index a4e4b9dfe..bd7f320e3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -273,6 +273,8 @@ #define PCI_CLASS_SERIAL_USB 0x0c03 #define PCI_CLASS_SERIAL_FIBER 0x0c04 +#define PCI_CLASS_HOT_SWAP_CONTROLLER 0xff00 + #define PCI_CLASS_OTHERS 0xff /* @@ -365,6 +367,7 @@ #define PCI_DEVICE_ID_DEC_21150 0x0022 #define PCI_DEVICE_ID_DEC_21152 0x0024 #define PCI_DEVICE_ID_DEC_21153 0x0025 +#define PCI_DEVICE_ID_DEC_21154 0x0026 #define PCI_VENDOR_ID_CIRRUS 0x1013 #define PCI_DEVICE_ID_CIRRUS_7548 0x0038 @@ -510,12 +513,16 @@ #define PCI_DEVICE_ID_WINBOND2_89C940 0x0940 #define PCI_VENDOR_ID_MOTOROLA 0x1057 +#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507 #define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 #define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 #define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 +#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802 +#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806 #define PCI_VENDOR_ID_PROMISE 0x105a #define PCI_DEVICE_ID_PROMISE_20246 0x4d33 +#define PCI_DEVICE_ID_PROMISE_20262 0x4d38 #define PCI_DEVICE_ID_PROMISE_5300 0x5300 #define PCI_VENDOR_ID_N9 0x105d @@ -659,11 +666,14 @@ #define PCI_DEVICE_ID_AL_M1523 0x1523 #define PCI_DEVICE_ID_AL_M1531 0x1531 #define PCI_DEVICE_ID_AL_M1533 0x1533 +#define PCI_DEVICE_ID_AL_M1541 0x1541 +#define PCI_DEVICE_ID_AL_M1543 0x1543 #define PCI_DEVICE_ID_AL_M3307 0x3307 #define PCI_DEVICE_ID_AL_M4803 0x5215 #define PCI_DEVICE_ID_AL_M5219 0x5219 #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_M7101 0x7101 #define PCI_VENDOR_ID_MITSUBISHI 0x10ba @@ -1064,9 +1074,11 @@ #define PCI_VENDOR_ID_ADAPTEC 0x9004 #define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 +#define PCI_DEVICE_ID_ADAPTEC_7821 0x2178 #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 #define PCI_DEVICE_ID_ADAPTEC_5800 0x5800 +#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038 #define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075 #define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 #define PCI_DEVICE_ID_ADAPTEC_7861 0x6178 @@ -1081,15 +1093,28 @@ #define PCI_DEVICE_ID_ADAPTEC_7882 0x8278 #define PCI_DEVICE_ID_ADAPTEC_7883 0x8378 #define PCI_DEVICE_ID_ADAPTEC_7884 0x8478 +#define PCI_DEVICE_ID_ADAPTEC_7885 0x8578 +#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678 +#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778 +#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878 #define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78 #define PCI_VENDOR_ID_ADAPTEC2 0x9005 #define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010 -#define PCI_DEVICE_ID_ADAPTEC2_78902 0x0013 +#define PCI_DEVICE_ID_ADAPTEC2_2930U2 0x0011 +#define PCI_DEVICE_ID_ADAPTEC2_7890B 0x0013 #define PCI_DEVICE_ID_ADAPTEC2_7890 0x001f #define PCI_DEVICE_ID_ADAPTEC2_3940U2 0x0050 #define PCI_DEVICE_ID_ADAPTEC2_3950U2D 0x0051 #define PCI_DEVICE_ID_ADAPTEC2_7896 0x005f +#define PCI_DEVICE_ID_ADAPTEC2_7892A 0x0080 +#define PCI_DEVICE_ID_ADAPTEC2_7892B 0x0081 +#define PCI_DEVICE_ID_ADAPTEC2_7892D 0x0083 +#define PCI_DEVICE_ID_ADAPTEC2_7892P 0x008f +#define PCI_DEVICE_ID_ADAPTEC2_7899A 0x00c0 +#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1 +#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3 +#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf #define PCI_VENDOR_ID_ATRONICS 0x907f #define PCI_DEVICE_ID_ATRONICS_2015 0x2015 diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 3a847d72c..7d44e8293 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -2,7 +2,7 @@ #define _LINUX_PIPE_FS_I_H struct pipe_inode_info { - struct wait_queue * wait; + wait_queue_head_t wait; char * base; unsigned int start; unsigned int lock; diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 4ec170dbd..4f804d15f 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h @@ -38,6 +38,9 @@ struct tc_stats __u32 pps; /* Current flow packet rate */ __u32 qlen; __u32 backlog; +#ifdef __KERNEL__ + spinlock_t *lock; +#endif }; struct tc_estimator diff --git a/include/linux/poll.h b/include/linux/poll.h index 7eb57334f..b56cdcf4c 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -13,8 +13,8 @@ struct poll_table_entry { struct file * filp; - struct wait_queue wait; - struct wait_queue ** wait_address; + wait_queue_t wait; + wait_queue_head_t * wait_address; }; typedef struct poll_table_struct { @@ -25,9 +25,9 @@ typedef struct poll_table_struct { #define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (poll_table)) / sizeof (struct poll_table_entry)) -extern void __pollwait(struct file * filp, struct wait_queue ** wait_address, poll_table *p); +extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p); -extern inline void poll_wait(struct file * filp, struct wait_queue ** wait_address, poll_table *p) +extern inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) { if (p && wait_address) __pollwait(filp, wait_address, p); diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 1de3fe2ec..e9a284573 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -52,7 +52,8 @@ enum root_directory_inos { PROC_STRAM, PROC_SOUND, PROC_MTRR, /* whether enabled or not */ - PROC_FS + PROC_FS, + PROC_SYSVIPC }; enum pid_directory_inos { @@ -135,11 +136,11 @@ enum net_directory_inos { PROC_NET_TR_RIF, PROC_NET_DN_DEV, PROC_NET_DN_ADJ, - PROC_NET_DN_L1, - PROC_NET_DN_L2, + PROC_NET_DN_ROUTE, PROC_NET_DN_CACHE, PROC_NET_DN_SKT, - PROC_NET_DN_FW, + PROC_NET_DN_FW_CHAINS, + PROC_NET_DN_FW_CHAIN_NAMES, PROC_NET_DN_RAW, PROC_NET_NETSTAT, PROC_NET_IPFW_CHAINS, @@ -205,8 +206,10 @@ enum scsi_directory_inos { PROC_SCSI_53C94, PROC_SCSI_PLUTO, PROC_SCSI_INI9100U, - PROC_SCSI_INIA100, + PROC_SCSI_INIA100, PROC_SCSI_FCAL, + PROC_SCSI_I2O, + PROC_SCSI_USB_SCSI, PROC_SCSI_SCSI_DEBUG, PROC_SCSI_NOT_PRESENT, PROC_SCSI_FILE, /* I'm assuming here that we */ @@ -243,6 +246,12 @@ enum fs_coda_directory_inos { PROC_CODA_FS_LAST }; +enum sysvipc_directory_inos { + PROC_SYSVIPC_SHM = PROC_CODA_FS_LAST, + PROC_SYSVIPC_SEM, + PROC_SYSVIPC_MSG +}; + /* Finally, the dynamically allocatable proc entries are reserved: */ #define PROC_DYNAMIC_FIRST 4096 @@ -313,6 +322,7 @@ extern struct proc_dir_entry proc_pid; extern struct proc_dir_entry proc_pid_fd; extern struct proc_dir_entry proc_mca; extern struct proc_dir_entry *proc_bus; +extern struct proc_dir_entry *proc_sysvipc; extern struct inode_operations proc_scsi_inode_operations; @@ -422,6 +432,7 @@ extern struct inode_operations proc_ringbuf_inode_operations; #endif extern struct inode_operations proc_omirr_inode_operations; extern struct inode_operations proc_ppc_htab_inode_operations; +extern struct inode_operations proc_sysvipc_inode_operations; /* * generic.c diff --git a/include/linux/quota.h b/include/linux/quota.h index 2c4a5bcef..a3e76e138 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -170,7 +170,7 @@ struct dquot { struct list_head dq_free; /* free list element */ struct dquot *dq_hash_next; /* Pointer to next in dquot_hash */ struct dquot **dq_hash_pprev; /* Pointer to previous in dquot_hash */ - struct wait_queue *dq_wait; /* Pointer to waitqueue */ + wait_queue_head_t dq_wait; /* Pointer to waitqueue */ int dq_count; /* Reference count */ /* fields after this point are cleared when invalidating */ diff --git a/include/linux/raid5.h b/include/linux/raid5.h index 5efd211a2..655d41d54 100644 --- a/include/linux/raid5.h +++ b/include/linux/raid5.h @@ -35,7 +35,7 @@ struct stripe_head { int count; /* nr of waiters */ int write_method; /* reconstruct-write / read-modify-write */ int phase; /* PHASE_BEGIN, ..., PHASE_COMPLETE */ - struct wait_queue *wait; /* processes waiting for this stripe */ + wait_queue_head_t wait; /* processes waiting for this stripe */ }; /* @@ -94,7 +94,7 @@ struct raid5_data { */ int nr_free_sh; struct stripe_head *free_sh_list; - struct wait_queue *wait_for_stripe; + wait_queue_head_t wait_for_stripe; }; #endif diff --git a/include/linux/rpcsock.h b/include/linux/rpcsock.h index 80f1fc4c6..2039f4824 100644 --- a/include/linux/rpcsock.h +++ b/include/linux/rpcsock.h @@ -77,7 +77,7 @@ struct rpc_wait { struct rpc_wait * w_next; struct rpc_ioreq * w_req; int w_result; - struct wait_queue * w_wait; + wait_queue_head_t w_wait; rpc_callback_fn_t w_handler; void * w_cdata; char w_queued; @@ -94,8 +94,8 @@ struct rpc_sock { unsigned long cwnd; struct rpc_wait * pending; struct rpc_wait * free; - struct wait_queue * backlog; - struct wait_queue * shutwait; + wait_queue_head_t backlog; + wait_queue_head_t shutwait; int shutdown; }; diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index b339f6528..fdbdedfe2 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -418,7 +418,9 @@ enum IFLA_MTU, IFLA_LINK, IFLA_QDISC, - IFLA_STATS + IFLA_STATS, + IFLA_COST, + IFLA_PRIORITY }; @@ -506,13 +508,13 @@ enum #define RTMGRP_IPV6_MROUTE 0x200 #define RTMGRP_IPV6_ROUTE 0x400 +#define RTMGRP_DECnet_IFADDR 0x1000 +#define RTMGRP_DECnet_ROUTE 0x4000 + /* End of information exported to user level */ #ifdef __KERNEL__ -extern atomic_t rtnl_rlockct; -extern struct wait_queue *rtnl_wait; - extern __inline__ int rtattr_strcmp(struct rtattr *rta, char *str) { int len = strlen(str) + 1; @@ -539,128 +541,32 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi #define RTA_PUT(skb, attrtype, attrlen, data) \ ({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) - -extern unsigned long rtnl_wlockct; - -/* NOTE: these locks are not interrupt safe, are not SMP safe, - * they are even not atomic. 8)8)8) ... and it is not a bug. - * Really, if these locks will be programmed correctly, - * all the addressing/routing machine would become SMP safe, - * but is absolutely useless at the moment, because all the kernel - * is not reenterable in any case. --ANK - * - * Well, atomic_* and set_bit provide the only thing here: - * gcc is confused not to overoptimize them, that's all. - * I remember as gcc splitted ++ operation, but cannot reproduce - * it with gcc-2.7.*. --ANK - * - * One more note: rwlock facility should be written and put - * to a kernel wide location: f.e. current implementation of semaphores - * (especially, for x86) looks like a wonder. It would be good - * to have something similar for rwlock. Recursive lock could be also - * useful thing. --ANK - */ - -extern __inline__ int rtnl_shlock_nowait(void) -{ - atomic_inc(&rtnl_rlockct); - if (test_bit(0, &rtnl_wlockct)) { - atomic_dec(&rtnl_rlockct); - return -EAGAIN; - } - return 0; -} - -extern __inline__ void rtnl_shlock(void) -{ - while (rtnl_shlock_nowait()) - sleep_on(&rtnl_wait); -} - -/* Check for possibility to PROMOTE shared lock to exclusive. - Shared lock must be already grabbed with rtnl_shlock*(). - */ - -extern __inline__ int rtnl_exlock_nowait(void) -{ - if (atomic_read(&rtnl_rlockct) > 1) - return -EAGAIN; - if (test_and_set_bit(0, &rtnl_wlockct)) - return -EAGAIN; - return 0; -} - -extern __inline__ void rtnl_exlock(void) -{ - while (rtnl_exlock_nowait()) - sleep_on(&rtnl_wait); -} - -#if 0 -extern __inline__ void rtnl_shunlock(void) -{ - atomic_dec(&rtnl_rlockct); - if (atomic_read(&rtnl_rlockct) <= 1) { - wake_up(&rtnl_wait); - if (rtnl && rtnl->receive_queue.qlen) - rtnl->data_ready(rtnl, 0); - } -} -#else - -/* The problem: inline requires to include <net/sock.h> and, hence, - almost all of net includes :-( - */ - -#define rtnl_shunlock() ({ \ - atomic_dec(&rtnl_rlockct); \ - if (atomic_read(&rtnl_rlockct) <= 1) { \ - wake_up(&rtnl_wait); \ - if (rtnl && rtnl->receive_queue.qlen) \ - rtnl->data_ready(rtnl, 0); \ - } \ -}) #endif -/* Release exclusive lock. Note, that we do not wake up rtnetlink socket, - * it will be done later after releasing shared lock. - */ - -extern __inline__ void rtnl_exunlock(void) -{ - clear_bit(0, &rtnl_wlockct); - wake_up(&rtnl_wait); -} +extern struct semaphore rtnl_sem; -#else +#define rtnl_exlock() do { } while(0) +#define rtnl_exunlock() do { } while(0) +#define rtnl_exlock_nowait() (0) -extern __inline__ void rtnl_shlock(void) -{ - while (atomic_read(&rtnl_rlockct)) - sleep_on(&rtnl_wait); - atomic_inc(&rtnl_rlockct); -} - -extern __inline__ void rtnl_shunlock(void) -{ - if (atomic_dec_and_test(&rtnl_rlockct)) - wake_up(&rtnl_wait); -} - -extern __inline__ void rtnl_exlock(void) -{ -} - -extern __inline__ void rtnl_exunlock(void) -{ -} +#define rtnl_shlock() down(&rtnl_sem) +#define rtnl_shlock_nowait() down_trylock(&rtnl_sem) +#ifndef CONFIG_RTNETLINK +#define rtnl_shunlock() up(&rtnl_sem) +#else +#define rtnl_shunlock() do { up(&rtnl_sem); \ + if (rtnl && rtnl->receive_queue.qlen) \ + rtnl->data_ready(rtnl, 0); \ + } while(0) #endif extern void rtnl_lock(void); extern void rtnl_unlock(void); extern void rtnetlink_init(void); + + #endif /* __KERNEL__ */ diff --git a/include/linux/sched.h b/include/linux/sched.h index e0066b3f6..bfa9e633e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -16,6 +16,7 @@ extern unsigned long event; #include <asm/system.h> #include <asm/semaphore.h> #include <asm/page.h> +#include <asm/ptrace.h> #include <linux/smp.h> #include <linux/tty.h> @@ -79,6 +80,7 @@ extern int last_pid; #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 #define TASK_SWAPPING 16 +#define TASK_EXCLUSIVE 32 /* * Scheduling policies @@ -161,9 +163,9 @@ struct fs_struct { #define AVL_MIN_MAP_COUNT 32 struct mm_struct { - struct vm_area_struct *mmap; /* list of VMAs */ - struct vm_area_struct *mmap_avl; /* tree of VMAs */ - struct vm_area_struct *mmap_cache; /* last find_vma result */ + struct vm_area_struct * mmap; /* list of VMAs */ + struct vm_area_struct * mmap_avl; /* tree of VMAs */ + struct vm_area_struct * mmap_cache; /* last find_vma result */ pgd_t * pgd; atomic_t count; int map_count; /* number of VMAs */ @@ -184,11 +186,11 @@ struct mm_struct { void * segments; }; -#define INIT_MM { \ +#define INIT_MM(name) { \ &init_mmap, NULL, NULL, \ swapper_pg_dir, \ ATOMIC_INIT(1), 1, \ - MUTEX, \ + __MUTEX_INITIALIZER(name.mmap_sem), \ 0, \ 0, 0, 0, 0, \ 0, 0, 0, \ @@ -267,7 +269,7 @@ struct task_struct { /* Pointer to task[] array linkage. */ struct task_struct **tarray_ptr; - struct wait_queue *wait_chldexit; /* for wait4() */ + wait_queue_head_t wait_chldexit; /* for wait4() */ struct semaphore *vfork_sem; /* for vfork() */ unsigned long policy, rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; @@ -345,7 +347,7 @@ struct task_struct { * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ -#define INIT_TASK \ +#define INIT_TASK(name) \ /* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0, \ /* counter */ DEF_PRIORITY,DEF_PRIORITY,0, \ /* SMP */ 0,0,0,-1, \ @@ -356,7 +358,7 @@ struct task_struct { /* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \ /* pidhash */ NULL, NULL, \ /* tarray */ &task[0], \ -/* chld wait */ NULL, NULL, \ +/* chld wait */ __WAIT_QUEUE_HEAD_INITIALIZER(name.wait_chldexit), NULL, \ /* timeout */ SCHED_OTHER,0,0,0,0,0,0,0, \ /* timer */ { NULL, NULL, 0, 0, it_real_fn }, \ /* utime */ {0,0,0,0},0, \ @@ -380,9 +382,13 @@ struct task_struct { /* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ } +#ifndef INIT_TASK_SIZE +# define INIT_TASK_SIZE 2048*sizeof(long) +#endif + union task_union { struct task_struct task; - unsigned long stack[2048]; + unsigned long stack[INIT_TASK_SIZE/sizeof(long)]; }; extern union task_union init_task_union; @@ -447,8 +453,8 @@ extern __inline__ struct task_struct *find_task_by_pid(int pid) } /* per-UID process charging. */ -extern int alloc_uid(struct task_struct *p); -void free_uid(struct task_struct *p); +extern int alloc_uid(struct task_struct *); +void free_uid(struct task_struct *); #include <asm/current.h> @@ -464,39 +470,39 @@ extern unsigned long prof_shift; #define CURRENT_TIME (xtime.tv_sec) -extern void FASTCALL(__wake_up(struct wait_queue ** p, unsigned int mode)); -extern void FASTCALL(sleep_on(struct wait_queue ** p)); -extern long FASTCALL(sleep_on_timeout(struct wait_queue ** p, +extern void FASTCALL(__wake_up(wait_queue_head_t *q, unsigned int mode)); +extern void FASTCALL(sleep_on(wait_queue_head_t *q)); +extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); -extern void FASTCALL(interruptible_sleep_on(struct wait_queue ** p)); -extern long FASTCALL(interruptible_sleep_on_timeout(struct wait_queue ** p, +extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); +extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); extern void FASTCALL(wake_up_process(struct task_struct * tsk)); #define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE) #define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE) +extern int in_group_p(gid_t); + extern void release(struct task_struct * p); -extern int in_group_p(gid_t grp); extern void flush_signals(struct task_struct *); extern void flush_signal_handlers(struct task_struct *); -extern int dequeue_signal(sigset_t *block, siginfo_t *); -extern int send_sig_info(int, struct siginfo *info, struct task_struct *); -extern int force_sig_info(int, struct siginfo *info, struct task_struct *); -extern int kill_pg_info(int, struct siginfo *info, pid_t); -extern int kill_sl_info(int, struct siginfo *info, pid_t); -extern int kill_proc_info(int, struct siginfo *info, pid_t); -extern int kill_something_info(int, struct siginfo *info, int); -extern void notify_parent(struct task_struct * tsk, int); -extern void force_sig(int sig, struct task_struct * p); -extern int send_sig(int sig, struct task_struct * p, int priv); +extern int dequeue_signal(sigset_t *, siginfo_t *); +extern int send_sig_info(int, struct siginfo *, struct task_struct *); +extern int force_sig_info(int, struct siginfo *, struct task_struct *); +extern int kill_pg_info(int, struct siginfo *, pid_t); +extern int kill_sl_info(int, struct siginfo *, pid_t); +extern int kill_proc_info(int, struct siginfo *, pid_t); +extern int kill_something_info(int, struct siginfo *, int); +extern void notify_parent(struct task_struct *, int); +extern void force_sig(int, struct task_struct *); +extern int send_sig(int, struct task_struct *, int); extern int kill_pg(pid_t, int, int); extern int kill_sl(pid_t, int, int); extern int kill_proc(pid_t, int, int); -extern int do_sigaction(int sig, const struct k_sigaction *act, - struct k_sigaction *oact); -extern int do_sigaltstack(const stack_t *ss, stack_t *oss, unsigned long sp); +extern int do_sigaction(int, const struct k_sigaction *, struct k_sigaction *); +extern int do_sigaltstack(const stack_t *, stack_t *, unsigned long); extern inline int signal_pending(struct task_struct *p) { @@ -538,8 +544,7 @@ static inline void recalc_sigpending(struct task_struct *t) static inline int on_sig_stack(unsigned long sp) { - return (sp >= current->sas_ss_sp - && sp < current->sas_ss_sp + current->sas_ss_size); + return (sp - current->sas_ss_sp < current->sas_ss_size); } static inline int sas_ss_flags(unsigned long sp) @@ -548,12 +553,10 @@ static inline int sas_ss_flags(unsigned long sp) : on_sig_stack(sp) ? SS_ONSTACK : 0); } -extern int request_irq(unsigned int irq, +extern int request_irq(unsigned int, void (*handler)(int, void *, struct pt_regs *), - unsigned long flags, - const char *device, - void *dev_id); -extern void free_irq(unsigned int irq, void *dev_id); + unsigned long, const char *, void *); +extern void free_irq(unsigned int, void *); /* * This has now become a routine instead of a macro, it sets a flag if @@ -631,54 +634,39 @@ extern void exit_sighand(struct task_struct *); extern int do_execve(char *, char **, char **, struct pt_regs *); extern int do_fork(unsigned long, unsigned long, struct pt_regs *); -/* - * The wait-queues are circular lists, and you have to be *very* sure - * to keep them correct. Use only these two functions to add/remove - * entries in the queues. - */ -extern inline void __add_wait_queue(struct wait_queue ** p, struct wait_queue * wait) -{ - wait->next = *p ? : WAIT_QUEUE_HEAD(p); - *p = wait; -} - -extern rwlock_t waitqueue_lock; - -extern inline void add_wait_queue(struct wait_queue ** p, struct wait_queue * wait) +extern inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; - write_lock_irqsave(&waitqueue_lock, flags); - __add_wait_queue(p, wait); - write_unlock_irqrestore(&waitqueue_lock, flags); + wq_write_lock_irqsave(&q->lock, flags); + __add_wait_queue(q, wait); + wq_write_unlock_irqrestore(&q->lock, flags); } -extern inline void __remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait) +extern inline void add_wait_queue_exclusive(wait_queue_head_t *q, + wait_queue_t * wait) { - struct wait_queue * next = wait->next; - struct wait_queue * head = next; - struct wait_queue * tmp; + unsigned long flags; - while ((tmp = head->next) != wait) { - head = tmp; - } - head->next = next; + wq_write_lock_irqsave(&q->lock, flags); + __add_wait_queue_tail(q, wait); + wq_write_unlock_irqrestore(&q->lock, flags); } -extern inline void remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait) +extern inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait) { unsigned long flags; - write_lock_irqsave(&waitqueue_lock, flags); - __remove_wait_queue(p, wait); - write_unlock_irqrestore(&waitqueue_lock, flags); + wq_write_lock_irqsave(&q->lock, flags); + __remove_wait_queue(q, wait); + wq_write_unlock_irqrestore(&q->lock, flags); } #define __wait_event(wq, condition) \ do { \ - struct wait_queue __wait; \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ \ - __wait.task = current; \ add_wait_queue(&wq, &__wait); \ for (;;) { \ current->state = TASK_UNINTERRUPTIBLE; \ @@ -699,9 +687,9 @@ do { \ #define __wait_event_interruptible(wq, condition, ret) \ do { \ - struct wait_queue __wait; \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ \ - __wait.task = current; \ add_wait_queue(&wq, &__wait); \ for (;;) { \ current->state = TASK_INTERRUPTIBLE; \ diff --git a/include/linux/sem.h b/include/linux/sem.h index 3fb2a48f6..3896d7535 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -85,7 +85,7 @@ struct sem { struct sem_queue { struct sem_queue * next; /* next entry in the queue */ struct sem_queue ** prev; /* previous entry in the queue, *(q->prev) == q */ - struct wait_queue * sleeper; /* sleeping process */ + wait_queue_head_t sleeper; /* sleeping process */ struct sem_undo * undo; /* undo structure */ int pid; /* process id of requesting process */ int status; /* completion status of operation */ diff --git a/include/linux/serial167.h b/include/linux/serial167.h index 9f01f3618..8886c292f 100644 --- a/include/linux/serial167.h +++ b/include/linux/serial167.h @@ -54,8 +54,8 @@ struct cyclades_port { struct tq_struct tqueue; struct termios normal_termios; struct termios callout_termios; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct cyclades_monitor mon; }; diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 6bf0746ee..28e66f9e4 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -80,9 +80,9 @@ struct async_struct { int xmit_tail; int xmit_cnt; struct tq_struct tqueue; - struct wait_queue *open_wait; - struct wait_queue *close_wait; - struct wait_queue *delta_msr_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; + wait_queue_head_t delta_msr_wait; struct async_struct *next_port; /* For the linked list */ struct async_struct *prev_port; }; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2089a9710..d499875de 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -15,6 +15,8 @@ #define _LINUX_SKBUFF_H #include <linux/config.h> +#include <linux/kernel.h> +#include <linux/sched.h> #include <linux/time.h> #include <asm/atomic.h> @@ -30,15 +32,19 @@ #define CHECKSUM_UNNECESSARY 2 struct sk_buff_head { + /* These two members must be first. */ struct sk_buff * next; struct sk_buff * prev; - __u32 qlen; /* Must be same length as a pointer - for using debugging */ + + __u32 qlen; + spinlock_t lock; }; struct sk_buff { + /* These two members must be first. */ struct sk_buff * next; /* Next buffer in list */ struct sk_buff * prev; /* Previous buffer in list */ + struct sk_buff_head * list; /* List we are on */ struct sock *sk; /* Socket we are owned by */ struct timeval stamp; /* Time we arrived */ @@ -245,6 +251,7 @@ extern __inline__ __u32 skb_queue_len(struct sk_buff_head *list_) extern __inline__ void skb_queue_head_init(struct sk_buff_head *list) { + spin_lock_init(&list->lock); list->prev = (struct sk_buff *)list; list->next = (struct sk_buff *)list; list->qlen = 0; @@ -271,15 +278,13 @@ extern __inline__ void __skb_queue_head(struct sk_buff_head *list, struct sk_buf prev->next = newsk; } -extern spinlock_t skb_queue_lock; - extern __inline__ void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk) { unsigned long flags; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&list->lock, flags); __skb_queue_head(list, newsk); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&list->lock, flags); } /* @@ -304,9 +309,9 @@ extern __inline__ void skb_queue_tail(struct sk_buff_head *list, struct sk_buff { unsigned long flags; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&list->lock, flags); __skb_queue_tail(list, newsk); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&list->lock, flags); } /* @@ -338,9 +343,9 @@ extern __inline__ struct sk_buff *skb_dequeue(struct sk_buff_head *list) long flags; struct sk_buff *result; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&list->lock, flags); result = __skb_dequeue(list); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&list->lock, flags); return result; } @@ -367,9 +372,9 @@ extern __inline__ void skb_insert(struct sk_buff *old, struct sk_buff *newsk) { unsigned long flags; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&old->list->lock, flags); __skb_insert(newsk, old->prev, old, old->list); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&old->list->lock, flags); } /* @@ -385,9 +390,9 @@ extern __inline__ void skb_append(struct sk_buff *old, struct sk_buff *newsk) { unsigned long flags; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&old->list->lock, flags); __skb_append(old, newsk); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&old->list->lock, flags); } /* @@ -417,12 +422,16 @@ extern __inline__ void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *li extern __inline__ void skb_unlink(struct sk_buff *skb) { - unsigned long flags; + struct sk_buff_head *list = skb->list; + + if(list) { + unsigned long flags; - spin_lock_irqsave(&skb_queue_lock, flags); - if(skb->list) - __skb_unlink(skb, skb->list); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_lock_irqsave(&list->lock, flags); + if(skb->list == list) + __skb_unlink(skb, skb->list); + spin_unlock_irqrestore(&list->lock, flags); + } } /* XXX: more streamlined implementation */ @@ -439,9 +448,9 @@ extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list) long flags; struct sk_buff *result; - spin_lock_irqsave(&skb_queue_lock, flags); + spin_lock_irqsave(&list->lock, flags); result = __skb_dequeue_tail(list); - spin_unlock_irqrestore(&skb_queue_lock, flags); + spin_unlock_irqrestore(&list->lock, flags); return result; } @@ -449,29 +458,38 @@ extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list) * Add data to an sk_buff */ +extern __inline__ unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) +{ + unsigned char *tmp=skb->tail; + skb->tail+=len; + skb->len+=len; + return tmp; +} + extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len) { unsigned char *tmp=skb->tail; skb->tail+=len; skb->len+=len; - if(skb->tail>skb->end) - { - __label__ here; - skb_over_panic(skb, len, &&here); -here: ; + if(skb->tail>skb->end) { + skb_over_panic(skb, len, current_text_addr()); } return tmp; } +extern __inline__ unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) +{ + skb->data-=len; + skb->len+=len; + return skb->data; +} + extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int len) { skb->data-=len; skb->len+=len; - if(skb->data<skb->head) - { - __label__ here; - skb_under_panic(skb, len, &&here); -here: ; + if(skb->data<skb->head) { + skb_under_panic(skb, len, current_text_addr()); } return skb->data; } diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h index cedbb5ab8..31052af1f 100644 --- a/include/linux/smb_fs_sb.h +++ b/include/linux/smb_fs_sb.h @@ -34,7 +34,7 @@ struct smb_sb_info { struct smb_conn_opt opt; struct semaphore sem; - struct wait_queue * wait; + wait_queue_head_t wait; __u32 packet_size; unsigned char * packet; diff --git a/include/linux/smp.h b/include/linux/smp.h index 75c34e87f..eae129070 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -3,7 +3,7 @@ /* * Generic SMP support - * Alan Cox. <alan@cymru.net> + * Alan Cox. <alan@redhat.com> */ #ifdef __SMP__ diff --git a/include/linux/stallion.h b/include/linux/stallion.h index 35274488d..94f5a1734 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h @@ -95,8 +95,8 @@ typedef struct stlport { unsigned long hwid; void *uartp; struct tty_struct *tty; - struct wait_queue *open_wait; - struct wait_queue *close_wait; + wait_queue_head_t open_wait; + wait_queue_head_t close_wait; struct termios normaltermios; struct termios callouttermios; struct tq_struct tqueue; diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8ec30527f..d43dfaf0c 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -12,6 +12,7 @@ #include <linux/timer.h> #include <linux/tqueue.h> #include <linux/sunrpc/types.h> +#include <linux/wait.h> /* * Define this if you want to test the fast scheduler for async calls. @@ -63,7 +64,7 @@ struct rpc_task { * you have a pathological interest in kernel oopses. */ struct timer_list tk_timer; /* kernel timer */ - struct wait_queue * tk_wait; /* sync: sleep on this q */ + wait_queue_head_t tk_wait; /* sync: sleep on this q */ unsigned long tk_timeout; /* timeout for rpc_sleep() */ unsigned short tk_flags; /* misc flags */ #ifdef RPC_DEBUG diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 4ab59ed1c..db1cb7c41 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -116,7 +116,7 @@ struct svc_rqst { struct svc_client * rq_client; /* RPC peer info */ struct svc_cacherep * rq_cacherep; /* cache info */ - struct wait_queue * rq_wait; /* synchronozation */ + wait_queue_head_t rq_wait; /* synchronozation */ }; /* diff --git a/include/linux/swap.h b/include/linux/swap.h index 66ba5d623..bc9fb4e48 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -113,6 +113,7 @@ extern void free_page_and_swap_cache(unsigned long addr); /* linux/mm/swapfile.c */ extern unsigned int nr_swapfiles; extern struct swap_info_struct swap_info[]; +extern int is_swap_partition(kdev_t); void si_swapinfo(struct sysinfo *); unsigned long get_swap_page(void); extern void FASTCALL(swap_free(unsigned long)); diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index db74f03be..b5b46b7f1 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -392,14 +392,42 @@ enum NET_TR_RIF_TIMEOUT=1 }; -/* /proc/sys/net/decnet */ +/* /proc/sys/net/decnet/ */ enum { - NET_DECNET_DEF_T3_BROADCAST=1, - NET_DECNET_DEF_T3_POINTTOPOINT=2, - NET_DECNET_DEF_T1=3, - NET_DECNET_DEF_BCT1=4, - NET_DECNET_CACHETIMEOUT=5, - NET_DECNET_DEBUG_LEVEL=6 + NET_DECNET_NODE_TYPE = 1, + NET_DECNET_NODE_ADDRESS = 2, + NET_DECNET_NODE_NAME = 3, + NET_DECNET_DEFAULT_DEVICE = 4, + NET_DECNET_TIME_WAIT = 5, + NET_DECNET_DN_COUNT = 6, + NET_DECNET_DI_COUNT = 7, + NET_DECNET_DR_COUNT = 8, + NET_DECNET_DST_GC_INTERVAL = 9, + NET_DECNET_CONF = 10, + NET_DECNET_DEBUG_LEVEL = 255 +}; + +/* /proc/sys/net/decnet/conf/<dev> */ +enum { + NET_DECNET_CONF_LOOPBACK = -2, + NET_DECNET_CONF_DDCMP = -3, + NET_DECNET_CONF_PPP = -4, + NET_DECNET_CONF_X25 = -5, + NET_DECNET_CONF_GRE = -6, + NET_DECNET_CONF_ETHER = -7 + + /* ... and ifindex of devices */ +}; + +/* /proc/sys/net/decnet/conf/<dev>/ */ +enum { + NET_DECNET_CONF_DEV_PRIORITY = 1, + NET_DECNET_CONF_DEV_T1 = 2, + NET_DECNET_CONF_DEV_T2 = 3, + NET_DECNET_CONF_DEV_T3 = 4, + NET_DECNET_CONF_DEV_COST = 5, + NET_DECNET_CONF_DEV_BLKSIZE = 6, + NET_DECNET_CONF_DEV_STATE = 7 }; /* CTL_PROC names: */ @@ -424,7 +452,8 @@ enum /* CTL_DEV names: */ enum { DEV_CDROM=1, - DEV_HWMON=2 + DEV_HWMON=2, + DEV_PARPORT=3 }; /* /proc/sys/dev/cdrom */ @@ -432,6 +461,35 @@ enum { DEV_CDROM_INFO=1 }; +/* /proc/sys/dev/parport */ +enum { + DEV_PARPORT_DEFAULT=-3 +}; + +/* /proc/sys/dev/parport/default */ +enum { + DEV_PARPORT_DEFAULT_TIMESLICE=1, + DEV_PARPORT_DEFAULT_SPINTIME=2 +}; + +/* /proc/sys/dev/parport/parport n */ +enum { + DEV_PARPORT_SPINTIME=1, + DEV_PARPORT_HARDWARE=2, + DEV_PARPORT_DEVICES=3, + DEV_PARPORT_AUTOPROBE=16 +}; + +/* /proc/sys/dev/parport/parport n/devices/ */ +enum { + DEV_PARPORT_DEVICES_ACTIVE=-3, +}; + +/* /proc/sys/dev/parport/parport n/devices/device n */ +enum { + DEV_PARPORT_DEVICE_TIMESLICE=1, +}; + #ifdef __KERNEL__ extern asmlinkage int sys_sysctl(struct __sysctl_args *); diff --git a/include/linux/tty.h b/include/linux/tty.h index 854cbd1a8..58fb7abfa 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -277,8 +277,8 @@ struct tty_struct { struct tty_flip_buffer flip; int max_flip_cnt; int alt_speed; /* For magic substitution of 38400 bps */ - struct wait_queue *write_wait; - struct wait_queue *read_wait; + wait_queue_head_t write_wait; + wait_queue_head_t read_wait; struct tq_struct tq_hangup; void *disc_data; void *driver_data; diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h index 111fd9137..e3af5e921 100644 --- a/include/linux/umsdos_fs_i.h +++ b/include/linux/umsdos_fs_i.h @@ -47,7 +47,7 @@ */ struct dir_locking_info { - struct wait_queue *p; + wait_queue_head_t p; short int looking; /* How many process doing a lookup */ short int creating; /* Is there any creation going on here * Only one at a time, although one diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 119b60eec..52c1e0f31 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -278,6 +278,7 @@ struct video_unit #define VID_HARDWARE_TYPHOON 19 #define VID_HARDWARE_VINO 20 /* Reserved for SGI Indy Vino */ #define VID_HARDWARE_CADET 21 /* Cadet radio */ +#define VID_HARDWARE_CPIA 22 /* * Initialiser list diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index e1b727680..66451acdb 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -27,7 +27,7 @@ extern struct vt_struct { struct vt_mode vt_mode; int vt_pid; int vt_newvt; - struct wait_queue *paste_wait; + wait_queue_head_t paste_wait; } *vt_cons[MAX_NR_CONSOLES]; void (*kd_mksound)(unsigned int hz, unsigned int ticks); diff --git a/include/linux/wait.h b/include/linux/wait.h index 6514693c2..79fae9356 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -8,24 +8,193 @@ #ifdef __KERNEL__ +#include <linux/kernel.h> +#include <linux/list.h> +#include <linux/stddef.h> + #include <asm/page.h> +#include <asm/spinlock.h> +#include <asm/processor.h> + +/* + * Temporary debugging help until all code is converted to the new + * waitqueue usage. + */ +#define WAITQUEUE_DEBUG 1 + +#if WAITQUEUE_DEBUG +extern int printk(const char *fmt, ...); +#define WQ_BUG() do { \ + printk("wq bug, forcing oops.\n"); \ + *(int*)0 = 0; \ +} while (0) + +#define CHECK_MAGIC(x) if (x != (long)&(x)) \ + { printk("bad magic %lx (should be %lx), ", (long)x, (long)&(x)); WQ_BUG(); } + +#define CHECK_MAGIC_WQHEAD(x) do { \ + if (x->__magic != (long)&(x->__magic)) { \ + printk("bad magic %lx (should be %lx, creator %lx), ", \ + x->__magic, (long)&(x->__magic), x->__creator); \ + WQ_BUG(); \ + } \ +} while (0) +#endif -struct wait_queue { +struct __wait_queue { + unsigned int compiler_warning; struct task_struct * task; - struct wait_queue * next; + struct list_head task_list; +#if WAITQUEUE_DEBUG + long __magic; + long __waker; +#endif +}; +typedef struct __wait_queue wait_queue_t; + +/* + * 'dual' spinlock architecture. Can be switched between spinlock_t and + * rwlock_t locks via changing this define. Since waitqueues are quite + * decoupled in the new architecture, lightweight 'simple' spinlocks give + * us slightly better latencies and smaller waitqueue structure size. + */ +#define USE_RW_WAIT_QUEUE_SPINLOCK 0 + +#if USE_RW_WAIT_QUEUE_SPINLOCK +# define wq_lock_t rwlock_t +# define WAITQUEUE_RW_LOCK_UNLOCKED RW_LOCK_UNLOCKED + +# define wq_read_lock read_lock +# define wq_read_lock_irqsave read_lock_irqsave +# define wq_read_unlock_irqrestore read_unlock_irqrestore +# define wq_read_unlock read_unlock +# define wq_write_lock_irq write_lock_irq +# define wq_write_lock_irqsave write_lock_irqsave +# define wq_write_unlock_irqrestore write_unlock_irqrestore +# define wq_write_unlock write_unlock +#else +# define wq_lock_t spinlock_t +# define WAITQUEUE_RW_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED + +# define wq_read_lock spin_lock +# define wq_read_lock_irqsave spin_lock_irqsave +# define wq_read_unlock spin_unlock +# define wq_read_unlock_irqrestore spin_unlock_irqrestore +# define wq_write_lock_irq spin_lock_irq +# define wq_write_lock_irqsave spin_lock_irqsave +# define wq_write_unlock_irqrestore spin_unlock_irqrestore +# define wq_write_unlock spin_unlock +#endif + +struct __wait_queue_head { + wq_lock_t lock; + struct list_head task_list; +#if WAITQUEUE_DEBUG + long __magic; + long __creator; +#endif }; +typedef struct __wait_queue_head wait_queue_head_t; + +#if WAITQUEUE_DEBUG +# define __WAITQUEUE_DEBUG_INIT(name) \ + , (long)&(name).__magic, 0 +# define __WAITQUEUE_HEAD_DEBUG_INIT(name) \ + , (long)&(name).__magic, (long)&(name).__magic +#else +# define __WAITQUEUE_DEBUG_INIT(name) +# define __WAITQUEUE_HEAD_DEBUG_INIT(name) +#endif + +#define __WAITQUEUE_INITIALIZER(name,task) \ + { 0x1234567, task, { NULL, NULL } __WAITQUEUE_DEBUG_INIT(name)} +#define DECLARE_WAITQUEUE(name,task) \ + wait_queue_t name = __WAITQUEUE_INITIALIZER(name,task) + +#define __WAIT_QUEUE_HEAD_INITIALIZER(name) \ +{ WAITQUEUE_RW_LOCK_UNLOCKED, { &(name).task_list, &(name).task_list } \ + __WAITQUEUE_HEAD_DEBUG_INIT(name)} + +#define DECLARE_WAIT_QUEUE_HEAD(name) \ + wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name) -#define WAIT_QUEUE_HEAD(x) ((struct wait_queue *)((x)-1)) +static inline void init_waitqueue_head(wait_queue_head_t *q) +{ +#if WAITQUEUE_DEBUG + if (!q) + WQ_BUG(); +#endif + q->lock = WAITQUEUE_RW_LOCK_UNLOCKED; + INIT_LIST_HEAD(&q->task_list); +#if WAITQUEUE_DEBUG + q->__magic = (long)&q->__magic; + q->__creator = (long)current_text_addr(); +#endif +} + +static inline void init_waitqueue_entry(wait_queue_t *q, + struct task_struct *p) +{ +#if WAITQUEUE_DEBUG + if (!q || !p) + WQ_BUG(); +#endif + q->task = p; +#if WAITQUEUE_DEBUG + q->__magic = (long)&q->__magic; +#endif +} + +static inline int waitqueue_active(wait_queue_head_t *q) +{ +#if WAITQUEUE_DEBUG + if (!q) + WQ_BUG(); + CHECK_MAGIC_WQHEAD(q); +#endif + + return !list_empty(&q->task_list); +} + +extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) +{ +#if WAITQUEUE_DEBUG + if (!head || !new) + WQ_BUG(); + CHECK_MAGIC_WQHEAD(head); + CHECK_MAGIC(new->__magic); + if (!head->task_list.next || !head->task_list.prev) + WQ_BUG(); +#endif + list_add(&new->task_list, &head->task_list); +} -static inline void init_waitqueue(struct wait_queue **q) +/* + * Used for wake-one threads: + */ +extern inline void __add_wait_queue_tail(wait_queue_head_t *head, + wait_queue_t *new) { - *q = WAIT_QUEUE_HEAD(q); +#if WAITQUEUE_DEBUG + if (!head || !new) + WQ_BUG(); + CHECK_MAGIC_WQHEAD(head); + CHECK_MAGIC(new->__magic); + if (!head->task_list.next || !head->task_list.prev) + WQ_BUG(); +#endif + list_add(&new->task_list, head->task_list.prev); } -static inline int waitqueue_active(struct wait_queue **q) +extern inline void __remove_wait_queue(wait_queue_head_t *head, + wait_queue_t *old) { - struct wait_queue *head = *q; - return head && head != WAIT_QUEUE_HEAD(q); +#if WAITQUEUE_DEBUG + if (!old) + WQ_BUG(); + CHECK_MAGIC(old->__magic); +#endif + list_del(&old->task_list); } #endif /* __KERNEL__ */ diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index fd63868f9..c2c5ff4c3 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -5,6 +5,7 @@ * * Author: Gene Kozin <genek@compuserve.com> * Jaspreet Singh <jaspreet@sangoma.com> +* Additions: Arnaldo Carvalho de Melo <acme@conectiva.com.br> * * Copyright: (c) 1995-1997 Sangoma Technologies Inc. * @@ -13,11 +14,14 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* May 23, 1999 Arnaldo Melo Added local_addr to wanif_conf_t +* WAN_DISCONNECTING state added * Nov 06, 1997 Jaspreet Singh Changed Router Driver version to 1.1 from 1.0 * Oct 20, 1997 Jaspreet Singh Added 'cir','bc','be' and 'mc' to 'wanif_conf_t' * Added 'enable_IPX' and 'network_number' to * 'wan_device_t'. Also added defines for -* UDP PACKET TYPE, Interrupt test, critical values* for RACE conditions. +* UDP PACKET TYPE, Interrupt test, critical values +* for RACE conditions. * Oct 05, 1997 Jaspreet Singh Added 'dlci_num' and 'dlci[100]' to * 'wan_fr_conf_t' to configure a list of dlci(s) * for a NODE @@ -125,7 +129,7 @@ typedef struct wan_fr_conf unsigned n392; /* error threshold counter */ unsigned n393; /* monitored events counter */ unsigned dlci_num; /* number of DLCs (access node) */ - unsigned dlci[100]; /* List of all DLCIs */ + unsigned dlci[100]; /* List of all DLCIs */ } wan_fr_conf_t; /*---------------------------------------------------------------------------- @@ -274,6 +278,7 @@ enum wan_states WAN_DISCONNECTED, /* link/channel is disconnected */ WAN_CONNECTING, /* connection is in progress */ WAN_CONNECTED, /* link/channel is operational */ + WAN_DISCONNECTING, /* disconnection is in progress */ WAN_LIMIT /* for verification only */ }; @@ -298,6 +303,8 @@ typedef struct wanif_conf unsigned bc; /* Committed Burst Size fwd, bwd */ unsigned be; /* Excess Burst Size fwd, bwd */ char mc; /* Multicast on or off */ + char local_addr[WAN_ADDRESS_SZ+1];/* local media address, ASCIIZ */ + unsigned char port; /* board port */ int reserved[8]; /* reserved for future extensions */ } wanif_conf_t; |