diff options
Diffstat (limited to 'include/linux')
139 files changed, 4302 insertions, 1761 deletions
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h new file mode 100644 index 000000000..453bb9258 --- /dev/null +++ b/include/linux/adfs_fs.h @@ -0,0 +1,183 @@ +#ifndef _ADFS_FS_H +#define _ADFS_FS_H + +#include <linux/types.h> +/* + * Structures of data on the disk + */ + +/* + * Disc Record at disc address 0xc00 + */ +struct adfs_discrecord { + unsigned char log2secsize; + unsigned char secspertrack; + unsigned char heads; + unsigned char density; + unsigned char idlen; + unsigned char log2bpmb; + unsigned char skew; + unsigned char bootoption; + unsigned char lowsector; + unsigned char nzones; + unsigned short zone_spare; + unsigned long root; + unsigned long disc_size; + unsigned short disc_id; + unsigned char disc_name[10]; + unsigned long disc_type; + unsigned long disc_size_high; + unsigned char log2sharesize:4; + unsigned char unused:4; + unsigned char big_flag:1; +}; + +#define ADFS_DISCRECORD (0xc00) +#define ADFS_DR_OFFSET (0x1c0) +#define ADFS_DR_SIZE 60 +#define ADFS_SUPER_MAGIC 0xadf5 +#define ADFS_FREE_FRAG 0 +#define ADFS_BAD_FRAG 1 +#define ADFS_ROOT_FRAG 2 + +/* + * Directory header + */ +struct adfs_dirheader { + unsigned char startmasseq; + unsigned char startname[4]; +}; + +#define ADFS_NEWDIR_SIZE 2048 +#define ADFS_OLDDIR_SIZE 1024 +#define ADFS_NUM_DIR_ENTRIES 77 + +/* + * Directory entries + */ +struct adfs_direntry { + char dirobname[10]; +#define ADFS_NAME_LEN 10 + __u8 dirload[4]; + __u8 direxec[4]; + __u8 dirlen[4]; + __u8 dirinddiscadd[3]; + __u8 newdiratts; +#define ADFS_NDA_OWNER_READ (1 << 0) +#define ADFS_NDA_OWNER_WRITE (1 << 1) +#define ADFS_NDA_LOCKED (1 << 2) +#define ADFS_NDA_DIRECTORY (1 << 3) +#define ADFS_NDA_EXECUTE (1 << 4) +#define ADFS_NDA_PUBLIC_READ (1 << 5) +#define ADFS_NDA_PUBLIC_WRITE (1 << 6) +}; + +#define ADFS_MAX_NAME_LEN 255 +struct adfs_idir_entry { + __u32 inode_no; /* Address */ + __u32 file_id; /* file id */ + __u32 name_len; /* name length */ + __u32 size; /* size */ + __u32 mtime; /* modification time */ + __u32 filetype; /* RiscOS file type */ + __u8 mode; /* internal mode */ + char name[ADFS_MAX_NAME_LEN]; /* file name */ +}; + +/* + * Directory tail + */ +union adfs_dirtail { + struct { + unsigned char dirlastmask; + char dirname[10]; + unsigned char dirparent[3]; + char dirtitle[19]; + unsigned char reserved[14]; + unsigned char endmasseq; + unsigned char endname[4]; + unsigned char dircheckbyte; + } old; + struct { + unsigned char dirlastmask; + unsigned char reserved[2]; + unsigned char dirparent[3]; + char dirtitle[19]; + char dirname[10]; + unsigned char endmasseq; + unsigned char endname[4]; + unsigned char dircheckbyte; + } new; +}; + +#ifdef __KERNEL__ + + +/* + * Calculate the boot block checksum on an ADFS drive. Note that this will + * appear to be correct if the sector contains all zeros, so also check that + * the disk size is non-zero!!! + */ + +extern inline int adfs_checkbblk(unsigned char *ptr) +{ + int i = 511; + + int result = 0; + + do { + result = (result & 0xff) + (result >> 8); + result = result + ptr[i]; + i--; + } + while (i != 0); + + result &= 0xff; + return result != ptr[511]; + return 0; +} + +/* dir.c */ +extern unsigned int adfs_val (unsigned char *p, int len); +extern int adfs_dir_read_parent (struct inode *inode, struct buffer_head **bhp); +extern int adfs_dir_read (struct inode *inode, struct buffer_head **bhp); +extern int adfs_dir_check (struct inode *inode, struct buffer_head **bhp, + int buffers, union adfs_dirtail *dtp); +extern void adfs_dir_free (struct buffer_head **bhp, int buffers); +extern int adfs_dir_get (struct super_block *sb, struct buffer_head **bhp, + int buffers, int pos, unsigned long parent_object_id, + struct adfs_idir_entry *ide); +extern int adfs_dir_find_entry (struct super_block *sb, struct buffer_head **bhp, + int buffers, unsigned int index, + struct adfs_idir_entry *ide); + +/* inode.c */ +extern int adfs_inode_validate (struct inode *inode); +extern unsigned long adfs_inode_generate (unsigned long parent_id, int diridx); +extern unsigned long adfs_inode_objid (struct inode *inode); +extern unsigned int adfs_parent_bmap (struct inode *inode, int block); +extern int adfs_bmap (struct inode *inode, int block); +extern void adfs_read_inode (struct inode *inode); + +/* map.c */ +extern int adfs_map_lookup (struct super_block *sb, int frag_id, int offset); + +/* namei.c */ +extern int adfs_lookup (struct inode *dir, struct dentry *dentry); + +/* super.c */ +extern int init_adfs_fs (void); +extern void adfs_error (struct super_block *, const char *, const char *, ...); + +/* + * Inodes and file operations + */ + +/* dir.c */ +extern struct inode_operations adfs_dir_inode_operations; + +/* file.c */ +extern struct inode_operations adfs_file_inode_operations; +#endif + +#endif diff --git a/include/linux/adfs_fs_fs.h b/include/linux/adfs_fs_fs.h new file mode 100644 index 000000000..7fff6be19 --- /dev/null +++ b/include/linux/adfs_fs_fs.h @@ -0,0 +1,177 @@ +#ifndef _ADFS_FS_H +#define _ADFS_FS_H + +#include <linux/types.h> +/* + * Structures of data on the disk + */ + +/* + * Disc Record at disc address 0xc00 + */ +struct adfs_discrecord { + unsigned char log2secsize; + unsigned char secspertrack; + unsigned char heads; + unsigned char density; + unsigned char idlen; + unsigned char log2bpmb; + unsigned char skew; + unsigned char bootoption; + unsigned char lowsector; + unsigned char nzones; + unsigned short zone_spare; + unsigned long root; + unsigned long disc_size; + unsigned short disc_id; + unsigned char disc_name[10]; + unsigned long disc_type; + unsigned long disc_size_high; + unsigned char log2sharesize:4; + unsigned char unused:4; + unsigned char big_flag:1; +}; + +#define ADFS_DISCRECORD (0xc00) +#define ADFS_DR_OFFSET (0x1c0) +#define ADFS_DR_SIZE 60 +#define ADFS_SUPER_MAGIC 0xadf5 +#define ADFS_FREE_FRAG 0 +#define ADFS_BAD_FRAG 1 +#define ADFS_ROOT_FRAG 2 + +/* + * Directory header + */ +struct adfs_dirheader { + unsigned char startmasseq; + unsigned char startname[4]; +}; + +#define ADFS_NEWDIR_SIZE 2048 +#define ADFS_OLDDIR_SIZE 1024 +#define ADFS_NUM_DIR_ENTRIES 77 + +/* + * Directory entries + */ +struct adfs_direntry { + char dirobname[10]; +#define ADFS_NAME_LEN 10 + __u8 dirload[4]; + __u8 direxec[4]; + __u8 dirlen[4]; + __u8 dirinddiscadd[3]; + __u8 newdiratts; +#define ADFS_NDA_OWNER_READ (1 << 0) +#define ADFS_NDA_OWNER_WRITE (1 << 1) +#define ADFS_NDA_LOCKED (1 << 2) +#define ADFS_NDA_DIRECTORY (1 << 3) +#define ADFS_NDA_EXECUTE (1 << 4) +#define ADFS_NDA_PUBLIC_READ (1 << 5) +#define ADFS_NDA_PUBLIC_WRITE (1 << 6) +}; + +#define ADFS_MAX_NAME_LEN 255 +struct adfs_idir_entry { + __u32 inode_no; /* Address */ + __u32 file_id; /* file id */ + __u32 name_len; /* name length */ + __u32 size; /* size */ + __u32 mtime; /* modification time */ + __u32 filetype; /* RiscOS file type */ + __u8 mode; /* internal mode */ + char name[ADFS_MAX_NAME_LEN]; /* file name */ +}; + +/* + * Directory tail + */ +union adfs_dirtail { + struct { + unsigned char dirlastmask; + char dirname[10]; + unsigned char dirparent[3]; + char dirtitle[19]; + unsigned char reserved[14]; + unsigned char endmasseq; + unsigned char endname[4]; + unsigned char dircheckbyte; + } old; + struct { + unsigned char dirlastmask; + unsigned char reserved[2]; + unsigned char dirparent[3]; + char dirtitle[19]; + char dirname[10]; + unsigned char endmasseq; + unsigned char endname[4]; + unsigned char dircheckbyte; + } new; +}; + +#ifdef __KERNEL__ +/* + * Calculate the boot block checksum on an ADFS drive. Note that this will + * appear to be correct if the sector contains all zeros, so also check that + * the disk size is non-zero!!! + */ +extern inline int adfs_checkbblk (unsigned char *ptr) +{ + unsigned int result = 0; + unsigned char *p = ptr + 511; + + do { + result = (result & 0xff) + (result >> 8); + result = result + *--p; + } while (p != ptr); + + return (result & 0xff) != ptr[511]; +} + +/* dir.c */ +extern unsigned int adfs_val (unsigned char *p, int len); +extern int adfs_dir_read_parent (struct inode *inode, struct buffer_head **bhp); +extern int adfs_dir_read (struct inode *inode, struct buffer_head **bhp); +extern int adfs_dir_check (struct inode *inode, struct buffer_head **bhp, + int buffers, union adfs_dirtail *dtp); +extern void adfs_dir_free (struct buffer_head **bhp, int buffers); +extern int adfs_dir_get (struct super_block *sb, struct buffer_head **bhp, + int buffers, int pos, unsigned long parent_object_id, + struct adfs_idir_entry *ide); +extern int adfs_dir_find_entry (struct super_block *sb, struct buffer_head **bhp, + int buffers, unsigned int index, + struct adfs_idir_entry *ide); + +/* inode.c */ +extern int adfs_inode_validate (struct inode *inode); +extern unsigned long adfs_inode_generate (unsigned long parent_id, int diridx); +extern unsigned long adfs_inode_objid (struct inode *inode); +extern unsigned int adfs_parent_bmap (struct inode *inode, int block); +extern int adfs_bmap (struct inode *inode, int block); +extern void adfs_read_inode (struct inode *inode); + +/* map.c */ +extern int adfs_map_lookup (struct super_block *sb, int frag_id, int offset); + +/* namei.c */ +extern int adfs_lookup (struct inode * dir, const char * name, int len, + struct inode ** result); + +/* super.c */ +extern int init_adfs_fs (void); +extern void adfs_error (struct super_block *, const char *, const char *, ...); + +/* + * Inodes and file operations + */ + +/* dir.c */ +extern struct inode_operations adfs_dir_inode_operations; + +/* file.c */ +extern struct inode_operations adfs_file_inode_operations; +#endif + +#endif + diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h new file mode 100644 index 000000000..831575165 --- /dev/null +++ b/include/linux/adfs_fs_i.h @@ -0,0 +1,17 @@ +/* + * linux/include/linux/adfs_fs_i.h + * + * Copyright (C) 1997 Russell King + */ + +#ifndef _ADFS_FS_I +#define _ADFS_FS_I + +/* + * adfs file system inode data in memory + */ +struct adfs_inode_info { + unsigned long file_id; /* id of fragments containing actual data */ +}; + +#endif diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h new file mode 100644 index 000000000..527c29fb6 --- /dev/null +++ b/include/linux/adfs_fs_sb.h @@ -0,0 +1,29 @@ +/* + * linux/include/linux/adfs_fs_sb.h + * + * Copyright (C) 1997 Russell King + */ + +#ifndef _ADFS_FS_SB +#define _ADFS_FS_SB + +#include <linux/adfs_fs.h> + +/* + * adfs file system superblock data in memory + */ +struct adfs_sb_info { + struct buffer_head *s_sbh; /* buffer head containing disc record */ + struct adfs_discrecord *s_dr; /* pointer to disc record in s_sbh */ + __u16 s_zone_size; /* size of a map zone in bits */ + __u16 s_ids_per_zone; /* max. no ids in one zone */ + __u32 s_idlen; /* length of ID in map */ + __u32 s_map_size; /* size of a map */ + __u32 s_zonesize; /* zone size (in map bits) */ + __u32 s_map_block; /* block address of map */ + struct buffer_head **s_map; /* bh list containing map */ + __u32 s_root; /* root disc address */ + __s8 s_map2blk; /* shift left by this for map->sector */ +}; + +#endif diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h index ec637973d..79e3c3639 100644 --- a/include/linux/affs_fs.h +++ b/include/linux/affs_fs.h @@ -65,7 +65,7 @@ extern int affs_unlink(struct inode *dir, struct dentry *dentry); extern int affs_create(struct inode *dir, struct dentry *dentry, int mode); extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode); extern int affs_rmdir(struct inode *dir, struct dentry *dentry); -extern int affs_link(struct inode *oldinode, struct inode *dir, +extern int affs_link(struct dentry *olddentry, struct inode *dir, struct dentry *dentry); extern int affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); @@ -78,7 +78,7 @@ extern struct buffer_head *affs_bread(kdev_t dev, int block, int size); extern void affs_brelse(struct buffer_head *buf); extern unsigned long affs_parent_ino(struct inode *dir); extern struct inode *affs_new_inode(const struct inode *dir); -extern int affs_notify_change(struct inode *inode, struct iattr *attr); +extern int affs_notify_change(struct dentry *dentry, struct iattr *attr); extern int affs_add_entry(struct inode *dir, struct inode *link, struct inode *inode, struct dentry *dentry, s32 type); extern void affs_put_inode(struct inode *inode); @@ -89,6 +89,7 @@ extern void affs_write_inode(struct inode *inode); /* super.c */ extern int affs_fs(void); +extern int init_affs_fs(void); /* file.c */ @@ -107,4 +108,7 @@ extern struct inode_operations affs_symlink_inode_operations; extern struct inode_operations affs_chrdev_inode_operations; extern struct inode_operations affs_blkdev_inode_operations; +extern struct dentry_operations affs_dentry_operations; +extern struct dentry_operations affs_dentry_operations_intl; + #endif diff --git a/include/linux/affs_fs_sb.h b/include/linux/affs_fs_sb.h index 7ab261209..a066aee71 100644 --- a/include/linux/affs_fs_sb.h +++ b/include/linux/affs_fs_sb.h @@ -37,6 +37,7 @@ struct affs_zone { struct affs_sb_info { int s_partition_size; /* Partition size in blocks. */ + int s_blksize; /* Initial device blksize */ s32 s_root_block; /* FFS root block number. */ int s_hashsize; /* Size of hash table. */ unsigned long s_flags; /* See below. */ diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 326445110..f0b7a5793 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h @@ -19,13 +19,12 @@ */ typedef unsigned short apm_event_t; +typedef unsigned short apm_eventinfo_t; #ifdef __KERNEL__ -#include <linux/tasks.h> /* for NR_TASKS */ -#include <linux/sched.h> /* for _TSS */ - -#define APM_CS _TSS(NR_TASKS) +#define APM_40 0x40 +#define APM_CS (APM_40 + 8) #define APM_CS_16 (APM_CS + 8) #define APM_DS (APM_CS_16 + 8) @@ -37,6 +36,7 @@ struct apm_bios_info { unsigned short dseg; unsigned short flags; unsigned short cseg_len; + unsigned short cseg_16_len; unsigned short dseg_len; }; @@ -113,6 +113,7 @@ extern int apm_display_unblank(void); #define APM_USER_STANDBY 0x0009 #define APM_USER_SUSPEND 0x000a #define APM_STANDBY_RESUME 0x000b +#define APM_CAPABILITY_CHANGE 0x000c /* * Error codes @@ -128,6 +129,8 @@ extern int apm_display_unblank(void); #define APM_BAD_DEVICE 0x09 #define APM_BAD_PARAM 0x0a #define APM_NOT_ENGAGED 0x0b +#define APM_BAD_FUNCTION 0x0c +#define APM_RESUME_DISABLED 0x0d #define APM_BAD_STATE 0x60 #define APM_NO_EVENTS 0x80 #define APM_NOT_PRESENT 0x86 diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index 843c0ad8c..dc427588b 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -5,7 +5,7 @@ * * Definitions for the ARCnet handlers. * - * Version: $Id: arcdevice.h,v 1.2 1997/09/05 08:57:56 mj Exp $ + * Version: $Id: arcdevice.h,v 1.3 1997/11/09 11:05:05 mj Exp $ * * Authors: Avery Pennarun <apenwarr@bond.net> * David Woodhouse <dwmw2@cam.ac.uk> @@ -74,7 +74,7 @@ /* Display warnings about the driver being an ALPHA version. */ -#define ALPHA_WARNING +#undef ALPHA_WARNING /* New debugging bitflags: each option can be enabled individually. diff --git a/include/linux/baycom.h b/include/linux/baycom.h index 9754f9384..81249e029 100644 --- a/include/linux/baycom.h +++ b/include/linux/baycom.h @@ -1,15 +1,12 @@ /* * The Linux BAYCOM driver for the Baycom serial 1200 baud modem * and the parallel 9600 baud modem - * (C) 1997 by Thomas Sailer, HB9JNX/AE4WA + * (C) 1997-1998 by Thomas Sailer, HB9JNX/AE4WA */ #ifndef _BAYCOM_H #define _BAYCOM_H -#include <linux/sockios.h> -#include <linux/if_ether.h> - /* -------------------------------------------------------------------- */ /* * structs for the IOCTL commands diff --git a/include/linux/blk.h b/include/linux/blk.h index 8893b170a..ec19b0cdd 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -5,6 +5,15 @@ #include <linux/locks.h> #include <linux/config.h> +#include <asm/spinlock.h> + +/* + * Spinlock for protecting the request queue which + * is mucked around with in interrupts on potentially + * multiple CPU's.. + */ +extern spinlock_t io_request_lock; + /* * NR_REQUEST is the number of entries in the request-queue. * NOTE that writes may use only the low 2/3 of these: reads @@ -39,6 +48,9 @@ #ifdef CONFIG_CDROM extern int cdrom_init(void); #endif CONFIG_CDROM +#ifdef CONFIG_ISP16_CDI +extern int isp16_init(void); +#endif CONFIG_ISP16_CDI #ifdef CONFIG_CDU31A extern int cdu31a_init(void); #endif CONFIG_CDU31A @@ -433,6 +445,11 @@ static void (DEVICE_REQUEST)(void); #if ! SCSI_BLK_MAJOR(MAJOR_NR) +/* + * The [*_]end_request() handler has to be called with the request queue + * spinlock aquired. All functions called within end_request() _must be_ + * atomic. + */ #if defined(IDE_DRIVER) && !defined(_IDE_C) /* shared copy for IDE modules */ void ide_end_request(byte uptodate, ide_hwgroup_t *hwgroup); #else diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1e7005e6c..f2d143359 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -38,6 +38,9 @@ typedef struct request ** (queue_proc) (kdev_t dev); struct blk_dev_struct { request_fn_proc *request_fn; + /* + * queue_proc has to be atomic + */ queue_proc *queue; void *data; struct request *current_request; @@ -72,4 +75,15 @@ extern int * max_readahead[MAX_BLKDEV]; extern int * max_sectors[MAX_BLKDEV]; +#define MAX_SECTORS 244 /* 254 ? */ + +#define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK) +#if 0 /* small readahead */ +#define MAX_READAHEAD PageAlignSize(4096*7) +#define MIN_READAHEAD PageAlignSize(4096*2) +#else /* large readahead */ +#define MAX_READAHEAD PageAlignSize(4096*18) +#define MIN_READAHEAD PageAlignSize(4096*3) +#endif + #endif diff --git a/include/linux/byteorder/vax_endian.h b/include/linux/byteorder/pdp_endian.h index 1c420fa69..306123839 100644 --- a/include/linux/byteorder/vax_endian.h +++ b/include/linux/byteorder/pdp_endian.h @@ -1,23 +1,30 @@ -#ifndef _LINUX_BYTEORDER_VAX_ENDIAN_H -#define _LINUX_BYTEORDER_VAX_ENDIAN_H +#ifndef _LINUX_BYTEORDER_PDP_ENDIAN_H +#define _LINUX_BYTEORDER_PDP_ENDIAN_H /* - * Could have been named NUXI-endian + * Could have been named NUXI-endian, but we use the same name as in glibc. + * hopefully only the PDP and its evolutions (old VAXen in compatibility mode) + * should ever use this braindead byteorder. * This file *should* work, but has not been tested. - * It's the beginning of what vaxlinux implementers will have to do. - * I just hope we won't have to write standardized cpu_to_ve32() and suches! - * little endian is 1234; bigendian is 4321; vaxendian is 3412 + * + * little-endian is 1234; big-endian is 4321; nuxi/pdp-endian is 3412 + * + * I thought vaxen were NUXI-endian, but was told they were correct-endian + * (little-endian), though indeed there existed NUXI-endian machines + * (DEC PDP-11 and old VAXen in compatibility mode). + * This makes this file a bit useless, but as a proof-of-concept. * * But what does a __u64 look like: is it 34127856 or 78563412 ??? * I don't dare imagine! Hence, no 64-bit byteorder support yet. + * Hopefully, there 64-bit pdp-endian support shouldn't ever be required. * */ -#ifndef __VAX_ENDIAN -#define __VAX_ENDIAN 3412 +#ifndef __PDP_ENDIAN +#define __PDP_ENDIAN 3412 #endif -#ifndef __VAX_ENDIAN_BITFIELD -#define __VAX_ENDIAN_BITFIELD +#ifndef __PDP_ENDIAN_BITFIELD +#define __PDP_ENDIAN_BITFIELD #endif #include <linux/byteorder/swab.h> @@ -66,4 +73,4 @@ #include <linux/byteorder/generic.h> -#endif /* _LINUX_BYTEORDER_VAX_ENDIAN_H */ +#endif /* _LINUX_BYTEORDER_PDP_ENDIAN_H */ diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index 1f34bc13d..22407afdf 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h @@ -6,7 +6,10 @@ * SWAp Bytes Bizarrely * swaHHXX[ps]?(foo) * - * Support for obNUXIous vax-endian and other bizarre architectures... + * Support for obNUXIous pdp-endian and other bizarre architectures. + * Will Linux ever run on such ancient beasts? if not, this file + * will be but a programming pearl. Still, it's a reminder that + * cpu_to_beXX and beXX_to_cpu should be well distinguished. * */ @@ -15,13 +18,11 @@ * swahw32 swap 16-bit half-words in a 32-bit word * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word * - * No 64-bit support yet. I don't know VAX conventions for long longs. + * No 64-bit support yet. I don't know NUXI conventions for long longs. * I guarantee it will be a mess when it's there, though :-> - * It will be even worse if there are conflicting 64-bit conventions for vaxen + * It will be even worse if there are conflicting 64-bit conventions. + * Hopefully, no one ever used 64-bit objects on NUXI machines. * - * Note that if communicating with vax machines becomes useful in some kernel - * FS driver, we'd have to move that mess into byteorder/swab.h, and - * create cpu_to_ve32 and suches. Ouch. */ @@ -31,8 +32,8 @@ (((__u32)(x) & (__u32)0xffff0000UL) >> 16) )) #define ___swahb32(x) \ ((__u32)( \ - (((__u32)(x) & (__u32)0x00ff00ffUL) << 16) | \ - (((__u32)(x) & (__u32)0xff00ff00UL) >> 16) )) + (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ + (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) )) /* * provide defaults when no architecture-specific optimization is detected diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h index e681f6a01..d07d1e61a 100644 --- a/include/linux/cd1400.h +++ b/include/linux/cd1400.h @@ -3,7 +3,7 @@ /* * cd1400.h -- cd1400 UART hardware info. * - * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au). * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify diff --git a/include/linux/cdk.h b/include/linux/cdk.h index 6ed83eef9..2180e4330 100644 --- a/include/linux/cdk.h +++ b/include/linux/cdk.h @@ -3,7 +3,7 @@ /* * cdk.h -- CDK interface definitions. * - * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au). * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify @@ -304,6 +304,10 @@ typedef struct asyport { #define P_DTRFOLLOW 0x20 #define P_FAKEDCD 0x40 +#define P_RXIMIN 0x10000 +#define P_RXITIME 0x20000 +#define P_RXTHOLD 0x40000 + /* * Define a structure to communicate serial port signal and data state * information. diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index f41342b53..8448fc6ca 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -4,7 +4,7 @@ * Copyright (C) 1992 David Giller, rafetmad@oxy.edu * 1994, 1995 Eberhard Moenkeberg, emoenke@gwdg.de * 1996 David van Leeuwen, david@tm.tno.nl - * 1997 Erik Andersen, andersee@debian.org + * 1997, 1998 Erik Andersen, andersee@debian.org */ #ifndef _LINUX_CDROM_H @@ -352,6 +352,7 @@ struct cdrom_blk #define CDS_DATA_2 102 #define CDS_XA_2_1 103 #define CDS_XA_2_2 104 +#define CDS_MIXED 105 /* User-configurable behavior options for the uniform CD-ROM driver */ #define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */ @@ -416,4 +417,4 @@ extern int register_cdrom(struct cdrom_device_info *cdi); extern int unregister_cdrom(struct cdrom_device_info *cdi); #endif /* End of kernel only stuff */ -#endif _LINUX_CDROM_H +#endif /* _LINUX_CDROM_H */ diff --git a/include/linux/coda.h b/include/linux/coda.h index 08e263925..3faa2e9ca 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -1,11 +1,3 @@ -/* - * Venus interface for Coda. - * Original version: (C) 1996 Peter Braam - * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University - * - * Carnegie Mellon encourages users of this code to contribute improvements - * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>. - */ /* * @@ -21,47 +13,86 @@ /* Catch new _KERNEL defn for NetBSD */ #ifdef __NetBSD__ #include <sys/types.h> -#ifdef _KERNEL -#define KERNEL -#endif #endif -#if 0 -#ifndef _SCALAR_T_ -#define _SCALAR_T_ 1 -typedef unsigned long u_int32_t; -typedef unsigned short u_int16_t; -typedef unsigned char u_int8_t; -#endif -#endif +#ifdef DJGPP +#ifdef KERNEL +typedef unsigned long u_long; +typedef unsigned int u_int; +typedef unsigned short u_short; +typedef u_long ino_t; +typedef u_long dev_t; +typedef void * caddr_t; +typedef u_long u_quad_t; + +#define inline + +struct timespec { + long ts_sec; + long ts_nsec; +}; +#else /* DJGPP but not KERNEL */ +#include <sys/types.h> +#include <sys/time.h> +typedef u_long u_quad_t; +#endif /* !KERNEL */ +#endif /* !DJGPP */ -#ifdef __linux__ -#ifndef _UQUAD_T_ + +#if defined(__linux__) || defined(__CYGWIN32__) +#define cdev_t u_quad_t +#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2) #define _UQUAD_T_ 1 -typedef unsigned long u_quad_t; -#endif +typedef unsigned long long u_quad_t; +#endif +#else +#define cdev_t dev_t +#endif -#ifdef __KERNEL__ -#define KERNEL -#endif __KERNEL__ +#ifdef __CYGWIN32__ +typedef unsigned char u_int8_t; +struct timespec { + time_t tv_sec; /* seconds */ + long tv_nsec; /* nanoseconds */ +}; #endif + /* * Cfs constants */ -#define CFS_MAXNAMLEN 256 -#define CFS_MAXPATHLEN 256 -#define CODA_MAXSYMLINK 10 +#define CFS_MAXNAMLEN 255 +#define CFS_MAXPATHLEN 1024 +#define CFS_MAXSYMLINK 10 + +/* these are Coda's version of O_RDONLY etc combinations + * to deal with VFS open modes + */ +#define C_O_READ 0x001 +#define C_O_WRITE 0x002 +#define C_O_TRUNC 0x010 +#define C_O_EXCL 0x100 + +/* these are to find mode bits in Venus */ +#define C_M_READ 00400 +#define C_M_WRITE 00200 + +/* for access Venus will use */ +#define C_A_R_OK 4 /* Test for read permission. */ +#define C_A_W_OK 2 /* Test for write permission. */ +#define C_A_X_OK 1 /* Test for execute permission. */ +#define C_A_F_OK 0 /* Test for existence. */ + + -/* types used in kernel and user mode */ #ifndef _VENUS_DIRENT_T_ #define _VENUS_DIRENT_T_ 1 struct venus_dirent { - unsigned long d_fileno; /* file number of entry */ - unsigned short d_reclen; /* length of this record */ - char d_type; /* file type, see below */ - char d_namlen; /* length of string in d_name */ - char d_name[CFS_MAXNAMLEN + 1];/* name must be no longer than this */ + unsigned long d_fileno; /* file number of entry */ + unsigned short d_reclen; /* length of this record */ + char d_type; /* file type, see below */ + char d_namlen; /* length of string in d_name */ + char d_name[CFS_MAXNAMLEN + 1];/* name must be no longer than this */ }; #undef DIRSIZ #define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CFS_MAXNAMLEN+1)) + \ @@ -70,21 +101,21 @@ struct venus_dirent { /* * File types */ -#define DT_UNKNOWN 0 -#define DT_FIFO 1 -#define DT_CHR 2 -#define DT_DIR 4 -#define DT_BLK 6 -#define DT_REG 8 -#define DT_LNK 10 -#define DT_SOCK 12 -#define DT_WHT 14 +#define CDT_UNKNOWN 0 +#define CDT_FIFO 1 +#define CDT_CHR 2 +#define CDT_DIR 4 +#define CDT_BLK 6 +#define CDT_REG 8 +#define CDT_LNK 10 +#define CDT_SOCK 12 +#define CDT_WHT 14 /* * Convert between stat structure types and directory types. */ -#define IFTODT(mode) (((mode) & 0170000) >> 12) -#define DTTOIF(dirtype) ((dirtype) << 12) +#define IFTOCDT(mode) (((mode) & 0170000) >> 12) +#define CDTTOIF(dirtype) ((dirtype) << 12) #endif @@ -105,6 +136,16 @@ typedef struct ViceFid { } ViceFid; #endif /* VICEFID */ +static inline ino_t coda_f2i(struct ViceFid *fid) +{ + if ( fid ) { + return (fid->Unique + (fid->Vnode << 10) + (fid->Volume << 20)); + } else { + return 0; + } +} + + #ifndef _VUID_T_ #define _VUID_T_ typedef u_long vuid_t; @@ -113,11 +154,13 @@ typedef u_long vgid_t; #ifndef _CODACRED_T_ #define _CODACRED_T_ -#define NGROUPS 32 -struct CodaCred { +struct coda_cred { vuid_t cr_uid, cr_euid, cr_suid, cr_fsuid; /* Real, efftve, set, fs uid*/ - vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ - vgid_t cr_groups[NGROUPS]; /* Group membership for caller */ +#if defined(__NetBSD__) || defined(__FreeBSD__) + vgid_t cr_groupid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ +#else + vgid_t cr_gid, cr_egid, cr_sgid, cr_fsgid; /* same for groups */ +#endif }; #endif @@ -126,7 +169,7 @@ struct CodaCred { /* * Vnode types. VNON means no type. */ -enum coda_vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD }; +enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD }; struct coda_vattr { enum coda_vtype va_type; /* vnode type (for create) */ @@ -134,7 +177,6 @@ struct coda_vattr { short va_nlink; /* number of references to file */ vuid_t va_uid; /* owner user id */ vgid_t va_gid; /* owner group id */ - long va_fsid; /* file system id (dev for now) */ long va_fileid; /* file id */ u_quad_t va_size; /* file size in bytes */ long va_blocksize; /* blocksize preferred for i/o */ @@ -143,20 +185,17 @@ struct coda_vattr { struct timespec va_ctime; /* time file changed */ u_long va_gen; /* generation number of file */ u_long va_flags; /* flags defined for file */ - dev_t va_rdev; /* device the special file represents */ + cdev_t va_rdev; /* device special file represents */ u_quad_t va_bytes; /* bytes of disk space held by file */ u_quad_t va_filerev; /* file modification number */ - u_int va_vaflags; /* operations flags, see below */ - long va_spare; /* remain quad aligned */ }; -#define VREAD 00400 -#define VWRITE 00200 #endif /* - * opcode constants + * Kernel <--> Venus communications. */ + #define CFS_ROOT ((u_long) 2) #define CFS_SYNC ((u_long) 3) #define CFS_OPEN ((u_long) 4) @@ -177,8 +216,8 @@ struct coda_vattr { #define CFS_READLINK ((u_long) 19) #define CFS_FSYNC ((u_long) 20) #define CFS_INACTIVE ((u_long) 21) -#define CFS_VGET ((u_long) 22) -#define CFS_SIGNAL ((u_long) 23) +#define CFS_VGET ((u_long) 22) +#define CFS_SIGNAL ((u_long) 23) #define CFS_REPLACE ((u_long) 24) #define CFS_FLUSH ((u_long) 25) #define CFS_PURGEUSER ((u_long) 26) @@ -186,273 +225,438 @@ struct coda_vattr { #define CFS_ZAPDIR ((u_long) 28) #define CFS_ZAPVNODE ((u_long) 29) #define CFS_PURGEFID ((u_long) 30) -#define CFS_RDWR ((u_long) 31) -#define ODY_MOUNT ((u_long) 32) -#define ODY_LOOKUP ((u_long) 33) -#define ODY_EXPAND ((u_long) 34) +#define CFS_OPEN_BY_PATH ((u_long) 31) +#define CFS_NCALLS 32 -#define CFS_NCALLS 35 #define DOWNCALL(opcode) (opcode >= CFS_REPLACE && opcode <= CFS_PURGEFID) +#define VC_MAXDATASIZE 8192 +#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ + VC_MAXDATASIZE + + + /* * Venus <-> Coda RPC arguments */ +struct cfs_in_hdr { + unsigned long opcode; + unsigned long unique; /* Keep multiple outstanding msgs distinct */ + u_short pid; /* Common to all */ + u_short pgid; /* Common to all */ + u_short sid; /* Common to all */ + struct coda_cred cred; /* Common to all */ +}; -struct inputArgs { - u_long opcode; - u_long unique; /* Keep multiple outstanding msgs distinct */ - u_short pid; /* Common to all */ - u_short pgid; /* Common to all */ - struct CodaCred cred; /* Common to all */ - - union { - /* Nothing needed for cfs_root */ - /* Nothing needed for cfs_sync */ - struct cfs_open_in { - ViceFid VFid; - int flags; - } cfs_open; - struct cfs_close_in { - ViceFid VFid; - int flags; - } cfs_close; - struct cfs_ioctl_in { - ViceFid VFid; - int cmd; - int len; - int rwflag; - char *data; /* Place holder for data. */ - } cfs_ioctl; - struct cfs_getattr_in { - ViceFid VFid; - struct coda_vattr attr; - } cfs_getattr; - struct cfs_setattr_in { - ViceFid VFid; - struct coda_vattr attr; - } cfs_setattr; - struct cfs_access_in { - ViceFid VFid; - int flags; - } cfs_access; - struct cfs_lookup_in { - ViceFid VFid; - char *name; /* Place holder for data. */ - } cfs_lookup; - struct cfs_create_in { - ViceFid VFid; - struct coda_vattr attr; - int excl; - int mode; - char *name; /* Place holder for data. */ - } cfs_create; - struct cfs_remove_in { - ViceFid VFid; - char *name; /* Place holder for data. */ - } cfs_remove; - struct cfs_link_in { - ViceFid sourceFid; /* cnode to link *to* */ - ViceFid destFid; /* Directory in which to place link */ - char *tname; /* Place holder for data. */ - } cfs_link; - struct cfs_rename_in { - ViceFid sourceFid; - char *srcname; - ViceFid destFid; - char *destname; - } cfs_rename; - struct cfs_mkdir_in { - ViceFid VFid; - struct coda_vattr attr; - char *name; /* Place holder for data. */ - } cfs_mkdir; - struct cfs_rmdir_in { - ViceFid VFid; - char *name; /* Place holder for data. */ - } cfs_rmdir; - struct cfs_readdir_in { - ViceFid VFid; - int count; - int offset; - } cfs_readdir; - struct cfs_symlink_in { - ViceFid VFid; /* Directory to put symlink in */ - char *srcname; - struct coda_vattr attr; - char *tname; - } cfs_symlink; - struct cfs_readlink_in { - ViceFid VFid; - } cfs_readlink; - struct cfs_fsync_in { - ViceFid VFid; - } cfs_fsync; - struct cfs_inactive_in { - ViceFid VFid; - } cfs_inactive; - struct cfs_vget_in { - ViceFid VFid; - } cfs_vget; - /* CFS_SIGNAL is out-of-band, doesn't need data. */ - /* CFS_INVALIDATE is a venus->kernel call */ - /* CFS_FLUSH is a venus->kernel call */ - /* CFS_PURGEUSER is a venus->kernel call */ - /* CFS_ZAPFILE is a venus->kernel call */ - /* CFS_ZAPDIR is a venus->kernel call */ - /* CFS_ZAPVNODE is a venus->kernel call */ - /* CFS_PURGEFID is a venus->kernel call */ - struct cfs_rdwr_in { - ViceFid VFid; - int rwflag; - int count; - int offset; - int ioflag; - caddr_t data; /* Place holder for data. */ - } cfs_rdwr; - struct ody_mount_in { - char *name; /* Place holder for data. */ - } ody_mount; - struct ody_lookup_in { - ViceFid VFid; - char *name; /* Place holder for data. */ - } ody_lookup; - struct ody_expand_in { - ViceFid VFid; - int size; /* Size of buffer to return. */ - } ody_expand; - /* CFS_REPLACE is a venus->kernel call */ - } d; -}; - -/* Occasionally, don't cache the fid returned by CFS_LOOKUP. For - * instance, if the fid is inconsistent. This case is handled by - * setting the top bit of the return result parameter. */ -#define CFS_NOCACHE 0x80000000 +/* Really important that opcode and unique are 1st two fields! */ +struct cfs_out_hdr { + unsigned long opcode; + unsigned long unique; + unsigned long result; +}; -#define INIT_OUT(out, opcode, result) \ - out->opcode = (opcode); out->result = (result); - -/* IMPORTANT: opcode and unique must be first two fields! */ -struct outputArgs { - u_long opcode; - u_long unique; /* Keep multiple outstanding msgs distinct */ - u_long result; - union { - struct cfs_root_out { - ViceFid VFid; - } cfs_root; - /* Nothing needed for cfs_sync */ - struct cfs_open_out { - dev_t dev; - ino_t inode; - } cfs_open; - /* Nothing needed for cfs_close */ - struct cfs_ioctl_out { - int len; - caddr_t data; /* Place holder for data. */ - } cfs_ioctl; - struct cfs_getattr_out { - struct coda_vattr attr; - } cfs_getattr; - /* Nothing needed for cfs_setattr */ - /* Nothing needed for cfs_access */ - struct cfs_lookup_out { - ViceFid VFid; - int vtype; - } cfs_lookup; - struct cfs_create_out { - ViceFid VFid; - struct coda_vattr attr; - } cfs_create; - /* Nothing needed for cfs_remove */ - /* Nothing needed for cfs_link */ - /* Nothing needed for cfs_rename */ - struct cfs_mkdir_out { - ViceFid VFid; - struct coda_vattr attr; - } cfs_mkdir; - /* Nothing needed for cfs_rmdir */ - struct cfs_readdir_out { - int size; - caddr_t data; /* Place holder for data. */ - } cfs_readdir; - /* Nothing needed for cfs_symlink */ - struct cfs_readlink_out { - int count; - caddr_t data; /* Place holder for data. */ - } cfs_readlink; - /* Nothing needed for cfs_fsync */ - /* Nothing needed for cfs_inactive */ - struct cfs_vget_out { - ViceFid VFid; - int vtype; - } cfs_vget; - /* CFS_SIGNAL is out-of-band, doesn't need data. */ - /* CFS_INVALIDATE is a venus->kernel call */ - /* CFS_FLUSH is a venus->kernel call */ - struct cfs_purgeuser_out {/* CFS_PURGEUSER is a venus->kernel call */ - struct CodaCred cred; - } cfs_purgeuser; - struct cfs_zapfile_out { /* CFS_ZAPFILE is a venus->kernel call */ - ViceFid CodaFid; - } cfs_zapfile; - struct cfs_zapdir_out { /* CFS_ZAPDIR is a venus->kernel call */ - ViceFid CodaFid; - } cfs_zapdir; - struct cfs_zapvnode_out { /* CFS_ZAPVNODE is a venus->kernel call */ - struct CodaCred cred; - ViceFid VFid; - } cfs_zapvnode; - struct cfs_purgefid_out { /* CFS_PURGEFID is a venus->kernel call */ - ViceFid CodaFid; - } cfs_purgefid; - struct cfs_rdwr_out { - int rwflag; - int count; - caddr_t data; /* Place holder for data. */ - } cfs_rdwr; - struct ody_mount_out { - ViceFid VFid; - } ody_mount; - struct ody_lookup_out { - ViceFid VFid; - } ody_lookup; - struct ody_expand_out { /* Eventually it would be nice to get some */ - char links[sizeof(int)]; /* Place holder for data. */ - } ody_expand; - struct cfs_replace_out { /* cfs_replace is a venus->kernel call */ - ViceFid NewFid; - ViceFid OldFid; - } cfs_replace; - } d; -}; - +/* cfs_root: NO_IN */ +struct cfs_root_out { + struct cfs_out_hdr oh; + ViceFid VFid; +}; + +struct cfs_root_in { + struct cfs_in_hdr in; +}; + +/* cfs_sync: */ +/* Nothing needed for cfs_sync */ + +/* cfs_open: */ +struct cfs_open_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int flags; +}; + +struct cfs_open_out { + struct cfs_out_hdr oh; + cdev_t dev; + ino_t inode; +}; + + +/* cfs_close: */ +struct cfs_close_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int flags; +}; + +struct cfs_close_out { + struct cfs_out_hdr out; +}; + +/* cfs_ioctl: */ +struct cfs_ioctl_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int cmd; + int len; + int rwflag; + char *data; /* Place holder for data. */ +}; + +struct cfs_ioctl_out { + struct cfs_out_hdr oh; + int len; + caddr_t data; /* Place holder for data. */ +}; + + +/* cfs_getattr: */ +struct cfs_getattr_in { + struct cfs_in_hdr ih; + ViceFid VFid; +}; + +struct cfs_getattr_out { + struct cfs_out_hdr oh; + struct coda_vattr attr; +}; + + +/* cfs_setattr: NO_OUT */ +struct cfs_setattr_in { + struct cfs_in_hdr ih; + ViceFid VFid; + struct coda_vattr attr; +}; + +struct cfs_setattr_out { + struct cfs_out_hdr out; +}; + +/* cfs_access: NO_OUT */ +struct cfs_access_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int flags; +}; + +struct cfs_access_out { + struct cfs_out_hdr out; +}; + +/* cfs_lookup: */ +struct cfs_lookup_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int name; /* Place holder for data. */ +}; + +struct cfs_lookup_out { + struct cfs_out_hdr oh; + ViceFid VFid; + int vtype; +}; + + +/* cfs_create: */ +struct cfs_create_in { + struct cfs_in_hdr ih; + ViceFid VFid; + struct coda_vattr attr; + int excl; + int mode; + int name; /* Place holder for data. */ +}; + +struct cfs_create_out { + struct cfs_out_hdr oh; + ViceFid VFid; + struct coda_vattr attr; +}; + + +/* cfs_remove: NO_OUT */ +struct cfs_remove_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int name; /* Place holder for data. */ +}; + +struct cfs_remove_out { + struct cfs_out_hdr out; +}; + +/* cfs_link: NO_OUT */ +struct cfs_link_in { + struct cfs_in_hdr ih; + ViceFid sourceFid; /* cnode to link *to* */ + ViceFid destFid; /* Directory in which to place link */ + int tname; /* Place holder for data. */ +}; + +struct cfs_link_out { + struct cfs_out_hdr out; +}; + + +/* cfs_rename: NO_OUT */ +struct cfs_rename_in { + struct cfs_in_hdr ih; + ViceFid sourceFid; + int srcname; + ViceFid destFid; + int destname; +}; + +struct cfs_rename_out { + struct cfs_out_hdr out; +}; + +/* cfs_mkdir: */ +struct cfs_mkdir_in { + struct cfs_in_hdr ih; + ViceFid VFid; + struct coda_vattr attr; + int name; /* Place holder for data. */ +}; + +struct cfs_mkdir_out { + struct cfs_out_hdr oh; + ViceFid VFid; + struct coda_vattr attr; +}; + + +/* cfs_rmdir: NO_OUT */ +struct cfs_rmdir_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int name; /* Place holder for data. */ +}; + +struct cfs_rmdir_out { + struct cfs_out_hdr out; +}; + +/* cfs_readdir: */ +struct cfs_readdir_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int count; + int offset; +}; + +struct cfs_readdir_out { + struct cfs_out_hdr oh; + int size; + caddr_t data; /* Place holder for data. */ +}; + +/* cfs_symlink: NO_OUT */ +struct cfs_symlink_in { + struct cfs_in_hdr ih; + ViceFid VFid; /* Directory to put symlink in */ + int srcname; + struct coda_vattr attr; + int tname; +}; + +struct cfs_symlink_out { + struct cfs_out_hdr out; +}; + +/* cfs_readlink: */ +struct cfs_readlink_in { + struct cfs_in_hdr ih; + ViceFid VFid; +}; + +struct cfs_readlink_out { + struct cfs_out_hdr oh; + int count; + caddr_t data; /* Place holder for data. */ +}; + + +/* cfs_fsync: NO_OUT */ +struct cfs_fsync_in { + struct cfs_in_hdr ih; + ViceFid VFid; +}; + +struct cfs_fsync_out { + struct cfs_out_hdr out; +}; + +/* cfs_inactive: NO_OUT */ +struct cfs_inactive_in { + struct cfs_in_hdr ih; + ViceFid VFid; +}; + +/* cfs_vget: */ +struct cfs_vget_in { + struct cfs_in_hdr ih; + ViceFid VFid; +}; + +struct cfs_vget_out { + struct cfs_out_hdr oh; + ViceFid VFid; + int vtype; +}; + + +/* CFS_SIGNAL is out-of-band, doesn't need data. */ +/* CFS_INVALIDATE is a venus->kernel call */ +/* CFS_FLUSH is a venus->kernel call */ + +/* cfs_purgeuser: */ +/* CFS_PURGEUSER is a venus->kernel call */ +struct cfs_purgeuser_out { + struct cfs_out_hdr oh; + struct coda_cred cred; +}; + +/* cfs_zapfile: */ +/* CFS_ZAPFILE is a venus->kernel call */ +struct cfs_zapfile_out { + struct cfs_out_hdr oh; + ViceFid CodaFid; +}; + +/* cfs_zapdir: */ +/* CFS_ZAPDIR is a venus->kernel call */ +struct cfs_zapdir_out { + struct cfs_out_hdr oh; + ViceFid CodaFid; +}; + +/* cfs_zapnode: */ +/* CFS_ZAPVNODE is a venus->kernel call */ +struct cfs_zapvnode_out { + struct cfs_out_hdr oh; + struct coda_cred cred; + ViceFid VFid; +}; + +/* cfs_purgefid: */ +/* CFS_PURGEFID is a venus->kernel call */ +struct cfs_purgefid_out { + struct cfs_out_hdr oh; + ViceFid CodaFid; +}; + +/* cfs_rdwr: */ +struct cfs_rdwr_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int rwflag; + int count; + int offset; + int ioflag; + caddr_t data; /* Place holder for data. */ +}; + +struct cfs_rdwr_out { + struct cfs_out_hdr oh; + int rwflag; + int count; + caddr_t data; /* Place holder for data. */ +}; + + +/* cfs_replace: */ +/* CFS_REPLACE is a venus->kernel call */ +struct cfs_replace_out { /* cfs_replace is a venus->kernel call */ + struct cfs_out_hdr oh; + ViceFid NewFid; + ViceFid OldFid; +}; + +/* cfs_open_by_path: */ +struct cfs_open_by_path_in { + struct cfs_in_hdr ih; + ViceFid VFid; + int flags; +}; + +struct cfs_open_by_path_out { + struct cfs_out_hdr oh; + int path; +}; /* - * how big are the inputArgs and outputArgs structures - * for the varying types of calls? + * Occasionally, don't cache the fid returned by CFS_LOOKUP. For instance, if + * the fid is inconsistent. This case is handled by setting the top bit of the + * return result parameter. */ -#define VC_IN_NO_DATA (2 * (int)sizeof(u_long) \ - + 2 * (int)sizeof(u_short) \ - + (int)sizeof(struct CodaCred)) -#define VC_OUT_NO_DATA (3 * (int)sizeof(u_long)) -#define VC_INSIZE(member) (VC_IN_NO_DATA + (int)sizeof(struct member)) -#define VC_OUTSIZE(member) (VC_OUT_NO_DATA + (int)sizeof(struct member)) - -/* Now for venus. C++ doesn't know what struct foo means. */ -#define VC_SIZE(Thing, Member) (VC_OUT_NO_DATA \ - + (int)sizeof((Thing)->d.Member)) - -#define VC_BIGGER_OF_IN_OR_OUT (sizeof(struct outputArgs) \ - > sizeof(struct inputArgs) \ - ? sizeof(struct outputArgs) \ - : sizeof(struct inputArgs)) -#define VC_DATASIZE 8192 -#define VC_MAXMSGSIZE (VC_DATASIZE + VC_BIGGER_OF_IN_OR_OUT) +#define CFS_NOCACHE 0x80000000 + +union inputArgs { + struct cfs_in_hdr ih; /* NB: every struct below begins with an ih */ + struct cfs_open_in cfs_open; + struct cfs_close_in cfs_close; + struct cfs_ioctl_in cfs_ioctl; + struct cfs_getattr_in cfs_getattr; + struct cfs_setattr_in cfs_setattr; + struct cfs_access_in cfs_access; + struct cfs_lookup_in cfs_lookup; + struct cfs_create_in cfs_create; + struct cfs_remove_in cfs_remove; + struct cfs_link_in cfs_link; + struct cfs_rename_in cfs_rename; + struct cfs_mkdir_in cfs_mkdir; + struct cfs_rmdir_in cfs_rmdir; + struct cfs_readdir_in cfs_readdir; + struct cfs_symlink_in cfs_symlink; + struct cfs_readlink_in cfs_readlink; + struct cfs_fsync_in cfs_fsync; + struct cfs_inactive_in cfs_inactive; + struct cfs_vget_in cfs_vget; + struct cfs_rdwr_in cfs_rdwr; + struct cfs_open_by_path_in cfs_open_by_path; +}; + +union outputArgs { + struct cfs_out_hdr oh; /* NB: every struct below begins with an oh */ + struct cfs_root_out cfs_root; + struct cfs_open_out cfs_open; + struct cfs_ioctl_out cfs_ioctl; + struct cfs_getattr_out cfs_getattr; + struct cfs_lookup_out cfs_lookup; + struct cfs_create_out cfs_create; + struct cfs_mkdir_out cfs_mkdir; + struct cfs_readdir_out cfs_readdir; + struct cfs_readlink_out cfs_readlink; + struct cfs_vget_out cfs_vget; + struct cfs_purgeuser_out cfs_purgeuser; + struct cfs_zapfile_out cfs_zapfile; + struct cfs_zapdir_out cfs_zapdir; + struct cfs_zapvnode_out cfs_zapvnode; + struct cfs_purgefid_out cfs_purgefid; + struct cfs_rdwr_out cfs_rdwr; + struct cfs_replace_out cfs_replace; + struct cfs_open_by_path_out cfs_open_by_path; +}; + +union cfs_downcalls { + /* CFS_INVALIDATE is a venus->kernel call */ + /* CFS_FLUSH is a venus->kernel call */ + struct cfs_purgeuser_out purgeuser; + struct cfs_zapfile_out zapfile; + struct cfs_zapdir_out zapdir; + struct cfs_zapvnode_out zapvnode; + struct cfs_purgefid_out purgefid; + struct cfs_replace_out replace; +}; + /* * Used for identifying usage of "Control" and pioctls */ + +#define PIOCPARM_MASK 0x0000ffff struct ViceIoctl { caddr_t in, out; /* Data to be transferred in, or out */ short in_size; /* Size of input buffer <= 2K */ @@ -465,25 +669,17 @@ struct PioctlData { struct ViceIoctl vi; }; - - - - - #define CFS_CONTROL ".CONTROL" #define CFS_CONTROLLEN 8 #define CTL_VOL -1 #define CTL_VNO -1 #define CTL_UNI -1 #define CTL_INO -1 -#define CTL_FILE "/coda/.CONTROL" -#define IOCPARM_MASK 0x0000ffff +#define CTL_FILE "/coda/.CONTROL" #define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\ (fidp)->Vnode == CTL_VNO &&\ (fidp)->Unique == CTL_UNI) - /*#define ISDIR(fid) ((fid).Vnode & 0x1) */ - #endif diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h new file mode 100644 index 000000000..44251867f --- /dev/null +++ b/include/linux/coda_cache.h @@ -0,0 +1,80 @@ +/* Coda filesystem -- Linux Minicache + * + * Copyright (C) 1989 - 1997 Carnegie Mellon University + * + * Carnegie Mellon University encourages users of this software to + * contribute improvements to the Coda project. Contact Peter Braam + * <coda@cs.cmu.edu> + */ + +#ifndef _CFSNC_HEADER_ +#define _CFSNC_HEADER_ + +/* + * Structure for an element in the Coda Credential Cache. + */ + +struct coda_cache { + struct list_head cc_cclist; /* list of all cache entries */ + struct list_head cc_cnlist; /* list of cache entries/cnode */ + int cc_mask; + struct coda_cred cc_cred; +}; + +void coda_ccinsert(struct coda_cache *el, struct super_block *sb); +void coda_cninsert(struct coda_cache *el, struct coda_inode_info *cnp); +void coda_ccremove(struct coda_cache *el); +void coda_cnremove(struct coda_cache *el); +void coda_cache_create(struct inode *inode, int mask); +struct coda_cache *coda_cache_find(struct inode *inode); +void coda_cache_enter(struct inode *inode, int mask); +void coda_cache_clear_cnp(struct coda_inode_info *cnp); +void coda_cache_clear_all(struct super_block *sb); +void coda_cache_clear_cred(struct super_block *sb, struct coda_cred *cred); +int coda_cache_check(struct inode *inode, int mask); +void coda_dentry_delete(struct dentry *dentry); +void coda_zapfid(struct ViceFid *fid, struct super_block *sb, int flag); + + +/* + * Structure to contain statistics on the cache usage + */ + +struct cfsnc_statistics { + unsigned hits; + unsigned misses; + unsigned enters; + unsigned dbl_enters; + unsigned long_name_enters; + unsigned long_name_lookups; + unsigned long_remove; + unsigned lru_rm; + unsigned zapPfids; + unsigned zapFids; + unsigned zapFile; + unsigned zapUsers; + unsigned Flushes; + unsigned Sum_bucket_len; + unsigned Sum2_bucket_len; + unsigned Max_bucket_len; + unsigned Num_zero_len; + unsigned Search_len; +}; + + +#define CFSNC_FIND ((u_long) 1) +#define CFSNC_REMOVE ((u_long) 2) +#define CFSNC_INIT ((u_long) 3) +#define CFSNC_ENTER ((u_long) 4) +#define CFSNC_LOOKUP ((u_long) 5) +#define CFSNC_ZAPPFID ((u_long) 6) +#define CFSNC_ZAPFID ((u_long) 7) +#define CFSNC_ZAPVNODE ((u_long) 8) +#define CFSNC_ZAPFILE ((u_long) 9) +#define CFSNC_PURGEUSER ((u_long) 10) +#define CFSNC_FLUSH ((u_long) 11) +#define CFSNC_PRINTCFSNC ((u_long) 12) +#define CFSNC_PRINTSTATS ((u_long) 13) +#define CFSNC_REPLACE ((u_long) 14) + +#endif _CFSNC_HEADER_ diff --git a/include/linux/coda_cnode.h b/include/linux/coda_cnode.h deleted file mode 100644 index 43bf1b2cc..000000000 --- a/include/linux/coda_cnode.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Cnode definitions for Coda. - * Original version: (C) 1996 Peter Braam - * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University - * - * Carnegie Mellon encourages users of this code to contribute improvements - * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>. - */ - -/* revamped cnode.h file: platform dependent, kernel only! */ - - -#ifndef _CNODE_H_ -#define _CNODE_H_ -#include <linux/coda.h> - - -#define CODA_CNODE_MAGIC 0x47114711 - -/* defintion of cnode, which combines ViceFid with inode information */ -struct cnode { - struct inode *c_vnode; /* linux inode associated with cnode */ - ViceFid c_fid; /* Coda identifier */ - u_short c_flags; /* flags (see below) */ - int c_magic; /* to verify the data structure */ - u_short c_ocount; /* count of openers */ - u_short c_owrite; /* count of open for write */ - u_short c_mmcount; /* count of mmappers */ - struct inode *c_ovp; /* open vnode pointer */ - struct dentry c_odentry; -}; - -/* flags */ -#define C_VATTR 0x1 /* Validity of vattr in the cnode */ -#define C_SYMLINK 0x2 /* Validity of symlink pointer in the cnode */ -#define C_DYING 0x4 /* Set for outstanding cnodes from venus (which died) */ - -struct cnode *coda_cnode_alloc(void); -void coda_cnode_free(struct cnode *cinode); -int coda_cnode_make(struct inode **inode, ViceFid *fid, struct super_block *sb); -struct inode *coda_fid2inode(ViceFid *fid, struct super_block *sb); -int coda_cnode_makectl(struct inode **inode, struct super_block *sb); - - - -#endif - diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h new file mode 100644 index 000000000..1277445b9 --- /dev/null +++ b/include/linux/coda_fs_i.h @@ -0,0 +1,52 @@ +/* + * coda_fs_i.h + * + * Copyright (C) 1998 Carnegie Mellon University + * + */ + +#ifndef _LINUX_CODA_FS_I +#define _LINUX_CODA_FS_I + +#ifdef __KERNEL__ +#include <linux/types.h> +#include <linux/list.h> +#include <linux/coda.h> + + + +#define CODA_CNODE_MAGIC 0x47114711 +/* + * smb fs inode data (in memory only) + */ +struct coda_inode_info { + struct ViceFid c_fid; /* Coda identifier */ + u_short c_flags; /* flags (see below) */ + u_short c_ocount; /* count of openers */ + u_short c_owrite; /* count of open for write */ + u_short c_mmcount; /* count of mmappers */ + struct inode *c_ovp; /* open inode pointer */ + struct list_head c_cnhead; /* head of cache entries */ + struct list_head c_volrootlist; /* list of volroot cnoddes */ + struct inode *c_vnode; /* inode associated with cnode */ + int c_magic; /* to verify the data structure */ +}; + +/* flags */ +#define C_VATTR 0x1 /* Validity of vattr in the cnode */ +#define C_SYMLINK 0x2 /* Validity of symlink pointer in the cnode */ +#define C_DYING 0x4 /* Set for outstanding cnodes from venus (which died) */ +#define C_ZAPFID 0x8 +#define C_ZAPDIR 0x10 +#define C_INITED 0x20 + +int coda_cnode_make(struct inode **, struct ViceFid *, struct super_block *); +int coda_cnode_makectl(struct inode **inode, struct super_block *sb); +struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb); + +/* inode to cnode */ +#define ITOC(inode) ((struct coda_inode_info *)&((inode)->u.coda_i)) + + +#endif +#endif diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 35901883b..fa477cb52 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -41,15 +41,20 @@ int coda_permission(struct inode *inode, int mask); extern int coda_debug; extern int coda_print_entry; extern int coda_access_cache; -extern int cfsnc_use; - -/* */ -char *coda_f2s(ViceFid *f, char *s); +/* this file: heloers */ +char *coda_f2s(ViceFid *f); int coda_isroot(struct inode *i); -void coda_load_creds(struct CodaCred *cred); - - +int coda_fid_is_volroot(struct ViceFid *); +int coda_iscontrol(const char *name, size_t length); +void coda_load_creds(struct coda_cred *cred); +int coda_mycred(struct coda_cred *); +void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); +void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); +unsigned short coda_flags_to_cflags(unsigned short); +void print_vattr( struct coda_vattr *attr ); +int coda_cred_ok(struct coda_cred *cred); +int coda_cred_eq(struct coda_cred *cred1, struct coda_cred *cred2); /* defined in file.c */ void coda_prepare_openfile(struct inode *coda_inode, struct file *coda_file, @@ -58,17 +63,8 @@ void coda_prepare_openfile(struct inode *coda_inode, struct file *coda_file, void coda_restore_codafile(struct inode *coda_inode, struct file *coda_file, struct inode *open_inode, struct file *open_file); int coda_inode_grab(dev_t dev, ino_t ino, struct inode **ind); -struct super_block *coda_find_super(kdev_t device); - -#define INIT_IN(in, op) \ - (in)->opcode = (op); \ - (in)->pid = current->pid; \ - (in)->pgid = current->gid; - -/* debugging aids */ - -#define coda_panic printk +#define NB_SFS_SIZ 0x895440 /* debugging masks */ #define D_SUPER 1 /* print results returned by Venus */ @@ -81,8 +77,8 @@ struct super_block *coda_find_super(kdev_t device); #define D_PSDEV 128 #define D_PIOCTL 256 #define D_SPECIAL 512 -/* until we are really good, ... */ -#define coda_panic printk +#define D_TIMING 1024 +#define D_DOWNCALL 2048 #define CDEBUG(mask, format, a...) \ do { \ @@ -97,31 +93,7 @@ struct super_block *coda_find_super(kdev_t device); #define EXIT \ if(coda_print_entry) printk("Process %d leaving %s\n",current->pid,__FUNCTION__) - -/* inode to cnode */ -#define ITOC(the_inode) ((struct cnode *)(the_inode)->u.generic_ip) -/* cnode to inode */ -#define CTOI(the_cnode) ((the_cnode)->c_vnode) - -#define CHECK_CNODE(c) \ -do { \ - struct cnode *cnode = (c); \ - if (!cnode) \ - coda_panic ("%s(%d): cnode is null\n", __FUNCTION__, __LINE__); \ - if (cnode->c_magic != CODA_CNODE_MAGIC) \ - coda_panic ("%s(%d): cnode magic wrong\n", __FUNCTION__, __LINE__); \ - if (!cnode->c_vnode) \ - coda_panic ("%s(%d): cnode has null inode\n", __FUNCTION__, __LINE__); \ - if ( (struct cnode *)cnode->c_vnode->u.generic_ip != cnode ) \ - coda_panic("AAooh, %s(%d) cnode doesn't link right!\n", __FUNCTION__,__LINE__);\ -} while (0); - - -/* ioctl stuff */ -/* this needs to be sorted out XXXX */ -#ifdef __linux__ -#define IOCPARM_MASK 0x0000ffff -#endif +#define CHECK_CNODE(c) do { } while (0); #define CODA_ALLOC(ptr, cast, size) \ do { \ @@ -132,7 +104,7 @@ do { \ ptr = (cast)vmalloc((unsigned long) size); \ CDEBUG(D_MALLOC, "vmalloced: %x at %x.\n", (int) size, (int) ptr);}\ if (ptr == 0) { \ - coda_panic("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ + printk("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ } \ memset( ptr, 0, size ); \ } while (0) @@ -140,48 +112,4 @@ do { \ #define CODA_FREE(ptr,size) do {if (size < 3000) { kfree_s((ptr), (size)); CDEBUG(D_MALLOC, "kfreed: %x at %x.\n", (int) size, (int) ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %x at %x.\n", (int) size, (int) ptr);} } while (0) - - - -/* - * Macros to manipulate the queue - */ -#define crfree(cred) CODA_FREE( (cred), sizeof(struct ucred)) - -#ifndef INIT_QUEUE - -struct queue { - struct queue *forw, *back; -}; - -#define INIT_QUEUE(head) \ -do { \ - (head).forw = (struct queue *)&(head); \ - (head).back = (struct queue *)&(head); \ -} while (0) - -#define GETNEXT(head) (head).forw - -#define EMPTY(head) ((head).forw == &(head)) - -#define EOQ(el, head) ((struct queue *)(el) == (struct queue *)&(head)) - -#define INSQUE(el, head) \ -do { \ - (el).forw = ((head).back)->forw; \ - (el).back = (head).back; \ - ((head).back)->forw = (struct queue *)&(el); \ - (head).back = (struct queue *)&(el); \ -} while (0) - -#define REMQUE(el) \ -do { \ - ((el).forw)->back = (el).back; \ - (el).back->forw = (el).forw; \ -} while (0) - -#endif INIT_QUEUE - - -#endif _LINUX_CODA_FS - +#endif diff --git a/include/linux/coda_namecache.h b/include/linux/coda_namecache.h deleted file mode 100644 index 261adff6b..000000000 --- a/include/linux/coda_namecache.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1990 Carnegie-Mellon University - * Copyright (c) 1989 Carnegie-Mellon University - * All rights reserved. The CMU software License Agreement specifies - * the terms and conditions for use and redistribution. - */ - -/* - * This code was written for the Coda file system at Carnegie Mellon University. - * Contributers include David Steere, James Kistler, and M. Satyanarayanan. - */ - -/* - * HISTORY - * cfsnc.h,v - * Revision 1.2 1996/01/02 16:57:19 bnoble - * Added support for Coda MiniCache and raw inode calls (final commit) - * - * Revision 1.1.2.1 1995/12/20 01:57:45 bnoble - * Added CFS-specific files - * - * Revision 3.1.1.1 1995/03/04 19:08:22 bnoble - * Branch for NetBSD port revisions - * - * Revision 3.1 1995/03/04 19:08:21 bnoble - * Bump to major revision 3 to prepare for NetBSD port - * - * Revision 2.2 1994/08/28 19:37:39 luqi - * Add a new CFS_REPLACE call to allow venus to replace a ViceFid in the - * mini-cache. - * - * In "cfs.h": - * Add CFS_REPLACE decl. - * - * In "cfs_namecache.c": - * Add routine cfsnc_replace. - * - * In "cfs_subr.c": - * Add case-statement to process CFS_REPLACE. - * - * In "cfsnc.h": - * Add decl for CFSNC_REPLACE. - * - * Revision 2.1 94/07/21 16:25:27 satya - * Conversion to C++ 3.0; start of Coda Release 2.0 - * - * Revision 1.2 92/10/27 17:58:34 lily - * merge kernel/latest and alpha/src/cfs - * - * Revision 2.2 90/07/05 11:27:04 mrt - * Created for the Coda File System. - * [90/05/23 dcs] - * - * Revision 1.4 90/05/31 17:02:12 dcs - * Prepare for merge with facilities kernel. - * - * - */ -#ifndef _CFSNC_HEADER_ -#define _CFSNC_HEADER_ - -#include "coda.h" -#include "coda_cnode.h" - - -/* - * Cfs constants - */ -#define CFSNC_NAMELEN 15 /* longest name stored in cache */ -#define CFSNC_CACHESIZE 256 /* Default cache size */ -#define CFSNC_HASHSIZE 64 /* Must be multiple of 2 */ -/* - * Structure for an element in the CFS Name Cache. - */ - -/* roughly 50 bytes per entry */ -struct cfscache { - struct cfscache *hash_next,*hash_prev; /* Hash list */ - struct cfscache *lru_next, *lru_prev; /* LRU list */ - struct cnode *cp; /* vnode of the file */ - struct cnode *dcp; /* parent's cnode */ - struct CodaCred *cred; /* user credentials */ - char name[CFSNC_NAMELEN]; /* segment name */ - int namelen; /* length of name */ -}; - - - -/* exported */ -void cfsnc_init(void); -void cfsnc_enter(struct cnode *dcp, register const char *name, int namelen, struct cnode *cp); -struct cnode *cfsnc_lookup(struct cnode *dcp, register const char *name, int namelen); -void cfsnc_zapParentfid(ViceFid *fid); -void cfsnc_zapfid(ViceFid *fid); -void cfsnc_zapfile(struct cnode *dcp, register const char *name, int length); -void cfsnc_purge_user(struct CodaCred *cred); -void cfsnc_flush(void); -void cfsnc_replace(ViceFid *f1, ViceFid *f2); -void print_cfsnc(void); -void coda_print_ce(struct cfscache *); -int cfsnc_resize(int hashsize, int heapsize); - - - -/* #define CFSNC_VALID(cncp) ( (cncp->dcp != (struct cnode *)0) && (cncp->cp->c_flags & C_VATTR) ) */ -#define CFSNC_VALID(cncp) (cncp->dcp != (struct cnode *)0) - -#define DATA_PART(cncp) (struct cfscache *) \ - ((char *)cncp + (4*sizeof(struct cfscache *))) -#define DATA_SIZE (sizeof(struct cfscache)-(4*sizeof(struct cfscache *))) - -/* - * Structure to contain statistics on the cache usage - */ - -struct cfsnc_statistics { - unsigned hits; - unsigned misses; - unsigned enters; - unsigned dbl_enters; - unsigned long_name_enters; - unsigned long_name_lookups; - unsigned long_remove; - unsigned lru_rm; - unsigned zapPfids; - unsigned zapFids; - unsigned zapFile; - unsigned zapUsers; - unsigned Flushes; - unsigned Sum_bucket_len; - unsigned Sum2_bucket_len; - unsigned Max_bucket_len; - unsigned Num_zero_len; - unsigned Search_len; -}; - -/* - * Symbols to aid in debugging the namecache code. Assumes the existence - * of the variable cfsnc_debug, which is defined in cfs_namecache.c - */ -extern int cfsnc_debug; -#define CFSNC_DEBUG(N, STMT) { if (cfsnc_debug & (1 <<N)) { STMT } } - -#define CFSNC_FIND ((u_long) 1) -#define CFSNC_REMOVE ((u_long) 2) -#define CFSNC_INIT ((u_long) 3) -#define CFSNC_ENTER ((u_long) 4) -#define CFSNC_LOOKUP ((u_long) 5) -#define CFSNC_ZAPPFID ((u_long) 6) -#define CFSNC_ZAPFID ((u_long) 7) -#define CFSNC_ZAPVNODE ((u_long) 8) -#define CFSNC_ZAPFILE ((u_long) 9) -#define CFSNC_PURGEUSER ((u_long) 10) -#define CFSNC_FLUSH ((u_long) 11) -#define CFSNC_PRINTCFSNC ((u_long) 12) -#define CFSNC_PRINTSTATS ((u_long) 13) -#define CFSNC_REPLACE ((u_long) 14) - -#endif _CFSNC_HEADER_ diff --git a/include/linux/coda_opstats.h b/include/linux/coda_opstats.h index 2c127e6e5..fdf3fac42 100644 --- a/include/linux/coda_opstats.h +++ b/include/linux/coda_opstats.h @@ -1,27 +1,14 @@ -/* - * Operations statistics for Coda. - * Original version: (C) 1996 Peter Braam - * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University - * - * Carnegie Mellon encourages users of this code to contribute improvements - * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>. - */ - /* - * operation stats: what the minicache can intercept that - * *isn't* seen by venus. These stats are kept to augment - * the stats maintained by the Volume-Session mechanism. + * Operation statistics for Coda. + * Copyright (C) 1997 Carnegie Mellon University + * + * Carnegie Mellon University encourages users of this software + * to contribute improvements to the Coda project. Contact Peter Braam + * <coda@coda.cs.cmu.edu>. */ -/* vfsops: - * mount: not currently bounced to Venus - * umount: nope - * root: only first call, rest is cached. - * statfs: none (bogus) - * sync: none (bogus) - * vget: all - */ + #define CFS_MOUNT_STATS 0 #define CFS_UMOUNT_STATS 1 diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index ecd213f8b..370408e07 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -6,17 +6,46 @@ extern struct vcomm psdev_vcomm[]; +/* queue stuff; the rest is static to psdev.c */ +struct queue { + struct queue *forw, *back; +}; +void coda_q_insert(struct queue *el, struct queue *q); +void coda_q_remove(struct queue *q); + + #define CODA_SUPER_MAGIC 0x73757245 struct coda_sb_info { - struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */ - struct inode * sbi_ctlcp; /* control magic file */ - int sbi_refct; - struct vcomm * sbi_vcomm; - struct inode * sbi_root; + struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */ + struct inode * sbi_ctlcp; /* control magic file */ + int sbi_refct; + struct vcomm * sbi_vcomm; + struct inode * sbi_root; + struct list_head sbi_cchead; + struct list_head sbi_volroothead; }; +/* communication pending/processing queues queues */ +struct vcomm { + u_long vc_seq; + struct wait_queue *vc_waitq; /* Venus wait queue */ + struct queue vc_pending; + struct queue vc_processing; + struct super_block *vc_sb; + int vc_inuse; +}; + +static inline int vcomm_open(struct vcomm *vcp) +{ + return ((vcp)->vc_pending.forw != NULL); +} + +static inline void mark_vcomm_closed(struct vcomm *vcp) +{ + (vcp)->vc_pending.forw = NULL; +} static inline struct coda_sb_info *coda_sbp(struct super_block *sb) { @@ -28,22 +57,6 @@ static inline struct coda_sb_info *coda_sbp(struct super_block *sb) extern void coda_psdev_detach(int unit); extern int init_coda_psdev(void); -/* to aid procedures make upcalls. They must have a - declaration at the top containing: - struct inputArgs *inp; - struct outputArgs *outp; - int error=0; - int size; -*/ - -#define UPARG(bsize, op)\ -do {\ - CODA_ALLOC(inp, struct inputArgs *, (bsize));\ - outp = (struct outputArgs *) (inp);\ - INIT_IN(inp, (op))\ - coda_load_creds(&(inp->cred));\ - size = (bsize);\ -} while (0) /* upcalls */ int venus_rootfid(struct super_block *sb, ViceFid *fidp); @@ -80,40 +93,27 @@ int venus_symlink(struct super_block *sb, struct ViceFid *fid, int venus_access(struct super_block *sb, struct ViceFid *fid, int mask); int venus_pioctl(struct super_block *sb, struct ViceFid *fid, unsigned int cmd, struct PioctlData *data); -int coda_downcall(int opcode, struct outputArgs *out); +int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb); int coda_upcall(struct coda_sb_info *mntinfo, int inSize, - int *outSize, struct inputArgs *buffer); + int *outSize, union inputArgs *buffer); +int venus_fsync(struct super_block *sb, struct ViceFid *fid); /* messages between coda filesystem in kernel and Venus */ +extern int coda_hard; +extern unsigned long coda_timeout; struct vmsg { - struct queue vm_chain; - caddr_t vm_data; - u_short vm_flags; - u_short vm_inSize; /* Size is at most 5000 bytes */ - u_short vm_outSize; - u_short vm_opcode; /* copied from data to save lookup */ - int vm_unique; - struct wait_queue *vm_sleep; /* process' wait queue */ -}; - -/* communication pending/processing queues queues */ -struct vcomm { - u_long vc_seq; - struct wait_queue *vc_waitq; /* Venus wait queue */ - struct queue vc_pending; - struct queue vc_processing; + struct queue vm_chain; + caddr_t vm_data; + u_short vm_flags; + u_short vm_inSize; /* Size is at most 5000 bytes */ + u_short vm_outSize; + u_short vm_opcode; /* copied from data to save lookup */ + int vm_unique; + struct wait_queue *vm_sleep; /* process' wait queue */ + unsigned long vm_posttime; }; -static inline int vcomm_open(struct vcomm *vcp) -{ - return ((vcp)->vc_pending.forw != NULL); -} - -static inline void mark_vcomm_closed(struct vcomm *vcp) -{ - (vcp)->vc_pending.forw = NULL; -} /* * Statistics diff --git a/include/linux/comstats.h b/include/linux/comstats.h index d56918486..066888599 100644 --- a/include/linux/comstats.h +++ b/include/linux/comstats.h @@ -3,7 +3,7 @@ /* * comstats.h -- Serial Port Stats. * - * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au). * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify diff --git a/include/linux/config.h b/include/linux/config.h index f817d0710..9d1c14f7a 100644 --- a/include/linux/config.h +++ b/include/linux/config.h @@ -3,28 +3,4 @@ #include <linux/autoconf.h> -/* - * Defines for what uname() should return - */ -#ifndef UTS_SYSNAME -#define UTS_SYSNAME "Linux" -#endif - -#ifndef UTS_MACHINE -#define UTS_MACHINE "unknown" -#endif - -#ifndef UTS_NODENAME -#define UTS_NODENAME "(none)" /* set by sethostname() */ -#endif - -#ifndef UTS_DOMAINNAME -#define UTS_DOMAINNAME "(none)" /* set by setdomainname() */ -#endif - -/* - * The definitions for UTS_RELEASE and UTS_VERSION are now defined - * in linux/version.h, and should only be used by linux/version.c - */ - #endif diff --git a/include/linux/console.h b/include/linux/console.h index fc5cd4b2d..8c0854b0b 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -99,6 +99,7 @@ struct console }; extern void register_console(struct console *); +extern int unregister_console(struct console *); extern struct console *console_drivers; #endif /* linux/console.h */ diff --git a/include/linux/ctype.h b/include/linux/ctype.h index bac58b52f..afa363922 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h @@ -2,7 +2,7 @@ #define _LINUX_CTYPE_H /* - * NOTE! This ctype does not handle EOF like the standarc C + * NOTE! This ctype does not handle EOF like the standard C * library is required to. */ diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 53a2ce3e3..c095f1007 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -61,18 +61,22 @@ struct dentry { struct list_head d_lru; /* d_count = 0 LRU list */ struct list_head d_child; /* child of parent list */ struct list_head d_subdirs; /* our children */ + struct list_head d_alias; /* inode alias list */ struct qstr d_name; unsigned long d_time; /* used by d_revalidate */ struct dentry_operations *d_op; struct super_block * d_sb; /* The root of the dentry tree */ unsigned long d_reftime; /* last time referenced */ + void * d_fsdata; /* fs-specific data */ }; struct dentry_operations { int (*d_revalidate)(struct dentry *); - int (*d_hash) (struct dentry *,struct qstr *); - int (*d_compare) (struct dentry *,struct qstr *, struct qstr *); + int (*d_hash) (struct dentry *, struct qstr *); + int (*d_compare) (struct dentry *, struct qstr *, struct qstr *); void (*d_delete)(struct dentry *); + void (*d_release)(struct dentry *); + void (*d_iput)(struct dentry *, struct inode *); }; /* the dentry parameter passed to d_hash and d_compare is the parent diff --git a/include/linux/elf.h b/include/linux/elf.h index 3d2864f55..2147b403d 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -151,7 +151,8 @@ typedef __u64 Elf64_Word; #define AT_EUID 12 /* effective uid */ #define AT_GID 13 /* real gid */ #define AT_EGID 14 /* effective gid */ - +#define AT_PLATFORM 15 /* string identifying cpu for optimizations */ +#define AT_HWCAP 16 /* arch dependent hints at cpu capabilities */ typedef struct dynamic{ Elf32_Sword d_tag; @@ -276,6 +277,14 @@ typedef struct { #define R_SPARC_5 44 #define R_SPARC_6 45 +/* Bits present in AT_HWCAP, primarily for Sparc32. */ + +#define HWCAP_SPARC_FLUSH 1 /* The cpu supports flush insn. */ +#define HWCAP_SPARC_STBAR 2 +#define HWCAP_SPARC_SWAP 4 +#define HWCAP_SPARC_MULDIV 8 + + /* * 68k ELF relocation types */ @@ -303,6 +312,43 @@ typedef struct { #define R_68K_JMP_SLOT 21 #define R_68K_RELATIVE 22 +/* + * Alpha ELF relocation types + */ +#define R_ALPHA_NONE 0 /* No reloc */ +#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ +#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ +#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ +#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ +#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ +#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ +#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ +#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ +#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ +#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ +#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ +#define R_ALPHA_OP_PUSH 12 /* OP stack push */ +#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */ +#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */ +#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */ +#define R_ALPHA_GPVALUE 16 +#define R_ALPHA_GPRELHIGH 17 +#define R_ALPHA_GPRELLOW 18 +#define R_ALPHA_IMMED_GP_16 19 +#define R_ALPHA_IMMED_GP_HI32 20 +#define R_ALPHA_IMMED_SCN_HI32 21 +#define R_ALPHA_IMMED_BR_HI32 22 +#define R_ALPHA_IMMED_LO32 23 +#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ +#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ +#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ +#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ + +/* Legal values for e_flags field of Elf64_Ehdr. */ + +#define EF_ALPHA_32BIT 1 /* All addresses are below 2GB */ + + typedef struct elf32_rel { Elf32_Addr r_offset; Elf32_Word r_info; @@ -528,8 +574,6 @@ typedef struct elf64_note { Elf32_Word n_type; /* Content type */ } Elf64_Nhdr; -#define ELF_START_MMAP 0x80000000 - #if ELF_CLASS == ELFCLASS32 extern Elf32_Dyn _DYNAMIC []; diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 2fe53ca3d..5c1cb05bd 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -41,8 +41,8 @@ struct elf_prstatus #endif struct elf_siginfo pr_info; /* Info associated with signal */ short pr_cursig; /* Current signal */ - sigset_t pr_sigpend; /* Set of pending signals */ - sigset_t pr_sighold; /* Set of held signals */ + unsigned long pr_sigpend; /* Set of pending signals */ + unsigned long pr_sighold; /* Set of held signals */ #if 0 struct sigaltstack pr_altstack; /* Alternate stack info */ struct sigaction pr_action; /* Signal action for current sig */ diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index c0384391d..9101855c5 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -35,15 +35,14 @@ extern int eth_rebuild_header(struct sk_buff *skb); extern unsigned short eth_type_trans(struct sk_buff *skb, struct device *dev); extern void eth_header_cache_update(struct hh_cache *hh, struct device *dev, unsigned char * haddr); -extern int eth_header_cache(struct dst_entry *dst, - struct neighbour *neigh, +extern int eth_header_cache(struct neighbour *neigh, struct hh_cache *hh); extern int eth_header_parse(struct sk_buff *skb, unsigned char *haddr); extern struct device * init_etherdev(struct device *, int); #ifdef CONFIG_IP_ROUTER -static void inline eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base) +static __inline__ void eth_copy_and_sum (struct sk_buff *dest, unsigned char *src, int len, int base) { memcpy (dest->data, src, len); } diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 604548798..49cdbe2f5 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -499,9 +499,10 @@ extern int ext2_mkdir (struct inode *,struct dentry *,int); extern int ext2_rmdir (struct inode *,struct dentry *); extern int ext2_unlink (struct inode *,struct dentry *); extern int ext2_symlink (struct inode *,struct dentry *,const char *); -extern int ext2_link (struct inode *, struct inode *, struct dentry *); +extern int ext2_link (struct dentry *, struct inode *, struct dentry *); extern int ext2_mknod (struct inode *, struct dentry *, int, int); -extern int ext2_rename (struct inode *, struct dentry *,struct inode *, struct dentry *); +extern int ext2_rename (struct inode *, struct dentry *, + struct inode *, struct dentry *); /* super.c */ extern void ext2_error (struct super_block *, const char *, const char *, ...) diff --git a/include/linux/fat_cvf.h b/include/linux/fat_cvf.h new file mode 100644 index 000000000..1c4df58f6 --- /dev/null +++ b/include/linux/fat_cvf.h @@ -0,0 +1,49 @@ +#ifndef _FAT_CVF +#define _FAT_CVF + +#define CVF_USE_READPAGE 0x0001 + +struct cvf_format +{ int cvf_version; + char* cvf_version_text; + unsigned long flags; + int (*detect_cvf) (struct super_block*sb); + int (*mount_cvf) (struct super_block*sb,char*options); + int (*unmount_cvf) (struct super_block*sb); + struct buffer_head* (*cvf_bread) (struct super_block*sb,int block); + struct buffer_head* (*cvf_getblk) (struct super_block*sb,int block); + void (*cvf_brelse) (struct super_block *sb,struct buffer_head *bh); + void (*cvf_mark_buffer_dirty) (struct super_block *sb, + struct buffer_head *bh, + int dirty_val); + void (*cvf_set_uptodate) (struct super_block *sb, + struct buffer_head *bh, + int val); + int (*cvf_is_uptodate) (struct super_block *sb,struct buffer_head *bh); + void (*cvf_ll_rw_block) (struct super_block *sb, + int opr, + int nbreq, + struct buffer_head *bh[32]); + int (*fat_access) (struct super_block *sb,int nr,int new_value); + int (*cvf_statfs) (struct super_block *sb,struct statfs *buf, int bufsiz); + int (*cvf_bmap) (struct inode *inode,int block); + int (*cvf_smap) (struct inode *inode,int sector); + ssize_t (*cvf_file_read) ( struct file *, char *, size_t, loff_t *); + ssize_t (*cvf_file_write) ( struct file *, const char *, size_t, loff_t *); + int (*cvf_mmap) (struct file *, struct vm_area_struct *); + int (*cvf_readpage) (struct inode *, struct page *); + int (*cvf_writepage) (struct inode *, struct page *); + int (*cvf_dir_ioctl) (struct inode * inode, struct file * filp, + unsigned int cmd, unsigned long arg); + void (*zero_out_cluster) (struct inode*, int clusternr); +}; + +int register_cvf_format(struct cvf_format*cvf_format); +int unregister_cvf_format(struct cvf_format*cvf_format); +void dec_cvf_format_use_count_by_version(int version); +int detect_cvf(struct super_block*sb,char*force); + +extern struct cvf_format *cvf_formats[]; +extern int cvf_format_use_count[]; + +#endif diff --git a/include/linux/fd.h b/include/linux/fd.h index a32532668..627a9d2bd 100644 --- a/include/linux/fd.h +++ b/include/linux/fd.h @@ -116,7 +116,7 @@ typedef char floppy_drive_name[16]; * Drive parameters (user modifiable) */ struct floppy_drive_params { - char cmos; /* cmos type */ + signed char cmos; /* cmos type */ /* Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms * etc) and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA). diff --git a/include/linux/file.h b/include/linux/file.h index b8cc01f0a..3f3870b9e 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -29,6 +29,7 @@ extern inline int fput(struct file *file) int error = 0; if (!count) { + locks_remove_flock(file); error = __fput(file); file->f_count = 0; remove_filp(file); @@ -46,4 +47,12 @@ extern inline void put_filp(struct file *file) } } +/* + * Install a file pointer in the files structure. + */ +extern inline void fd_install(unsigned long fd, struct file *file) +{ + current->files->fd[fd] = file; +} + #endif diff --git a/include/linux/filter.h b/include/linux/filter.h new file mode 100644 index 000000000..dcf33554e --- /dev/null +++ b/include/linux/filter.h @@ -0,0 +1,107 @@ +/* + * Linux Socket Filter Data Structures + */ + +#ifndef __LINUX_FILTER_H__ +#define __LINUX_FILTER_H__ + +/* + * Current version of the filter code architecture. + */ +#define BPF_MAJOR_VERSION 1 +#define BPF_MINOR_VERSION 1 + +/* + * Try and keep these values and structures similar to BSD, especially + * the BPF code definitions which need to match so you can share filters + */ + +struct sock_filter /* Filter block */ +{ + u16 code; /* Actual filter code */ + u8 jt; /* Jump true */ + u8 jf; /* Jump false */ + u32 k; /* Generic multiuse field */ +}; + +struct sock_fprog /* Required for SO_ATTACH_FILTER. */ +{ + unsigned short len; /* Number of filter blocks */ + struct sock_filter *filter; +}; + +/* + * Instruction classes + */ + +#define BPF_CLASS(code) ((code) & 0x07) +#define BPF_LD 0x00 +#define BPF_LDX 0x01 +#define BPF_ST 0x02 +#define BPF_STX 0x03 +#define BPF_ALU 0x04 +#define BPF_JMP 0x05 +#define BPF_RET 0x06 +#define BPF_MISC 0x07 + +/* ld/ldx fields */ +#define BPF_SIZE(code) ((code) & 0x18) +#define BPF_W 0x00 +#define BPF_H 0x08 +#define BPF_B 0x10 +#define BPF_MODE(code) ((code) & 0xe0) +#define BPF_IMM 0x00 +#define BPF_ABS 0x20 +#define BPF_IND 0x40 +#define BPF_MEM 0x60 +#define BPF_LEN 0x80 +#define BPF_MSH 0xa0 + +/* alu/jmp fields */ +#define BPF_OP(code) ((code) & 0xf0) +#define BPF_ADD 0x00 +#define BPF_SUB 0x10 +#define BPF_MUL 0x20 +#define BPF_DIV 0x30 +#define BPF_OR 0x40 +#define BPF_AND 0x50 +#define BPF_LSH 0x60 +#define BPF_RSH 0x70 +#define BPF_NEG 0x80 +#define BPF_JA 0x00 +#define BPF_JEQ 0x10 +#define BPF_JGT 0x20 +#define BPF_JGE 0x30 +#define BPF_JSET 0x40 +#define BPF_SRC(code) ((code) & 0x08) +#define BPF_K 0x00 +#define BPF_X 0x08 + +/* ret - BPF_K and BPF_X also apply */ +#define BPF_RVAL(code) ((code) & 0x18) +#define BPF_A 0x10 + +/* misc */ +#define BPF_MISCOP(code) ((code) & 0xf8) +#define BPF_TAX 0x00 +#define BPF_TXA 0x80 + +#define BPF_MAXINSNS 512 + +/* + * Macros for filter block array initializers. + */ +#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k } +#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k } + +/* + * Number of scratch memory words for: BPF_ST and BPF_STX + */ +#define BPF_MEMWORDS 16 + +#ifdef __KERNEL__ +extern int sk_run_filter(unsigned char *data, int len, struct sock_filter *filter, int flen); +extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); +#endif /* __KERNEL__ */ + +#endif /* __LINUX_FILTER_H__ */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 4c2bcd91c..026d3209e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -17,6 +17,7 @@ #include <linux/ioctl.h> #include <linux/list.h> #include <linux/dcache.h> +#include <linux/stat.h> #include <asm/atomic.h> #include <asm/bitops.h> @@ -43,8 +44,8 @@ /* And dynamically-tunable limits and defaults: */ extern int max_inodes; extern int max_files, nr_files, nr_free_files; -#define NR_INODE 4096 /* this should be bigger than NR_FILE */ -#define NR_FILE 1024 /* this can well be larger on a larger system */ +#define NR_INODE 4096 /* This should no longer be bigger than NR_FILE */ +#define NR_FILE 4096 /* this can well be larger on a larger system */ #define NR_RESERVED_FILES 10 /* reserved for root */ #define MAY_EXEC 1 @@ -90,11 +91,12 @@ extern int max_files, nr_files, nr_free_files; #define S_APPEND 256 /* Append-only file */ #define S_IMMUTABLE 512 /* Immutable file */ #define MS_NOATIME 1024 /* Do not update access times. */ +#define MS_NODIRATIME 2048 /* Do not update directory access times */ /* * 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) +#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. @@ -121,12 +123,7 @@ extern int max_files, nr_files, nr_free_files; #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME) - -#define UPDATE_ATIME(inode) \ - if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \ - inode->i_atime = CURRENT_TIME; \ - mark_inode_dirty(inode); \ - } +#define IS_NODIRATIME(inode) ((inode)->i_flags & 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. */ @@ -153,6 +150,9 @@ extern int max_files, nr_files, nr_free_files; #include <asm/byteorder.h> #include <asm/bitops.h> +extern void update_atime (struct inode *inode); +#define UPDATE_ATIME(inode) update_atime (inode) + extern void buffer_init(void); extern void inode_init(void); extern void file_table_init(void); @@ -256,6 +256,7 @@ static inline int buffer_protected(struct buffer_head * bh) #include <linux/minix_fs_i.h> #include <linux/ext2_fs_i.h> #include <linux/hpfs_fs_i.h> +#include <linux/ntfs_fs_i.h> #include <linux/msdos_fs_i.h> #include <linux/umsdos_fs_i.h> #include <linux/iso_fs_i.h> @@ -263,8 +264,11 @@ static inline int buffer_protected(struct buffer_head * bh) #include <linux/sysv_fs_i.h> #include <linux/affs_fs_i.h> #include <linux/ufs_fs_i.h> +#include <linux/coda_fs_i.h> #include <linux/romfs_fs_i.h> #include <linux/smb_fs_i.h> +#include <linux/hfs_fs_i.h> +#include <linux/adfs_fs_i.h> #include <linux/efs_fs_i.h> /* @@ -311,16 +315,18 @@ struct iattr { #define ATTR_FLAG_NOATIME 2 /* Don't update atime */ #define ATTR_FLAG_APPEND 4 /* Append-only file */ #define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */ +#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */ #include <linux/quota.h> struct inode { struct list_head i_hash; struct list_head i_list; + struct list_head i_dentry; unsigned long i_ino; + unsigned int i_count; kdev_t i_dev; - unsigned short i_count; umode_t i_mode; nlink_t i_nlink; uid_t i_uid; @@ -356,6 +362,7 @@ struct inode { struct minix_inode_info minix_i; struct ext2_inode_info ext2_i; struct hpfs_inode_info hpfs_i; + struct ntfs_inode_info ntfs_i; struct msdos_inode_info msdos_i; struct umsdos_inode_info umsdos_i; struct iso_inode_info isofs_i; @@ -364,7 +371,10 @@ struct inode { struct affs_inode_info affs_i; struct ufs_inode_info ufs_i; struct romfs_inode_info romfs_i; + struct coda_inode_info coda_i; struct smb_inode_info smbfs_i; + struct hfs_inode_info hfs_i; + struct adfs_inode_info adfs_i; struct efs_inode_info efs_i; struct socket socket_i; void *generic_ip; @@ -412,13 +422,22 @@ extern int init_private_file(struct file *, struct dentry *, int); #define FL_ACCESS 8 /* for processes suspended by mandatory locking */ #define FL_LOCKD 16 /* lock held by rpc.lockd */ +/* + * The POSIX file lock owner is determined by + * the "struct files_struct" in the thread group + * (or NULL for no owner - BSD locks). + * + * Lockd stuffs a "host" pointer into this. + */ +typedef struct files_struct *fl_owner_t; + struct file_lock { struct file_lock *fl_next; /* singly linked list for this inode */ struct file_lock *fl_nextlink; /* doubly linked list of all locks */ struct file_lock *fl_prevlink; /* used to simplify lock removal */ struct file_lock *fl_nextblock; /* circular list of blocked processes */ struct file_lock *fl_prevblock; - void *fl_owner; /* usu. the process' task_struct */ + fl_owner_t fl_owner; unsigned int fl_pid; struct wait_queue *fl_wait; struct file *fl_file; @@ -440,7 +459,10 @@ extern struct file_lock *file_lock_table; extern int fcntl_getlk(unsigned int fd, struct flock *l); extern int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l); -extern void locks_remove_locks(struct task_struct *task, struct file *filp); + +/* fs/locks.c */ +extern void locks_remove_posix(struct file *, fl_owner_t id); +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 *); @@ -494,6 +516,7 @@ extern int fasync_helper(struct file *, int, struct fasync_struct **); #include <linux/minix_fs_sb.h> #include <linux/ext2_fs_sb.h> #include <linux/hpfs_fs_sb.h> +#include <linux/ntfs_fs_sb.h> #include <linux/msdos_fs_sb.h> #include <linux/iso_fs_sb.h> #include <linux/nfs_fs_sb.h> @@ -503,6 +526,8 @@ extern int fasync_helper(struct file *, int, struct fasync_struct **); #include <linux/romfs_fs_sb.h> #include <linux/efs_fs_sb.h> #include <linux/smb_fs_sb.h> +#include <linux/hfs_fs_sb.h> +#include <linux/adfs_fs_sb.h> struct super_block { kdev_t s_dev; @@ -529,6 +554,7 @@ struct super_block { struct minix_sb_info minix_sb; struct ext2_sb_info ext2_sb; struct hpfs_sb_info hpfs_sb; + struct ntfs_sb_info ntfs_sb; struct msdos_sb_info msdos_sb; struct isofs_sb_info isofs_sb; struct nfs_sb_info nfs_sb; @@ -538,6 +564,8 @@ struct super_block { struct romfs_sb_info romfs_sb; struct efs_sb_info efs_sb; struct smb_sb_info smbfs_sb; + struct hfs_sb_info hfs_sb; + struct adfs_sb_info adfs_sb; void *generic_sbp; } u; }; @@ -571,24 +599,25 @@ struct inode_operations { struct file_operations * default_file_ops; int (*create) (struct inode *,struct dentry *,int); int (*lookup) (struct inode *,struct dentry *); - int (*link) (struct inode *,struct inode *,struct dentry *); + int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct inode *,struct dentry *,const char *); int (*mkdir) (struct inode *,struct dentry *,int); int (*rmdir) (struct inode *,struct dentry *); int (*mknod) (struct inode *,struct dentry *,int,int); - int (*rename) (struct inode *,struct dentry *,struct inode *,struct dentry *); - int (*readlink) (struct inode *,char *,int); - struct dentry * (*follow_link) (struct inode *, struct dentry *); - int (*readpage) (struct inode *, struct page *); - int (*writepage) (struct inode *, struct page *); + int (*rename) (struct inode *, struct dentry *, + struct inode *, struct dentry *); + int (*readlink) (struct dentry *, char *,int); + struct dentry * (*follow_link) (struct dentry *, struct dentry *); + int (*readpage) (struct file *, struct page *); + int (*writepage) (struct file *, struct page *); int (*bmap) (struct inode *,int); void (*truncate) (struct inode *); int (*permission) (struct inode *, int); int (*smap) (struct inode *,int); - int (*updatepage) (struct inode *, struct page *, const char *, + int (*updatepage) (struct file *, struct page *, const char *, unsigned long, unsigned int, int); - int (*revalidate) (struct inode *); + int (*revalidate) (struct dentry *); }; struct super_operations { @@ -596,11 +625,12 @@ struct super_operations { void (*write_inode) (struct inode *); void (*put_inode) (struct inode *); void (*delete_inode) (struct inode *); - int (*notify_change) (struct inode *, struct iattr *); + int (*notify_change) (struct dentry *, struct iattr *); void (*put_super) (struct super_block *); void (*write_super) (struct super_block *); int (*statfs) (struct super_block *, struct statfs *, int); int (*remount_fs) (struct super_block *, int *, char *); + void (*clear_inode) (struct inode *); }; struct dquot_operations { @@ -623,14 +653,20 @@ struct file_system_type { extern int register_filesystem(struct file_system_type *); extern int unregister_filesystem(struct file_system_type *); +/* fs/open.c */ + asmlinkage int sys_open(const char *, int, int); asmlinkage int sys_close(unsigned int); /* yes, it's really unsigned */ - -extern void kill_fasync(struct fasync_struct *fa, int sig); +extern int do_truncate(struct dentry *, unsigned long); +extern int get_unused_fd(void); +extern void put_unused_fd(unsigned int); +extern int __fput(struct file *); +extern int close_fp(struct file *, fl_owner_t id); extern char * getname(const char * filename); extern void putname(char * name); -extern int do_truncate(struct inode *, unsigned long); + +extern void kill_fasync(struct fasync_struct *fa, int sig); 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); @@ -710,13 +746,16 @@ 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 int notify_change(struct inode *, struct iattr *); +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 do_pipe(int *); + +/* fs/dcache.c -- generic fs support functions */ +extern int is_subdir(struct dentry *, struct dentry *); extern ino_t find_inode_number(struct dentry *, struct qstr *); /* @@ -737,45 +776,17 @@ extern struct dentry * __namei(const char *, int); #define namei(pathname) __namei(pathname, 1) #define lnamei(pathname) __namei(pathname, 0) -#include <asm/semaphore.h> - -/* Intended for short locks of the global data structures in inode.c. - * Could be replaced with spinlocks completely, since there is - * no blocking during manipulation of the static data; however the - * lock in invalidate_inodes() may last relatively long. - */ -extern struct semaphore vfs_sem; -extern inline void vfs_lock(void) -{ -#if 0 -#ifdef __SMP__ - down(&vfs_sem); -#endif -#endif -} - -extern inline void vfs_unlock(void) -{ -#if 0 -#ifdef __SMP__ - up(&vfs_sem); -#endif -#endif -} - extern void iput(struct inode *); extern struct inode * iget(struct super_block *, unsigned long); extern void clear_inode(struct inode *); extern struct inode * get_empty_inode(void); extern void insert_inode_hash(struct inode *); -extern int get_unused_fd(void); -extern void put_unused_fd(int); +extern void remove_inode_hash(struct inode *); extern struct file * get_empty_filp(void); -extern int close_fp(struct file *); extern struct buffer_head * get_hash_table(kdev_t, int, int); extern struct buffer_head * getblk(kdev_t, int, int); -extern struct buffer_head *efind_buffer(kdev_t dev, int block, int size); +extern struct buffer_head * find_buffer(kdev_t dev, int block, int size); extern void ll_rw_block(int, int, struct buffer_head * bh[]); extern void ll_rw_page(int, kdev_t, unsigned long, char *); extern void ll_rw_swap_file(int, kdev_t, unsigned int *, int, char *); @@ -800,7 +811,7 @@ extern struct buffer_head * breada(kdev_t dev,int block, int size, extern int brw_page(int, struct page *, kdev_t, int [], int, int); -extern int generic_readpage(struct inode *, struct page *); +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*); @@ -831,7 +842,6 @@ extern int file_fsync(struct file *, struct dentry *dir); extern int inode_change_ok(struct inode *, struct iattr *); extern void inode_setattr(struct inode *, struct iattr *); -extern int notify_change(struct inode * inode, struct iattr * attr); /* kludge to get SCSI modules working */ #include <linux/minix_fs.h> diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 44e600fc3..c8f38cfde 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -25,10 +25,16 @@ #define CONFIG_SGI_PARTITION 1 #endif -/* These two have identical behaviour; use the second one if DOS fdisk gets +/* These three have identical behaviour; use the second one if DOS fdisk gets confused about extended/logical partitions starting past cylinder 1023. */ #define DOS_EXTENDED_PARTITION 5 #define LINUX_EXTENDED_PARTITION 0x85 +#define WIN98_EXTENDED_PARTITION 0x0f +#define LINUX_SWAP_PARTITION 0x82 + +#ifdef CONFIG_SOLARIS_X86_PARTITION +#define SOLARIS_X86_PARTITION LINUX_SWAP_PARTITION +#endif #define DM6_PARTITION 0x54 /* has DDO: use xlated geom & offset */ #define EZD_PARTITION 0x55 /* EZ-DRIVE: same as DM6 (we think) */ @@ -70,6 +76,34 @@ struct gendisk { struct gendisk *next; }; +#ifdef CONFIG_SOLARIS_X86_PARTITION + +#define SOLARIS_X86_NUMSLICE 8 +#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) + +struct solaris_x86_slice { + ushort s_tag; /* ID tag of partition */ + ushort s_flag; /* permision flags */ + daddr_t s_start; /* start sector no of partition */ + long s_size; /* # of blocks in partition */ +}; + +struct solaris_x86_vtoc { + unsigned long v_bootinfo[3]; /* info needed by mboot (unsupported) */ + unsigned long v_sanity; /* to verify vtoc sanity */ + unsigned long v_version; /* layout version */ + char v_volume[8]; /* volume name */ + ushort v_sectorsz; /* sector size in bytes */ + ushort v_nparts; /* number of partitions */ + unsigned long v_reserved[10]; /* free space */ + struct solaris_x86_slice + v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */ + time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */ + char v_asciilabel[128]; /* for compatibility */ +}; + +#endif /* CONFIG_SOLARIS_X86_PARTITION */ + #ifdef CONFIG_BSD_DISKLABEL /* * BSD disklabel support by Yossi Gottlieb <yogo@math.tau.ac.il> diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index b321d292c..d7d4609cb 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -1,20 +1,12 @@ /* * hdlcdrv.h -- HDLC packet radio network driver. * The Linux soundcard driver for 1200 baud and 9600 baud packet radio - * (C) 1996 by Thomas Sailer, HB9JNX/AE4WA + * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA */ #ifndef _HDLCDRV_H #define _HDLCDRV_H -#include <linux/version.h> -#include <linux/sockios.h> -#include <linux/version.h> -#if LINUX_VERSION_CODE < 0x20119 -#include <linux/if_ether.h> -#endif -#include <linux/netdevice.h> - /* -------------------------------------------------------------------- */ /* * structs for the IOCTL commands @@ -43,9 +35,6 @@ struct hdlcdrv_old_channel_state { int ptt; int dcd; int ptt_keyed; -#if LINUX_VERSION_CODE < 0x20100 - struct enet_statistics stats; -#endif }; struct hdlcdrv_channel_state { @@ -115,6 +104,9 @@ struct hdlcdrv_ioctl { #ifdef __KERNEL__ +#include <linux/netdevice.h> +#include <linux/if.h> + #define HDLCDRV_MAGIC 0x5ac6e778 #define HDLCDRV_IFNAMELEN 6 #define HDLCDRV_HDLCBUFFER 32 /* should be a power of 2 for speed reasons */ diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index 35db77dc9..9be5bd1b1 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h @@ -62,11 +62,25 @@ #define WIN_READDMA 0xc8 /* read sectors using DMA transfers */ #define WIN_WRITEDMA 0xca /* write sectors using DMA transfers */ +#define WIN_SMART 0xb0 /* self-monitoring and reporting */ + /* Additional drive command codes used by ATAPI devices. */ #define WIN_PIDENTIFY 0xA1 /* identify ATAPI device */ #define WIN_SRST 0x08 /* ATAPI soft reset command */ #define WIN_PACKETCMD 0xa0 /* Send a packet command. */ +/* WIN_SMART sub-commands */ + +#define SMART_READ_VALUES 0xd0 +#define SMART_READ_THRESHOLDS 0xd1 +#define SMART_AUTOSAVE 0xd2 +#define SMART_SAVE 0xd3 +#define SMART_IMMEDIATE_OFFLINE 0xd4 +#define SMART_ENABLE 0xd8 +#define SMART_DISABLE 0xd9 +#define SMART_STATUS 0xda +#define SMART_AUTO_OFFLINE 0xdb + /* Bits for HD_ERROR */ #define MARK_ERR 0x01 /* Bad address mark */ #define TRK0_ERR 0x02 /* couldn't find track 0 */ diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h new file mode 100644 index 000000000..de51db0b1 --- /dev/null +++ b/include/linux/hfs_fs.h @@ -0,0 +1,324 @@ +/* + * linux/include/linux/hfs_fs.h + * + * Copyright (C) 1995-1997 Paul H. Hargrove + * This file may be distributed under the terms of the GNU Public License. + * + * The source code distribution of the Columbia AppleTalk Package for + * UNIX, version 6.0, (CAP) was used as a specification of the + * location and format of files used by CAP's Aufs. No code from CAP + * appears in hfs_fs. hfs_fs is not a work ``derived'' from CAP in + * the sense of intellectual property law. + * + * The source code distributions of Netatalk, versions 1.3.3b2 and + * 1.4b2, were used as a specification of the location and format of + * files used by Netatalk's afpd. No code from Netatalk appears in + * hfs_fs. hfs_fs is not a work ``derived'' from Netatalk in the + * sense of intellectual property law. + */ + +#ifndef _LINUX_HFS_FS_H +#define _LINUX_HFS_FS_H + +#include <linux/hfs_sysdep.h> + +/* magic numbers for Apple Double header files */ +#define HFS_DBL_MAGIC 0x00051607 +#define HFS_SNGL_MAGIC 0x00051600 +#define HFS_HDR_VERSION_1 0x00010000 +#define HFS_HDR_VERSION_2 0x00020000 + +/* magic numbers for various internal structures */ +#define HFS_INO_MAGIC 0x4821 +#define HFS_SB_MAGIC 0x4822 + +/* The space used for the AppleDouble or AppleSingle headers */ +#define HFS_DBL_HDR_LEN 1024 + +/* The space used for the Netatalk header */ +#define HFS_NAT_HDR_LEN 1024 /* 589 for an exact match */ + +/* Macros to extract CNID and file "type" from the Linux inode number */ +#define HFS_CNID(X) ((X) & 0x3FFFFFFF) +#define HFS_ITYPE(X) ((X) & 0xC0000000) + +/* Macros to enumerate types */ +#define HFS_ITYPE_TO_INT(X) ((X) >> 30) +#define HFS_INT_TO_ITYPE(X) ((X) << 30) + +/* generic ITYPEs */ +#define HFS_ITYPE_0 0x00000000 +#define HFS_ITYPE_1 0x40000000 +#define HFS_ITYPE_2 0x80000000 +#define HFS_ITYPE_3 0xC0000000 +#define HFS_ITYPE_NORM HFS_ITYPE_0 /* "normal" directory or file */ + +/* ITYPEs for CAP */ +#define HFS_CAP_NORM HFS_ITYPE_0 /* data fork or normal directory */ +#define HFS_CAP_DATA HFS_ITYPE_0 /* data fork of file */ +#define HFS_CAP_NDIR HFS_ITYPE_0 /* normal directory */ +#define HFS_CAP_FNDR HFS_ITYPE_1 /* finder info for file or dir */ +#define HFS_CAP_RSRC HFS_ITYPE_2 /* resource fork of file */ +#define HFS_CAP_RDIR HFS_ITYPE_2 /* .resource directory */ +#define HFS_CAP_FDIR HFS_ITYPE_3 /* .finderinfo directory */ + +/* ITYPEs for Apple Double */ +#define HFS_DBL_NORM HFS_ITYPE_0 /* data fork or directory */ +#define HFS_DBL_DATA HFS_ITYPE_0 /* data fork of file */ +#define HFS_DBL_DIR HFS_ITYPE_0 /* directory */ +#define HFS_DBL_HDR HFS_ITYPE_1 /* AD header of file or dir */ + +/* ITYPEs for netatalk */ +#define HFS_NAT_NORM HFS_ITYPE_0 /* data fork or directory */ +#define HFS_NAT_DATA HFS_ITYPE_0 /* data fork of file */ +#define HFS_NAT_NDIR HFS_ITYPE_0 /* normal directory */ +#define HFS_NAT_HDR HFS_ITYPE_1 /* AD header of file or dir */ +#define HFS_NAT_HDIR HFS_ITYPE_2 /* directory holding AD headers */ + +/* ITYPEs for Apple Single */ +#define HFS_SGL_NORM HFS_ITYPE_0 /* AppleSingle file or directory */ +#define HFS_SGL_SNGL HFS_ITYPE_0 /* AppleSingle file */ +#define HFS_SGL_DIR HFS_ITYPE_0 /* directory */ +#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 + +/* + * There are three time systems. All three are based on seconds since + * a particular time/date. + * Unix: unsigned lil-endian since 00:00 GMT, Jan. 1, 1970 + * mac: unsigned big-endian since 00:00 GMT, Jan. 1, 1904 + * header: SIGNED big-endian since 00:00 GMT, Jan. 1, 2000 + * + */ +#define hfs_h_to_mtime(ARG) htonl((hfs_s32)ntohl(ARG)+3029529600U) +#define hfs_m_to_htime(ARG) ((hfs_s32)htonl(ntohl(ARG)-3029529600U)) +#define hfs_h_to_utime(ARG) ((hfs_s32)ntohl(ARG)+946684800U) +#define hfs_u_to_htime(ARG) ((hfs_s32)htonl((ARG)-946684800U)) +#define hfs_u_to_mtime(ARG) htonl((ARG)+2082844800U) +#define hfs_m_to_utime(ARG) (ntohl(ARG)-2082844800U) + +/*======== Data structures kept in memory ========*/ + +/* + * A descriptor for a single entry within the header of an + * AppleDouble or AppleSingle header file. + * An array of these make up a table of contents for the file. + */ +struct hfs_hdr_descr { + hfs_u32 id; /* The Apple assigned ID for the entry type */ + hfs_u32 offset; /* The offset to reach the entry */ + hfs_u32 length; /* The length of the entry */ +}; + +/* + * The info needed to reconstruct a given header layout + */ +struct hfs_hdr_layout { + hfs_u32 magic; /* AppleSingle or AppleDouble */ + hfs_u32 version; /* 0x00010000 or 0x00020000 */ + hfs_u16 entries; /* How many entries used */ + struct hfs_hdr_descr + descr[HFS_HDR_MAX]; /* Descriptors */ + struct hfs_hdr_descr + *order[HFS_HDR_MAX]; /* 'descr' ordered by offset */ +}; + +/* + * 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 + */ +struct hfs_dbl_hdr { + hfs_lword_t magic; + hfs_lword_t version; + 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_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 */ +}; + +/* 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) */ +#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 + hfs_byte_t fi_version; /* Version of this structure: */ +#define HFS_CAP_VERSION 0x10 + hfs_byte_t fi_magic; /* Another magic number: */ +#define HFS_CAP_MAGIC 0xDA + hfs_byte_t fi_bitmap; /* Bitmap of which names are valid: */ +#define HFS_CAP_SHORTNAME 0x01 +#define HFS_CAP_LONGNAME 0x02 + hfs_byte_t fi_shortfilename[12+1]; /* "short name" (unused) */ + hfs_byte_t fi_macfilename[32+1]; /* Original (Macintosh) name */ + hfs_byte_t fi_comln; /* Length of comment (always 0) */ + hfs_byte_t fi_comnt[200]; /* Finder comment (unused) */ + /* optional: used by aufs only if compiled with USE_MAC_DATES */ + hfs_byte_t fi_datemagic; /* Magic number for dates extension: */ +#define HFS_CAP_DMAGIC 0xDA + hfs_byte_t fi_datevalid; /* Bitmap of which dates are valid: */ +#define HFS_CAP_MDATE 0x01 +#define HFS_CAP_CDATE 0x02 + hfs_lword_t fi_ctime; /* Creation date (in AFP format) */ + hfs_lword_t fi_mtime; /* Modify date (in AFP format) */ + hfs_lword_t fi_utime; /* Un*x time of last mtime change */ + hfs_byte_t pad; +}; + +#ifdef __KERNEL__ + +typedef ssize_t hfs_rwret_t; +typedef size_t hfs_rwarg_t; + +#include <asm/uaccess.h> + +/* Some forward declarations */ +struct hfs_fork; +struct hfs_cat_key; +struct hfs_cat_entry; +extern struct hfs_cat_entry *hfs_cat_get(struct hfs_mdb *, + const struct hfs_cat_key *); + +/* dir.c */ +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 *, + struct inode *, struct dentry *); + +/* dir_cap.c */ +extern const struct hfs_name hfs_cap_reserved1[]; +extern const struct hfs_name hfs_cap_reserved2[]; +extern struct inode_operations hfs_cap_ndir_inode_operations; +extern struct inode_operations hfs_cap_fdir_inode_operations; +extern struct inode_operations hfs_cap_rdir_inode_operations; +extern void hfs_cap_drop_dentry(const ino_t, struct dentry *); + +/* dir_dbl.c */ +extern const struct hfs_name hfs_dbl_reserved1[]; +extern const struct hfs_name hfs_dbl_reserved2[]; +extern struct inode_operations hfs_dbl_dir_inode_operations; +extern void hfs_dbl_drop_dentry(const ino_t, struct dentry *); + +/* dir_nat.c */ +extern const struct hfs_name hfs_nat_reserved1[]; +extern const struct hfs_name hfs_nat_reserved2[]; +extern struct inode_operations hfs_nat_ndir_inode_operations; +extern struct inode_operations hfs_nat_hdir_inode_operations; +extern void hfs_nat_drop_dentry(const ino_t, struct dentry *); + +/* dir_sngl.c */ +extern const struct hfs_name hfs_sngl_reserved1[]; +extern const struct hfs_name hfs_sngl_reserved2[]; +extern struct inode_operations hfs_sngl_dir_inode_operations; + +/* file.c */ +extern hfs_s32 hfs_do_read(struct inode *, struct hfs_fork *, hfs_u32, + char *, hfs_u32, int); +extern hfs_s32 hfs_do_write(struct inode *, struct hfs_fork *, hfs_u32, + const char *, hfs_u32); +extern void hfs_file_fix_mode(struct hfs_cat_entry *entry); +extern struct inode_operations hfs_file_inode_operations; + +/* file_cap.c */ +extern struct inode_operations hfs_cap_info_inode_operations; + +/* file_hdr.c */ +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_sngl_hdr_layout; + +/* inode.c */ +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); + +/* super.c */ +extern struct super_block *hfs_read_super(struct super_block *,void *,int); +extern int init_hfs_fs(void); + +/* trans.c */ +extern void hfs_colon2mac(struct hfs_name *, const char *, int); +extern void hfs_prcnt2mac(struct hfs_name *, const char *, int); +extern void hfs_triv2mac(struct hfs_name *, const char *, int); +extern void hfs_latin2mac(struct hfs_name *, const char *, int); +extern int hfs_mac2cap(char *, const struct hfs_name *); +extern int hfs_mac2nat(char *, const struct hfs_name *); +extern int hfs_mac2latin(char *, const struct hfs_name *); +extern int hfs_mac2seven(char *, const struct hfs_name *); +extern int hfs_mac2eight(char *, const struct hfs_name *); +extern int hfs_mac2alpha(char *, const struct hfs_name *); +extern int hfs_mac2triv(char *, const struct hfs_name *); +extern void hfs_tolower(unsigned char *, int); + +#define HFS_I(X) (&((X)->u.hfs_i)) +#define HFS_SB(X) (&((X)->u.hfs_sb)) + +extern __inline__ void hfs_nameout(struct inode *dir, struct hfs_name *out, + const char *in, int len) { + HFS_SB(dir->i_sb)->s_nameout(out, in, len); +} + +extern __inline__ int hfs_namein(struct inode *dir, char *out, + const struct hfs_name *in) { + int len = HFS_SB(dir->i_sb)->s_namein(out, in); + if (HFS_SB(dir->i_sb)->s_lowercase) { + hfs_tolower(out, len); + } + return len; +} + +#endif /* __KERNEL__ */ +#endif diff --git a/include/linux/hfs_fs_i.h b/include/linux/hfs_fs_i.h new file mode 100644 index 000000000..cf9ed53e0 --- /dev/null +++ b/include/linux/hfs_fs_i.h @@ -0,0 +1,40 @@ +/* + * linux/include/linux/hfs_fs_i.h + * + * Copyright (C) 1995, 1996 Paul H. Hargrove + * This file may be distributed under the terms of the GNU Public License. + * + * This file defines the type (struct hfs_inode_info) and the two + * subordinate types hfs_extent and hfs_file. + */ + +#ifndef _LINUX_HFS_FS_I_H +#define _LINUX_HFS_FS_I_H + +/* + * struct hfs_inode_info + * + * The HFS-specific part of a Linux (struct inode) + */ +struct hfs_inode_info { + int magic; /* A magic number */ + + struct hfs_cat_entry *entry; + + /* For a regular or header file */ + struct hfs_fork *fork; + int convert; + + /* For a directory */ + ino_t file_type; + char dir_size; + + /* For header files */ + const struct hfs_hdr_layout *default_layout; + struct hfs_hdr_layout *layout; + + /* for dentry cleanup */ + void (*d_drop_op)(const ino_t, struct dentry *); +}; + +#endif diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h new file mode 100644 index 000000000..c5279b201 --- /dev/null +++ b/include/linux/hfs_fs_sb.h @@ -0,0 +1,52 @@ +/* + * linux/include/linux/hfs_fs_sb.h + * + * Copyright (C) 1995-1997 Paul H. Hargrove + * This file may be distributed under the terms of the GNU Public License. + * + * This file defines the type (struct hfs_sb_info) which contains the + * HFS-specific information in the in-core superblock. + */ + +#ifndef _LINUX_HFS_FS_SB_H +#define _LINUX_HFS_FS_SB_H + +/* forward declaration: */ +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); + +/* + * struct hfs_sb_info + * + * The HFS-specific part of a Linux (struct super_block) + */ +struct hfs_sb_info { + int magic; /* A magic number */ + struct hfs_mdb *s_mdb; /* The HFS MDB */ + int s_quiet; /* Silent failure when + changing owner or mode? */ + int s_lowercase; /* Map names to lowercase? */ + int s_afpd; /* AFPD compatible mode? */ + hfs_namein_fn s_namein; /* The function used to + map Mac filenames to + Linux filenames */ + hfs_nameout_fn s_nameout; /* The function used to + map Linux filenames + to Mac filenames */ + hfs_ifill_fn s_ifill; /* The function used + to fill in inode fields */ + const struct hfs_name *s_reserved1; /* Reserved names */ + const struct hfs_name *s_reserved2; /* Reserved names */ + __u32 s_type; /* Type for new files */ + __u32 s_creator; /* Creator for new files */ + umode_t s_umask; /* The umask applied to the + permissions on all files */ + uid_t s_uid; /* The uid of all files */ + gid_t s_gid; /* The gid of all files */ + char s_conv; /* Type of text conversion */ +}; + +#endif diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h new file mode 100644 index 000000000..93de05aad --- /dev/null +++ b/include/linux/hfs_sysdep.h @@ -0,0 +1,224 @@ +/* + * linux/include/linux/hfs_sysdep.h + * + * Copyright (C) 1996-1997 Paul H. Hargrove + * This file may be distributed under the terms of the GNU Public License. + * + * This file contains constants, types and inline + * functions for various system dependent things. + * + * "XXX" in a comment is a note to myself to consider changing something. + * + * In function preconditions the term "valid" applied to a pointer to + * a structure means that the pointer is non-NULL and the structure it + * points to has all fields initialized to consistent values. + */ + +#ifndef _HFS_SYSDEP_H +#define _HFS_SYSDEP_H + +#include <linux/malloc.h> +#include <linux/types.h> +#include <linux/locks.h> +#include <linux/fs.h> + +#include <asm/byteorder.h> +#include <asm/unaligned.h> + + +#undef offsetof +#define offsetof(TYPE, MEMB) ((size_t) &((TYPE *)0)->MEMB) + +/* Typedefs for integer types by size and signedness */ +typedef __u8 hfs_u8; +typedef __u16 hfs_u16; +typedef __u32 hfs_u32; +typedef __s8 hfs_s8; +typedef __s16 hfs_s16; +typedef __s32 hfs_s32; + +/* Typedefs for unaligned integer types */ +typedef unsigned char hfs_byte_t; +typedef unsigned char hfs_word_t[2]; +typedef unsigned char hfs_lword_t[4]; + +/* these funny looking things are GCC variable argument macros */ +#define hfs_warn(format, args...) printk(KERN_WARNING format , ## args) +#define hfs_error(format, args...) printk(KERN_ERR format , ## args) + + +#if defined(DEBUG_ALL) || defined(DEBUG_MEM) +extern long int hfs_alloc; +#endif + +extern inline void *hfs_malloc(unsigned int size) { +#if defined(DEBUG_ALL) || defined(DEBUG_MEM) + hfs_warn("%ld bytes allocation at %s:%u\n", + (hfs_alloc += size), __FILE__, __LINE__); +#endif + return kmalloc(size, GFP_KERNEL); +} + +extern inline void hfs_free(void *ptr, unsigned int size) { + kfree_s(ptr, size); +#if defined(DEBUG_ALL) || defined(DEBUG_MEM) + hfs_warn("%ld bytes allocation at %s:%u\n", + (hfs_alloc -= ptr ? size : 0), __FILE__, __LINE__); +#endif +} + + +extern inline hfs_u32 hfs_time(void) { + return htonl(CURRENT_TIME+2082844800U); +} + + +/* + * hfs_wait_queue + */ +typedef struct wait_queue *hfs_wait_queue; + +extern inline void hfs_sleep_on(hfs_wait_queue *queue) { + sleep_on(queue); +} + +extern inline void hfs_wake_up(hfs_wait_queue *queue) { + wake_up(queue); +} + +extern inline void hfs_relinquish(void) { + schedule(); +} + + +/* + * hfs_sysmdb + */ +typedef struct super_block *hfs_sysmdb; + +extern inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) { + sys_mdb->s_dirt = 1; +} + +extern inline char *hfs_mdb_name(hfs_sysmdb sys_mdb) { + return kdevname(sys_mdb->s_dev); +} + + +/* + * hfs_sysentry + */ +typedef struct dentry *hfs_sysentry[4]; + +/* + * hfs_buffer + */ +typedef struct buffer_head *hfs_buffer; + +#define HFS_BAD_BUFFER NULL + +/* In sysdep.c, since it needs HFS_SECTOR_SIZE */ +extern hfs_buffer hfs_buffer_get(hfs_sysmdb, int, int); + +extern inline int hfs_buffer_ok(hfs_buffer buffer) { + return (buffer != NULL); +} + +extern inline void hfs_buffer_put(hfs_buffer buffer) { + brelse(buffer); +} + +extern inline void hfs_buffer_dirty(hfs_buffer buffer) { + mark_buffer_dirty(buffer, 1); +} + +extern inline void hfs_buffer_sync(hfs_buffer buffer) { + while (buffer_locked(buffer)) { + wait_on_buffer(buffer); + } + if (buffer_dirty(buffer)) { + ll_rw_block(WRITE, 1, &buffer); + wait_on_buffer(buffer); + } +} + +extern inline void *hfs_buffer_data(const hfs_buffer buffer) { + return buffer->b_data; +} + + +/* + * bit operations + */ + +#undef BITNR +#if defined(__BIG_ENDIAN) +# define BITNR(X) ((X)^31) +# if !defined(__constant_htonl) +# define __constant_htonl(x) (x) +# endif +# if !defined(__constant_htons) +# define __constant_htons(x) (x) +# endif +#elif defined(__LITTLE_ENDIAN) +# define BITNR(X) ((X)^7) +# if !defined(__constant_htonl) +# define __constant_htonl(x) \ + ((unsigned long int)((((unsigned long int)(x) & 0x000000ffU) << 24) | \ + (((unsigned long int)(x) & 0x0000ff00U) << 8) | \ + (((unsigned long int)(x) & 0x00ff0000U) >> 8) | \ + (((unsigned long int)(x) & 0xff000000U) >> 24))) +# endif +# if !defined(__constant_htons) +# define __constant_htons(x) \ + ((unsigned short int)((((unsigned short int)(x) & 0x00ff) << 8) | \ + (((unsigned short int)(x) & 0xff00) >> 8))) +# endif +#else +# error "Don't know if bytes are big- or little-endian!" +#endif + +extern inline int hfs_clear_bit(int bitnr, hfs_u32 *lword) { + return test_and_clear_bit(BITNR(bitnr), lword); +} + +extern inline int hfs_set_bit(int bitnr, hfs_u32 *lword) { + return test_and_set_bit(BITNR(bitnr), lword); +} + +extern inline int hfs_test_bit(int bitnr, const hfs_u32 *lword) { + /* the kernel should declare the second arg of test_bit as const */ + return test_bit(BITNR(bitnr), (void *)lword); +} + +#undef BITNR + +/* + * HFS structures have fields aligned to 16-bit boundaries. + * So, 16-bit get/put are easy while 32-bit get/put need + * some care on architectures like the DEC Alpha. + * + * In what follows: + * ns = 16-bit integer in network byte-order w/ 16-bit alignment + * hs = 16-bit integer in host byte-order w/ 16-bit alignment + * nl = 32-bit integer in network byte-order w/ unknown alignment + * hl = 32-bit integer in host byte-order w/ unknown alignment + * anl = 32-bit integer in network byte-order w/ 32-bit alignment + * ahl = 32-bit integer in host byte-order w/ 32-bit alignment + * Example: hfs_get_hl() gets an unaligned 32-bit integer converting + * it to host byte-order. + */ +#define hfs_get_hs(addr) ntohs(*((hfs_u16 *)(addr))) +#define hfs_get_ns(addr) (*((hfs_u16 *)(addr))) +#define hfs_get_hl(addr) ntohl(get_unaligned((hfs_u32 *)(addr))) +#define hfs_get_nl(addr) get_unaligned((hfs_u32 *)(addr)) +#define hfs_get_ahl(addr) ntohl(*((hfs_u32 *)(addr))) +#define hfs_get_anl(addr) (*((hfs_u32 *)(addr))) +#define hfs_put_hs(val, addr) ((void)(*((hfs_u16 *)(addr)) = ntohs(val))) +#define hfs_put_ns(val, addr) ((void)(*((hfs_u16 *)(addr)) = (val))) +#define hfs_put_hl(val, addr) put_unaligned(htonl(val), (hfs_u32 *)(addr)) +#define hfs_put_nl(val, addr) put_unaligned((val), (hfs_u32 *)(addr)) +#define hfs_put_ahl(val, addr) ((void)(*((hfs_u32 *)(addr)) = ntohl(val))) +#define hfs_put_anl(val, addr) ((void)(*((hfs_u32 *)(addr)) = (val))) + +#endif diff --git a/include/linux/if.h b/include/linux/if.h index bd98fb029..87b6692c8 100644 --- a/include/linux/if.h +++ b/include/linux/if.h @@ -43,7 +43,7 @@ #define IFF_PORTSEL 0x2000 /* can set media type */ #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ - +#define IFF_NODYNARP 0x8000 /* use static ARP only (HIPPI) */ /* * The ifaddr structure contains information about one address * of an interface. They are maintained by the different address @@ -132,6 +132,7 @@ struct ifreq #define ifr_data ifr_ifru.ifru_data /* for use by interface */ #define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ #define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ +#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */ /* * Structure used in SIOCGIFCONF request. diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index e63cb85a6..8183b8e94 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -96,7 +96,6 @@ struct arpreq_old { #define ATF_NETMASK 0x20 /* want to use a netmask (only for proxy entries) */ #define ATF_DONTPUB 0x40 /* don't answer this addresses */ -#define ATF_MAGIC 0x80 /* automatically added entry */ /* * This structure defines an ethernet arp header. @@ -122,20 +121,4 @@ struct arphdr }; -/* Support for the user space arp daemon, arpd */ - -#define ARPD_UPDATE 0x01 -#define ARPD_LOOKUP 0x02 -#define ARPD_FLUSH 0x03 - -struct arpd_request -{ - unsigned short req; /* request type */ - __u32 ip; /* ip address of entry */ - unsigned long dev; /* Device entry is tied to */ - unsigned long stamp; - unsigned long updated; - unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */ -}; - #endif /* _LINUX_IF_ARP_H */ diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 0ac234125..3bdeca342 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h @@ -25,8 +25,9 @@ struct sockaddr_ll #define PACKET_BROADCAST 1 /* To all */ #define PACKET_MULTICAST 2 /* To group */ #define PACKET_OTHERHOST 3 /* To someone else */ -#define PACKET_OUTGOING 4 /* Originated by us */ -#define PACKET_NDISC 17 /* Outgoing NDISC packet*/ +#define PACKET_OUTGOING 4 /* Originated by us */ +#define PACKET_LOOPBACK 5 +#define PACKET_FASTROUTE 6 /* Packet socket options */ diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h index 1d3a750d8..5811992db 100644 --- a/include/linux/if_ppp.h +++ b/include/linux/if_ppp.h @@ -1,4 +1,4 @@ -/* $Id: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp $ */ +/* $Id: if_ppp.h,v 1.2 1998/01/01 15:05:12 phil Exp $ */ /* * if_ppp.h - Point-to-Point Protocol definitions. @@ -21,7 +21,7 @@ */ /* - * ==FILEVERSION 960109== + * ==FILEVERSION 971223== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. @@ -47,7 +47,7 @@ #define PPP_MTU 1500 /* Default MTU (size of Info field) */ #define PPP_MAXMRU 65000 /* Largest MRU we allow */ -#define PPP_VERSION "2.2.0" +#define PPP_VERSION "2.3.3" #define PPP_MAGIC 0x5002 /* Magic value for the ppp structure */ #define PROTO_IPX 0x002b /* protocol numbers */ #define PROTO_DNA_RT 0x0027 /* DNA Routing */ diff --git a/include/linux/if_pppvar.h b/include/linux/if_pppvar.h index 720e5cdad..c1fe88ab4 100644 --- a/include/linux/if_pppvar.h +++ b/include/linux/if_pppvar.h @@ -1,4 +1,4 @@ -/* $Id: if_pppvar.h,v 1.4 1997/09/03 11:55:06 ecd Exp $ */ +/* From: if_pppvar.h,v 1.2 1995/06/12 11:36:51 paulus Exp */ /* * if_pppvar.h - private structures and declarations for PPP. * @@ -42,7 +42,7 @@ */ /* - * ==FILEVERSION 960302== + * ==FILEVERSION 971001== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. @@ -79,7 +79,7 @@ struct ppp_buffer { /* =2, daemon write buffer */ /* =3, daemon read buffer */ __u16 fcs; /* Frame Check Sequence (CRC) */ - __u8 filler[4]; /* Extra space if needed */ + __u16 magic; /* Extra space if needed */ }; /* Given a pointer to the ppp_buffer then return base address of buffer */ @@ -91,6 +91,7 @@ struct ppp_buffer { struct ppp { __s32 magic; /* magic value for structure */ + struct ppp *next; /* unit with next index */ /* Bitmapped flag fields. */ unsigned long inuse; /* are we allocated? */ @@ -104,27 +105,26 @@ struct ppp { __u32 recv_async_map; /* 1 bit means that given control character is ignored on input*/ - __s32 mtu; /* maximum xmit frame size */ - __s32 mru; /* maximum receive frame size */ + __s32 mtu; /* maximum xmit frame size */ + __s32 mru; /* maximum receive frame size */ /* Information about the current tty data */ - __s32 line; /* PPP channel number */ - struct tty_struct *tty; /* ptr to TTY structure */ - __s32 bytes_sent; /* Bytes sent on frame */ - __s32 bytes_rcvd; /* Bytes recvd on frame */ - - /* Interface to the network layer */ - struct device *dev; /* easy for intr handling */ + __s32 line; /* PPP channel number */ + struct tty_struct *tty; /* ptr to TTY structure */ + struct tty_struct *backup_tty; /* TTY to use if tty gets closed */ + __s32 bytes_sent; /* Bytes sent on frame */ + __s32 bytes_rcvd; /* Bytes recvd on frame */ /* VJ Header compression data */ - struct slcompress *slcomp; /* for header compression */ + struct slcompress *slcomp; /* for header compression */ /* Transmission information */ struct ppp_buffer *xbuf; /* Buffer currently being sent */ struct ppp_buffer *s1buf; /* Pointer to daemon buffer */ struct ppp_buffer *s2buf; /* Pointer to device buffer */ - __u32 last_xmit; /* time of last transmission */ + unsigned long last_xmit; /* time of last transmission */ + unsigned long last_recv; /* time last packet received */ /* These are pointers to the malloc()ed frame buffers. These buffers are used while processing a packet. If a packet @@ -142,8 +142,7 @@ struct ppp { struct wait_queue *read_wait; /* queue for writing processes */ /* Statistic information */ - struct pppstat stats; /* statistic information */ - struct ppp_idle ddinfo; /* demand dial information */ + struct pppstat stats; /* statistic information */ /* PPP compression protocol information */ __u32 sc_bytessent; /* count of octets sent */ @@ -154,4 +153,7 @@ struct ppp { struct compressor *sc_rcomp; /* receive decompressor */ void *sc_rc_state; /* receive decompressor state */ __s32 sc_xfer; /* PID of reserved PPP table */ + char name[8]; + struct device dev; /* net device structure */ + struct enet_statistics estats; /* more detailed stats */ }; diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index abb6198af..7377867e7 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h @@ -5,7 +5,7 @@ #define SHAPER_QLEN 10 /* - * This is a bit speed dependant (read it shouldnt be a constant!) + * This is a bit speed dependent (read it shouldn't be a constant!) * * 5 is about right for 28.8 upwards. Below that double for every * halving of speed or so. - ie about 20 for 9600 baud. @@ -33,8 +33,7 @@ struct shaper void *saddr, unsigned len); int (*rebuild_header)(struct sk_buff *skb); - int (*hard_header_cache)(struct dst_entry *dst, struct neighbour *neigh, - struct hh_cache *hh); + 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; diff --git a/include/linux/if_slip.h b/include/linux/if_slip.h index 5bd77e520..1eb4e3a83 100644 --- a/include/linux/if_slip.h +++ b/include/linux/if_slip.h @@ -23,6 +23,8 @@ #define SIOCGKEEPALIVE (SIOCDEVPRIVATE+1) /* Get keepalive timeout */ #define SIOCSOUTFILL (SIOCDEVPRIVATE+2) /* Set outfill timeout */ #define SIOCGOUTFILL (SIOCDEVPRIVATE+3) /* Get outfill timeout */ +#define SIOCSLEASE (SIOCDEVPRIVATE+4) /* Set "leased" line type */ +#define SIOCGLEASE (SIOCDEVPRIVATE+5) /* Get line type */ #endif diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 8be2d1b87..c13afde28 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -98,6 +98,7 @@ struct ip_mc_list char tm_running; char reporter; char unsolicit_count; + char loaded; }; extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr) diff --git a/include/linux/in_route.h b/include/linux/in_route.h index 6eaa7992a..a64453839 100644 --- a/include/linux/in_route.h +++ b/include/linux/in_route.h @@ -6,13 +6,15 @@ #define RTCF_DEAD RTNH_F_DEAD #define RTCF_ONLINK RTNH_F_ONLINK +/* Obsolete flag. About to be deleted */ #define RTCF_NOPMTUDISC RTM_F_NOPMTUDISC #define RTCF_NOTIFY 0x00010000 #define RTCF_DIRECTDST 0x00020000 #define RTCF_REDIRECTED 0x00040000 +#define RTCF_TPROXY 0x00080000 -#define RTCF_VALVE 0x00200000 +#define RTCF_FAST 0x00200000 #define RTCF_MASQ 0x00400000 #define RTCF_SNAT 0x00800000 #define RTCF_DOREDIRECT 0x01000000 diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 5f84c38de..f4662fc3d 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -1,19 +1,25 @@ #ifndef _LINUX_INETDEVICE_H #define _LINUX_INETDEVICE_H -/* IPv4 specific flags. They are initialized from global sysctl variables, - when IPv4 is initialized. - */ +#ifdef __KERNEL__ -#define IFF_IP_FORWARD 1 -#define IFF_IP_PROXYARP 2 -#define IFF_IP_RXREDIRECTS 4 -#define IFF_IP_TXREDIRECTS 8 -#define IFF_IP_SHAREDMEDIA 0x10 -#define IFF_IP_MFORWARD 0x20 -#define IFF_IP_RPFILTER 0x40 +struct ipv4_devconf +{ + int accept_redirects; + int send_redirects; + int secure_redirects; + int shared_media; + int accept_source_route; + int rp_filter; + int proxy_arp; + int bootp_relay; + int log_martians; + int forwarding; + int mc_forwarding; + void *sysctl; +}; -#ifdef __KERNEL__ +extern struct ipv4_devconf ipv4_devconf; struct in_device { @@ -22,24 +28,27 @@ struct in_device struct ip_mc_list *mc_list; /* IP multicast filter chain */ unsigned long mr_v1_seen; unsigned flags; + struct neigh_parms *arp_parms; + struct ipv4_devconf cnf; }; +#define IN_DEV_FORWARD(in_dev) ((in_dev)->cnf.forwarding) +#define IN_DEV_MFORWARD(in_dev) (ipv4_devconf.mc_forwarding && (in_dev)->cnf.mc_forwarding) +#define IN_DEV_RPFILTER(in_dev) (ipv4_devconf.rp_filter && (in_dev)->cnf.rp_filter) +#define IN_DEV_SOURCE_ROUTE(in_dev) (ipv4_devconf.accept_source_route && (in_dev)->cnf.accept_source_route) +#define IN_DEV_BOOTP_RELAY(in_dev) (ipv4_devconf.bootp_relay && (in_dev)->cnf.bootp_relay) -#define IN_DEV_RPFILTER(in_dev) (ipv4_config.rfc1812_filter && ((in_dev)->flags&IFF_IP_RPFILTER)) -#define IN_DEV_MFORWARD(in_dev) (ipv4_config.multicast_route && ((in_dev)->flags&IFF_IP_MFORWARD)) -#define IN_DEV_PROXY_ARP(in_dev) ((in_dev)->flags&IFF_IP_PROXYARP) +#define IN_DEV_LOG_MARTIANS(in_dev) (ipv4_devconf.log_martians || (in_dev)->cnf.log_martians) +#define IN_DEV_PROXY_ARP(in_dev) (ipv4_devconf.proxy_arp || (in_dev)->cnf.proxy_arp) +#define IN_DEV_SHARED_MEDIA(in_dev) (ipv4_devconf.shared_media || (in_dev)->cnf.shared_media) +#define IN_DEV_TX_REDIRECTS(in_dev) (ipv4_devconf.send_redirects || (in_dev)->cnf.send_redirects) +#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) -#if 1 -#define IN_DEV_FORWARD(in_dev) (IS_ROUTER) -#define IN_DEV_RX_REDIRECTS(in_dev) (ipv4_config.accept_redirects) -#define IN_DEV_TX_REDIRECTS(in_dev) (1) -#define IN_DEV_SHARED_MEDIA(in_dev) (ipv4_config.rfc1620_redirects) -#else -#define IN_DEV_FORWARD(in_dev) (ipv4_config.ip_forwarding==1 && ((in_dev)->flags&IFF_IP_FORWARD)) -#define IN_DEV_RX_REDIRECTS(in_dev) ((in_dev)->flags&IFF_IP_RXREDIRECTS) -#define IN_DEV_TX_REDIRECTS(in_dev) ((in_dev)->flags&IFF_IP_TXREDIRECTS) -#define IN_DEV_SHARED_MEDIA(in_dev) ((in_dev)->flags&IFF_IP_SHAREDMEDIA) -#endif +#define IN_DEV_RX_REDIRECTS(in_dev) \ + ((IN_DEV_FORWARD(in_dev) && \ + (ipv4_devconf.accept_redirects && (in_dev)->cnf.accept_redirects)) \ + || (!IN_DEV_FORWARD(in_dev) && \ + (ipv4_devconf.accept_redirects || (in_dev)->cnf.accept_redirects))) struct in_ifaddr { @@ -69,6 +78,7 @@ extern u32 inet_select_addr(struct device *dev, u32 dst, int scope); extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); extern int inet_add_bootp_addr(struct device *dev); extern void inet_del_bootp_addr(struct device *dev); +extern void inet_forward_change(void); extern __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa) { diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a3cabfbc1..a6c8e89c2 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -37,6 +37,7 @@ enum { SPECIALIX_BH, ESP_BH, NET_BH, + SCSI_BH, IMMEDIATE_BH, KEYBOARD_BH, CYCLADES_BH, @@ -48,6 +49,12 @@ enum { #include <asm/softirq.h> /* + * Are we in an interrupt context? Either doing bottom half + * or hardware interrupt processing? + */ +#define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) + +/* * Autoprobing for irqs: * * probe_irq_on() and probe_irq_off() provide robust primitives diff --git a/include/linux/ip.h b/include/linux/ip.h index 538cede73..f09175b4e 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h @@ -124,6 +124,10 @@ struct ip_options { unsigned char __data[0]; }; +#ifdef __KERNEL__ +#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) +#endif + struct iphdr { #if defined(__LITTLE_ENDIAN_BITFIELD) __u8 ihl:4, diff --git a/include/linux/ip_fw.h b/include/linux/ip_fw.h index a9933659c..6f9bc510a 100644 --- a/include/linux/ip_fw.h +++ b/include/linux/ip_fw.h @@ -126,8 +126,8 @@ struct ip_fw #define IP_FW_IN 1 #define IP_FW_OUT 2 #define IP_FW_ACCT 3 -#define IP_FW_MASQ 4 -#define IP_FW_CHAINS 5 /* total number of ip_fw chains */ +#define IP_FW_CHAINS 4 /* total number of ip_fw chains */ +#define IP_FW_MASQ 5 #define IP_FW_INSERT (IP_FW_BASE_CTL) #define IP_FW_APPEND (IP_FW_BASE_CTL+1) @@ -173,6 +173,11 @@ struct ip_fw #define IP_FW_MASQ_DEL (IP_FW_DELETE | (IP_FW_MASQ << IP_FW_SHIFT)) #define IP_FW_MASQ_FLUSH (IP_FW_FLUSH | (IP_FW_MASQ << IP_FW_SHIFT)) +#define IP_FW_MASQ_INSERT (IP_FW_INSERT | (IP_FW_MASQ << IP_FW_SHIFT)) +#define IP_FW_MASQ_ADD (IP_FW_APPEND | (IP_FW_MASQ << IP_FW_SHIFT)) +#define IP_FW_MASQ_DEL (IP_FW_DELETE | (IP_FW_MASQ << IP_FW_SHIFT)) +#define IP_FW_MASQ_FLUSH (IP_FW_FLUSH | (IP_FW_MASQ << IP_FW_SHIFT)) + struct ip_fwpkt { struct iphdr fwp_iph; /* IP header */ @@ -234,10 +239,14 @@ extern int ip_acct_ctl(int, void *, int); #ifdef CONFIG_IP_MASQUERADE extern int ip_masq_ctl(int, void *, int); #endif +#ifdef CONFIG_IP_MASQUERADE +extern int ip_masq_ctl(int, void *, int); +#endif extern int ip_fw_chk(struct iphdr *, struct device *, __u16 *, struct ip_fw *, int, int); extern void ip_fw_init(void); #endif /* KERNEL */ + #endif /* _IP_FW_H */ diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h index d53b16080..41591e876 100644 --- a/include/linux/ipv6_route.h +++ b/include/linux/ipv6_route.h @@ -13,6 +13,14 @@ #ifndef _LINUX_IPV6_ROUTE_H #define _LINUX_IPV6_ROUTE_H +enum +{ + RTA_IPV6_UNSPEC, + RTA_IPV6_HOPLIMIT, +}; + +#define RTA_IPV6_MAX RTA_IPV6_HOPLIMIT + #define RTF_DEFAULT 0x00010000 /* default - learned via ND */ #define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */ @@ -44,6 +52,5 @@ struct in6_rtmsg { #define RTMSG_DELDEVICE 0x12 #define RTMSG_NEWROUTE 0x21 #define RTMSG_DELROUTE 0x22 -#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed */ #endif diff --git a/include/linux/ipx.h b/include/linux/ipx.h index 9cf48e4d0..d3aa23844 100644 --- a/include/linux/ipx.h +++ b/include/linux/ipx.h @@ -76,5 +76,12 @@ struct ipx_route_def #define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) #define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1) #define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2) -#endif +#ifdef __KERNEL__ +#include <linux/skbuff.h> + +extern int ipxrtr_route_skb(struct sk_buff *); +extern int ipx_if_offset(unsigned long ipx_net_number); +#endif /* def __KERNEL__ */ + +#endif /* def _IPX_H_ */ diff --git a/include/linux/isdn.h b/include/linux/isdn.h index ea45d35cb..f7b4747d3 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -425,25 +425,11 @@ typedef struct isdn_net_local_s { struct isdn_net_dev_s *netdev; /* Ptr to netdev */ struct sk_buff *first_skb; /* Ptr to skb that triggers dialing */ struct sk_buff *sav_skb; /* Ptr to skb, rejected by LL-driver*/ -#if (LINUX_VERSION_CODE < 0x02010F) - /* Ptr to orig. header_cache_bind */ - void (*org_hcb)(struct hh_cache **, - struct device *, - unsigned short, - __u32); -#else -#if (LINUX_VERSION_CODE < 0x2011E) - /* Ptr to orig. hard_header_cache */ - int (*org_hhc)(struct dst_entry *dst, - struct dst_entry *neigh, - struct hh_cache *hh); -#else + /* Ptr to orig. hard_header_cache */ - int (*org_hhc)(struct dst_entry *dst, - struct neighbour *neigh, + int (*org_hhc)(struct neighbour *neigh, struct hh_cache *hh); -#endif -#endif + /* Ptr to orig. header_cache_update */ void (*org_hcu)(struct hh_cache *, struct device *, diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index a8a3cbece..a81dc1296 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -163,10 +163,6 @@ struct iso_directory_record { #define ISOFS_ZONE_BITS(INODE) ((INODE)->i_sb->u.isofs_sb.s_log_zone_size) #define ISOFS_SUPER_MAGIC 0x9660 -#define ISOFS_FILE_UNKNOWN 0 -#define ISOFS_FILE_TEXT 1 -#define ISOFS_FILE_BINARY 2 -#define ISOFS_FILE_TEXT_M 3 #ifdef __KERNEL__ extern int isonum_711(char *); diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h index a1343a636..02f17e071 100644 --- a/include/linux/iso_fs_i.h +++ b/include/linux/iso_fs_i.h @@ -7,6 +7,8 @@ struct iso_inode_info { unsigned int i_first_extent; unsigned char i_file_format; + unsigned long i_next_section_ino; + off_t i_section_size; }; #endif diff --git a/include/linux/iso_fs_sb.h b/include/linux/iso_fs_sb.h index 35bd29203..834ae348b 100644 --- a/include/linux/iso_fs_sb.h +++ b/include/linux/iso_fs_sb.h @@ -13,7 +13,6 @@ struct isofs_sb_info { unsigned char s_high_sierra; /* A simple flag */ unsigned char s_mapping; - unsigned char s_conversion; unsigned char s_rock; unsigned char s_joliet_level; unsigned char s_utf8; diff --git a/include/linux/istallion.h b/include/linux/istallion.h index e1bf37264..269ef88ba 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h @@ -3,7 +3,7 @@ /* * istallion.h -- stallion intelligent multiport serial driver. * - * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au). * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify @@ -102,6 +102,7 @@ typedef struct stlibrd { int nrports; int nrdevs; unsigned int iobase; + int iosize; unsigned long memaddr; void *membase; int memsize; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index cf21ecf73..a5e6544f6 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -65,12 +65,6 @@ asmlinkage int printk(const char * fmt, ...) printk(KERN_INFO fmt,##arg) /* - * "suser()" checks against the effective user id, while "fsuser()" - * is used for file permission checking and checks against the fsuid.. - */ -#define fsuser() (current->fsuid == 0) - -/* * Display an IP address in readable format. */ diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 1966490a7..6bf0d79cb 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -2,6 +2,9 @@ #define _LINUX_KERNEL_STAT_H #include <asm/irq.h> +#include <asm/smp.h> +#include <linux/smp.h> +#include <linux/tasks.h> /* * 'kernel_stat.h' contains the definitions needed for doing @@ -12,7 +15,10 @@ #define DK_NDRIVE 4 struct kernel_stat { - unsigned int cpu_user, cpu_nice, cpu_system; + unsigned int cpu_user, cpu_nice, cpu_system; + unsigned int per_cpu_user[NR_CPUS], + per_cpu_nice[NR_CPUS], + per_cpu_system[NR_CPUS]; unsigned int dk_drive[DK_NDRIVE]; unsigned int dk_drive_rio[DK_NDRIVE]; unsigned int dk_drive_wio[DK_NDRIVE]; @@ -20,7 +26,7 @@ struct kernel_stat { unsigned int dk_drive_wblk[DK_NDRIVE]; unsigned int pgpgin, pgpgout; unsigned int pswpin, pswpout; - unsigned int interrupts[NR_IRQS]; + unsigned int irqs[NR_CPUS][NR_IRQS]; unsigned int ipackets, opackets; unsigned int ierrors, oerrors; unsigned int collisions; @@ -29,4 +35,17 @@ struct kernel_stat { extern struct kernel_stat kstat; +/* + * Number of interrupts per specific IRQ source, since bootup + */ +extern inline int kstat_irqs (int irq) +{ + int i, sum=0; + + for (i = 0 ; i < smp_num_cpus ; i++) + sum += kstat.irqs[cpu_logical_map(i)][irq]; + + return sum; +} + #endif /* _LINUX_KERNEL_STAT_H */ diff --git a/include/linux/kerneld.h b/include/linux/kerneld.h index 641f231ee..b2db5f8c7 100644 --- a/include/linux/kerneld.h +++ b/include/linux/kerneld.h @@ -48,8 +48,10 @@ struct kerneld_msg { }; #ifdef __KERNEL__ +#include <linux/string.h> + extern int kerneld_send(int msgtype, int ret_size, int msgsz, - const char *text, const char *ret_val); + const char *text, const char *ret_val); /* * Request that a module should be loaded. @@ -59,8 +61,8 @@ extern int kerneld_send(int msgtype, int ret_size, int msgsz, static inline int request_module(const char *name) { return kerneld_send(KERNELD_REQUEST_MODULE, - 0 | KERNELD_WAIT, - strlen(name), name, NULL); + 0 | KERNELD_WAIT, + strlen(name), name, NULL); } /* @@ -70,8 +72,8 @@ static inline int request_module(const char *name) static inline int release_module(const char *name, int waitflag) { return kerneld_send(KERNELD_RELEASE_MODULE, - 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT), - strlen(name), name, NULL); + 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT), + strlen(name), name, NULL); } /* @@ -81,8 +83,8 @@ static inline int release_module(const char *name, int waitflag) static inline int delayed_release_module(const char *name) { return kerneld_send(KERNELD_DELAYED_RELEASE_MODULE, - 0 | KERNELD_NOWAIT, - strlen(name), name, NULL); + 0 | KERNELD_NOWAIT, + strlen(name), name, NULL); } /* @@ -94,8 +96,8 @@ static inline int delayed_release_module(const char *name) static inline int cancel_release_module(const char *name) { return kerneld_send(KERNELD_CANCEL_RELEASE_MODULE, - 0 | KERNELD_NOWAIT, - strlen(name), name, NULL); + 0 | KERNELD_NOWAIT, + strlen(name), name, NULL); } /* @@ -104,8 +106,8 @@ static inline int cancel_release_module(const char *name) static inline int ksystem(const char *cmd, int waitflag) { return kerneld_send(KERNELD_SYSTEM, - 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT), - strlen(cmd), cmd, NULL); + 0 | (waitflag?KERNELD_WAIT:KERNELD_NOWAIT), + strlen(cmd), cmd, NULL); } /* @@ -114,18 +116,19 @@ static inline int ksystem(const char *cmd, int waitflag) static inline int kerneld_route(const char *ip_route) { return kerneld_send(KERNELD_REQUEST_ROUTE, - 0 | KERNELD_WAIT, - strlen(ip_route), ip_route, NULL); + 0 | KERNELD_WAIT, + strlen(ip_route), ip_route, NULL); } /* * Handle an external screen blanker */ -static inline int kerneld_blanker(int on_off) /* 0 => "off", else "on" */ +static inline int kerneld_blanker(int on_off) { + char *s = on_off ? "on" : "off"; return kerneld_send(KERNELD_BLANKER, - 0 | (on_off?KERNELD_NOWAIT:KERNELD_WAIT), - strlen(on_off?"on":"off"), on_off?"on":"off", NULL); + 0 | (on_off ? KERNELD_NOWAIT : KERNELD_WAIT), + strlen(s), s, NULL); } #endif /* __KERNEL__ */ diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 148eaad22..cd5cdb349 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -15,6 +15,10 @@ #define SYMBOL_NAME_LABEL(X) X/**/: #endif +#ifdef __arm__ +#define __ALIGN .align 0 +#define __ALIGN_STR ".align 0" +#else #ifdef __mc68000__ #define __ALIGN .align 4 #define __ALIGN_STR ".align 4" @@ -27,6 +31,7 @@ #define __ALIGN_STR ".align 16,0x90" #endif /* __i486__/__i586__ */ #endif /* __mc68000__ */ +#endif /* __arm__ */ #ifdef __ASSEMBLY__ diff --git a/include/linux/lp.h b/include/linux/lp.h index 368cd9bef..ba2e34f07 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -7,6 +7,12 @@ * 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... @@ -89,20 +95,6 @@ #define LP_BASE(x) lp_table[(x)].dev->port->base -#define r_dtr(x) inb(LP_BASE(x)) -#define r_str(x) inb(LP_BASE(x)+1) -#define r_ctr(x) inb(LP_BASE(x)+2) -#define r_epp(x) inb(LP_BASE(x)+4) -#define r_fifo(x) inb(LP_BASE(x)+0x400) -#define r_ecr(x) inb(LP_BASE(x)+0x402) - -#define w_dtr(x,y) outb((y), LP_BASE(x)) -#define w_str(x,y) outb((y), LP_BASE(x)+1) -#define w_ctr(x,y) outb((y), LP_BASE(x)+2) -#define w_epp(x,y) outb((y), LP_BASE(x)+4) -#define w_fifo(x,y) outb((y), LP_BASE(x)+0x400) -#define w_ecr(x,y) outb((y), LP_BASE(x)+0x402) - struct lp_stats { unsigned long chars; unsigned long sleeps; @@ -118,12 +110,10 @@ struct lp_struct { unsigned int chars; unsigned int time; unsigned int wait; - struct wait_queue *lp_wait_q; char *lp_buffer; unsigned int lastcall; unsigned int runchars; unsigned int waittime; - unsigned int should_relinquish; struct lp_stats stats; }; @@ -170,6 +160,9 @@ struct lp_struct { */ #define LP_DELAY 50 +#define LP_POLLING(minor) (lp_table[(minor)].dev->port->irq == PARPORT_IRQ_NONE) +#define LP_PREEMPTED(minor) (lp_table[(minor)].dev->port->waithead != NULL) + /* * function prototypes */ diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index d942ccdc3..696b1a764 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h @@ -128,6 +128,8 @@ struct rtc_time { #define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time) /* Set RTC time */ #define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) /* Read IRQ rate */ #define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) /* Set IRQ rate */ +#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */ +#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */ #endif /* _MC146818RTC_H */ diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index a725bbe36..20a8cd66d 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -95,7 +95,7 @@ extern int minix_rmdir(struct inode * dir, struct dentry *dentry); extern int minix_unlink(struct inode * dir, struct dentry *dentry); extern int minix_symlink(struct inode * inode, struct dentry *dentry, const char * symname); -extern int minix_link(struct inode * oldinode, struct inode * dir, struct dentry *dentry); +extern int minix_link(struct dentry * old_dentry, struct inode * dir, struct dentry *dentry); extern int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev); extern int minix_rename(struct inode * old_dir, struct dentry *old_dentry, struct inode * new_dir, struct dentry *new_dentry); diff --git a/include/linux/minix_fs_sb.h b/include/linux/minix_fs_sb.h index e77b4efc6..c533e63ac 100644 --- a/include/linux/minix_fs_sb.h +++ b/include/linux/minix_fs_sb.h @@ -12,10 +12,10 @@ struct minix_sb_info { unsigned long s_firstdatazone; unsigned long s_log_zone_size; unsigned long s_max_size; - struct buffer_head * s_imap[8]; - struct buffer_head * s_zmap[64]; unsigned long s_dirsize; unsigned long s_namelen; + struct buffer_head ** s_imap; + struct buffer_head ** s_zmap; struct buffer_head * s_sbh; struct minix_super_block * s_ms; unsigned short s_mount_state; diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 3bdb48348..c6646ddd1 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -9,6 +9,8 @@ #define ATARIMOUSE_MINOR 5 #define SUN_MOUSE_MINOR 6 #define PC110PAD_MINOR 9 +#define WATCHDOG_MINOR 130 /* Watchdog timer */ +#define TEMP_MINOR 131 /* Temperature Sensor */ #define RTC_MINOR 135 #define SUN_OPENPROM_MINOR 139 #define NVRAM_MINOR 144 diff --git a/include/linux/mm.h b/include/linux/mm.h index 4a44f193d..11d04d453 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -48,7 +48,7 @@ struct vm_area_struct { struct vm_operations_struct * vm_ops; unsigned long vm_offset; - struct dentry * vm_dentry; + struct file * vm_file; unsigned long vm_pte; /* shared mem */ }; @@ -123,7 +123,6 @@ typedef struct page { struct wait_queue *wait; struct page **pprev_hash; struct buffer_head * buffers; - unsigned long pg_swap_entry; unsigned long map_nr; /* page->map_nr == page - mem_map */ } mem_map_t; @@ -134,7 +133,7 @@ typedef struct page { #define PG_uptodate 3 #define PG_free_after 4 #define PG_decr_after 5 -#define PG_swap_unlock_after 6 +/* Unused 6 */ #define PG_DMA 7 #define PG_Slab 8 #define PG_swap_cache 9 @@ -147,7 +146,6 @@ typedef struct page { #define PageUptodate(page) (test_bit(PG_uptodate, &(page)->flags)) #define PageFreeAfter(page) (test_bit(PG_free_after, &(page)->flags)) #define PageDecrAfter(page) (test_bit(PG_decr_after, &(page)->flags)) -#define PageSwapUnlockAfter(page) (test_bit(PG_swap_unlock_after, &(page)->flags)) #define PageDMA(page) (test_bit(PG_DMA, &(page)->flags)) #define PageSlab(page) (test_bit(PG_Slab, &(page)->flags)) #define PageSwapCache(page) (test_bit(PG_swap_cache, &(page)->flags)) @@ -238,21 +236,22 @@ extern mem_map_t * mem_map; * goes to clearing the page. If you want a page without the clearing * overhead, just use __get_free_page() directly.. */ -#define __get_free_page(priority) __get_free_pages((priority),0,0) -#define __get_dma_pages(priority, order) __get_free_pages((priority),(order),1) -extern unsigned long FASTCALL(__get_free_pages(int priority, unsigned long gfporder, int dma)); +#define __get_free_page(gfp_mask) __get_free_pages((gfp_mask),0) +#define __get_dma_pages(gfp_mask, order) __get_free_pages((gfp_mask) | GFP_DMA,(order)) +extern unsigned long FASTCALL(__get_free_pages(int gfp_mask, unsigned long gfp_order)); -extern inline unsigned long get_free_page(int priority) +extern inline unsigned long get_free_page(int gfp_mask) { unsigned long page; - page = __get_free_page(priority); + page = __get_free_page(gfp_mask); if (page) clear_page(page); return page; } /* memory.c & swap.c*/ +extern int free_memory_available(void); #define free_page(addr) free_pages((addr),0) extern void FASTCALL(free_pages(unsigned long addr, unsigned long order)); @@ -298,23 +297,36 @@ extern void truncate_inode_pages(struct inode *, unsigned long); extern unsigned long get_cached_page(struct inode *, unsigned long, int); extern void put_cached_page(unsigned long); -#define GFP_BUFFER 0x00 -#define GFP_ATOMIC 0x01 -#define GFP_USER 0x02 -#define GFP_KERNEL 0x03 -#define GFP_NOBUFFER 0x04 -#define GFP_NFS 0x05 +/* + * GFP bitmasks.. + */ +#define __GFP_WAIT 0x01 +#define __GFP_IO 0x02 +#define __GFP_LOW 0x00 +#define __GFP_MED 0x04 +#define __GFP_HIGH 0x08 + +#define __GFP_UNCACHED 0x40 +#define __GFP_DMA 0x80 + +#define GFP_BUFFER (__GFP_LOW | __GFP_WAIT) +#define GFP_ATOMIC (__GFP_HIGH) +#define GFP_USER (__GFP_LOW | __GFP_WAIT | __GFP_IO) +#define GFP_KERNEL (__GFP_LOW | __GFP_WAIT | __GFP_IO) +#define GFP_NFS (__GFP_MED | __GFP_WAIT | __GFP_IO) /* Flag - indicates that the buffer should be allocated uncached as for an architecture where the caches don't snoop DMA access. This is a even stricter requirement than GFP_DMA as GFP_DMA allocated buffers might be writeback cacheable and not be suitable for use with devices like networks cards which manipulate objects smaller than a cacheline. */ -#define GFP_UNCACHED 0x40 + +#define GFP_UNCACHED __GFP_UNCACHED /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ -#define GFP_DMA 0x80 + +#define GFP_DMA __GFP_DMA #define GFP_LEVEL_MASK 0xf diff --git a/include/linux/module.h b/include/linux/module.h index 483aea5dc..475c68854 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -94,6 +94,7 @@ struct module_info #define MOD_AUTOCLEAN 4 #define MOD_VISITED 8 #define MOD_USED_ONCE 16 +#define MOD_JUST_FREED 32 /* Values for query_module's which. */ diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index de0e47ab2..bcf4d0134 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -161,7 +161,7 @@ struct msdos_dir_slot { __u8 name11_12[4]; /* last 2 characters in name */ }; -struct slot_info { +struct vfat_slot_info { int is_long; /* was the found entry long */ int long_slots; /* number of long slots in filename */ int total_slots; /* total slots (long and short) */ @@ -218,14 +218,14 @@ extern int fat_smap(struct inode *inode,int sector); extern int fat_free(struct inode *inode,int skip); void fat_cache_inval_inode(struct inode *inode); void fat_cache_inval_dev(kdev_t device); -extern void cache_init(void); -void cache_lookup(struct inode *inode,int cluster,int *f_clu,int *d_clu); -void cache_add(struct inode *inode,int f_clu,int d_clu); -int get_cluster(struct inode *inode,int cluster); +extern void fat_cache_init(void); +void fat_cache_lookup(struct inode *inode,int cluster,int *f_clu,int *d_clu); +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 int fat_bmap(struct inode *inode,int block); -extern int fat_notify_change(struct inode *,struct iattr *); +extern int fat_notify_change(struct dentry *, struct iattr *); extern void fat_put_inode(struct inode *inode); extern void fat_delete_inode(struct inode *inode); extern void fat_put_super(struct super_block *sb); @@ -248,12 +248,14 @@ extern int fat_dir_ioctl(struct inode * inode, struct file * filp, /* file.c */ extern struct inode_operations fat_file_inode_operations; extern struct inode_operations fat_file_inode_operations_1024; +extern struct inode_operations fat_file_inode_operations_readpage; extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *); extern void fat_truncate(struct inode *inode); /* mmap.c */ extern int fat_mmap(struct file *, struct vm_area_struct *); +extern int fat_readpage(struct file *, struct page *); /* vfat.c */ diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h index 530930e53..674999c58 100644 --- a/include/linux/msdos_fs_i.h +++ b/include/linux/msdos_fs_i.h @@ -28,16 +28,9 @@ struct msdos_inode_info { int i_start; /* first cluster or 0 */ int i_logstart; /* logical first cluster */ int i_attrs; /* unused attribute bits */ + int i_ctime_ms; /* unused change time in milliseconds */ int i_busy; /* file is either deleted but still open, or inconsistent (mkdir) */ - struct inode *i_depend; /* pointer to inode that depends on the - current inode */ - struct inode *i_old; /* pointer to the old inode this inode - depends on */ - struct inode *i_linked; /* pointer to inode linked to the current one, - happens when an open file is moved */ - struct inode *i_oldlink;/* pointer to open inode that references - the same file */ int i_binary; /* file contains non-text data */ }; diff --git a/include/linux/msdos_fs_sb.h b/include/linux/msdos_fs_sb.h index fe584a85b..4985eef15 100644 --- a/include/linux/msdos_fs_sb.h +++ b/include/linux/msdos_fs_sb.h @@ -1,5 +1,6 @@ #ifndef _MSDOS_FS_SB #define _MSDOS_FS_SB +#include<linux/fat_cvf.h> /* * MS-DOS file system in-core superblock data @@ -47,6 +48,8 @@ struct msdos_sb_info { struct fat_mount_options options; 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; }; #endif diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 7b09f94a9..03904df71 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h @@ -29,7 +29,7 @@ struct ncp_ioctl_request { struct ncp_fs_info { int version; struct sockaddr_ipx addr; - uid_t mounted_uid; + __kernel_uid_t mounted_uid; int connection; /* Connection number the server assigned us */ int buffer_size; /* The negotiated buffer size, to be used for read/write requests! */ @@ -38,13 +38,72 @@ struct ncp_fs_info { __u32 directory_id; }; +struct ncp_sign_init +{ + char sign_root[8]; + char sign_last[16]; +}; + +struct ncp_lock_ioctl +{ +#define NCP_LOCK_LOG 0 +#define NCP_LOCK_SH 1 +#define NCP_LOCK_EX 2 +#define NCP_LOCK_CLEAR 256 + int cmd; + int origin; + unsigned int offset; + unsigned int length; +#define NCP_LOCK_DEFAULT_TIMEOUT 18 +#define NCP_LOCK_MAX_TIMEOUT 180 + int timeout; +}; + +struct ncp_setroot_ioctl +{ + int volNumber; + int namespace; + __u32 dirEntNum; +}; + +struct ncp_objectname_ioctl +{ +#define NCP_AUTH_NONE 0x00 +#define NCP_AUTH_BIND 0x31 +#define NCP_AUTH_NDS 0x32 + int auth_type; + size_t object_name_len; + void* object_name; /* an userspace data, in most cases user name */ +}; + +struct ncp_privatedata_ioctl +{ + size_t len; + void* data; /* ~1000 for NDS */ +}; + #define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request) #define NCP_IOC_GETMOUNTUID _IOW('n', 2, uid_t) +#define NCP_IOC_GETMOUNTUID_INT _IOW('n', 2, unsigned int) #define NCP_IOC_CONN_LOGGED_IN _IO('n', 3) #define NCP_GET_FS_INFO_VERSION (1) #define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info) +#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init) +#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int) +#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int) + +#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl) + +#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl) +#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl) + +#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl) +#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl) +#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl) +#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl) + /* * The packet size to allocate. One page should be enough. */ @@ -55,8 +114,12 @@ struct ncp_fs_info { #ifdef __KERNEL__ +#include <linux/config.h> + #undef NCPFS_PARANOIA +#ifndef DEBUG_NCP #define DEBUG_NCP 0 +#endif #if DEBUG_NCP > 0 #define DPRINTK(format, args...) printk(format , ## args) #else @@ -140,9 +203,11 @@ static inline void ncp_kfree_s(void *obj, int size) #endif /* DEBUG_NCP_MALLOC */ /* linux/fs/ncpfs/inode.c */ +int ncp_notify_change(struct dentry *, struct iattr *attr); struct super_block *ncp_read_super(struct super_block *, void *, int); struct inode *ncp_iget(struct super_block *, struct ncpfs_inode_info *); void ncp_update_inode(struct inode *, struct nw_file_info *); +void ncp_update_inode2(struct inode *, struct nw_file_info *); extern int init_ncp_fs(void); /* linux/fs/ncpfs/dir.c */ @@ -202,12 +267,26 @@ static inline int ncp_namespace(struct inode *inode) static inline int ncp_preserve_case(struct inode *i) { - return (ncp_namespace(i) == NW_NS_OS2); +#if defined(CONFIG_NCPFS_NFS_NS) || defined(CONFIG_NCPFS_OS2_NS) + int ns = ncp_namespace(i); +#endif + return +#ifdef CONFIG_NCPFS_OS2_NS + (ns == NW_NS_OS2) || +#endif /* CONFIG_NCPFS_OS2_NS */ +#ifdef CONFIG_NCPFS_NFS_NS + (ns == NW_NS_NFS) || +#endif /* CONFIG_NCPFS_NFS_NS */ + 0; } static inline int ncp_case_sensitive(struct inode *i) { +#ifdef CONFIG_NCPFS_NFS_NS + return ncp_namespace(i) == NW_NS_NFS; +#else return 0; +#endif /* CONFIG_NCPFS_NFS_NS */ } #endif /* __KERNEL__ */ diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index cfe205547..efcc20556 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h @@ -14,6 +14,7 @@ #ifdef __KERNEL__ #define NCP_DEFAULT_BUFSIZE 1024 +#define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */ struct ncp_server { @@ -21,7 +22,7 @@ struct ncp_server { interest for us later, so we store it completely. */ - __u8 name_space[NCP_NUMBER_OF_VOLUMES]; + __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2]; struct file *ncp_filp; /* File pointer to ncp socket */ @@ -50,7 +51,30 @@ struct ncp_server { int ncp_reply_size; struct ncp_inode_info root; +#if 0 char root_path; /* '\0' */ +#else + struct dentry* root_dentry; +#endif + +/* info for packet signing */ + int sign_wanted; /* 1=Server needs signed packets */ + int sign_active; /* 0=don't do signing, 1=do */ + char sign_root[8]; /* generated from password and encr. key */ + char sign_last[16]; + + /* Authentication info: NDS or BINDERY, username */ + struct { + int auth_type; + size_t object_name_len; + void* object_name; + int object_type; + } auth; + /* Password info */ + struct { + size_t len; + void* data; + } priv; }; static inline int ncp_conn_valid(struct ncp_server *server) @@ -66,3 +90,4 @@ static inline void ncp_invalidate_conn(struct ncp_server *server) #endif /* __KERNEL__ */ #endif + diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h index ed169e70a..54bc5b943 100644 --- a/include/linux/ncp_mount.h +++ b/include/linux/ncp_mount.h @@ -18,12 +18,15 @@ /* Values for flags */ #define NCP_MOUNT_SOFT 0x0001 #define NCP_MOUNT_INTR 0x0002 +#define NCP_MOUNT_STRONG 0x0004 /* enable delete/rename of r/o files */ +#define NCP_MOUNT_NO_OS2 0x0008 +#define NCP_MOUNT_NO_NFS 0x0010 struct ncp_mount_data { int version; unsigned int ncp_fd; /* The socket to the ncp port */ - uid_t mounted_uid; /* Who may umount() this filesystem? */ - pid_t wdog_pid; /* Who cares for our watchdog packets? */ + __kernel_uid_t mounted_uid; /* Who may umount() this filesystem? */ + __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */ unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; unsigned int time_out; /* How long should I wait after @@ -31,10 +34,10 @@ struct ncp_mount_data { unsigned int retry_count; /* And how often should I retry? */ unsigned int flags; - uid_t uid; - gid_t gid; - mode_t file_mode; - mode_t dir_mode; + __kernel_uid_t uid; + __kernel_gid_t gid; + __kernel_mode_t file_mode; + __kernel_mode_t dir_mode; }; #endif diff --git a/include/linux/net.h b/include/linux/net.h index 015f2d8b2..63e996f9d 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -93,7 +93,7 @@ struct proto_ops { int flags); int (*getname) (struct socket *sock, struct sockaddr *uaddr, int *usockaddr_len, int peer); - unsigned int (*poll) (struct socket *sock, struct poll_table_struct *wait); + unsigned int (*poll) (struct file *file, struct socket *sock, struct poll_table_struct *wait); int (*ioctl) (struct socket *sock, unsigned int cmd, unsigned long arg); int (*listen) (struct socket *sock, int len); @@ -137,7 +137,9 @@ extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags); extern int sock_readv_writev(int type, struct inode * inode, struct file * file, const struct iovec * iov, long count, long size); -int net_ratelimit(void); +extern int net_ratelimit(void); +extern unsigned long net_random(void); +extern void net_srandom(unsigned long); #endif /* __KERNEL__ */ #endif /* _LINUX_NET_H */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9d1f67cc0..72430508a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -31,6 +31,12 @@ #include <asm/atomic.h> +#ifdef __KERNEL__ +#ifdef CONFIG_NET_PROFILE +#include <net/profile.h> +#endif +#endif + /* * For future expansion when we will have different priorities. */ @@ -60,6 +66,8 @@ #endif struct neighbour; +struct neigh_parms; +struct sk_buff; /* * We tag multicasts with these structures. @@ -67,10 +75,11 @@ struct neighbour; struct dev_mc_list { - struct dev_mc_list *next; - char dmi_addr[MAX_ADDR_LEN]; - unsigned short dmi_addrlen; - unsigned short dmi_users; + struct dev_mc_list *next; + __u8 dmi_addr[MAX_ADDR_LEN]; + unsigned char dmi_addrlen; + int dmi_users; + int dmi_gusers; }; struct hh_cache @@ -78,7 +87,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 */ - char hh_uptodate; /* hh_data is valid */ + int (*hh_output)(struct sk_buff *skb); /* cached hardware header; allow for machine alignment needs. */ unsigned long hh_data[16/sizeof(unsigned long)]; }; @@ -118,6 +127,16 @@ struct net_device_stats }; +#ifdef CONFIG_NET_FASTROUTE +struct net_fastroute_stats +{ + int hits; + int succeed; + int deferred; + int latency_reduction; +}; +#endif + /* Media selection options. */ enum { IF_PORT_UNKNOWN = 0, @@ -260,8 +279,7 @@ struct device int (*set_config)(struct device *dev, struct ifmap *map); #define HAVE_HEADER_CACHE - int (*hard_header_cache)(struct dst_entry *dst, - struct neighbour *neigh, + int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); void (*header_cache_update)(struct hh_cache *hh, struct device *dev, @@ -271,6 +289,18 @@ struct device int (*hard_header_parse)(struct sk_buff *skb, unsigned char *haddr); + int (*neigh_setup)(struct device *dev, struct neigh_parms *); + int (*accept_fastpath)(struct device *, struct dst_entry*); + +#ifdef CONFIG_NET_FASTROUTE + /* Really, this semaphore may be necessary and for not fastroute code; + f.e. SMP?? + */ + int tx_semaphore; +#define NETDEV_FASTROUTE_HMASK 0xF + /* Semi-private data. Keep it at the end of device struct. */ + struct dst_entry *fastpath[NETDEV_FASTROUTE_HMASK+1]; +#endif }; @@ -310,13 +340,18 @@ extern int register_netdevice_notifier(struct notifier_block *nb); extern int unregister_netdevice_notifier(struct notifier_block *nb); extern int dev_new_index(void); extern struct device *dev_get_by_index(int ifindex); -extern int register_gifconf(int family, int (*func)(struct device *dev, char *bufptr, int len)); extern int dev_restart(struct device *dev); +typedef int gifconf_func_t(struct device * dev, char * bufptr, int len); +extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf); +extern __inline__ int unregister_gifconf(unsigned int family) +{ + return register_gifconf(family, 0); +} + #define HAVE_NETIF_RX 1 extern void netif_rx(struct sk_buff *skb); extern void net_bh(void); -extern void dev_tint(struct device *dev); extern int dev_get_info(char *buffer, char **start, off_t offset, int length, int dummy); extern int dev_ioctl(unsigned int cmd, void *); extern int dev_change_flags(struct device *, unsigned); @@ -383,13 +418,26 @@ extern int register_trdev(struct device *dev); extern void unregister_trdev(struct device *dev); /* Functions used for multicast support */ extern void dev_mc_upload(struct device *dev); -extern void dev_mc_delete(struct device *dev, void *addr, int alen, int all); -extern void dev_mc_add(struct device *dev, void *addr, int alen, int newonly); +extern int dev_mc_delete(struct device *dev, void *addr, int alen, int all); +extern int dev_mc_add(struct device *dev, void *addr, int alen, int newonly); extern void dev_mc_discard(struct device *dev); extern void dev_set_promiscuity(struct device *dev, int inc); extern void dev_set_allmulti(struct device *dev, int inc); /* Load a device via the kerneld */ extern void dev_load(const char *name); +extern void dev_mcast_init(void); +extern int netdev_register_fc(struct device *dev, void (*stimul)(struct device *dev)); +extern void netdev_unregister_fc(int bit); +extern int netdev_dropping; +extern int netdev_max_backlog; +extern atomic_t netdev_rx_dropped; +extern unsigned long netdev_fc_xoff; +#ifdef CONFIG_NET_FASTROUTE +extern int netdev_fastroute; +extern int netdev_fastroute_obstacles; +extern void dev_clear_fastroute(struct device *dev); +extern struct net_fastroute_stats dev_fastroute_stat; +#endif #endif /* __KERNEL__ */ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 8766af2b4..83d9fae1b 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -46,6 +46,7 @@ struct nlmsghdr #define NLM_F_REPLACE 0x100 /* Override existing */ #define NLM_F_EXCL 0x200 /* Do not touch, if it exists */ #define NLM_F_CREATE 0x400 /* Create, if it does not exist */ +#define NLM_F_APPEND 0x800 /* Add to end of list */ /* 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL @@ -65,6 +66,7 @@ struct nlmsghdr (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) #define NLMSG_OK(nlh,len) ((nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ (nlh)->nlmsg_len <= (len)) +#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) #define NLMSG_NOOP 0x1 /* Nothing. */ #define NLMSG_ERROR 0x2 /* Error */ @@ -119,6 +121,7 @@ struct netlink_callback struct nlmsghdr *nlh; int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); int (*done)(struct netlink_callback *cb); + int family; long args[4]; }; diff --git a/include/linux/nfs.h b/include/linux/nfs.h index c8ea8ffdf..c4aab89e1 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h @@ -33,6 +33,7 @@ enum nfs_stat { NFSERR_EAGAIN = 11, NFSERR_ACCES = 13, NFSERR_EXIST = 17, + NFSERR_XDEV = 18, NFSERR_NODEV = 19, NFSERR_NOTDIR = 20, NFSERR_ISDIR = 21, @@ -137,6 +138,13 @@ struct nfs_fsinfo { __u32 bavail; }; +struct nfs_writeargs { + struct nfs_fh * fh; + __u32 offset; + __u32 count; + const void * buffer; +}; + #ifdef NFS_NEED_XDR_TYPES struct nfs_sattrargs { @@ -156,13 +164,6 @@ struct nfs_readargs { void * buffer; }; -struct nfs_writeargs { - struct nfs_fh * fh; - __u32 offset; - __u32 count; - const void * buffer; -}; - struct nfs_createargs { struct nfs_fh * fh; const char * name; diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 3c869e38d..a7b51b977 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -11,9 +11,10 @@ #include <linux/signal.h> #include <linux/sched.h> -#include <linux/nfs.h> #include <linux/in.h> -#include <linux/sunrpc/debug.h> + +#include <linux/sunrpc/sched.h> +#include <linux/nfs.h> #include <linux/nfs_mount.h> /* @@ -53,11 +54,12 @@ */ #define NFS_SUPER_MAGIC 0x6969 +#define NFS_FH(dentry) ((struct nfs_fh *) ((dentry)->d_fsdata)) +#define NFS_DSERVER(dentry) (&(dentry)->d_sb->u.nfs_sb.s_server) #define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server) #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) #define NFS_ADDR(inode) (RPC_PEERADDR(NFS_CLIENT(inode))) #define NFS_CONGESTED(inode) (RPC_CONGESTED(NFS_CLIENT(inode))) -#define NFS_FH(inode) (&(inode)->u.nfs_i.fhandle) #define NFS_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies) #define NFS_OLDMTIME(inode) ((inode)->u.nfs_i.read_cache_mtime) @@ -76,8 +78,6 @@ do { \ #define NFS_FLAGS(inode) ((inode)->u.nfs_i.flags) #define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATE) - -#define NFS_RENAMED_DIR(inode) ((inode)->u.nfs_i.silly_inode) #define NFS_WRITEBACK(inode) ((inode)->u.nfs_i.writeback) /* @@ -88,6 +88,48 @@ do { \ #ifdef __KERNEL__ /* + * This struct describes a file region to be written. + * It's kind of a pity we have to keep all these lists ourselves, rather + * than sticking an extra pointer into struct page. + */ +struct nfs_wreq { + struct rpc_listitem wb_list; /* linked list of req's */ + struct rpc_task wb_task; /* RPC task */ + struct dentry * wb_dentry; /* dentry referenced */ + struct inode * wb_inode; /* inode referenced */ + struct page * wb_page; /* page to be written */ + unsigned int wb_offset; /* offset within page */ + unsigned int wb_bytes; /* dirty range */ + pid_t wb_pid; /* owner process */ + unsigned short wb_flags; /* status flags */ + + struct nfs_writeargs wb_args; /* NFS RPC stuff */ + struct nfs_fattr wb_fattr; /* file attributes */ +}; +#define wb_status wb_task.tk_status + +#define WB_NEXT(req) ((struct nfs_wreq *) ((req)->wb_list.next)) + +/* + * Various flags for wb_flags + */ +#define NFS_WRITE_WANTLOCK 0x0001 /* needs to lock page */ +#define NFS_WRITE_LOCKED 0x0002 /* holds lock on page */ +#define NFS_WRITE_CANCELLED 0x0004 /* has been cancelled */ +#define NFS_WRITE_UNCOMMITTED 0x0008 /* written but uncommitted (NFSv3) */ +#define NFS_WRITE_INVALIDATE 0x0010 /* invalidate after write */ +#define NFS_WRITE_INPROGRESS 0x0100 /* RPC call in progress */ +#define NFS_WRITE_COMPLETE 0x0200 /* RPC call completed */ + +#define WB_WANTLOCK(req) ((req)->wb_flags & NFS_WRITE_WANTLOCK) +#define WB_HAVELOCK(req) ((req)->wb_flags & NFS_WRITE_LOCKED) +#define WB_CANCELLED(req) ((req)->wb_flags & NFS_WRITE_CANCELLED) +#define WB_UNCOMMITTED(req) ((req)->wb_flags & NFS_WRITE_UNCOMMITTED) +#define WB_INVALIDATE(req) ((req)->wb_flags & NFS_WRITE_INVALIDATE) +#define WB_INPROGRESS(req) ((req)->wb_flags & NFS_WRITE_INPROGRESS) +#define WB_COMPLETE(req) ((req)->wb_flags & NFS_WRITE_COMPLETE) + +/* * linux/fs/nfs/proc.c */ extern int nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, @@ -135,11 +177,11 @@ extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle, */ extern struct super_block *nfs_read_super(struct super_block *, void *, int); extern int init_nfs_fs(void); -extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, - struct nfs_fattr *); +extern struct inode *nfs_fhget(struct dentry *, struct nfs_fh *, + struct nfs_fattr *); extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); -extern int nfs_revalidate(struct inode *); -extern int _nfs_revalidate_inode(struct nfs_server *, struct inode *); +extern int nfs_revalidate(struct dentry *); +extern int _nfs_revalidate_inode(struct nfs_server *, struct dentry *); /* * linux/fs/nfs/file.c @@ -150,6 +192,7 @@ extern struct inode_operations nfs_file_inode_operations; * linux/fs/nfs/dir.c */ 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 *); @@ -162,25 +205,25 @@ extern struct inode_operations nfs_symlink_inode_operations; /* * linux/fs/nfs/locks.c */ -extern int nfs_lock(struct file *file, int cmd, struct file_lock *fl); +extern int nfs_lock(struct file *, int, struct file_lock *); /* * linux/fs/nfs/write.c */ -extern int nfs_writepage(struct inode *, struct page *); +extern int nfs_writepage(struct file *, struct page *); +extern int nfs_find_dentry_request(struct inode *, struct dentry *); extern int nfs_check_failed_request(struct inode *); extern int nfs_check_error(struct inode *); extern int nfs_flush_dirty_pages(struct inode *, pid_t, off_t, off_t); extern int nfs_truncate_dirty_pages(struct inode *, unsigned long); extern void nfs_invalidate_pages(struct inode *); -extern int nfs_updatepage(struct inode *, struct page *, const char *, +extern int nfs_updatepage(struct file *, struct page *, const char *, unsigned long, unsigned int, int); /* * linux/fs/nfs/read.c */ -extern int nfs_readpage(struct inode *, struct page *); -extern int nfs_readpage_sync(struct inode *, struct page *); +extern int nfs_readpage(struct file *, struct page *); /* * linux/fs/mount_clnt.c @@ -192,11 +235,12 @@ extern int nfs_mount(struct sockaddr_in *, char *, struct nfs_fh *); * inline functions */ static inline int -nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) +nfs_revalidate_inode(struct nfs_server *server, struct dentry *dentry) { + struct inode *inode = dentry->d_inode; if (jiffies - NFS_READTIME(inode) < NFS_ATTRTIMEO(inode)) return 0; - return _nfs_revalidate_inode(server, inode); + return _nfs_revalidate_inode(server, dentry); } extern struct nfs_wreq * nfs_failed_requests; @@ -210,14 +254,7 @@ nfs_write_error(struct inode *inode) /* NFS root */ -#define NFS_ROOT "/tftpboot/%s" -#define NFS_ROOT_NAME_LEN 256 -#define NFS_ROOT_ADDRS_LEN 128 - extern int nfs_root_mount(struct super_block *sb); -extern int nfs_root_init(char *nfsname, char *nfsaddrs); -extern char nfs_root_name[]; -extern char nfs_root_addrs[]; #endif /* __KERNEL__ */ diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index b0163ec22..885f21f01 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h @@ -16,11 +16,6 @@ struct nfs_inode_info { struct pipe_inode_info pipeinfo; /* - * The file handle - */ - struct nfs_fh fhandle; - - /* * Various flags */ unsigned short flags; @@ -58,6 +53,7 @@ struct nfs_inode_info { * Legal inode flag values */ #define NFS_INO_REVALIDATE 0x0001 /* revalidating attrs */ +#define NFS_IS_SNAPSHOT 0x0010 /* a snapshot file */ /* * NFS lock info diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index c1bedfbdf..343455ec9 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -5,8 +5,7 @@ #include <linux/in.h> /* - * NFS client parameters - * Part of this is duplicated in rpc_clnt and is therefore obsolete. + * NFS client parameters stored in the superblock. */ struct nfs_server { struct rpc_clnt * client; /* RPC client handle */ @@ -18,7 +17,7 @@ struct nfs_server { unsigned int acregmax; unsigned int acdirmin; unsigned int acdirmax; - char hostname[256]; /* remote hostname */ + char * hostname; /* remote hostname */ }; /* diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 4869c7ef8..d7f0851fe 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h @@ -111,6 +111,9 @@ int nfsd_statfs(struct svc_rqst *, struct svc_fh *, int nfsd_notify_change(struct inode *, struct iattr *); int nfsd_permission(struct svc_export *, struct dentry *, int); +/* nfsd/nfsctl.c */ +void nfsd_modcount(struct inode *, int); + /* * lockd binding */ diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index f0577b05d..3e3410776 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h @@ -70,6 +70,8 @@ typedef struct svc_fh { * Shorthand for dprintk()'s */ #define SVCFH_DENTRY(f) ((f)->fh_dentry) +#define SVCFH_INO(f) ((f)->fh_handle.fh_ino) +#define SVCFH_DEV(f) ((f)->fh_handle.fh_dev) /* * Function prototypes @@ -114,12 +116,16 @@ fh_lock(struct svc_fh *fhp) dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n", SVCFH_DEV(fhp), SVCFH_INO(fhp), fhp->fh_locked); */ - if (!fhp->fh_locked) { - down(&inode->i_sem); - if (!fhp->fh_pre_mtime) - fhp->fh_pre_mtime = inode->i_mtime; - fhp->fh_locked = 1; + if (fhp->fh_locked) { + printk(KERN_WARNING "fh_lock: %s/%s already locked!\n", + fhp->fh_dentry->d_parent->d_name.name, + fhp->fh_dentry->d_name.name); + return; } + down(&inode->i_sem); + if (!fhp->fh_pre_mtime) + fhp->fh_pre_mtime = inode->i_mtime; + fhp->fh_locked = 1; } /* @@ -128,9 +134,8 @@ fh_lock(struct svc_fh *fhp) static inline void fh_unlock(struct svc_fh *fhp) { - struct inode *inode = fhp->fh_dentry->d_inode; - if (fhp->fh_locked) { + struct inode *inode = fhp->fh_dentry->d_inode; if (!fhp->fh_post_version) fhp->fh_post_version = inode->i_version; fhp->fh_locked = 0; diff --git a/include/linux/nls.h b/include/linux/nls.h index 73f83633d..3321e2958 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h @@ -52,3 +52,4 @@ extern int init_nls_cp865(void); extern int init_nls_cp866(void); extern int init_nls_cp869(void); extern int init_nls_cp874(void); +extern int init_nls_koi8_r(void); diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 86db4508f..a9842306e 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h @@ -97,6 +97,7 @@ extern __inline__ int notifier_call_chain(struct notifier_block **n, unsigned lo #define NETDEV_UNREGISTER 0x0006 #define NETDEV_CHANGEMTU 0x0007 #define NETDEV_CHANGEADDR 0x0008 +#define NETDEV_GOING_DOWN 0x0009 #define SYS_DOWN 0x0001 /* Notify of system down */ #define SYS_RESTART SYS_DOWN diff --git a/include/linux/ntfs_fs.h b/include/linux/ntfs_fs.h new file mode 100644 index 000000000..acbfc2939 --- /dev/null +++ b/include/linux/ntfs_fs.h @@ -0,0 +1,7 @@ +#ifndef _LINUX_NTFS_FS_H +#define _LINUX_NTFS_FS_H + +int init_ntfs_fs(void); + +#endif + diff --git a/include/linux/ntfs_fs_i.h b/include/linux/ntfs_fs_i.h new file mode 100644 index 000000000..dbb0289fd --- /dev/null +++ b/include/linux/ntfs_fs_i.h @@ -0,0 +1,79 @@ +#ifndef _LINUX_NTFS_FS_I_H +#define _LINUX_NTFS_FS_I_H + +/* Forward declarations, to keep number of mutual includes low */ +struct ntfs_attribute; +struct ntfs_sb_info; + +/* Duplicate definitions from ntfs/types.h */ +#ifndef NTFS_INTEGRAL_TYPES +#define NTFS_INTEGRAL_TYPES +typedef unsigned char ntfs_u8; +typedef unsigned short ntfs_u16; +typedef unsigned int ntfs_u32; +typedef unsigned long long ntfs_u64; +#endif + +#ifndef NTMODE_T +#define NTMODE_T +typedef __kernel_mode_t ntmode_t; +#endif +#ifndef NTFS_UID_T +#define NTFS_UID_T +typedef __kernel_uid_t ntfs_uid_t; +#endif +#ifndef NTFS_GID_T +#define NTFS_GID_T +typedef __kernel_gid_t ntfs_gid_t; +#endif +#ifndef NTFS_SIZE_T +#define NTFS_SIZE_T +typedef __kernel_size_t ntfs_size_t; +#endif +#ifndef NTFS_TIME_T +#define NTFS_TIME_T +typedef __kernel_time_t ntfs_time_t; +#endif + +/* unicode character type */ +#ifndef NTFS_WCHAR_T +#define NTFS_WCHAR_T +typedef unsigned short ntfs_wchar_t; +#endif +/* file offset */ +#ifndef NTFS_OFFSET_T +#define NTFS_OFFSET_T +typedef unsigned long long ntfs_offset_t; +#endif +/* UTC */ +#ifndef NTFS_TIME64_T +#define NTFS_TIME64_T +typedef unsigned long long ntfs_time64_t; +#endif +/* This is really unsigned long long. So we support only volumes up to 2 TB */ +#ifndef NTFS_CLUSTER_T +#define NTFS_CLUSTER_T +typedef unsigned int ntfs_cluster_t; +#endif + +/* Definition of NTFS in-memory inode structure */ +struct ntfs_inode_info{ + struct ntfs_sb_info *vol; + int i_number; /* should be really 48 bits */ + unsigned sequence_number; + unsigned char* attr; /* array of the attributes */ + int attr_count; /* size of attrs[] */ + struct ntfs_attribute *attrs; + int record_count; /* size of records[] */ + /* array of the record numbers of the MFT + whose attributes have been inserted in the inode */ + int *records; + union{ + struct{ + int recordsize; + int clusters_per_record; + }index; + } u; +}; + +#endif diff --git a/include/linux/ntfs_fs_sb.h b/include/linux/ntfs_fs_sb.h new file mode 100644 index 000000000..898ef7105 --- /dev/null +++ b/include/linux/ntfs_fs_sb.h @@ -0,0 +1,44 @@ +#ifndef _LINUX_NTFS_FS_SB_H +#define _LINUX_NTFS_FS_SB_H + +struct ntfs_sb_info{ + /* Configuration provided by user at mount time */ + ntfs_uid_t uid; + ntfs_gid_t gid; + ntmode_t umask; + unsigned int nct; + void *nls_map; + unsigned int ngt; + /* Configuration provided by user with ntfstools */ + ntfs_size_t partition_bias; /* for access to underlying device */ + /* Attribute definitions */ + ntfs_u32 at_standard_information; + ntfs_u32 at_attribute_list; + ntfs_u32 at_file_name; + ntfs_u32 at_security_descriptor; + ntfs_u32 at_data; + ntfs_u32 at_index_root; + ntfs_u32 at_index_allocation; + ntfs_u32 at_bitmap; + ntfs_u32 at_symlink; /* aka SYMBOLIC_LINK or REPARSE_POINT */ + /* Data read from the boot file */ + int blocksize; + int clusterfactor; + int clustersize; + int mft_recordsize; + int mft_clusters_per_record; + int index_recordsize; + int index_clusters_per_record; + int mft_cluster; + /* data read from special files */ + unsigned char *mft; + unsigned short *upcase; + unsigned int upcase_length; + /* inodes we always hold onto */ + struct ntfs_inode_info *mft_ino; + struct ntfs_inode_info *mftmirr; + struct ntfs_inode_info *bitmap; + struct super_block *sb; +}; + +#endif diff --git a/include/linux/parport.h b/include/linux/parport.h index 6a2bbd183..35b7fbb5a 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -1,22 +1,74 @@ -/* $Id: parport.h,v 1.3 1997/10/19 18:02:00 phil Exp $ */ +/* $Id: parport.h,v 1.6 1997/12/29 12:31:05 phil Exp $ */ #ifndef _PARPORT_H_ #define _PARPORT_H_ -#include <asm/system.h> -#include <asm/ptrace.h> -#include <linux/proc_fs.h> +/* Start off with user-visible constants */ /* Maximum of 8 ports per machine */ #define PARPORT_MAX 8 /* Magic numbers */ -#define PARPORT_IRQ_NONE -2 -#define PARPORT_DMA_NONE -2 -#define PARPORT_IRQ_AUTO -1 -#define PARPORT_DMA_AUTO -1 +#define PARPORT_IRQ_NONE -1 +#define PARPORT_DMA_NONE -1 +#define PARPORT_IRQ_AUTO -2 +#define PARPORT_DMA_AUTO -2 #define PARPORT_DISABLE -2 +#define PARPORT_CONTROL_STROBE 0x1 +#define PARPORT_CONTROL_AUTOFD 0x2 +#define PARPORT_CONTROL_INIT 0x4 +#define PARPORT_CONTROL_SELECT 0x8 +#define PARPORT_CONTROL_INTEN 0x10 +#define PARPORT_CONTROL_DIRECTION 0x20 + +#define PARPORT_STATUS_ERROR 0x8 +#define PARPORT_STATUS_SELECT 0x10 +#define PARPORT_STATUS_PAPEROUT 0x20 +#define PARPORT_STATUS_ACK 0x40 +#define PARPORT_STATUS_BUSY 0x80 + +/* Type classes for Plug-and-Play probe. */ +typedef enum { + PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ + PARPORT_CLASS_PRINTER, + PARPORT_CLASS_MODEM, + PARPORT_CLASS_NET, + PARPORT_CLASS_HDC, /* Hard disk controller */ + PARPORT_CLASS_PCMCIA, + PARPORT_CLASS_MEDIA, /* Multimedia device */ + PARPORT_CLASS_FDC, /* Floppy disk controller */ + PARPORT_CLASS_PORTS, + PARPORT_CLASS_SCANNER, + PARPORT_CLASS_DIGCAM, + PARPORT_CLASS_OTHER, /* Anything else */ + PARPORT_CLASS_UNSPEC /* No CLS field in ID */ +} parport_device_class; + +/* The "modes" entry in parport is a bit field representing the following + * modes. + * Note that PARPORT_MODE_PCECPEPP is for the SMC EPP+ECP mode which is NOT + * 100% compatible with EPP. + */ +#define PARPORT_MODE_PCSPP 0x0001 +#define PARPORT_MODE_PCPS2 0x0002 +#define PARPORT_MODE_PCEPP 0x0004 +#define PARPORT_MODE_PCECP 0x0008 +#define PARPORT_MODE_PCECPEPP 0x0010 +#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */ +#define PARPORT_MODE_PCECPPS2 0x0040 + +/* The rest is for the kernel only */ +#ifdef __KERNEL__ + +#include <asm/system.h> +#include <asm/ptrace.h> +#include <asm/spinlock.h> +#include <linux/proc_fs.h> +#include <linux/config.h> + +#define PARPORT_NEED_GENERIC_OPS + /* Define this later. */ struct parport; @@ -29,51 +81,35 @@ struct parport_state { union { struct pc_parport_state pc; /* ARC has no state. */ + /* AX uses same state information as PC */ void *misc; } u; }; -/* Generic operations vector through the dispatch table. */ -#define parport_write_data(p,x) (p)->ops->write_data(p,x) -#define parport_read_data(p) (p)->ops->read_data(p) -#define parport_write_control(p,x) (p)->ops->write_control(p,x) -#define parport_read_control(p) (p)->ops->read_control(p) -#define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v) -#define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x) -#define parport_read_econtrol(p) (p)->ops->read_econtrol(p) -#define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v) -#define parport_write_status(p,v) (p)->ops->write_status(p,v) -#define parport_read_status(p) (p)->ops->read_status(p) -#define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v) -#define parport_read_fifo(p) (p)->ops->read_fifo(p) -#define parport_change_mode(p,m) (p)->ops->change_mode(p,m) -#define parport_release_resources(p) (p)->ops->release_resources(p) -#define parport_claim_resources(p) (p)->ops->claim_resources(p) - struct parport_operations { - void (*write_data)(struct parport *, unsigned int); - unsigned int (*read_data)(struct parport *); - void (*write_control)(struct parport *, unsigned int); - unsigned int (*read_control)(struct parport *); - unsigned int (*frob_control)(struct parport *, unsigned int mask, unsigned int val); - void (*write_econtrol)(struct parport *, unsigned int); - unsigned int (*read_econtrol)(struct parport *); - unsigned int (*frob_econtrol)(struct parport *, unsigned int mask, unsigned int val); - void (*write_status)(struct parport *, unsigned int); - unsigned int (*read_status)(struct parport *); - void (*write_fifo)(struct parport *, unsigned int); - unsigned int (*read_fifo)(struct parport *); + void (*write_data)(struct parport *, unsigned char); + unsigned char (*read_data)(struct parport *); + void (*write_control)(struct parport *, unsigned char); + unsigned char (*read_control)(struct parport *); + unsigned char (*frob_control)(struct parport *, unsigned char mask, unsigned char val); + void (*write_econtrol)(struct parport *, unsigned char); + unsigned char (*read_econtrol)(struct parport *); + unsigned char (*frob_econtrol)(struct parport *, unsigned char mask, unsigned char val); + void (*write_status)(struct parport *, unsigned char); + unsigned char (*read_status)(struct parport *); + void (*write_fifo)(struct parport *, unsigned char); + unsigned char (*read_fifo)(struct parport *); void (*change_mode)(struct parport *, int); void (*release_resources)(struct parport *); int (*claim_resources)(struct parport *); - unsigned int (*epp_write_block)(struct parport *, void *, unsigned int); - unsigned int (*epp_read_block)(struct parport *, void *, unsigned int); + size_t (*epp_write_block)(struct parport *, void *, size_t); + size_t (*epp_read_block)(struct parport *, void *, size_t); - unsigned int (*ecp_write_block)(struct parport *, void *, unsigned int, void (*fn)(struct parport *, void *, unsigned int), void *); - unsigned int (*ecp_read_block)(struct parport *, void *, unsigned int, void (*fn)(struct parport *, void *, unsigned int), void *); + int (*ecp_write_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); + int (*ecp_read_block)(struct parport *, void *, size_t, void (*fn)(struct parport *, void *, size_t), void *); void (*save_state)(struct parport *, struct parport_state *); void (*restore_state)(struct parport *, struct parport_state *); @@ -86,36 +122,6 @@ struct parport_operations { void (*dec_use_count)(void); }; -#define PARPORT_CONTROL_STROBE 0x1 -#define PARPORT_CONTROL_AUTOFD 0x2 -#define PARPORT_CONTROL_INIT 0x4 -#define PARPORT_CONTROL_SELECT 0x8 -#define PARPORT_CONTROL_INTEN 0x10 -#define PARPORT_CONTROL_DIRECTION 0x20 - -#define PARPORT_STATUS_ERROR 0x8 -#define PARPORT_STATUS_SELECT 0x10 -#define PARPORT_STATUS_PAPEROUT 0x20 -#define PARPORT_STATUS_ACK 0x40 -#define PARPORT_STATUS_BUSY 0x80 - -/* Type classes for Plug-and-Play probe. */ -typedef enum { - PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */ - PARPORT_CLASS_PRINTER, - PARPORT_CLASS_MODEM, - PARPORT_CLASS_NET, - PARPORT_CLASS_HDC, /* Hard disk controller */ - PARPORT_CLASS_PCMCIA, - PARPORT_CLASS_MEDIA, /* Multimedia device */ - PARPORT_CLASS_FDC, /* Floppy disk controller */ - PARPORT_CLASS_PORTS, - PARPORT_CLASS_SCANNER, - PARPORT_CLASS_DIGCAM, - PARPORT_CLASS_OTHER, /* Anything else */ - PARPORT_CLASS_UNSPEC /* No CLS field in ID */ -} parport_device_class; - struct parport_device_info { parport_device_class class; char *mfr; @@ -144,18 +150,26 @@ struct pardevice { void (*wakeup)(void *); void *private; void (*irq_func)(int, void *, struct pt_regs *); - int flags; + unsigned int flags; struct pardevice *next; struct pardevice *prev; struct parport_state *state; /* saved status over preemption */ + struct wait_queue *wait_q; + unsigned long int time; + unsigned long int timeslice; + unsigned int waiting; + struct pardevice *waitprev; + struct pardevice *waitnext; }; +/* Directory information for the /proc interface */ struct parport_dir { struct proc_dir_entry *entry; /* Directory /proc/parport/X */ - struct proc_dir_entry *irq; /* IRQ entry /proc/parport/X/irq */ - struct proc_dir_entry *devices; /* /proc/parport/X/devices */ - struct proc_dir_entry *hardware; /* /proc/parport/X/hardware */ - char name[4]; /* /proc/parport/"XXXX" */ + struct proc_dir_entry *irq; /* .../irq */ + struct proc_dir_entry *devices; /* .../devices */ + struct proc_dir_entry *hardware; /* .../hardware */ + struct proc_dir_entry *probe; /* .../autoprobe */ + char name[4]; }; /* A parallel port */ @@ -169,16 +183,21 @@ struct parport { struct pardevice *devices; struct pardevice *cad; /* port owner */ - struct pardevice *lurker; + + struct pardevice *waithead; + struct pardevice *waittail; struct parport *next; - unsigned int flags; + unsigned int flags; struct parport_dir pdir; struct parport_device_info probe_info; struct parport_operations *ops; void *private_data; /* for lowlevel driver */ + + int number; /* port index - the `n' in `parportn' */ + spinlock_t lock; }; /* parport_register_port registers a new parallel port at the given address (if @@ -190,14 +209,14 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, struct parport_operations *ops); /* Unregister a port. */ -void parport_unregister_port(struct parport *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. */ -void parport_quiesce(struct parport *); +extern void parport_quiesce(struct parport *); /* parport_enumerate returns a pointer to the linked list of all the ports * in this machine. @@ -219,13 +238,17 @@ struct pardevice *parport_register_device(struct parport *port, int flags, void *handle); /* parport_unregister unlinks a device from the chain. */ -void parport_unregister_device(struct pardevice *dev); +extern void parport_unregister_device(struct pardevice *dev); /* parport_claim tries to gain ownership of the port for a particular driver. * This may fail (return non-zero) if another driver is busy. If this * driver has registered an interrupt handler, it will be enabled. */ -int parport_claim(struct pardevice *dev); +extern int parport_claim(struct pardevice *dev); + +/* parport_claim_or_block is the same, but sleeps if the port cannot be + claimed. Return value is 1 if it slept, 0 normally and -errno on error. */ +extern int parport_claim_or_block(struct pardevice *dev); /* parport_release reverses a previous parport_claim. This can never fail, * though the effects are undefined (except that they are bad) if you didn't @@ -235,20 +258,32 @@ int parport_claim(struct pardevice *dev); * If you mess with the port state (enabling ECP for example) you should * clean up before releasing the port. */ -void parport_release(struct pardevice *dev); -/* The "modes" entry in parport is a bit field representing the following - * modes. - * Note that LP_ECPEPP is for the SMC EPP+ECP mode which is NOT - * 100% compatible with EPP. +extern void parport_release(struct pardevice *dev); + +/* parport_yield relinquishes the port if it would be helpful to other + * drivers. The return value is the same as for parport_claim. */ -#define PARPORT_MODE_PCSPP 0x0001 -#define PARPORT_MODE_PCPS2 0x0002 -#define PARPORT_MODE_PCEPP 0x0004 -#define PARPORT_MODE_PCECP 0x0008 -#define PARPORT_MODE_PCECPEPP 0x0010 -#define PARPORT_MODE_PCECR 0x0020 /* ECR Register Exists */ -#define PARPORT_MODE_PCECPPS2 0x0040 +extern __inline__ unsigned int parport_yield(struct pardevice *dev) +{ + unsigned long int timeslip = (jiffies - dev->time); + if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice)) + return 0; + parport_release(dev); + return parport_claim(dev); +} + +/* parport_yield_blocking is the same but uses parport_claim_or_block + * instead of parport_claim. + */ +extern __inline__ unsigned int parport_yield_blocking(struct pardevice *dev) +{ + unsigned long int timeslip = (jiffies - dev->time); + if ((dev->port->waithead == NULL) || (timeslip < dev->timeslice)) + return 0; + parport_release(dev); + return parport_claim_or_block(dev); +} /* Flags used to identify what a device does. */ #define PARPORT_DEV_TRAN 0x0000 /* We're transient. */ @@ -262,7 +297,7 @@ extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned /* Prototypes from parport_procfs */ extern int parport_proc_init(void); -extern int parport_proc_cleanup(void); +extern void parport_proc_cleanup(void); extern int parport_proc_register(struct parport *pp); extern int parport_proc_unregister(struct parport *pp); @@ -273,4 +308,45 @@ extern int parport_probe(struct parport *port, char *buffer, int len); extern void parport_probe_one(struct parport *port); extern void (*parport_probe_hook)(struct parport *port); +/* If PC hardware is the only type supported, we can optimise a bit. */ +#if (defined(CONFIG_PARPORT_PC) || defined(CONFIG_PARPORT_PC_MODULE)) && !(defined(CONFIG_PARPORT_AX) || defined(CONFIG_PARPORT_AX_MODULE)) && !(defined(CONFIG_PARPORT_ARC) || defined(CONFIG_PARPORT_ARC_MODULE)) && !defined(CONFIG_PARPORT_OTHER) +#undef PARPORT_NEED_GENERIC_OPS +#include <linux/parport_pc.h> +#define parport_write_data(p,x) parport_pc_write_data(p,x) +#define parport_read_data(p) parport_pc_read_data(p) +#define parport_write_control(p,x) parport_pc_write_control(p,x) +#define parport_read_control(p) parport_pc_read_control(p) +#define parport_frob_control(p,m,v) parport_pc_frob_control(p,m,v) +#define parport_write_econtrol(p,x) parport_pc_write_econtrol(p,x) +#define parport_read_econtrol(p) parport_pc_read_econtrol(p) +#define parport_frob_econtrol(p,m,v) parport_pc_frob_econtrol(p,m,v) +#define parport_write_status(p,v) parport_pc_write_status(p,v) +#define parport_read_status(p) parport_pc_read_status(p) +#define parport_write_fifo(p,v) parport_pc_write_fifo(p,v) +#define parport_read_fifo(p) parport_pc_read_fifo(p) +#define parport_change_mode(p,m) parport_pc_change_mode(p,m) +#define parport_release_resources(p) parport_pc_release_resources(p) +#define parport_claim_resources(p) parport_pc_claim_resources(p) +#endif + +#ifdef PARPORT_NEED_GENERIC_OPS +/* Generic operations vector through the dispatch table. */ +#define parport_write_data(p,x) (p)->ops->write_data(p,x) +#define parport_read_data(p) (p)->ops->read_data(p) +#define parport_write_control(p,x) (p)->ops->write_control(p,x) +#define parport_read_control(p) (p)->ops->read_control(p) +#define parport_frob_control(p,m,v) (p)->ops->frob_control(p,m,v) +#define parport_write_econtrol(p,x) (p)->ops->write_econtrol(p,x) +#define parport_read_econtrol(p) (p)->ops->read_econtrol(p) +#define parport_frob_econtrol(p,m,v) (p)->ops->frob_econtrol(p,m,v) +#define parport_write_status(p,v) (p)->ops->write_status(p,v) +#define parport_read_status(p) (p)->ops->read_status(p) +#define parport_write_fifo(p,v) (p)->ops->write_fifo(p,v) +#define parport_read_fifo(p) (p)->ops->read_fifo(p) +#define parport_change_mode(p,m) (p)->ops->change_mode(p,m) +#define parport_release_resources(p) (p)->ops->release_resources(p) +#define parport_claim_resources(p) (p)->ops->claim_resources(p) +#endif + +#endif /* __KERNEL__ */ #endif /* _PARPORT_H_ */ diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h new file mode 100644 index 000000000..45f4c0fb8 --- /dev/null +++ b/include/linux/parport_pc.h @@ -0,0 +1,117 @@ +#ifndef __LINUX_PARPORT_PC_H +#define __LINUX_PARPORT_PC_H + +#include <asm/io.h> + +/* --- register definitions ------------------------------- */ + +#define ECONTROL 0x402 +#define CONFIGB 0x401 +#define CONFIGA 0x400 +#define EPPREG 0x4 +#define CONTROL 0x2 +#define STATUS 0x1 +#define DATA 0 + +extern __inline__ void parport_pc_write_epp(struct parport *p, unsigned char d) +{ + outb(d, p->base+EPPREG); +} + +extern __inline__ unsigned char parport_pc_read_epp(struct parport *p) +{ + return inb(p->base+EPPREG); +} + +extern __inline__ unsigned char parport_pc_read_configb(struct parport *p) +{ + return inb(p->base+CONFIGB); +} + +extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) +{ + outb(d, p->base+DATA); +} + +extern __inline__ unsigned char parport_pc_read_data(struct parport *p) +{ + return inb(p->base+DATA); +} + +extern __inline__ void parport_pc_write_control(struct parport *p, unsigned char d) +{ + outb(d, p->base+CONTROL); +} + +extern __inline__ unsigned char parport_pc_read_control(struct parport *p) +{ + return inb(p->base+CONTROL); +} + +extern __inline__ unsigned char parport_pc_frob_control(struct parport *p, unsigned char mask, unsigned char val) +{ + unsigned char old = inb(p->base+CONTROL); + outb(((old & ~mask) ^ val), p->base+CONTROL); + return old; +} + +extern __inline__ void parport_pc_write_status(struct parport *p, unsigned char d) +{ + outb(d, p->base+STATUS); +} + +extern __inline__ unsigned char parport_pc_read_status(struct parport *p) +{ + return inb(p->base+STATUS); +} + +extern __inline__ void parport_pc_write_econtrol(struct parport *p, unsigned char d) +{ + outb(d, p->base+ECONTROL); +} + +extern __inline__ unsigned char parport_pc_read_econtrol(struct parport *p) +{ + return inb(p->base+ECONTROL); +} + +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); + return old; +} + +extern void parport_pc_change_mode(struct parport *p, int m); + +extern void parport_pc_write_fifo(struct parport *p, unsigned char v); + +extern unsigned char parport_pc_read_fifo(struct parport *p); + +extern void parport_pc_disable_irq(struct parport *p); + +extern void parport_pc_enable_irq(struct parport *p); + +extern void parport_pc_release_resources(struct parport *p); + +extern int parport_pc_claim_resources(struct parport *p); + +extern void parport_pc_save_state(struct parport *p, struct parport_state *s); + +extern void parport_pc_restore_state(struct parport *p, struct parport_state *s); + +extern size_t parport_pc_epp_read_block(struct parport *p, void *buf, size_t length); + +extern size_t parport_pc_epp_write_block(struct parport *p, void *buf, size_t length); + +extern int parport_pc_ecp_read_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle); + +extern int parport_pc_ecp_write_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle); + +extern int parport_pc_examine_irq(struct parport *p); + +extern void parport_pc_inc_use_count(void); + +extern void parport_pc_dec_use_count(void); + +#endif diff --git a/include/linux/pci.h b/include/linux/pci.h index d242a9912..138710213 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1,48 +1,27 @@ /* - * PCI defines and function prototypes - * Copyright 1994, Drew Eckhardt + * $Id: pci.h,v 1.51 1997/12/27 13:55:23 mj Exp $ * - * For more information, please consult - * - * PCI BIOS Specification Revision - * PCI Local Bus Specification - * PCI System Design Guide + * PCI defines and function prototypes + * Copyright 1994, Drew Eckhardt + * Copyright 1997, Martin Mares <mj@atrey.karlin.mff.cuni.cz> * - * PCI Special Interest Group - * M/S HF3-15A - * 5200 N.E. Elam Young Parkway - * Hillsboro, Oregon 97124-6497 - * +1 (503) 696-2000 - * +1 (800) 433-5177 + * For more information, please consult * - * Manuals are $25 each or $50 for all three, plus $7 shipping - * within the United States, $35 abroad. - */ - - - -/* PROCEDURE TO REPORT NEW PCI DEVICES - * We are trying to collect information on new PCI devices, using - * the standard PCI identification procedure. If some warning is - * displayed at boot time, please report - * - /proc/pci - * - your exact hardware description. Try to find out - * which device is unknown. It may be your mainboard chipset. - * PCI-CPU bridge or PCI-ISA bridge. - * - If you can't find the actual information in your hardware - * booklet, try to read the references of the chip on the board. - * - Send all that to linux-pcisupport@cck.uni-kl.de - * and I'll add your device to the list as soon as possible + * PCI BIOS Specification Revision + * PCI Local Bus Specification + * PCI System Design Guide * - * BEFORE you send a mail, please check the latest linux releases - * to be sure it has not been recently added. - * - * Thanks - * Jens Maurer + * PCI Special Interest Group + * M/S HF3-15A + * 5200 N.E. Elam Young Parkway + * Hillsboro, Oregon 97124-6497 + * +1 (503) 696-2000 + * +1 (800) 433-5177 + * + * Manuals are $25 each or $50 for all three, plus $7 shipping + * within the United States, $35 abroad. */ - - #ifndef LINUX_PCI_H #define LINUX_PCI_H @@ -102,7 +81,7 @@ */ #define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ #define PCI_BASE_ADDRESS_1 0x14 /* 32 bits */ -#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits */ +#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ #define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ #define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ #define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ @@ -118,6 +97,7 @@ #define PCI_BASE_ADDRESS_IO_MASK (~0x03) /* bit 1 is reserved if address_space = 1 */ +/* Header type 0 (normal devices) */ #define PCI_CARDBUS_CIS 0x28 #define PCI_SUBSYSTEM_ID 0x2c #define PCI_SUBSYSTEM_VENDOR_ID 0x2e @@ -131,6 +111,46 @@ #define PCI_MIN_GNT 0x3e /* 8 bits */ #define PCI_MAX_LAT 0x3f /* 8 bits */ +/* Header type 1 (PCI-to-PCI bridges) */ +#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ +#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ +#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ +#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ +#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ +#define PCI_IO_LIMIT 0x1d +#define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */ +#define PCI_IO_RANGE_TYPE_16 0x00 +#define PCI_IO_RANGE_TYPE_32 0x01 +#define PCI_IO_RANGE_MASK ~0x0f +#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ +#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ +#define PCI_MEMORY_LIMIT 0x22 +#define PCI_MEMORY_RANGE_TYPE_MASK 0x0f +#define PCI_MEMORY_RANGE_MASK ~0x0f +#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ +#define PCI_PREF_MEMORY_LIMIT 0x26 +#define PCI_PREF_RANGE_TYPE_MASK 0x0f +#define PCI_PREF_RANGE_TYPE_32 0x00 +#define PCI_PREF_RANGE_TYPE_64 0x01 +#define PCI_PREF_RANGE_MASK ~0x0f +#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ +#define PCI_PREF_LIMIT_UPPER32 0x2c +#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ +#define PCI_IO_LIMIT_UPPER16 0x32 +/* 0x34-0x3b is reserved */ +#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_BRIDGE_CONTROL 0x3e +#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ +#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ +#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ +#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ +#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ +#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ +#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ + +/* Device classes and subclasses */ + #define PCI_CLASS_NOT_DEFINED 0x0000 #define PCI_CLASS_NOT_DEFINED_VGA 0x0001 @@ -175,7 +195,6 @@ #define PCI_CLASS_BRIDGE_CARDBUS 0x0607 #define PCI_CLASS_BRIDGE_OTHER 0x0680 - #define PCI_BASE_CLASS_COMMUNICATION 0x07 #define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 #define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 @@ -241,13 +260,14 @@ #define PCI_DEVICE_ID_NCR_53C895 0x000c #define PCI_DEVICE_ID_NCR_53C885 0x000d #define PCI_DEVICE_ID_NCR_53C875 0x000f -#define PCI_DEVICE_ID_NCR_53C876 0x008f +#define PCI_DEVICE_ID_NCR_53C875J 0x008f #define PCI_VENDOR_ID_ATI 0x1002 #define PCI_DEVICE_ID_ATI_68800 0x4158 #define PCI_DEVICE_ID_ATI_215CT222 0x4354 #define PCI_DEVICE_ID_ATI_210888CX 0x4358 #define PCI_DEVICE_ID_ATI_215GB 0x4742 +#define PCI_DEVICE_ID_ATI_215GD 0x4744 #define PCI_DEVICE_ID_ATI_215GP 0x4750 #define PCI_DEVICE_ID_ATI_215GT 0x4754 #define PCI_DEVICE_ID_ATI_215GTB 0x4755 @@ -261,6 +281,10 @@ #define PCI_DEVICE_ID_VLSI_82C597 0x0009 #define PCI_DEVICE_ID_VLSI_82C541 0x000c #define PCI_DEVICE_ID_VLSI_82C543 0x000d +#define PCI_DEVICE_ID_VLSI_82C532 0x0101 +#define PCI_DEVICE_ID_VLSI_82C534 0x0102 +#define PCI_DEVICE_ID_VLSI_82C535 0x0104 +#define PCI_DEVICE_ID_VLSI_82C147 0x0105 #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 #define PCI_VENDOR_ID_ADL 0x1005 @@ -291,6 +315,7 @@ #define PCI_DEVICE_ID_DEC_TULIP_PLUS 0x0014 #define PCI_DEVICE_ID_DEC_21142 0x0019 #define PCI_DEVICE_ID_DEC_21052 0x0021 +#define PCI_DEVICE_ID_DEC_21150 0x0022 #define PCI_DEVICE_ID_DEC_21152 0x0024 #define PCI_VENDOR_ID_CIRRUS 0x1013 @@ -313,7 +338,10 @@ #define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a #define PCI_DEVICE_ID_IBM_TR 0x0018 #define PCI_DEVICE_ID_IBM_82G2675 0x001d +#define PCI_DEVICE_ID_IBM_MCA 0x0020 #define PCI_DEVICE_ID_IBM_82351 0x0022 +#define PCI_DEVICE_ID_IBM_SERVERAID 0x002e +#define PCI_DEVICE_ID_IBM_MPEG2 0x007d #define PCI_VENDOR_ID_WD 0x101c #define PCI_DEVICE_ID_WD_7197 0x3296 @@ -323,6 +351,7 @@ #define PCI_DEVICE_ID_AMD_SCSI 0x2020 #define PCI_VENDOR_ID_TRIDENT 0x1023 +#define PCI_DEVICE_ID_TRIDENT_9397 0x9397 #define PCI_DEVICE_ID_TRIDENT_9420 0x9420 #define PCI_DEVICE_ID_TRIDENT_9440 0x9440 #define PCI_DEVICE_ID_TRIDENT_9660 0x9660 @@ -336,6 +365,7 @@ #define PCI_DEVICE_ID_MATROX_MIL 0x0519 #define PCI_DEVICE_ID_MATROX_MYS 0x051A #define PCI_DEVICE_ID_MATROX_MIL_2 0x051b +#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f #define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 #define PCI_VENDOR_ID_CT 0x102c @@ -356,8 +386,8 @@ #define PCI_VENDOR_ID_SI 0x1039 #define PCI_DEVICE_ID_SI_6201 0x0001 #define PCI_DEVICE_ID_SI_6202 0x0002 -#define PCI_DEVICE_ID_SI_6205 0x0205 #define PCI_DEVICE_ID_SI_503 0x0008 +#define PCI_DEVICE_ID_SI_6205 0x0205 #define PCI_DEVICE_ID_SI_501 0x0406 #define PCI_DEVICE_ID_SI_496 0x0496 #define PCI_DEVICE_ID_SI_601 0x0601 @@ -372,12 +402,12 @@ #define PCI_DEVICE_ID_HP_J2585A 0x1030 #define PCI_DEVICE_ID_HP_J2585B 0x1031 -#define PCI_VENDOR_ID_HOLTEK 0x9412 -#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 - #define PCI_VENDOR_ID_PCTECH 0x1042 #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 #define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010 +#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 #define PCI_VENDOR_ID_DPT 0x1044 #define PCI_DEVICE_ID_DPT 0xa400 @@ -391,6 +421,7 @@ #define PCI_DEVICE_ID_OPTI_82C701 0xc701 #define PCI_DEVICE_ID_OPTI_82C814 0xc814 #define PCI_DEVICE_ID_OPTI_82C822 0xc822 +#define PCI_DEVICE_ID_OPTI_82C825 0xd568 #define PCI_VENDOR_ID_SGS 0x104a #define PCI_DEVICE_ID_SGS_2000 0x0008 @@ -406,6 +437,7 @@ #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 #define PCI_DEVICE_ID_TI_PCI1130 0xac12 #define PCI_DEVICE_ID_TI_PCI1131 0xac15 +#define PCI_DEVICE_ID_TI_PCI1250 0xac16 #define PCI_VENDOR_ID_OAK 0x104e #define PCI_DEVICE_ID_OAK_OTI107 0x0107 @@ -456,11 +488,22 @@ #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 #define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022 +#define PCI_VENDOR_ID_CYRIX 0x1078 +#define PCI_DEVICE_ID_CYRIX_5510 0x0000 +#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001 +#define PCI_DEVICE_ID_CYRIX_5520 0x0002 +#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100 +#define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101 +#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102 +#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 +#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 + #define PCI_VENDOR_ID_LEADTEK 0x107d #define PCI_DEVICE_ID_LEADTEK_805 0x0000 #define PCI_VENDOR_ID_CONTAQ 0x1080 #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 +/* ??? Alpha SX164 has reference to device nr 0xc693 as a CYPRESS bridge. */ #define PCI_VENDOR_ID_FOREX 0x1083 @@ -489,6 +532,8 @@ #define PCI_VENDOR_ID_BROOKTREE 0x109e #define PCI_DEVICE_ID_BROOKTREE_848 0x0350 +#define PCI_DEVICE_ID_BROOKTREE_849A 0x0351 +#define PCI_DEVICE_ID_BROOKTREE_8474 0x8474 #define PCI_VENDOR_ID_SIERRA 0x10a8 #define PCI_DEVICE_ID_SIERRA_STB 0x0000 @@ -504,6 +549,9 @@ #define PCI_VENDOR_ID_DATABOOK 0x10b3 #define PCI_DEVICE_ID_DATABOOK_87144 0xb106 +#define PCI_VENDOR_ID_PLX 0x10b5 +#define PCI_DEVICE_ID_PLX_9080 0x9080 + #define PCI_VENDOR_ID_3COM 0x10b7 #define PCI_DEVICE_ID_3COM_3C590 0x5900 #define PCI_DEVICE_ID_3COM_3C595TX 0x5950 @@ -528,9 +576,11 @@ #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_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_VENDOR_ID_MITSUBISHI 0x10ba @@ -546,6 +596,7 @@ #define PCI_VENDOR_ID_ASP 0x10cd #define PCI_DEVICE_ID_ASP_ABP940 0x1200 #define PCI_DEVICE_ID_ASP_ABP940U 0x1300 +#define PCI_DEVICE_ID_ASP_ABP940UW 0x2300 #define PCI_VENDOR_ID_CERN 0x10dc #define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001 @@ -565,6 +616,7 @@ #define PCI_VENDOR_ID_AMCC 0x10e8 #define PCI_DEVICE_ID_AMCC_MYRINET 0x8043 #define PCI_DEVICE_ID_AMCC_S5933 0x807d +#define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c #define PCI_VENDOR_ID_INTERG 0x10ea #define PCI_DEVICE_ID_INTERG_1680 0x1680 @@ -579,6 +631,7 @@ #define PCI_VENDOR_ID_INIT 0x1101 #define PCI_DEVICE_ID_INIT_320P 0x9100 +#define PCI_DEVICE_ID_INIT_360P 0x9500 #define PCI_VENDOR_ID_VIA 0x1106 #define PCI_DEVICE_ID_VIA_82C505 0x0505 @@ -588,11 +641,13 @@ #define PCI_DEVICE_ID_VIA_82C585 0x0585 #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 #define PCI_DEVICE_ID_VIA_82C595 0x0595 +#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 #define PCI_DEVICE_ID_VIA_82C926 0x0926 #define PCI_DEVICE_ID_VIA_82C416 0x1571 #define PCI_DEVICE_ID_VIA_82C595_97 0x1595 #define PCI_DEVICE_ID_VIA_82C586_2 0x3038 #define PCI_DEVICE_ID_VIA_82C586_3 0x3040 +#define PCI_DEVICE_ID_VIA_82C597_1 0x8597 #define PCI_VENDOR_ID_VORTEX 0x1119 #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 @@ -642,8 +697,8 @@ #define PCI_VENDOR_ID_PHILIPS 0x1131 #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 -#define PCI_VENDOR_ID_PLX 0x113c -#define PCI_DEVICE_ID_PLX_9060 0x0001 +#define PCI_VENDOR_ID_CYCLONE 0x113c +#define PCI_DEVICE_ID_CYCLONE_SDK 0x0001 #define PCI_VENDOR_ID_ALLIANCE 0x1142 #define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210 @@ -655,20 +710,32 @@ #define PCI_DEVICE_ID_VMIC_VME 0x7587 #define PCI_VENDOR_ID_DIGI 0x114f +#define PCI_DEVICE_ID_DIGI_EPC 0x0002 #define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003 +#define PCI_DEVICE_ID_DIGI_XEM 0x0004 +#define PCI_DEVICE_ID_DIGI_XR 0x0005 +#define PCI_DEVICE_ID_DIGI_CX 0x0006 +#define PCI_DEVICE_ID_DIGI_XRJ 0x0009 +#define PCI_DEVICE_ID_DIGI_EPCJ 0x000a #define PCI_VENDOR_ID_MUTECH 0x1159 #define PCI_DEVICE_ID_MUTECH_MV1000 0x0001 #define PCI_VENDOR_ID_RENDITION 0x1163 #define PCI_DEVICE_ID_RENDITION_VERITE 0x0001 +#define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000 #define PCI_VENDOR_ID_TOSHIBA 0x1179 #define PCI_DEVICE_ID_TOSHIBA_601 0x0601 +#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a +#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f #define PCI_VENDOR_ID_RICOH 0x1180 #define PCI_DEVICE_ID_RICOH_RL5C466 0x0466 +#define PCI_VENDOR_ID_ARTOP 0x1191 +#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 + #define PCI_VENDOR_ID_ZEITNET 0x1193 #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 #define PCI_DEVICE_ID_ZEITNET_1225 0x0002 @@ -685,6 +752,9 @@ #define PCI_VENDOR_ID_NP 0x11bc #define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001 +#define PCI_VENDOR_ID_ATT 0x11c1 +#define PCI_DEVICE_ID_ATT_L56XMF 0x0440 + #define PCI_VENDOR_ID_SPECIALIX 0x11cb #define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000 #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 @@ -716,12 +786,21 @@ #define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200 #define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201 +#define PCI_VENDOR_ID_O2 0x1217 +#define PCI_DEVICE_ID_O2_6832 0x6832 + #define PCI_VENDOR_ID_3DFX 0x121a #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 +#define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002 #define PCI_VENDOR_ID_SIGMADES 0x1236 #define PCI_DEVICE_ID_SIGMADES_6425 0x6401 +#define PCI_VENDOR_ID_STALLION 0x124d +#define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000 +#define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002 +#define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003 + #define PCI_VENDOR_ID_OPTIBASE 0x1255 #define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110 #define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210 @@ -775,6 +854,10 @@ #define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902 #define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01 #define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10 +#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01 +#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02 +#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03 +#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_82375 0x0482 @@ -833,12 +916,14 @@ #define PCI_VENDOR_ID_ATRONICS 0x907f #define PCI_DEVICE_ID_ATRONICS_2015 0x2015 +#define PCI_VENDOR_ID_HOLTEK 0x9412 +#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 + #define PCI_VENDOR_ID_ARK 0xedd8 #define PCI_DEVICE_ID_ARK_STING 0xa091 #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 -#ifdef __KERNEL__ /* * The PCI interface treats multi-function devices as independent * devices. The slot/function address of each device is encoded @@ -851,6 +936,7 @@ #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) +#ifdef __KERNEL__ /* * There is one pci_dev structure for each slot-number/function-number * combination: @@ -902,32 +988,16 @@ struct pci_bus { unsigned char subordinate; /* max number of subordinate buses */ }; -/* - * This is used to map a vendor-id/device-id pair into device-specific - * information. - */ -struct pci_dev_info { - unsigned short vendor; /* vendor id */ - unsigned short device; /* device id */ - - const char *name; /* device name */ - unsigned char bridge_type; /* bridge type or 0xff */ -}; - extern struct pci_bus pci_root; /* root bus */ extern struct pci_dev *pci_devices; /* list of all devices */ - extern unsigned long pci_init (unsigned long mem_start, unsigned long mem_end); -extern unsigned int pci_scan_bus(struct pci_bus *bus, unsigned long *mem_startp); - -extern struct pci_dev_info *pci_lookup_dev (unsigned int vendor, - unsigned int dev); -extern const char *pci_strclass (unsigned int class); -extern const char *pci_strvendor (unsigned int vendor); -extern const char *pci_strdev (unsigned int vendor, unsigned int device); +extern unsigned int pci_scan_bus (struct pci_bus *bus, unsigned long *mem_startp); extern int get_pci_list (char *buf); + +extern void pci_quirks_init (void); + #endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */ diff --git a/include/linux/personality.h b/include/linux/personality.h index 71599e3ee..67233278a 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -8,12 +8,14 @@ /* Flags for bug emulation. These occupy the top three bytes. */ #define STICKY_TIMEOUTS 0x4000000 #define WHOLE_SECONDS 0x2000000 +#define ADDR_LIMIT_32BIT 0x0800000 /* Personality types. These go in the low byte. Avoid using the top bit, * it will conflict with error returns. */ #define PER_MASK (0x00ff) #define PER_LINUX (0x0000) +#define PER_LINUX_32BIT (0x0000 | ADDR_LIMIT_32BIT) #define PER_SVR4 (0x0001 | STICKY_TIMEOUTS) #define PER_SVR3 (0x0002 | STICKY_TIMEOUTS) #define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS) diff --git a/include/linux/poll.h b/include/linux/poll.h index 01c4d1519..b849b5751 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -1,4 +1,5 @@ #ifndef _LINUX_POLL_H +#define _LINUX_POLL_H #include <asm/poll.h> @@ -10,6 +11,7 @@ struct poll_table_entry { + struct file * filp; struct wait_queue wait; struct wait_queue ** wait_address; }; @@ -21,7 +23,7 @@ typedef struct poll_table_struct { #define __MAX_POLL_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct poll_table_entry)) -extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p) +extern inline void poll_wait(struct file * filp, struct wait_queue ** wait_address, poll_table *p) { struct poll_table_entry * entry; @@ -30,6 +32,8 @@ extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p) if (p->nr >= __MAX_POLL_TABLE_ENTRIES) return; entry = p->entry + p->nr; + entry->filp = filp; + filp->f_count++; entry->wait_address = wait_address; entry->wait.task = current; entry->wait.next = NULL; diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h index 3bb4337d1..2cdc35715 100644 --- a/include/linux/ppp-comp.h +++ b/include/linux/ppp-comp.h @@ -28,7 +28,7 @@ */ /* - * ==FILEVERSION 970501== + * ==FILEVERSION 971024== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. @@ -120,9 +120,8 @@ struct compressor { * Don't you just lurve software patents. */ -#define DECOMP_OK 0 /* no error occured */ -#define DECOMP_ERROR 1 /* error detected before decomp. */ -#define DECOMP_FATALERROR 2 /* error detected after decomp. */ +#define DECOMP_ERROR -1 /* error detected before decomp. */ +#define DECOMP_FATALERROR -2 /* error detected after decomp. */ /* * CCP codes. diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 2d2a7453e..5fd4821e2 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -36,9 +36,6 @@ enum root_directory_inos { PROC_KSYMS, PROC_DMA, PROC_IOPORTS, -#ifdef __SMP_PROF__ - PROC_SMP_PROF, -#endif PROC_PROFILE, /* whether enabled or not */ PROC_CMDLINE, PROC_SYS, @@ -51,8 +48,8 @@ enum root_directory_inos { PROC_HARDWARE, PROC_SLABINFO, PROC_PARPORT, - PROC_OMIRR, /* whether enabled or not */ - PROC_PPC_HTAB + PROC_PPC_HTAB, + PROC_SOUND }; enum pid_directory_inos { @@ -71,6 +68,7 @@ enum pid_directory_inos { #if CONFIG_AP1000 PROC_PID_RINGBUF, #endif + PROC_PID_CPU, }; enum pid_subdirectory_inos { @@ -199,6 +197,12 @@ enum mca_directory_inos { PROC_MCA_LAST = (PROC_MCA_SLOT + 8) }; +enum bus_directory_inos { + PROC_BUS_PCI = PROC_MCA_LAST, + PROC_BUS_PCI_DEVICES, + PROC_BUS_LAST +}; + /* Finally, the dynamically allocatable proc entries are reserved: */ #define PROC_DYNAMIC_FIRST 4096 @@ -244,6 +248,7 @@ struct proc_dir_entry { int count, int *eof, void *data); int (*write_proc)(struct file *file, const char *buffer, unsigned long count, void *data); + int (*readlink_proc)(struct proc_dir_entry *de, char *page); unsigned int count; /* use count */ int deleted; /* delete flag */ }; @@ -264,12 +269,13 @@ extern struct proc_dir_entry proc_openprom; 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 inode_operations proc_scsi_inode_operations; extern void proc_root_init(void); extern void proc_base_init(void); -extern void proc_net_init(void); +extern void proc_bus_pci_init(void); extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *); extern int proc_unregister(struct proc_dir_entry *, int); diff --git a/include/linux/route.h b/include/linux/route.h index 2582f9a89..e670dbac5 100644 --- a/include/linux/route.h +++ b/include/linux/route.h @@ -12,6 +12,9 @@ * * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * + * Changes: + * Mike McLagan : Routing by source + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 01f60fb24..4a309eb91 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -5,6 +5,7 @@ #include <linux/netlink.h> #define RTNL_DEBUG 1 +#define CONFIG_RTNL_OLD_IFINFO 1 /**** @@ -35,48 +36,32 @@ #define RTM_DELRULE (RTM_BASE+17) #define RTM_GETRULE (RTM_BASE+18) -#define RTM_MAX (RTM_BASE+19) +#define RTM_NEWQDISC (RTM_BASE+20) +#define RTM_DELQDSIC (RTM_BASE+21) +#define RTM_GETQDISC (RTM_BASE+22) +#define RTM_NEWTFLOW (RTM_BASE+24) +#define RTM_DELTFLOW (RTM_BASE+25) +#define RTM_GETTFLOW (RTM_BASE+26) -/* Generic structure for encapsulation optional route - information. It is reminiscent of sockaddr, but with sa_family - replaced with attribute type. - It would be good, if constructions of sort: - struct something { - struct rtattr rta; - struct a_content a; - } - had correct alignment. It is true for x86, but I have no idea - how to make it on 64bit architectures. Please, teach me. --ANK +#define RTM_NEWTFILTER (RTM_BASE+28) +#define RTM_DELTFILTER (RTM_BASE+29) +#define RTM_GETTFILTER (RTM_BASE+30) + +#define RTM_MAX (RTM_BASE+31) + +/* + Generic structure for encapsulation optional route information. + It is reminiscent of sockaddr, but with sa_family replaced + with attribute type. */ struct rtattr { unsigned short rta_len; unsigned short rta_type; -/* - unsigned char rta_data[0]; - */ -}; - -enum rtattr_type_t -{ - RTA_UNSPEC, - RTA_DST, - RTA_SRC, - RTA_IIF, - RTA_OIF, - RTA_GATEWAY, - RTA_PRIORITY, - RTA_PREFSRC, - RTA_WINDOW, - RTA_RTT, - RTA_MTU, - RTA_IFNAME }; -#define RTA_MAX RTA_IFNAME - /* Macros to handle rtattributes */ #define RTA_ALIGNTO 4 @@ -88,44 +73,14 @@ enum rtattr_type_t #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) #define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len)) #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) +#define RTA_PAYLOAD(rta) ((rta)->rta_len - RTA_LENGTH(0)) -/* - * "struct rtnexthop" describres all necessary nexthop information, - * i.e. parameters of path to a destination via this nextop. - * - * At the moment it is impossible to set different prefsrc, mtu, window - * and rtt for different paths from multipath. - */ - -struct rtnexthop -{ - unsigned short rtnh_len; - unsigned char rtnh_flags; - unsigned char rtnh_hops; - int rtnh_ifindex; -/* - struct rtattr rtnh_data[0]; - */ -}; - -/* rtnh_flags */ - -#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ -#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ -#define RTNH_F_ONLINK 4 /* Gateway is forced on link */ -/* Macros to handle hexthops */ - -#define RTNH_ALIGNTO 4 -#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) ) -#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ - (rtnh)->rtnh_len <= (len)) -#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) -#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) -#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) -#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) +/****************************************************************************** + * Definitions used in routing table administation. + ****/ struct rtmsg { @@ -133,25 +88,24 @@ struct rtmsg unsigned char rtm_dst_len; unsigned char rtm_src_len; unsigned char rtm_tos; + unsigned char rtm_table; /* Routing table id */ unsigned char rtm_protocol; /* Routing protocol; see below */ +#ifdef CONFIG_RTNL_OLD_IFINFO unsigned char rtm_nhs; /* Number of nexthops */ +#else + unsigned char rtm_scope; /* See below */ +#endif unsigned char rtm_type; /* See below */ + +#ifdef CONFIG_RTNL_OLD_IFINFO unsigned short rtm_optlen; /* Byte length of rtm_opt */ unsigned char rtm_scope; /* See below */ unsigned char rtm_whatsit; /* Unused byte */ +#endif unsigned rtm_flags; -/* - struct rtattr rtm_opt[0]; - struct rtnexthop rtm_nh[0]; - */ }; -#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)))) -#define RTM_RTNH(r) ((struct rtnexthop*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)) \ - + NLMSG_ALIGN((r)->rtm_optlen))) -#define RTM_NHLEN(nlh,r) ((nlh)->nlmsg_len - NLMSG_SPACE(sizeof(struct rtmsg)) - NLMSG_ALIGN((r)->rtm_optlen)) - /* rtm_type */ enum @@ -174,6 +128,7 @@ enum #define RTN_MAX RTN_XRESOLVE + /* rtm_protocol */ #define RTPROT_UNSPEC 0 @@ -191,15 +146,16 @@ enum */ #define RTPROT_GATED 8 /* Apparently, GateD */ -#define RTPROT_RA 9 /* RDISC router advertisment */ - +#define RTPROT_RA 9 /* RDISC/ND router advertisments */ +#define RTPROT_MRT 10 /* Merit MRT */ +#define RTPROT_ZEBRA 11 /* Zebra */ /* rtm_scope Really it is not scope, but sort of distance to the destination. NOWHERE are reserved for not existing destinations, HOST is our - local addresses, LINK are destinations, locate on directly attached - link and UNIVERSE is everywhere in the Universe :-) + local addresses, LINK are destinations, located on directly attached + link and UNIVERSE is everywhere in the Universe. Intermediate values are also possible f.e. interior routes could be assigned a value between UNIVERSE and LINK. @@ -208,7 +164,8 @@ enum enum rt_scope_t { RT_SCOPE_UNIVERSE=0, -/* User defined values f.e. "site" */ +/* User defined values */ + RT_SCOPE_SITE=200, RT_SCOPE_LINK=253, RT_SCOPE_HOST=254, RT_SCOPE_NOWHERE=255 @@ -218,8 +175,10 @@ enum rt_scope_t #define RTM_F_NOTIFY 0x100 /* Notify user of route change */ #define RTM_F_CLONED 0x200 /* This route is cloned */ -#define RTM_F_NOPMTUDISC 0x400 /* Do not make PMTU discovery */ -#define RTM_F_EQUALIZE 0x800 /* Multipath equalizer: NI */ +#define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */ +#ifdef CONFIG_RTNL_OLD_IFINFO +#define RTM_F_NOPMTUDISC 0x800 /* Do not make PMTU discovery */ +#endif /* Reserved table identifiers */ @@ -234,6 +193,107 @@ enum rt_class_t #define RT_TABLE_MAX RT_TABLE_LOCAL + +/* Routing message attributes */ + +enum rtattr_type_t +{ + RTA_UNSPEC, + RTA_DST, + RTA_SRC, + RTA_IIF, + RTA_OIF, + RTA_GATEWAY, + RTA_PRIORITY, + RTA_PREFSRC, +#ifndef CONFIG_RTNL_OLD_IFINFO + RTA_METRICS, + RTA_MULTIPATH, + RTA_PROTOINFO, + RTA_FLOW, +#else + RTA_WINDOW, + RTA_RTT, + RTA_MTU, + RTA_IFNAME, +#endif + RTA_CACHEINFO +}; + +#define RTA_MAX RTA_CACHEINFO + +#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)))) +#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg)) + +/* RTM_MULTIPATH --- array of struct rtnexthop. + * + * "struct rtnexthop" describres all necessary nexthop information, + * i.e. parameters of path to a destination via this nextop. + * + * At the moment it is impossible to set different prefsrc, mtu, window + * and rtt for different paths from multipath. + */ + +struct rtnexthop +{ + unsigned short rtnh_len; + unsigned char rtnh_flags; + unsigned char rtnh_hops; + int rtnh_ifindex; +}; + +/* rtnh_flags */ + +#define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ +#define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ +#define RTNH_F_ONLINK 4 /* Gateway is forced on link */ + +/* Macros to handle hexthops */ + +#define RTNH_ALIGNTO 4 +#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) ) +#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ + (rtnh)->rtnh_len <= (len)) +#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) +#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) +#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) +#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) + +#ifdef CONFIG_RTNL_OLD_IFINFO +#define RTM_RTNH(r) ((struct rtnexthop*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)) \ + + NLMSG_ALIGN((r)->rtm_optlen))) +#define RTM_NHLEN(nlh,r) ((nlh)->nlmsg_len - NLMSG_SPACE(sizeof(struct rtmsg)) - NLMSG_ALIGN((r)->rtm_optlen)) +#endif + +/* RTM_CACHEINFO */ + +struct rta_cacheinfo +{ + __u32 rta_clntref; + __u32 rta_lastuse; + __s32 rta_expires; + __u32 rta_error; + __u32 rta_used; +}; + +/* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ + +enum +{ + RTAX_UNSPEC, + RTAX_LOCK, + RTAX_MTU, + RTAX_WINDOW, + RTAX_RTT, + RTAX_HOPS, + RTAX_SSTHRESH, + RTAX_CWND, +}; + +#define RTAX_MAX RTAX_CWND + + + /********************************************************* * Interface address. ****/ @@ -245,9 +305,6 @@ struct ifaddrmsg unsigned char ifa_flags; /* Flags */ unsigned char ifa_scope; /* See above */ int ifa_index; /* Link index */ -/* - struct rtattr ifa_data[0]; - */ }; enum @@ -257,17 +314,29 @@ enum IFA_LOCAL, IFA_LABEL, IFA_BROADCAST, - IFA_ANYCAST + IFA_ANYCAST, + IFA_CACHEINFO }; -#define IFA_MAX IFA_ANYCAST +#define IFA_MAX IFA_CACHEINFO /* ifa_flags */ -#define IFA_F_SECONDARY 1 +#define IFA_F_SECONDARY 0x01 + +#define IFA_F_DEPRECATED 0x20 +#define IFA_F_TENTATIVE 0x40 +#define IFA_F_PERMANENT 0x80 + +struct ifa_cacheinfo +{ + __s32 ifa_prefered; + __s32 ifa_valid; +}; #define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg)))) +#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg)) /* Important comment: @@ -283,12 +352,13 @@ enum struct ndmsg { - unsigned char nd_family; - int nd_ifindex; /* Link index */ - unsigned nd_flags; -/* - struct rtattr nd_data[0]; - */ + unsigned char ndm_family; + unsigned char ndm_pad1; + unsigned short ndm_pad2; + int ndm_ifindex; /* Link index */ + __u16 ndm_state; + __u8 ndm_flags; + __u8 ndm_type; }; enum @@ -296,11 +366,45 @@ enum NDA_UNSPEC, NDA_DST, NDA_LLADDR, + NDA_CACHEINFO }; -#define NDA_MAX NDA_LLADDR +#define NDA_MAX NDA_CACHEINFO #define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg)))) +#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg)) + +/* + * Neighbor Cache Entry Flags + */ + +#define NTF_PROXY 0x08 /* == ATF_PUBL */ +#define NTF_ROUTER 0x80 + +/* + * Neighbor Cache Entry States. + */ + +#define NUD_INCOMPLETE 0x01 +#define NUD_REACHABLE 0x02 +#define NUD_STALE 0x04 +#define NUD_DELAY 0x08 +#define NUD_PROBE 0x10 +#define NUD_FAILED 0x20 + +/* Dummy states */ +#define NUD_NOARP 0x40 +#define NUD_PERMANENT 0x80 +#define NUD_NONE 0x00 + + +struct nda_cacheinfo +{ + __u32 ndm_confirmed; + __u32 ndm_used; + __u32 ndm_updated; + __u32 ndm_refcnt; +}; /**** * General form of address family dependent message. @@ -320,6 +424,7 @@ struct rtgenmsg * on network protocol. */ +#ifdef CONFIG_RTNL_OLD_IFINFO struct ifinfomsg { unsigned char ifi_family; /* Dummy */ @@ -336,6 +441,48 @@ struct ifinfomsg int ifi_qdisc; /* Packet scheduler handle */ }; +enum +{ + IFLA_UNSPEC, + IFLA_ADDRESS, + IFLA_BROADCAST, + IFLA_IFNAME, + IFLA_QDISC, + IFLA_STATS +}; + +#else + +struct ifinfomsg +{ + unsigned char ifi_family; + unsigned char __ifi_pad; + unsigned short ifi_type; /* ARPHRD_* */ + int ifi_index; /* Link index */ + unsigned ifi_flags; /* IFF_* flags */ + unsigned ifi_change; /* IFF_* change mask */ +}; + +enum +{ + IFLA_UNSPEC, + IFLA_ADDRESS, + IFLA_BROADCAST, + IFLA_IFNAME, + IFLA_MTU, + IFLA_LINK, + IFLA_QDISC, + IFLA_STATS +}; + +#endif + + +#define IFLA_MAX IFLA_STATS + +#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) +#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) + /* ifi_flags. IFF_* flags. @@ -365,47 +512,58 @@ struct ifinfomsg for IPIP tunnels, when route to endpoint is allowed to change) */ +/***************************************************************** + * Traffic control messages. + ****/ + +struct tcmsg +{ + unsigned char tcm_family; + unsigned char tcm__pad1; + unsigned short tcm__pad2; + int tcm_ifindex; + __u32 tcm_handle; + __u32 tcm_parent; + __u32 tcm_info; +}; + +enum +{ + TCA_UNSPEC, + TCA_KIND, + TCA_OPTIONS, + TCA_STATS, + TCA_XSTATS +}; + +#define TCA_MAX TCA_XSTATS + +#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) +#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) + + +/* SUMMARY: maximal rtattr understood by kernel */ + +#define RTATTR_MAX RTA_MAX + +/* RTnetlink multicast groups */ + #define RTMGRP_LINK 1 #define RTMGRP_NOTIFY 2 +#define RTMGRP_NEIGH 4 #define RTMGRP_IPV4_IFADDR 0x10 -#define RTMGRP_IPV4_NDISC 0x20 +#define RTMGRP_IPV4_MROUTE 0x20 #define RTMGRP_IPV4_ROUTE 0x40 -#define RTMGRP_IPV4_MROUTE 0x80 #define RTMGRP_IPV6_IFADDR 0x100 -#define RTMGRP_IPV6_NDISC 0x200 +#define RTMGRP_IPV6_MROUTE 0x200 #define RTMGRP_IPV6_ROUTE 0x400 -#define RTMGRP_IPV6_MROUTE 0x800 +/* End of information exported to user level */ #ifdef __KERNEL__ -struct kern_rta -{ - void *rta_dst; - void *rta_src; - int *rta_iif; - int *rta_oif; - void *rta_gw; - u32 *rta_priority; - void *rta_prefsrc; - unsigned *rta_window; - unsigned *rta_rtt; - unsigned *rta_mtu; - unsigned char *rta_ifname; -}; - -struct kern_ifa -{ - void *ifa_address; - void *ifa_local; - unsigned char *ifa_label; - void *ifa_broadcast; - void *ifa_anycast; -}; - - extern atomic_t rtnl_rlockct; extern struct wait_queue *rtnl_wait; diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h index 255241c61..38685e077 100644 --- a/include/linux/sc26198.h +++ b/include/linux/sc26198.h @@ -3,7 +3,7 @@ /* * sc26198.h -- SC26198 UART hardware info. * - * Copyright (C) 1995-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1995-1998 Stallion Technologies (support@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,15 +28,15 @@ /* * Define the number of async ports per sc26198 uart device. */ -#define SC26198_PORTS 8 +#define SC26198_PORTS 8 /* * Baud rate timing clocks. All derived from a master 14.7456 MHz clock. */ -#define SC26198_MASTERCLOCK 14745600L -#define SC26198_DCLK (SC26198_MASTERCLOCK) -#define SC26198_CCLK (SC26198_MASTERCLOCK / 2) -#define SC26198_BCLK (SC26198_MASTERCLOCK / 4) +#define SC26198_MASTERCLOCK 14745600L +#define SC26198_DCLK (SC26198_MASTERCLOCK) +#define SC26198_CCLK (SC26198_MASTERCLOCK / 2) +#define SC26198_BCLK (SC26198_MASTERCLOCK / 4) /* * Define internal FIFO sizes for the 26198 ports. diff --git a/include/linux/sched.h b/include/linux/sched.h index 3afeaa33c..096d0656c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -75,9 +75,9 @@ extern int last_pid; #define TASK_RUNNING 0 #define TASK_INTERRUPTIBLE 1 #define TASK_UNINTERRUPTIBLE 2 -#define TASK_ZOMBIE 3 -#define TASK_STOPPED 4 -#define TASK_SWAPPING 5 +#define TASK_ZOMBIE 4 +#define TASK_STOPPED 8 +#define TASK_SWAPPING 16 /* * Scheduling policies @@ -140,14 +140,17 @@ struct fs_struct { NULL, NULL \ } +/* Maximum number of active map areas.. This is a random (large) number */ +#define MAX_MAP_COUNT (65536) + struct mm_struct { struct vm_area_struct *mmap, *mmap_cache; pgd_t * pgd; - int count; + int count, map_count; struct semaphore mmap_sem; unsigned long context; unsigned long start_code, end_code, start_data, end_data; - unsigned long start_brk, brk, start_stack, start_mmap; + unsigned long start_brk, brk, start_stack; unsigned long arg_start, arg_end, env_start, env_end; unsigned long rss, total_vm, locked_vm; unsigned long def_flags; @@ -155,11 +158,11 @@ struct mm_struct { }; #define INIT_MM { \ - &init_mmap, NULL, swapper_pg_dir, 1, \ + &init_mmap, NULL, swapper_pg_dir, 1, 1, \ MUTEX, \ 0, \ 0, 0, 0, 0, \ - 0, 0, 0, 0, \ + 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, \ 0, 0 } @@ -179,13 +182,18 @@ struct signal_struct { struct task_struct { /* these are hardcoded - don't touch */ volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ - long counter; - long priority; unsigned long flags; /* per process flags, defined below */ int sigpending; - long debugreg[8]; /* Hardware debugging registers */ + mm_segment_t addr_limit; /* thread address space: + 0-0xBFFFFFFF for user-thead + 0-0xFFFFFFFF for kernel-thread + */ struct exec_domain *exec_domain; + /* various fields */ + long debugreg[8]; /* Hardware debugging registers */ + long counter; + long priority; struct linux_binfmt *binfmt; struct task_struct *next_task, *prev_task; struct task_struct *next_run, *prev_run; @@ -226,6 +234,7 @@ struct task_struct { struct timer_list real_timer; struct tms times; unsigned long start_time; + long per_cpu_utime[NR_CPUS], per_cpu_stime[NR_CPUS]; /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; @@ -307,9 +316,9 @@ struct task_struct { * your own risk!. Base=0, limit=0x1fffff (=2MB) */ #define INIT_TASK \ -/* state etc */ { 0,DEF_PRIORITY,DEF_PRIORITY,0,0, \ +/* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain, \ /* debugregs */ { 0, }, \ -/* exec domain */&default_exec_domain, \ +/* counter */ DEF_PRIORITY,DEF_PRIORITY, \ /* binfmt */ NULL, \ /* schedlink */ &init_task,&init_task, &init_task, &init_task, \ /* ec,brk... */ 0,0,0,0,0,0, \ @@ -323,6 +332,7 @@ struct task_struct { /* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \ /* timer */ { NULL, NULL, 0, 0, it_real_fn }, \ /* utime */ {0,0,0,0},0, \ +/* per cpu times */ {0, }, {0, }, \ /* flt */ 0,0,0,0,0,0, \ /* swp */ 0,0,0,0,0, \ /* rlimits */ INIT_RLIMITS, \ @@ -438,12 +448,14 @@ extern int securelevel; /* system security level */ #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 void FASTCALL(interruptible_sleep_on(struct wait_queue ** p)); -extern void FASTCALL(wake_up(struct wait_queue ** p)); -extern void FASTCALL(wake_up_interruptible(struct wait_queue ** p)); 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 void release(struct task_struct * p); extern int in_group_p(gid_t grp); @@ -513,6 +525,11 @@ extern void free_irq(unsigned int irq, void *dev_id); * it returns true (to do BSD-style accounting where the process is flagged * if it uses root privs). The implication of this is that you should do * normal permissions checks first, and check suser() last. + * + * [Dec 1997 -- Chris Evans] + * For correctness, the above considerations need to be extended to + * fsuser(). This is done, along with moving fsuser() checks to be + * last. */ extern inline int suser(void) { @@ -523,6 +540,15 @@ extern inline int suser(void) return 0; } +extern inline int fsuser(void) +{ + if (current->fsuid == 0) { + current->flags |= PF_SUPERPRIV; + return 1; + } + return 0; +} + /* * Routines for handling mm_structs */ diff --git a/include/linux/sdla_fr.h b/include/linux/sdla_fr.h index c66ee0ec3..533f2acb0 100644 --- a/include/linux/sdla_fr.h +++ b/include/linux/sdla_fr.h @@ -1,7 +1,8 @@ /***************************************************************************** * sdla_fr.h Sangoma frame relay firmware API definitions. * -* Author: Gene Kozin <74604.152@compuserve.com> +* Author: Jaspreet Singh <jaspreet@sangoma.com> +* Gene Kozin <74604.152@compuserve.com> * * Copyright: (c) 1995-1996 Sangoma Technologies Inc. * @@ -10,6 +11,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* Oct 12, 1997 Jaspreet Singh Added FR_READ_DLCI_IB_MAPPING +* Jul 21, 1997 Jaspreet Singh Changed FRRES_TOO_LONG and FRRES_TOO_MANY to +* 0x05 and 0x06 respectively. * Dec 23, 1996 Gene Kozin v2.0 * Apr 29, 1996 Gene Kozin v1.0 (merged version S502 & S508 definitions). * Sep 26, 1995 Gene Kozin Initial version. @@ -94,6 +98,7 @@ typedef struct fr_cmd #define FR_SET_MODEM_STATUS 0x31 #define FR_READ_ERROR_STATS 0x32 #define FR_FLUSH_ERROR_STATS 0x33 +#define FR_READ_DLCI_IB_MAPPING 0x34 #define FR_READ_CODE_VERSION 0x40 #define FR_SET_INTR_MODE 0x50 #define FR_READ_INTR_MODE 0x51 @@ -104,8 +109,8 @@ typedef struct fr_cmd #define FRRES_INOPERATIVE 0x02 /* channel inoperative */ #define FRRES_DLCI_INACTIVE 0x03 /* DLCI is inactive */ #define FRRES_DLCI_INVALID 0x04 /* DLCI is not configured */ -#define FRRES_TOO_LONG 0x04 -#define FRRES_TOO_MANY 0x05 +#define FRRES_TOO_LONG 0x05 +#define FRRES_TOO_MANY 0x06 #define FRRES_CIR_OVERFLOW 0x07 /* Tx throughput has exceeded CIR */ #define FRRES_BUFFER_OVERFLOW 0x08 #define FRRES_MODEM_FAILURE 0x10 /* DCD and/or CTS dropped */ @@ -160,6 +165,7 @@ typedef struct fr508_flags unsigned char iflag PACKED; /* 10h: interrupt flag */ unsigned char imask PACKED; /* 11h: interrupt mask */ unsigned long tse_offs PACKED; /* 12h: Tx status element */ + unsigned short dlci PACKED; /* 16h: DLCI NUMBER */ } fr508_flags_t; /* 'event' field defines */ diff --git a/include/linux/sdla_x25.h b/include/linux/sdla_x25.h index 0cff58224..4c0f43725 100644 --- a/include/linux/sdla_x25.h +++ b/include/linux/sdla_x25.h @@ -159,7 +159,7 @@ typedef struct X25Cmd #define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occured */ #define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */ #define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */ -/*----- Command-dependant results -----*/ +/*----- Command-dependent results -----*/ #define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */ #define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */ #define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/ @@ -244,7 +244,8 @@ typedef struct X25Status unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */ TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */ unsigned char iflags PACKED; /* 0Dh: interrupt flags */ - unsigned char resrv[2] PACKED; /* 0Eh: */ + unsigned char imask PACKED; /* 0Eh: interrupt mask */ + unsigned char resrv PACKED; /* 0Eh: */ unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */ unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */ } TX25Status; diff --git a/include/linux/signal.h b/include/linux/signal.h index 0dd75b886..ff193cd24 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -174,6 +174,11 @@ extern inline void sigdelsetmask(sigset_t *set, unsigned long mask) set->sig[0] &= ~mask; } +extern inline int sigtestsetmask(sigset_t *set, unsigned long mask) +{ + return (set->sig[0] & mask) != 0; +} + extern inline void siginitset(sigset_t *set, unsigned long mask) { set->sig[0] = mask; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 3668712d8..e19a95fec 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -23,9 +23,6 @@ #define HAVE_ALLOC_SKB /* For the drivers to know */ #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ -#define FREE_READ 1 -#define FREE_WRITE 0 - #define CHECKSUM_NONE 0 #define CHECKSUM_HW 1 #define CHECKSUM_UNNECESSARY 2 @@ -78,7 +75,12 @@ struct sk_buff } mac; struct dst_entry *dst; + +#if (defined(__alpha__) || defined(__sparc64__)) && (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) + char cb[48]; /* sorry. 64bit pointers have a price */ +#else char cb[32]; +#endif __u32 seq; /* TCP sequence number */ __u32 end_seq; /* seq [+ fin] [+ syn] + datalen */ @@ -86,8 +88,7 @@ struct sk_buff unsigned int len; /* Length of actual data */ unsigned int csum; /* Checksum */ - volatile char used, /* Are we in use ? */ - arp; /* Has IP/ARP resolution finished */ + volatile char used; unsigned char tries, /* Times tried */ inclone, /* Inline clone */ pkt_type, /* Packet class */ @@ -137,9 +138,6 @@ struct sk_buff #include <asm/system.h> -#if 0 -extern void print_skb(struct sk_buff *); -#endif extern void __kfree_skb(struct sk_buff *skb); extern void skb_queue_head_init(struct sk_buff_head *list); extern void skb_queue_head(struct sk_buff_head *list,struct sk_buff *buf); @@ -156,7 +154,7 @@ extern void kfree_skbmem(struct sk_buff *skb); extern struct sk_buff * skb_clone(struct sk_buff *skb, int priority); extern struct sk_buff * skb_copy(struct sk_buff *skb, int priority); extern struct sk_buff * skb_realloc_headroom(struct sk_buff *skb, int newheadroom); -#define dev_kfree_skb(a, b) kfree_skb((a), (b)) +#define dev_kfree_skb(a) kfree_skb(a) extern unsigned char * skb_put(struct sk_buff *skb, unsigned int len); extern unsigned char * skb_push(struct sk_buff *skb, unsigned int len); extern unsigned char * skb_pull(struct sk_buff *skb, unsigned int len); @@ -170,7 +168,7 @@ extern __inline__ int skb_queue_empty(struct sk_buff_head *list) return (list->next == (struct sk_buff *) list); } -extern __inline__ void kfree_skb(struct sk_buff *skb, int rw) +extern __inline__ void kfree_skb(struct sk_buff *skb) { if (atomic_dec_and_test(&skb->users)) __kfree_skb(skb); @@ -193,13 +191,13 @@ extern __inline__ int skb_shared(struct sk_buff *skb) * a packet thats being forwarded. */ -extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri, int dir) +extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri) { struct sk_buff *nskb; if(!skb_cloned(skb)) return skb; nskb=skb_copy(skb, pri); - kfree_skb(skb, dir); /* Free our shared copy */ + kfree_skb(skb); /* Free our shared copy */ return nskb; } @@ -218,6 +216,14 @@ extern __inline__ struct sk_buff *skb_peek(struct sk_buff_head *list_) return list; } +extern __inline__ struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) +{ + struct sk_buff *list = ((struct sk_buff *)list_)->prev; + if (list == (struct sk_buff *)list_) + list = NULL; + return list; +} + /* * Return the length of an sk_buff queue */ @@ -408,6 +414,28 @@ extern __inline__ void skb_unlink(struct sk_buff *skb) restore_flags(flags); } +/* XXX: more streamlined implementation */ +extern __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) +{ + struct sk_buff *skb = skb_peek_tail(list); + if (skb) + __skb_unlink(skb, list); + return skb; +} + +extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list) +{ + long flags; + struct sk_buff *result; + + save_flags(flags); + cli(); + result = __skb_dequeue_tail(list); + restore_flags(flags); + return result; +} + + extern const char skb_put_errstr[]; extern const char skb_push_errstr[]; @@ -484,33 +512,6 @@ extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len) } } -/* dev_tint can lock buffer at any moment, - * so that cli(), unlink it and sti(), - * now it is safe. - */ - -extern __inline__ int skb_steal(struct sk_buff *skb) -{ - unsigned long flags; - - save_flags(flags); - cli(); - if (skb->next) { - skb_unlink(skb); - atomic_dec(&skb->users); - } - restore_flags(flags); - return 1; -} - -extern __inline__ void __skb_steal(struct sk_buff *skb) -{ - if (skb->next) { - skb_unlink(skb); - atomic_dec(&skb->users); - } -} - extern __inline__ void skb_orphan(struct sk_buff *skb) { if (skb->destructor) @@ -523,11 +524,21 @@ extern __inline__ void skb_queue_purge(struct sk_buff_head *list) { struct sk_buff *skb; while ((skb=skb_dequeue(list))!=NULL) - kfree_skb(skb,0); + kfree_skb(skb); +} + +extern __inline__ struct sk_buff *dev_alloc_skb(unsigned int length) +{ + struct sk_buff *skb; + + skb = alloc_skb(length+16, GFP_ATOMIC); + if (skb) + skb_reserve(skb,16); + return skb; } extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err); -extern unsigned int datagram_poll(struct socket *sock, struct poll_table_struct *wait); +extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait); extern int skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size); extern int skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size); extern void skb_free_datagram(struct sock * sk, struct sk_buff *skb); diff --git a/include/linux/slab.h b/include/linux/slab.h index decb1e747..0b46d3b73 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -15,14 +15,14 @@ typedef struct kmem_cache_s kmem_cache_t; #include <asm/cache.h> /* flags for kmem_cache_alloc() */ -#define SLAB_BUFFER GFP_BUFFER /* 0x00 */ -#define SLAB_ATOMIC GFP_ATOMIC /* 0x01 */ -#define SLAB_USER GFP_USER /* 0x02 */ -#define SLAB_KERNEL GFP_KERNEL /* 0x03 */ -#define SLAB_NOBUFFER GFP_NOBUFFER /* 0x04 */ -#define SLAB_NFS GFP_NFS /* 0x05 */ -#define SLAB_DMA GFP_DMA /* 0x08 */ -#define SLAB_LEVEL_MASK GFP_LEVEL_MASK /* 0x0f */ +#define SLAB_BUFFER GFP_BUFFER +#define SLAB_ATOMIC GFP_ATOMIC +#define SLAB_USER GFP_USER +#define SLAB_KERNEL GFP_KERNEL +#define SLAB_NFS GFP_NFS +#define SLAB_DMA GFP_DMA + +#define SLAB_LEVEL_MASK 0x0000007fUL #define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */ /* flags to pass to kmem_cache_create(). @@ -59,7 +59,7 @@ extern void *kmalloc(size_t, int); extern void kfree(const void *); extern void kfree_s(const void *, size_t); -extern int kmem_cache_reap(int, int, int); +extern void kmem_cache_reap(int); extern int get_slabinfo(char *); /* System wide caches */ diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index f21d66080..2e83cf446 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -76,6 +76,7 @@ smb_vfree(void *obj) */ #define SMB_FIX_WIN95 0x0001 /* Win 95 server */ #define SMB_FIX_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */ +#define SMB_FIX_DIRATTR 0x0004 /* Use find_first for getattr */ /* linux/fs/smbfs/mmap.c */ int smb_mmap(struct file *, struct vm_area_struct *); @@ -94,11 +95,11 @@ int smb_ioctl (struct inode *, struct file *, unsigned int, unsigned long); struct super_block *smb_read_super(struct super_block *, void *, int); void smb_get_inode_attr(struct inode *, struct smb_fattr *); void smb_invalidate_inodes(struct smb_sb_info *); -int smb_revalidate_inode(struct inode *); -int smb_refresh_inode(struct inode *); -int smb_notify_change(struct inode *, struct iattr *); +int smb_revalidate_inode(struct dentry *); +int smb_notify_change(struct dentry *, struct iattr *); unsigned long smb_invent_inos(unsigned long); struct inode *smb_iget(struct super_block *, struct smb_fattr *); +extern int init_smb_fs(void); /* linux/fs/smbfs/proc.c */ __u32 smb_len(unsigned char *); @@ -112,8 +113,8 @@ int smb_close(struct inode *); void smb_close_dentry(struct dentry *); int smb_close_fileid(struct dentry *, __u16); int smb_open(struct dentry *, int); -int smb_proc_read(struct inode *, off_t, int, char *); -int smb_proc_write(struct inode *, off_t, int, const char *); +int smb_proc_read(struct dentry *, off_t, int, char *); +int smb_proc_write(struct dentry *, off_t, int, const char *); int smb_proc_create(struct dentry *, __u16, time_t, __u16 *); int smb_proc_mv(struct dentry *, struct dentry *); int smb_proc_mkdir(struct dentry *); diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h index 71e57ea6a..4aea02c3c 100644 --- a/include/linux/smb_fs_i.h +++ b/include/linux/smb_fs_i.h @@ -21,15 +21,14 @@ struct smb_inode_info { * file handles are local to a connection. A file is open if * (open == generation). */ - unsigned int open; + unsigned int open; /* open generation */ __u16 fileid; /* What id to handle a file with? */ __u16 attr; /* Attribute fields, DOS value */ - __u16 access; /* Access bits. */ + __u16 access; /* Access mode */ __u16 cache_valid; /* dircache valid? */ unsigned long oldmtime; /* last time refreshed */ unsigned long closed; /* timestamp when closed */ - void * dentry; /* The dentry we were opened with */ }; #endif diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h index 4e277ad3c..cedbb5ab8 100644 --- a/include/linux/smb_fs_sb.h +++ b/include/linux/smb_fs_sb.h @@ -24,6 +24,7 @@ struct smb_sb_info { struct file * sock_file; struct smb_mount_data *mnt; + unsigned char *temp_buf; /* Connections are counted. Each time a new socket arrives, * generation is incremented. diff --git a/include/linux/smp.h b/include/linux/smp.h index ff4427960..1a8d71f58 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -8,36 +8,46 @@ #ifdef __SMP__ #include <asm/smp.h> - + +/* + * main IPI interface, handles INIT, TLB flush, STOP, etc.: + */ extern void smp_message_pass(int target, int msg, unsigned long data, int wait); -extern void smp_boot_cpus(void); /* Boot processor call to load the other CPU's */ -extern void smp_callin(void); /* Processor call in. Must hold processors until .. */ -extern void smp_commence(void); /* Multiprocessors may now schedule */ -extern int smp_num_cpus; -extern int smp_threads_ready; /* True once the per process idle is forked */ -#ifdef __SMP_PROF__ -extern volatile unsigned long smp_spins[NR_CPUS]; /* count of interrupt spins */ -extern volatile unsigned long smp_spins_sys_idle[]; /* count of idle spins */ -extern volatile unsigned long smp_spins_syscall[]; /* count of syscall spins */ -extern volatile unsigned long smp_spins_syscall_cur[]; /* count of syscall spins for the current - call */ -extern volatile unsigned long smp_idle_count[1+NR_CPUS];/* count idle ticks */ -extern volatile unsigned long smp_idle_map; /* map with idle cpus */ -#else -extern volatile unsigned long smp_spins; -#endif +/* + * Boot processor call to load the other CPU's + */ +extern void smp_boot_cpus(void); + +/* + * Processor call in. Must hold processors until .. + */ +extern void smp_callin(void); + +/* + * Multiprocessors may now schedule + */ +extern void smp_commence(void); + +/* + * True once the per process idle is forked + */ +extern int smp_threads_ready; + +extern int smp_num_cpus; extern volatile unsigned long smp_msg_data; extern volatile int smp_src_cpu; extern volatile int smp_msg_id; -#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ +#define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ #define MSG_ALL 0x8001 -#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */ -#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's when rebooting */ -#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU */ +#define MSG_INVALIDATE_TLB 0x0001 /* Remote processor TLB invalidate */ +#define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's + * when rebooting + */ +#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU */ #else @@ -51,5 +61,6 @@ extern volatile int smp_msg_id; #define smp_message_pass(t,m,d,w) #define smp_threads_ready 1 #define kernel_lock() + #endif #endif diff --git a/include/linux/sockios.h b/include/linux/sockios.h index 5465bc6b8..4f41001aa 100644 --- a/include/linux/sockios.h +++ b/include/linux/sockios.h @@ -45,8 +45,8 @@ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ -#define SIOCSIFHWADDR 0x8924 /* set hardware address (NI) */ -#define SIOCGIFENCAP 0x8925 /* get/set slip encapsulation */ +#define SIOCSIFHWADDR 0x8924 /* set hardware address */ +#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ @@ -64,6 +64,10 @@ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ +#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ +#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ + + /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ diff --git a/include/linux/soundmodem.h b/include/linux/soundmodem.h index 43ad5e3a2..10d0799d6 100644 --- a/include/linux/soundmodem.h +++ b/include/linux/soundmodem.h @@ -1,14 +1,11 @@ /* * The Linux soundcard driver for 1200 baud and 9600 baud packet radio - * (C) 1996 by Thomas Sailer, HB9JNX/AE4WA + * (C) 1996-1998 by Thomas Sailer, HB9JNX/AE4WA */ #ifndef _SOUNDMODEM_H #define _SOUNDMODEM_H -#include <linux/sockios.h> -#include <linux/if_ether.h> - /* -------------------------------------------------------------------- */ /* * structs for the IOCTL commands diff --git a/include/linux/stallion.h b/include/linux/stallion.h index f277551fe..35274488d 100644 --- a/include/linux/stallion.h +++ b/include/linux/stallion.h @@ -3,7 +3,7 @@ /* * stallion.h -- stallion multiport serial driver. * - * Copyright (C) 1996-1997 Stallion Technologies (support@stallion.oz.au). + * Copyright (C) 1996-1998 Stallion Technologies (support@stallion.oz.au). * Copyright (C) 1994-1996 Greg Ungerer (gerg@stallion.oz.au). * * This program is free software; you can redistribute it and/or modify @@ -131,6 +131,8 @@ typedef struct stlbrd { void (*isr)(struct stlbrd *brdp); unsigned int ioaddr1; unsigned int ioaddr2; + unsigned int iosize1; + unsigned int iosize2; unsigned int iostatus; unsigned int ioctrl; unsigned int ioctrlval; diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 715abce2d..7012fb4a3 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -89,6 +89,7 @@ typedef void (*rpc_action)(struct rpc_task *); #define RPC_TASK_ROOTCREDS 0x0100 /* force root creds */ #define RPC_TASK_DYNAMIC 0x0200 /* task was kmalloc'ed */ #define RPC_TASK_KILLED 0x0400 /* task was killed */ +#define RPC_TASK_NFSWRITE 0x1000 /* an NFS writeback */ #define RPC_IS_RUNNING(t) ((t)->tk_flags & RPC_TASK_RUNNING) #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) @@ -145,6 +146,9 @@ void * rpc_allocate(unsigned int flags, unsigned int); void rpc_free(void *); int rpciod_up(void); void rpciod_down(void); +#ifdef RPC_DEBUG +void rpc_show_tasks(void); +#endif extern __inline__ void * rpc_malloc(struct rpc_task *task, unsigned int size) diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index d0ced9fe4..c01ebfa4b 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h @@ -40,6 +40,9 @@ struct svc_stat { void rpc_proc_init(void); void rpc_proc_exit(void); +#ifdef MODULE +void rpc_modcount(struct inode *, int); +#endif struct proc_dir_entry * rpc_proc_register(struct rpc_stat *); void rpc_proc_unregister(const char *); diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 8445f2b10..e076098c4 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -49,7 +49,7 @@ struct svc_sock { /* * Function prototypes. */ -int svc_create_socket(struct svc_serv *, int, struct sockaddr_in *); +int svc_makesock(struct svc_serv *, int, unsigned short); void svc_delete_socket(struct svc_sock *); int svc_recv(struct svc_serv *, struct svc_rqst *); int svc_send(struct svc_rqst *); diff --git a/include/linux/swap.h b/include/linux/swap.h index d0873952a..4d291146e 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -9,6 +9,8 @@ #ifdef __KERNEL__ +#undef DEBUG_SWAP + #include <asm/atomic.h> #define SWP_USED 1 @@ -21,7 +23,6 @@ struct swap_info_struct { kdev_t swap_device; struct dentry * swap_file; unsigned char * swap_map; - unsigned char * swap_lockmap; unsigned int lowest_bit; unsigned int highest_bit; unsigned int cluster_next; @@ -38,6 +39,7 @@ extern atomic_t nr_async_pages; extern int min_free_pages; extern int free_pages_low; extern int free_pages_high; +extern struct inode swapper_inode; /* Incomplete types for prototype declarations: */ struct task_struct; @@ -48,15 +50,11 @@ struct sysinfo; extern int shm_swap (int, int); /* linux/mm/vmscan.c */ -extern int try_to_free_page(int, int, int); +extern int try_to_free_page(int); /* linux/mm/page_io.c */ extern void rw_swap_page(int, unsigned long, char *, int); -#define read_swap_page(nr,buf) \ - rw_swap_page(READ,(nr),(buf),1) -#define write_swap_page(nr,buf) \ - rw_swap_page(WRITE,(nr),(buf),1) -extern void swap_after_unlock_page (unsigned long entry); +extern void rw_swap_page_nocache(int, unsigned long, char *); /* linux/mm/page_alloc.c */ extern void swap_in(struct task_struct *, struct vm_area_struct *, @@ -67,6 +65,8 @@ extern void swap_in(struct task_struct *, struct vm_area_struct *, extern void show_swap_cache_info(void); extern int add_to_swap_cache(struct page *, unsigned long); extern void swap_duplicate(unsigned long); +extern struct page * read_swap_cache_async(unsigned long, int); +#define read_swap_cache(entry) read_swap_cache_async(entry, 1); /* linux/mm/swapfile.c */ extern unsigned int nr_swapfiles; @@ -80,7 +80,7 @@ extern void FASTCALL(swap_free(unsigned long)); * * Will go away eventually.. */ -#define SHM_SWP_TYPE 0x40 +#define SHM_SWP_TYPE 0x20 /* * swap cache stuff (in linux/mm/swap_state.c) @@ -100,39 +100,35 @@ extern unsigned long swap_cache_find_success; extern inline unsigned long in_swap_cache(struct page *page) { if (PageSwapCache(page)) - return page->pg_swap_entry; - return 0; -} - -extern inline long find_in_swap_cache(struct page *page) -{ -#ifdef SWAP_CACHE_INFO - swap_cache_find_total++; -#endif - if (PageTestandClearSwapCache(page)) { -#ifdef SWAP_CACHE_INFO - swap_cache_find_success++; -#endif - return page->pg_swap_entry; - } + return page->offset; return 0; } -extern inline int delete_from_swap_cache(struct page *page) +/* + * Work out if there are any other processes sharing this page, ignoring + * any page reference coming from the swap cache, or from outstanding + * swap IO on this page. (The page cache _does_ count as another valid + * reference to the page, however.) + */ +static inline int is_page_shared(struct page *page) { -#ifdef SWAP_CACHE_INFO - swap_cache_del_total++; -#endif - if (PageTestandClearSwapCache(page)) { -#ifdef SWAP_CACHE_INFO - swap_cache_del_success++; -#endif - swap_free(page->pg_swap_entry); + int count = atomic_read(&page->count); + if (PageReserved(page)) return 1; - } - return 0; + if (page->inode == &swapper_inode) + count--; + if (PageFreeAfter(page)) + count--; + return (count > 1); } +/* + * Make these inline later once they are working properly. + */ +extern long find_in_swap_cache(struct page *page); +extern int delete_from_swap_cache(struct page *page); +extern void remove_from_swap_cache(struct page *page); +extern void free_page_and_swap_cache(unsigned long addr); #endif /* __KERNEL__*/ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 68b6fee1b..865bdd1dd 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -114,6 +114,10 @@ enum NET_CORE_WMEM_DEFAULT, NET_CORE_RMEM_DEFAULT, NET_CORE_DESTROY_DELAY, + NET_CORE_MAX_BACKLOG, + NET_CORE_FASTROUTE, + NET_CORE_MSG_COST, + NET_CORE_MSG_BURST, }; /* /proc/sys/net/ethernet */ @@ -131,34 +135,24 @@ enum /* /proc/sys/net/ipv4 */ enum { - NET_IPV4_ARP_RES_TIME=1, - NET_IPV4_ARP_DEAD_RES_TIME, - NET_IPV4_ARP_MAX_TRIES, - NET_IPV4_ARP_MAX_PINGS, - NET_IPV4_ARP_TIMEOUT, - NET_IPV4_ARP_CHECK_INTERVAL, - NET_IPV4_ARP_CONFIRM_INTERVAL, - NET_IPV4_ARP_CONFIRM_TIMEOUT, - NET_IPV4_TCP_HOE_RETRANSMITS, + /* v2.0 compatibile variables */ + NET_IPV4_FORWARD = 8, + NET_IPV4_DYNADDR = 9, + + NET_IPV4_CONF = 16, + NET_IPV4_NEIGH = 17, + NET_IPV4_ROUTE = 18, + NET_IPV4_FIB_HASH = 19, + + NET_IPV4_TCP_HOE_RETRANSMITS=32, NET_IPV4_TCP_SACK, NET_IPV4_TCP_TSACK, NET_IPV4_TCP_TIMESTAMPS, NET_IPV4_TCP_WINDOW_SCALING, NET_IPV4_TCP_VEGAS_CONG_AVOID, - NET_IPV4_FORWARDING, NET_IPV4_DEFAULT_TTL, - NET_IPV4_RFC1812_FILTER, - NET_IPV4_LOG_MARTIANS, - NET_IPV4_SOURCE_ROUTE, - NET_IPV4_SEND_REDIRECTS, NET_IPV4_AUTOCONFIG, - NET_IPV4_BOOTP_RELAY, - NET_IPV4_PROXY_ARP, NET_IPV4_NO_PMTU_DISC, - NET_IPV4_ACCEPT_REDIRECTS, - NET_IPV4_SECURE_REDIRECTS, - NET_IPV4_RFC1620_REDIRECTS, - NET_IPV4_RTCACHE_FLUSH, NET_IPV4_TCP_SYN_RETRIES, NET_IPV4_IPFRAG_HIGH_THRESH, NET_IPV4_IPFRAG_LOW_THRESH, @@ -170,10 +164,6 @@ enum NET_IPV4_TCP_RETRIES2, NET_IPV4_TCP_MAX_DELAY_ACKS, NET_IPV4_TCP_FIN_TIMEOUT, - NET_IPV4_IGMP_MAX_HOST_REPORT_DELAY, - NET_IPV4_IGMP_TIMER_SCALE, - NET_IPV4_IGMP_AGE_THRESHOLD, - NET_IPV4_IP_DYNADDR, NET_IPV4_IP_MASQ_DEBUG, NET_TCP_SYNCOOKIES, NET_TCP_STDURG, @@ -186,31 +176,95 @@ enum NET_IPV4_ICMP_DESTUNREACH_RATE, NET_IPV4_ICMP_TIMEEXCEED_RATE, NET_IPV4_ICMP_PARAMPROB_RATE, - NET_IPV4_ICMP_ECHOREPLY_RATE + NET_IPV4_ICMP_ECHOREPLY_RATE, +}; + +enum { + NET_IPV4_ROUTE_FLUSH = 1, + NET_IPV4_ROUTE_MIN_DELAY, + NET_IPV4_ROUTE_MAX_DELAY, + NET_IPV4_ROUTE_GC_THRESH, + NET_IPV4_ROUTE_MAX_SIZE, + NET_IPV4_ROUTE_GC_MIN_INTERVAL, + NET_IPV4_ROUTE_GC_TIMEOUT, + NET_IPV4_ROUTE_GC_INTERVAL, + NET_IPV4_ROUTE_REDIRECT_LOAD, + NET_IPV4_ROUTE_REDIRECT_NUMBER, + NET_IPV4_ROUTE_REDIRECT_SILENCE, + NET_IPV4_ROUTE_ERROR_COST, + NET_IPV4_ROUTE_ERROR_BURST, +}; + +enum +{ + NET_PROTO_CONF_ALL = -2, + NET_PROTO_CONF_DEFAULT = -3, + + /* And device ifindices ... */ }; +enum +{ + NET_IPV4_CONF_FORWARDING = 1, + NET_IPV4_CONF_MC_FORWARDING, + NET_IPV4_CONF_PROXY_ARP, + NET_IPV4_CONF_ACCEPT_REDIRECTS, + NET_IPV4_CONF_SECURE_REDIRECTS, + NET_IPV4_CONF_SEND_REDIRECTS, + NET_IPV4_CONF_SHARED_MEDIA, + NET_IPV4_CONF_RP_FILTER, + NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, + NET_IPV4_CONF_BOOTP_RELAY, + NET_IPV4_CONF_LOG_MARTIANS, +}; /* /proc/sys/net/ipv6 */ enum { - NET_IPV6_FORWARDING = 1, - NET_IPV6_HOPLIMIT, + NET_IPV6_CONF = 16, + NET_IPV6_NEIGH = 17, + NET_IPV6_ROUTE = 18, +}; + +enum { + NET_IPV6_ROUTE_FLUSH = 1, + NET_IPV6_ROUTE_GC_THRESH, + NET_IPV6_ROUTE_MAX_SIZE, + NET_IPV6_ROUTE_GC_MIN_INTERVAL, + NET_IPV6_ROUTE_GC_TIMEOUT, + NET_IPV6_ROUTE_GC_INTERVAL, +}; +enum { + NET_IPV6_FORWARDING = 1, + NET_IPV6_HOP_LIMIT, + NET_IPV6_MTU, NET_IPV6_ACCEPT_RA, NET_IPV6_ACCEPT_REDIRECTS, - - NET_IPV6_ND_MAX_MCAST_SOLICIT, - NET_IPV6_ND_MAX_UCAST_SOLICIT, - NET_IPV6_ND_RETRANS_TIME, - NET_IPV6_ND_REACHABLE_TIME, - NET_IPV6_ND_DELAY_PROBE_TIME, - NET_IPV6_AUTOCONF, NET_IPV6_DAD_TRANSMITS, NET_IPV6_RTR_SOLICITS, NET_IPV6_RTR_SOLICIT_INTERVAL, NET_IPV6_RTR_SOLICIT_DELAY, +}; - NET_IPV6_ICMPV6_TIME, +/* /proc/sys/net/<protocol>/neigh/<dev> */ +enum { + NET_NEIGH_MCAST_SOLICIT=1, + NET_NEIGH_UCAST_SOLICIT, + NET_NEIGH_APP_SOLICIT, + NET_NEIGH_RETRANS_TIME, + NET_NEIGH_REACHABLE_TIME, + NET_NEIGH_DELAY_PROBE_TIME, + NET_NEIGH_GC_STALE_TIME, + NET_NEIGH_UNRES_QLEN, + NET_NEIGH_PROXY_QLEN, + NET_NEIGH_ANYCAST_DELAY, + NET_NEIGH_PROXY_DELAY, + NET_NEIGH_LOCKTIME, + NET_NEIGH_GC_INTERVAL, + NET_NEIGH_GC_THRESH1, + NET_NEIGH_GC_THRESH2, + NET_NEIGH_GC_THRESH3 }; /* /proc/sys/net/ipx */ diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index 7c5167fa8..00d40adca 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -367,7 +367,7 @@ extern int sysv_mkdir(struct inode * dir, struct dentry * dentry, int mode); extern int sysv_rmdir(struct inode * dir, struct dentry * dentry); extern int sysv_unlink(struct inode * dir, struct dentry * dentry); extern int sysv_symlink(struct inode * inode, struct dentry * dentry, const char * symname); -extern int sysv_link(struct inode * oldinode, struct inode * dir, struct dentry * dentry); +extern int sysv_link(struct dentry * old_dentry, struct inode * dir, struct dentry * dentry); extern int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev); extern int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, struct inode * new_dir, struct dentry * new_dentry); @@ -390,7 +390,7 @@ extern struct super_block *sysv_read_super(struct super_block *,void *,int); extern int init_sysv_fs(void); extern void sysv_write_super(struct super_block *); extern void sysv_read_inode(struct inode *); -extern int sysv_notify_change(struct inode *, struct iattr *); +extern int sysv_notify_change(struct dentry *, struct iattr *); extern void sysv_write_inode(struct inode *); extern void sysv_put_inode(struct inode *); extern int sysv_statfs(struct super_block *, struct statfs *, int); diff --git a/include/linux/sysv_fs_sb.h b/include/linux/sysv_fs_sb.h index 115b95bc6..99a7c125d 100644 --- a/include/linux/sysv_fs_sb.h +++ b/include/linux/sysv_fs_sb.h @@ -15,8 +15,8 @@ struct sysv_sb_info { unsigned int s_block_size; /* zone size, = 512 or = 1024 */ unsigned int s_block_size_1; /* block_size - 1 */ unsigned int s_block_size_bits; /* log2(block_size) */ - unsigned int s_block_size_ratio; /* BLOCK_SIZE / block_size */ - unsigned int s_block_size_ratio_bits; /* log2(block_size_ratio) */ + unsigned int s_block_size_inc_bits; /* log2(block_size/BLOCK_SIZE) if >0 */ + unsigned int s_block_size_dec_bits; /* log2(BLOCK_SIZE/block_size) if >0 */ char s_convert; /* flag whether byte ordering requires conversion */ char s_kludge_symlinks; /* flag whether symlinks have a kludgey mode */ char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */ @@ -66,15 +66,15 @@ struct sysv_sb_info { unsigned long s_ndatazones; /* total number of data zones */ unsigned long s_nzones; /* same as s_sbd->s_fsize */ }; -/* The fields s_block_size_ratio, s_ind_per_block_2_1, s_toobig_block are currently unused. */ +/* The fields s_ind_per_block_2_1, s_toobig_block are currently unused. */ /* sv_ == u.sysv_sb.s_ */ #define sv_type u.sysv_sb.s_type #define sv_block_size u.sysv_sb.s_block_size #define sv_block_size_1 u.sysv_sb.s_block_size_1 #define sv_block_size_bits u.sysv_sb.s_block_size_bits -#define sv_block_size_ratio u.sysv_sb.s_block_size_ratio -#define sv_block_size_ratio_bits u.sysv_sb.s_block_size_ratio_bits +#define sv_block_size_inc_bits u.sysv_sb.s_block_size_inc_bits +#define sv_block_size_dec_bits u.sysv_sb.s_block_size_dec_bits #define sv_convert u.sysv_sb.s_convert #define sv_kludge_symlinks u.sysv_sb.s_kludge_symlinks #define sv_truncate u.sysv_sb.s_truncate diff --git a/include/linux/timer.h b/include/linux/timer.h index 00ae5082f..7d11fd246 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -2,61 +2,27 @@ #define _LINUX_TIMER_H /* - * DON'T CHANGE THESE!! Most of them are hardcoded into some assembly language - * as well as being defined here. - */ - -/* - * The timers are: - * - * BLANK_TIMER console screen-saver timer - * - * BEEP_TIMER console beep timer - * - * RS_TIMER timer for the RS-232 ports - * - * SWAP_TIMER timer for the background pageout daemon - * - * HD_TIMER harddisk timer - * - * HD_TIMER2 (atdisk2 patches) - * - * FLOPPY_TIMER floppy disk timer (not used right now) - * - * SCSI_TIMER scsi.c timeout timer - * - * NET_TIMER tcp/ip timeout timer - * - * COPRO_TIMER 387 timeout for buggy hardware.. - * - * QIC02_TAPE_TIMER timer for QIC-02 tape driver (it's not hardcoded) - * - * MCD_TIMER Mitsumi CD-ROM Timer - * - * GSCD_TIMER Goldstar CD-ROM Timer + * Old-style timers. Please don't use for any new code. * + * Numbering of these timers should be consecutive to minimize + * processing delays. [MJ] */ -#define BLANK_TIMER 0 -#define BEEP_TIMER 1 -#define RS_TIMER 2 -#define SWAP_TIMER 3 - -#define HD_TIMER 16 -#define FLOPPY_TIMER 17 -#define SCSI_TIMER 18 -#define NET_TIMER 19 -#define SOUND_TIMER 20 -#define COPRO_TIMER 21 - -#define QIC02_TAPE_TIMER 22 /* hhb */ -#define MCD_TIMER 23 - -#define HD_TIMER2 24 -#define GSCD_TIMER 25 -#define COMTROL_TIMER 26 +#define BLANK_TIMER 0 /* Console screen-saver */ +#define BEEP_TIMER 1 /* Console beep */ +#define RS_TIMER 2 /* RS-232 ports */ +#define SWAP_TIMER 3 /* Background pageout */ +#define BACKGR_TIMER 4 /* io_request background I/O */ +#define HD_TIMER 5 /* Old IDE driver */ +#define FLOPPY_TIMER 6 /* Floppy */ +#define QIC02_TAPE_TIMER 7 /* QIC 02 tape */ +#define MCD_TIMER 8 /* Mitsumi CDROM */ +#define GSCD_TIMER 9 /* Goldstar CDROM */ +#define COMTROL_TIMER 10 /* Comtrol serial */ +#define DIGI_TIMER 11 /* Digi serial */ +#define GDTH_TIMER 12 /* Ugh - gdth scsi driver */ -#define DIGI_TIMER 29 +#define COPRO_TIMER 31 /* 387 timeout for buggy hardware (boot only) */ struct timer_struct { unsigned long expires; diff --git a/include/linux/tty.h b/include/linux/tty.h index 9c5d58ca8..6b00c4329 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -288,6 +288,7 @@ struct tty_struct { #define TTY_CLOSING 7 #define TTY_HW_COOK_OUT 14 #define TTY_HW_COOK_IN 15 +#define TTY_PTY_LOCK 16 #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) @@ -309,6 +310,7 @@ extern int tty_init(void); extern int pcxe_init(void); extern int pc_init(void); extern int vcs_init(void); +extern int rp_init(void); extern int cy_init(void); extern int stl_init(void); extern int stli_init(void); @@ -358,10 +360,6 @@ extern long serial_console_init(long kmem_start, long kmem_end); extern int pcxe_open(struct tty_struct *tty, struct file *filp); -/* epca.c */ - -extern int pc_open(struct tty_struct *tty, struct file *filp); - /* console.c */ extern void update_screen(int new_console); diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 1e8bf261c..ee6a7eb22 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -213,6 +213,7 @@ struct tty_driver { #define SYSTEM_TYPE_TTY 0x0001 #define SYSTEM_TYPE_CONSOLE 0x0002 #define SYSTEM_TYPE_SYSCONS 0x0003 +#define SYSTEM_TYPE_SYSPTMX 0x0004 /* pty subtypes (magic, used by tty_io.c) */ #define PTY_TYPE_MASTER 0x0001 diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 25420e1b1..78b336416 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -8,6 +8,14 @@ * * Clean swab support by Fare <rideau@ens.fr> * just hope no one is using NNUUXXI on __?64 structure elements + * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl> + * + * 4.4BSD (FreeBSD) support added on February 1st 1998 by + * Niels Kristian Bech Jensen <nkbj@image.dk> partially based + * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>. + * + * NeXTstep support added on February 5th 1998 by + * Niels Kristian Bech Jensen <nkbj@image.dk>. */ #ifndef __LINUX_UFS_FS_H @@ -48,13 +56,45 @@ #define UFS_FSACTIVE ((char)0x00) #define UFS_FSCLEAN ((char)0x01) #define UFS_FSSTABLE ((char)0x02) +#define UFS_FSOSF1 ((char)0x03) /* is this correct for DEC OSF/1? */ #define UFS_FSBAD ((char)0xff) -/* Flags for ufs_sb_info */ -#define UFS_DEBUG 0x00000001 -#define UFS_DEBUG_INODE 0x00000002 -#define UFS_DEBUG_NAMEI 0x00000004 -#define UFS_DEBUG_LINKS 0x00000008 +/* From here to next blank line, s_flags for ufs_sb_info */ +/* endianness */ +#define UFS_BYTESEX 0x00000001 /* mask; leave room to 0xF */ +#define UFS_LITTLE_ENDIAN 0x00000000 +#define UFS_BIG_ENDIAN 0x00000001 +/* directory entry encoding */ +#define UFS_DE_MASK 0x00000010 /* mask for the following */ +#define UFS_DE_OLD 0x00000000 +#define UFS_DE_44BSD 0x00000010 +/* uid encoding */ +#define UFS_UID_MASK 0x00000060 /* mask for the following */ +#define UFS_UID_OLD 0x00000000 +#define UFS_UID_44BSD 0x00000020 +#define UFS_UID_EFT 0x00000040 +/* superblock state encoding */ +#define UFS_ST_MASK 0x00000700 /* mask for the following */ +#define UFS_ST_OLD 0x00000000 +#define UFS_ST_44BSD 0x00000100 +#define UFS_ST_SUN 0x00000200 +#define UFS_ST_NEXT 0x00000400 +/* filesystem flavors (combo of features) */ +#define UFS_FEATURES 0x00FFFFF0 /* room for extension */ +#define UFS_VANILLA 0x00000000 +#define UFS_OLD 0x00000000 /* 4.2BSD */ +#define UFS_44BSD 0x00000130 +#define UFS_HURD 0x00000130 +#define UFS_SUN 0x00000200 +#define UFS_NEXT 0x00000400 +/* we preserve distinction in flavor identification even without difference, + * because yet-to-be-supported features may introduce difference in the future + */ +/* last but not least, debug flags */ +#define UFS_DEBUG 0x01000000 +#define UFS_DEBUG_INODE 0x02000000 +#define UFS_DEBUG_NAMEI 0x04000000 +#define UFS_DEBUG_LINKS 0x08000000 #ifdef UFS_HEAVY_DEBUG # define UFS_DEBUG_INITIAL UFS_DEBUG @@ -62,10 +102,9 @@ # define UFS_DEBUG_INITIAL 0 #endif -/* (!) HERE WE ASSUME EITHER BIG OR LITTLE ENDIAN UFSes */ -#define UFS_LITTLE_ENDIAN 0x00000000 /* 0x00010000 */ -#define UFS_BIG_ENDIAN 0x00010000 /* 0x00020000 */ -#define UFS_BYTESEX 0x00010000 /* 0x00030000 */ +/* fs_inodefmt options */ +#define UFS_42INODEFMT -1 +#define UFS_44INODEFMT 2 #define UFS_ADDR_PER_BLOCK(sb) ((sb)->u.ufs_sb.s_bsize >> 2) #define UFS_ADDR_PER_BLOCK_BITS(sb) ((sb)->u.ufs_sb.s_bshift - 2) @@ -86,17 +125,34 @@ /* XXX - this can be optimized if s_ipg is a power of 2. */ #define ufs_ino2cg(inode) ((inode)->i_ino/(inode)->i_sb->u.ufs_sb.s_ipg) +/* current filesystem state; method depends on flags */ +#define UFS_STATE(usb) \ + ( ((flags&UFS_ST_MASK) == UFS_ST_OLD) \ + ? (usb)->fs_u.fs_sun.fs_state /* old normal way */ \ + : (usb)->fs_u.fs_44.fs_state /* 4.4BSD way */ ) + #define UFS_MAXNAMLEN 255 #define ufs_lbn(sb, block) ((block) >> (sb)->u.ufs_sb.s_lshift) #define ufs_boff(sb, block) ((block) & ~((sb)->u.ufs_sb.s_lmask)) #define ufs_dbn(sb, block, boff) ((block) + ufs_boff((sb), (boff))) +struct ufs_timeval { + __s32 tv_sec; + __s32 tv_usec; +}; + struct ufs_direct { __u32 d_ino; /* inode number of this entry */ __u16 d_reclen; /* length of this entry */ - __u16 d_namlen; /* actual length of d_name */ - char d_name[UFS_MAXNAMLEN + 1]; /* file name */ + union { + __u16 d_namlen; /* actual length of d_name */ + struct { + __u8 d_type; /* file type */ + __u8 d_namlen; /* length of string in d_name */ + } d_44; + } d_u; + __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */ }; #define MAXMNTLEN 512 @@ -184,13 +240,27 @@ struct ufs_superblock { __u8 fs_fsmnt[MAXMNTLEN]; /* name mounted on */ /* these fields retain the current block allocation info */ __u32 fs_cgrotor; /* last cg searched */ - struct ufs_csum * fs_csp[MAXCSBUFS]; /* list of fs_cs info buffers */ + __u32 fs_csp[MAXCSBUFS]; /* list of fs_cs info buffers */ __u32 fs_cpc; /* cyl per cycle in postbl */ __u16 fs_opostbl[16][8]; /* old rotation block list head */ - __s32 fs_sparecon[55]; /* reserved for future constants */ - __s32 fs_state; /* file system state time stamp */ - __s64 fs_qbmask; /* ~usb_bmask */ - __s64 fs_qfmask; /* ~usb_fmask */ + union { + struct { + __s32 fs_sparecon[55];/* reserved for future constants */ + __s32 fs_state; /* file system state time stamp */ + __u32 fs_qbmask[2]; /* ~usb_bmask */ + __u32 fs_qfmask[2]; /* ~usb_fmask */ + } fs_sun; + struct { + __s32 fs_sparecon[50];/* reserved for future constants */ + __s32 fs_contigsumsize;/* size of cluster summary array */ + __s32 fs_maxsymlinklen;/* max length of an internal symlink */ + __s32 fs_inodefmt; /* format of on-disk inodes */ + __u64 fs_maxfilesize; /* max representable file size */ + __u32 fs_qbmask[2]; /* ~usb_bmask */ + __u32 fs_qfmask[2]; /* ~usb_fmask */ + __s32 fs_state; /* file system state time stamp */ + } fs_44; + } fs_u; __s32 fs_postblformat; /* format of positional layout tables */ __s32 fs_nrpos; /* number of rotational positions */ __s32 fs_postbloff; /* (__s16) rotation block list head */ @@ -205,24 +275,66 @@ struct ufs_superblock { struct ufs_inode { __u16 ui_mode; /* 0x0 */ __u16 ui_nlink; /* 0x2 */ - __u16 ui_suid; /* 0x4 */ - __u16 ui_sgid; /* 0x6 */ + union { + struct { + __u16 suid; /* 0x4 */ + __u16 sgid; /* 0x6 */ + } oldids; + __u32 inumber; /* 0x4 lsf: inode number */ + __u32 author; /* 0x4 GNU HURD: author */ + } ui_u1; __u64 ui_size; /* 0x8 */ - struct timeval ui_atime; /* 0x10 access */ - struct timeval ui_mtime; /* 0x18 modification */ - struct timeval ui_ctime; /* 0x20 creation */ - __u32 ui_db[UFS_NDADDR]; /* 0x28 data blocks */ - __u32 ui_ib[UFS_NINDIR]; /* 0x58 indirect blocks */ - __u32 ui_flags; /* 0x64 unused -- "status flags (chflags)" ??? */ + struct ufs_timeval ui_atime; /* 0x10 access */ + struct ufs_timeval ui_mtime; /* 0x18 modification */ + struct ufs_timeval ui_ctime; /* 0x20 creation */ + union { + struct { + __u32 ui_db[UFS_NDADDR];/* 0x28 data blocks */ + __u32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */ + } ui_addr; + __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */ + } ui_u2; + __u32 ui_flags; /* 0x64 immutable, append-only... */ __u32 ui_blocks; /* 0x68 blocks in use */ - __u32 ui_gen; /* 0x6c generation number XXX - what is this? */ - __u32 ui_shadow; /* 0x70 shadow inode XXX - what is this?*/ - __u32 ui_uid; /* 0x74 long EFT version of uid */ - __u32 ui_gid; /* 0x78 long EFT version of gid */ - __u32 ui_oeftflag; /* 0x7c reserved */ + __u32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */ + union { + struct { + __u32 ui_shadow;/* 0x70 shadow inode with security data */ + __u32 ui_uid; /* 0x74 long EFT version of uid */ + __u32 ui_gid; /* 0x78 long EFT version of gid */ + __u32 ui_oeftflag;/* 0x7c reserved */ + } ui_sun; + struct { + __u32 ui_uid; /* 0x70 File owner */ + __u32 ui_gid; /* 0x74 File group */ + __s32 ui_spare[2];/* 0x78 reserved */ + } ui_44; + struct { + __u32 ui_uid; /* 0x70 */ + __u32 ui_gid; /* 0x74 */ + __u16 ui_modeh;/* 0x78 mode high bits */ + __u16 ui_spare;/* 0x7A unused */ + __u32 ui_trans;/* 0x7c filesystem translator */ + } ui_hurd; + } ui_u3; }; - +/* FreeBSD has these in sys/stat.h */ +/* ui_flags that can be set by a file owner */ +#define UFS_UF_SETTABLE 0x0000ffff +#define UFS_UF_NODUMP 0x00000001 /* do not dump */ +#define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */ +#define UFS_UF_APPEND 0x00000004 /* append-only */ +#define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */ +#define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */ +/* ui_flags that only root can set */ +#define UFS_SF_SETTABLE 0xffff0000 +#define UFS_SF_ARCHIVED 0x00010000 /* archived */ +#define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */ +#define UFS_SF_APPEND 0x00040000 /* append-only */ +#define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */ + + #ifdef __KERNEL__ /* * Function prototypes diff --git a/include/linux/ufs_fs_i.h b/include/linux/ufs_fs_i.h index f10b36d91..31611830b 100644 --- a/include/linux/ufs_fs_i.h +++ b/include/linux/ufs_fs_i.h @@ -6,15 +6,18 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_fs_i.h,v 1.2 1996/05/03 04:02:25 davem Exp $ - * + * NeXTstep support added on February 5th 1998 by + * Niels Kristian Bech Jensen <nkbj@image.dk>. */ #ifndef _LINUX_UFS_FS_I_H #define _LINUX_UFS_FS_I_H struct ufs_inode_info { - __u32 i_data[15]; + union { + __u32 i_data[15]; + __u8 i_symlink[4*15]; /* fast symlink */ + } i_u1; __u64 i_size; __u32 i_flags; __u32 i_gen; diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h index da56276a2..1469f659f 100644 --- a/include/linux/ufs_fs_sb.h +++ b/include/linux/ufs_fs_sb.h @@ -6,8 +6,8 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_fs_sb.h,v 1.6 1996/06/01 15:31:08 ecd Exp $ - * + * NeXTstep support added on February 5th 1998 by + * Niels Kristian Bech Jensen <nkbj@image.dk>. */ #ifndef __LINUX_UFS_FS_SB_H @@ -35,6 +35,7 @@ struct ufs_sb_info { __u32 s_lshift; __u32 s_lmask; __u32 s_fsfrag; + __u32 s_blockbase; /* offset of NeXTstep superblock */ }; #endif /* __LINUX_UFS_FS_SB_H */ diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h index b25f0c31e..730517cef 100644 --- a/include/linux/umsdos_fs.h +++ b/include/linux/umsdos_fs.h @@ -4,6 +4,8 @@ #define UMSDOS_VERSION 0 #define UMSDOS_RELEASE 4 +#define UMSDOS_ROOT_INO 1 + /* This is the file acting as a directory extension */ #define UMSDOS_EMD_FILE "--linux-.---" #define UMSDOS_EMD_NAMELEN 12 @@ -20,32 +22,34 @@ #include <linux/ioctl.h> #endif + struct umsdos_fake_info { - char fname[13]; - int len; + char fname[13]; + int len; }; #define UMSDOS_MAXNAME 220 /* This structure is 256 bytes large, depending on the name, only part */ /* of it is written to disk */ +/* nice though it would be, I can't change this and preserve backward compatibility */ struct umsdos_dirent { - unsigned char name_len; /* if == 0, then this entry is not used */ - unsigned char flags; /* UMSDOS_xxxx */ - unsigned short nlink; /* How many hard links point to this entry */ - uid_t uid; /* Owner user id */ - gid_t gid; /* Group id */ - time_t atime; /* Access time */ - time_t mtime; /* Last modification time */ - time_t ctime; /* Creation time */ - dev_t rdev; /* major and minor number of a device */ - /* special file */ - umode_t mode; /* Standard UNIX permissions bits + type of */ - char spare[12]; /* unused bytes for future extensions */ - /* file, see linux/stat.h */ - char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */ - /* but '\0' padded, so it will allow */ - /* for adding news fields in this record */ - /* by reducing the size of name[] */ + unsigned char name_len; /* if == 0, then this entry is not used */ + unsigned char flags; /* UMSDOS_xxxx */ + unsigned short nlink; /* How many hard links point to this entry */ + uid_t uid; /* Owner user id */ + gid_t gid; /* Group id */ + time_t atime; /* Access time */ + time_t mtime; /* Last modification time */ + time_t ctime; /* Creation time */ + dev_t rdev; /* major and minor number of a device */ + /* special file */ + umode_t mode; /* Standard UNIX permissions bits + type of */ + char spare[12]; /* unused bytes for future extensions */ + /* file, see linux/stat.h */ + char name[UMSDOS_MAXNAME]; /* Not '\0' terminated */ + /* but '\0' padded, so it will allow */ + /* for adding news fields in this record */ + /* by reducing the size of name[] */ }; #define UMSDOS_HIDDEN 1 /* Never show this entry in directory search */ #define UMSDOS_HLINK 2 /* It is a (pseudo) hard link */ @@ -58,15 +62,16 @@ struct umsdos_dirent { #define UMSDOS_REC_SIZE 64 /* Translation between MSDOS name and UMSDOS name */ + struct umsdos_info{ - int msdos_reject; /* Tell if the file name is invalid for MSDOS */ - /* See umsdos_parse */ - struct umsdos_fake_info fake; - struct umsdos_dirent entry; - off_t f_pos; /* offset of the entry in the EMD file */ - /* or offset where the entry may be store */ - /* if it is a new entry */ - int recsize; /* Record size needed to store entry */ + int msdos_reject; /* Tell if the file name is invalid for MSDOS */ + /* See umsdos_parse */ + struct umsdos_fake_info fake; + struct umsdos_dirent entry; + off_t f_pos; /* offset of the entry in the EMD file */ + /* or offset where the entry may be store */ + /* if it is a new entry */ + int recsize; /* Record size needed to store entry */ }; /* Definitions for ioctl (number randomly chosen) */ @@ -88,38 +93,39 @@ struct umsdos_info{ #define UMSDOS_RENAME_DOS _IO(0x04,220) /* rename a file/directory in the DOS */ /* directory only */ struct umsdos_ioctl{ - struct dirent dos_dirent; - struct umsdos_dirent umsdos_dirent; - /* The following structure is used to exchange some data */ - /* with utilities (umsdos_progs/util/umsdosio.c). The first */ - /* releases were using struct stat from "sys/stat.h". This was */ - /* causing some problem for cross compilation of the kernel */ - /* Since I am not really using the structure stat, but only some field */ - /* of it, I have decided to replicate the structure here */ - /* for compatibility with the binaries out there */ - struct { - dev_t st_dev; - unsigned short __pad1; - ino_t st_ino; - umode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - unsigned short __pad2; - off_t st_size; - unsigned long st_blksize; - unsigned long st_blocks; - time_t st_atime; - unsigned long __unused1; - time_t st_mtime; - unsigned long __unused2; - time_t st_ctime; - unsigned long __unused3; - unsigned long __unused4; - unsigned long __unused5; - }stat; - char version,release; + struct dirent dos_dirent; + struct umsdos_dirent umsdos_dirent; + /* The following structure is used to exchange some data */ + /* with utilities (umsdos_progs/util/umsdosio.c). The first */ + /* releases were using struct stat from "sys/stat.h". This was */ + /* causing some problem for cross compilation of the kernel */ + /* Since I am not really using the structure stat, but only some field */ + /* of it, I have decided to replicate the structure here */ + /* for compatibility with the binaries out there */ + /* FIXME PTW 1998, this has probably changed */ + struct { + dev_t st_dev; + unsigned short __pad1; + ino_t st_ino; + umode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + unsigned short __pad2; + off_t st_size; + unsigned long st_blksize; + unsigned long st_blocks; + time_t st_atime; + unsigned long __unused1; + time_t st_mtime; + unsigned long __unused2; + time_t st_ctime; + unsigned long __unused3; + unsigned long __unused4; + unsigned long __unused5; + }stat; + char version,release; }; /* Different macros to access struct umsdos_dirent */ diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p index f271694c5..62ce67d0c 100644 --- a/include/linux/umsdos_fs.p +++ b/include/linux/umsdos_fs.p @@ -1,10 +1,18 @@ /* check.c 23/01/95 03.38.30 */ void check_page_tables (void); /* dir.c 22/06/95 00.22.12 */ -long UMSDOS_dir_read (struct inode *inode, - struct file *filp, +struct dentry *creat_dentry (const char *name, + const int len, + struct inode *inode); +int compat_msdos_create(struct inode *dir, + const char *name, + int len, + int mode, + struct inode **inode); +int UMSDOS_dir_read ( struct file *filp, char *buf, - unsigned long count); + size_t size, + loff_t *count); void umsdos_lookup_patch (struct inode *dir, struct inode *inode, struct umsdos_dirent *entry, @@ -13,29 +21,35 @@ int umsdos_inode2entry (struct inode *dir, struct inode *inode, struct umsdos_dirent *entry); int umsdos_locate_path (struct inode *inode, char *path); -int umsdos_is_pseudodos (struct inode *dir, const char *name, int len); -int UMSDOS_lookup (struct inode *dir, - const char *name, - int len, - struct inode **result); +int umsdos_is_pseudodos (struct inode *dir, struct dentry *dentry); +int umsdos_lookup_x ( + struct inode *dir, + struct dentry *dentry, + int nopseudo); +int UMSDOS_lookup(struct inode *dir,struct dentry *dentry); + int umsdos_hlink2inode (struct inode *hlink, struct inode **result); /* emd.c 22/06/95 00.22.04 */ -long umsdos_file_read_kmem (struct inode *inode, +ssize_t umsdos_file_read_kmem (struct inode *emd_dir, struct file *filp, char *buf, - unsigned long count); -long umsdos_file_write_kmem (struct inode *inode, + size_t count, + loff_t *offs); +ssize_t umsdos_file_write_kmem (struct inode *emd_dir, struct file *filp, const char *buf, - unsigned long count); -long umsdos_emd_dir_write (struct inode *emd_dir, + size_t count, + loff_t *offs); +ssize_t umsdos_emd_dir_write (struct inode *emd_dir, struct file *filp, char *buf, - unsigned long count); -long umsdos_emd_dir_read (struct inode *emd_dir, + size_t count, + loff_t *offs); +ssize_t umsdos_emd_dir_read (struct inode *emd_dir, struct file *filp, char *buf, - unsigned long count); + size_t count, + loff_t *loffs); struct inode *umsdos_emd_dir_lookup (struct inode *dir, int creat); int umsdos_emd_dir_readentry (struct inode *emd_dir, struct file *filp, @@ -57,13 +71,14 @@ int umsdos_findentry (struct inode *dir, /* inode.c 12/06/95 09.49.40 */ void UMSDOS_put_inode (struct inode *inode); void UMSDOS_put_super (struct super_block *sb); -void UMSDOS_statfs (struct super_block *sb, +int UMSDOS_statfs (struct super_block *sb, struct statfs *buf, int bufsiz); -int umsdos_real_lookup (struct inode *dir, +int compat_umsdos_real_lookup (struct inode *dir, const char *name, int len, struct inode **result); +int umsdos_real_lookup(struct inode *inode,struct dentry *dentry); void umsdos_setup_dir_inode (struct inode *inode); void umsdos_set_dirinfo (struct inode *inode, struct inode *dir, @@ -75,7 +90,7 @@ void umsdos_patch_inode (struct inode *inode, int umsdos_get_dirowner (struct inode *inode, struct inode **result); void UMSDOS_read_inode (struct inode *inode); void UMSDOS_write_inode (struct inode *inode); -int UMSDOS_notify_change (struct inode *inode, struct iattr *attr); +int UMSDOS_notify_change (struct dentry *dentry, struct iattr *attr); struct super_block *UMSDOS_read_super (struct super_block *s, void *data, int silent); @@ -87,50 +102,40 @@ int UMSDOS_ioctl_dir (struct inode *dir, /* mangle.c 25/01/95 02.25.38 */ void umsdos_manglename (struct umsdos_info *info); int umsdos_evalrecsize (int len); -int umsdos_parse (const char *fname, int len, struct umsdos_info *info); +int umsdos_parse (const char *name,int len, struct umsdos_info *info); /* namei.c 25/01/95 02.25.38 */ void umsdos_lockcreate (struct inode *dir); void umsdos_startlookup (struct inode *dir); void umsdos_unlockcreate (struct inode *dir); void umsdos_endlookup (struct inode *dir); + int UMSDOS_symlink (struct inode *dir, - const char *name, - int len, - const char *symname); -int UMSDOS_link (struct inode *oldinode, - struct inode *dir, - const char *name, - int len); + struct dentry *dentry, + const char *symname); +int UMSDOS_link (struct dentry *olddentry, + struct inode *dir, + struct dentry *dentry); int UMSDOS_create (struct inode *dir, - const char *name, - int len, - int mode, - struct inode **result); + struct dentry *dentry, + int mode); + int UMSDOS_mkdir (struct inode *dir, - const char *name, - int len, - int mode); + struct dentry *dentry, + int mode); int UMSDOS_mknod (struct inode *dir, - const char *name, - int len, - int mode, - int rdev); -int UMSDOS_rmdir (struct inode *dir, const char *name, int len); -int UMSDOS_unlink (struct inode *dir, const char *name, int len); + struct dentry *dentry, + int mode, + int rdev); +int UMSDOS_rmdir (struct inode *dir,struct dentry *dentry); +int UMSDOS_unlink (struct inode *dir, struct dentry *dentry); int UMSDOS_rename (struct inode *old_dir, - const char *old_name, - int old_len, - struct inode *new_dir, - const char *new_name, - int new_len); + struct dentry *old_dentry, + struct inode *new_dir, + struct dentry *new_dentry); /* rdir.c 22/03/95 03.31.42 */ int umsdos_rlookup_x (struct inode *dir, - const char *name, - int len, - struct inode **result, + struct dentry *dentry, int nopseudo); int UMSDOS_rlookup (struct inode *dir, - const char *name, - int len, - struct inode **result); + struct dentry *dentry); /* symlink.c 23/01/95 03.38.30 */ diff --git a/include/linux/uts.h b/include/linux/uts.h new file mode 100644 index 000000000..39e09ae10 --- /dev/null +++ b/include/linux/uts.h @@ -0,0 +1,23 @@ +#ifndef _LINUX_UTS_H +#define _LINUX_UTS_H + +/* + * Defines for what uname() should return + */ +#ifndef UTS_SYSNAME +#define UTS_SYSNAME "Linux" +#endif + +#ifndef UTS_MACHINE +#define UTS_MACHINE "unknown" +#endif + +#ifndef UTS_NODENAME +#define UTS_NODENAME "(none)" /* set by sethostname() */ +#endif + +#ifndef UTS_DOMAINNAME +#define UTS_DOMAINNAME "(none)" /* set by setdomainname() */ +#endif + +#endif diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 4cf4d241f..064ee9d06 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -110,6 +110,7 @@ struct video_audio #define VIDEO_AUDIO_VOLUME 4 #define VIDEO_AUDIO_BASS 8 #define VIDEO_AUDIO_TREBLE 16 + char name[16]; }; struct video_clip @@ -158,14 +159,28 @@ struct video_key #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ #define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ -#define VIDIOCGFREQ _IOR('v',15, unsigned long) /* Set tuner */ +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ + + #define VID_HARDWARE_BT848 1 #define VID_HARDWARE_QCAM_BW 2 #define VID_HARDWARE_PMS 3 +#define VID_HARDWARE_QCAM_C 4 + +/* + * Initialiser list + */ + +struct video_init +{ + char *name; + int (*init)(struct video_init *); +}; #endif diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 922a76961..aa3cb84a3 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -3,6 +3,7 @@ * User-level API definitions. * * Author: Gene Kozin <genek@compuserve.com> +* Jaspreet Singh <jaspreet@sangoma.com> * * Copyright: (c) 1995-1997 Sangoma Technologies Inc. * @@ -11,6 +12,15 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ +* Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added +* 'devs_struct','dev_to_devtint_next' to 'sdla_t' +* Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count', +* 'irq_dis_poll_count' to 'sdla_t'. +* Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE' +* Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and +* 'dlci_intr_mode_unbusy' to 'sdla_t' +* Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver +* statistics. * Jan 15, 1997 Gene Kozin Version 3.1.0 * o added UDP management stuff * Jan 02, 1997 Gene Kozin Version 3.0.0 @@ -61,6 +71,46 @@ typedef struct wum_header unsigned char reserved[6]; /* 0Ah: reserved */ } wum_header_t; +/************************************************************************* + Data Structure for global statistics +*************************************************************************/ + +typedef struct global_stats +{ + unsigned long isr_entry; + unsigned long isr_already_critical; + unsigned long isr_rx; + unsigned long isr_tx; + unsigned long isr_intr_test; + unsigned long isr_spurious; + unsigned long isr_enable_tx_int; + unsigned long rx_intr_corrupt_rx_bfr; + unsigned long rx_intr_on_orphaned_DLCI; + unsigned long rx_intr_dev_not_started; + unsigned long tx_intr_dev_not_started; + unsigned long poll_entry; + unsigned long poll_already_critical; + unsigned long poll_processed; + unsigned long poll_tbusy_bad_status; + unsigned long poll_host_disable_irq; + unsigned long poll_host_enable_irq; + +} global_stats_t; + +/* This structure is used for maitaining a circular linked list of all + * interfaces(devices) per card. It is used in the Interrupt Service routine + * for a transmit interrupt where the start of the loop to dev_tint all + * interfaces changes. + */ +typedef struct load_sharing +{ + struct device* dev_ptr; + struct load_sharing* next; +} load_sharing_t; + +/* This is used for interrupt testing */ +#define INTR_TEST_MODE 0x02 + #define WUM_SIGNATURE_L 0x50495046 #define WUM_SIGNATURE_H 0x444E3845 @@ -100,8 +150,21 @@ typedef struct sdla wan_device_t wandev; /* WAN device data space */ unsigned open_cnt; /* number of open interfaces */ unsigned long state_tick; /* link state timestamp */ -/* unsigned tx_int_enabled; */ /* tranmit interrupt enabled or not */ + unsigned intr_mode; /* Type of Interrupt Mode */ char in_isr; /* interrupt-in-service flag */ + char buff_int_mode_unbusy; /* flag for carrying out dev_tint */ + char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */ + unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/ + unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/ + global_stats_t statistics; /* global statistics */ + + /* The following is used as a pointer to the structure in our + circular linked list which changes the start of the loop for + dev_tint of all interfaces */ + + load_sharing_t* dev_to_devtint_next; + load_sharing_t* devs_struct; + void* mbox; /* -> mailbox */ void* rxmb; /* -> receive mailbox */ void* flags; /* -> adapter status flags */ @@ -123,7 +186,7 @@ typedef struct sdla void* rxmb_last; /* -> last Rx buffer */ unsigned rx_base; /* S508 receive buffer base */ unsigned rx_top; /* S508 receive buffer end */ - unsigned short node_dlci; + unsigned short node_dlci[100]; unsigned short dlci_num; } f; struct /****** PPP-specific data ***********/ diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index accb9c9ee..8bdba9cad 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -4,6 +4,7 @@ * Drivers and is completely hardware-independent. * * Author: Gene Kozin <genek@compuserve.com> +* Jaspreet Singh <jaspreet@sangoma.com> * * Copyright: (c) 1995-1997 Sangoma Technologies Inc. * @@ -12,7 +13,16 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * ============================================================================ -* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' tp 'wan_device_t' +* 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. +* 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 +* Jul 07, 1997 Jaspreet Singh Added 'ttl' to 'wandev_conf_t' & 'wan_device_t' +* May 29, 1997 Jaspreet Singh Added 'tx_int_enabled' to 'wan_device_t' * May 21, 1997 Jaspreet Singh Added 'udp_port' to 'wan_device_t' * Apr 25, 1997 Farhan Thawar Added 'udp_port' to 'wandev_conf_t' * Jan 16, 1997 Gene Kozin router_devlist made public @@ -23,7 +33,7 @@ #define ROUTER_NAME "wanrouter" /* in case we ever change it */ #define ROUTER_VERSION 1 /* version number */ -#define ROUTER_RELEASE 0 /* release (minor version) number */ +#define ROUTER_RELEASE 1 /* release (minor version) number */ #define ROUTER_IOCTL 'W' /* for IOCTL calls */ #define ROUTER_MAGIC 0x524D4157L /* signature: 'WANR' reversed */ @@ -53,6 +63,27 @@ enum router_ioctls #define WAN_DRVNAME_SZ 15 /* max length of the link driver name */ #define WAN_ADDRESS_SZ 31 /* max length of the WAN media address */ +/* Defines for UDP PACKET TYPE */ +#define UDP_PTPIPE_TYPE 0x01 +#define UDP_FPIPE_TYPE 0x02 +#define UDP_DRVSTATS_TYPE 0x03 +#define UDP_INVALID_TYPE 0x04 + +/* Command return code */ +#define CMD_OK 0 /* normal firmware return code */ +#define CMD_TIMEOUT 0xFF /* firmware command timed out */ + +/* UDP Packet Management */ +#define UDP_PKT_FRM_STACK 0x00 +#define UDP_PKT_FRM_NETWORK 0x01 + +/* Maximum interrupt test counter */ +#define MAX_INTR_TEST_COUNTER 100 + +/* Critical Values for RACE conditions*/ +#define CRITICAL_IN_ISR 0xA1 +#define CRITICAL_INTR_HANDLED 0xB1 + /****** Data Types **********************************************************/ /*---------------------------------------------------------------------------- @@ -87,15 +118,14 @@ typedef struct wan_x25_conf */ typedef struct wan_fr_conf { - unsigned cir; /* committed information rate */ unsigned signalling; /* local in-channel signalling type */ unsigned t391; /* link integrity verification timer */ unsigned t392; /* polling verification timer */ unsigned n391; /* full status polling cycle counter */ unsigned n392; /* error threshold counter */ unsigned n393; /* monitored events counter */ - unsigned dlci; /* first DLC number (access node) */ unsigned dlci_num; /* number of DLCs (access node) */ + unsigned dlci[100]; /* List of all DLCIs */ } wan_fr_conf_t; /*---------------------------------------------------------------------------- @@ -133,12 +163,15 @@ typedef struct wandev_conf unsigned bps; /* data transfer rate */ unsigned mtu; /* maximum transmit unit size */ unsigned udp_port; /* UDP port for management */ + unsigned char ttl; /* Time To Live for UDP security */ char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ char station; /* DTE/DCE, primary/secondary, etc. */ char connection; /* permanent/switched/on-demand */ unsigned hw_opt[4]; /* other hardware options */ + unsigned char enable_IPX; /* Enable or Disable IPX */ + unsigned long network_number; /* Network Number for IPX */ unsigned reserved[4]; /****** arbitrary data ***************/ unsigned data_size; /* data buffer size */ @@ -261,6 +294,10 @@ typedef struct wanif_conf char addr[WAN_ADDRESS_SZ+1]; /* media address, ASCIIZ */ unsigned idle_timeout; /* sec, before disconnecting */ unsigned hold_timeout; /* sec, before re-connecting */ + unsigned cir; /* Committed Information Rate fwd,bwd*/ + unsigned bc; /* Committed Burst Size fwd, bwd */ + unsigned be; /* Excess Burst Size fwd, bwd */ + char mc; /* Multicast on or off */ int reserved[8]; /* reserved for future extensions */ } wanif_conf_t; @@ -289,13 +326,16 @@ typedef struct wan_device unsigned bps; /* data transfer rate */ unsigned mtu; /* max physical transmit unit size */ unsigned udp_port; /* UDP port for management */ - unsigned tx_int_enabled; /* Transmit Interrupt enabled or not */ + unsigned char ttl; /* Time To Live for UDP security */ + unsigned enable_tx_int; /* Transmit Interrupt enabled or not */ char interface; /* RS-232/V.35, etc. */ char clocking; /* external/internal */ char line_coding; /* NRZ/NRZI/FM0/FM1, etc. */ char station; /* DTE/DCE, primary/secondary, etc. */ char connection; /* permanent/switched/on-demand */ unsigned hw_opt[4]; /* other hardware options */ + unsigned char enable_IPX; /* Enable or Disable IPX */ + unsigned long network_number; /* Network Number for IPX */ /****** status and statistics *******/ char state; /* device state */ unsigned modem_status; /* modem status */ diff --git a/include/linux/wireless.h b/include/linux/wireless.h index b15f2a0db..0c2e9fb2a 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h @@ -213,7 +213,7 @@ struct iw_encoding struct iw_statistics { __u8 status; /* Status - * - device dependant for now */ + * - device dependent for now */ struct iw_quality qual; /* Quality of the link * (instant/mean/max) */ |