diff options
Diffstat (limited to 'include/linux')
73 files changed, 1155 insertions, 449 deletions
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index f4468611e..84d6387d5 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -142,6 +142,7 @@ struct ac97_codec { char *name; int id; int dev_mixer; + int type; /* codec specific init/reset routines, used mainly for 4 or 6 channel support */ int (*codec_init) (struct ac97_codec *codec); @@ -158,7 +159,9 @@ struct ac97_codec { int supported_mixers; int stereo_mixers; int record_sources; - + + int bit_resolution; + /* OSS mixer interface */ int (*read_mixer) (struct ac97_codec *codec, int oss_channel); void (*write_mixer)(struct ac97_codec *codec, int oss_channel, diff --git a/include/linux/adb.h b/include/linux/adb.h index 639a6535d..e2af8f33c 100644 --- a/include/linux/adb.h +++ b/include/linux/adb.h @@ -58,7 +58,6 @@ struct adb_driver { int (*probe)(void); int (*init)(void); int (*send_request)(struct adb_request *req, int sync); - /*int (*write)(struct adb_request *req);*/ int (*autopoll)(int devs); void (*poll)(void); int (*reset_bus)(void); @@ -83,6 +82,7 @@ int adb_request(struct adb_request *req, void (*done)(struct adb_request *), int flags, int nbytes, ...); int adb_register(int default_id,int handler_id,struct adb_ids *ids, void (*handler)(unsigned char *, int, struct pt_regs *, int)); +int adb_unregister(int index); void adb_poll(void); void adb_input(unsigned char *, int, struct pt_regs *, int); int adb_reset_bus(void); diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index c881f0fd6..43add21b5 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h @@ -46,7 +46,7 @@ struct adfs_discrecord { * 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) +static inline int adfs_checkbblk(unsigned char *ptr) { unsigned int result = 0; unsigned char *p = ptr + 511; diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index dd88e8a80..3c37d0538 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h @@ -340,7 +340,6 @@ void arcnet_rfc1051_init(void); void arcnet_raw_init(void); int com90xx_probe(struct net_device *dev); -void com20020pci_probe_all(void); #endif /* __KERNEL__ */ diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 5b1dafc17..5c2c0c355 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h @@ -161,7 +161,7 @@ extern void aarp_proto_init(void); * Give a device find its atif control structure */ -extern __inline__ struct atalk_iface *atalk_find_dev(struct net_device *dev) +static inline struct atalk_iface *atalk_find_dev(struct net_device *dev) { return dev->atalk_ptr; } diff --git a/include/linux/blk.h b/include/linux/blk.h index 778617529..66bbdcf60 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -308,7 +308,7 @@ static void floppy_off(unsigned int nr); #elif (MAJOR_NR == I2O_MAJOR) #define DEVICE_NAME "I2O block" -#define DEVICE_REQUEST do_i2ob_request +#define DEVICE_REQUEST i2ob_request #define DEVICE_NR(device) (MINOR(device)>>4) #elif (MAJOR_NR == COMPAQ_SMART2_MAJOR) diff --git a/include/linux/brlock.h b/include/linux/brlock.h index 2fd39cac9..c805304f1 100644 --- a/include/linux/brlock.h +++ b/include/linux/brlock.h @@ -114,10 +114,23 @@ static inline void br_read_lock (enum brlock_indices idx) lock = &__br_write_locks[idx].lock; again: (*ctr)++; - rmb(); + mb(); if (spin_is_locked(lock)) { (*ctr)--; - rmb(); + wmb(); /* + * The release of the ctr must become visible + * to the other cpus eventually thus wmb(), + * we don't care if spin_is_locked is reordered + * before the releasing of the ctr. + * However IMHO this wmb() is superflous even in theory. + * It would not be superflous only if on the + * other CPUs doing a ldl_l instead of an ldl + * would make a difference and I don't think this is + * the case. + * I'd like to clarify this issue further + * but for now this is a slow path so adding the + * wmb() will keep us on the safe side. + */ while (spin_is_locked(lock)) barrier(); goto again; diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h index 813df46c3..23f1be7d7 100644 --- a/include/linux/byteorder/swab.h +++ b/include/linux/byteorder/swab.h @@ -43,33 +43,33 @@ * provide defaults when no architecture-specific optimization is detected */ #ifndef __arch__swab16 -# define __arch__swab16(x) ___swab16(x) +# define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); }) #endif #ifndef __arch__swab32 -# define __arch__swab32(x) ___swab32(x) +# define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); }) #endif #ifndef __arch__swab64 -# define __arch__swab64(x) ___swab64(x) +# define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); }) #endif #ifndef __arch__swab16p -# define __arch__swab16p(x) __swab16(*(x)) +# define __arch__swab16p(x) __arch__swab16(*(x)) #endif #ifndef __arch__swab32p -# define __arch__swab32p(x) __swab32(*(x)) +# define __arch__swab32p(x) __arch__swab32(*(x)) #endif #ifndef __arch__swab64p -# define __arch__swab64p(x) __swab64(*(x)) +# define __arch__swab64p(x) __arch__swab64(*(x)) #endif #ifndef __arch__swab16s -# define __arch__swab16s(x) do { *(x) = __swab16p((x)); } while (0) +# define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0) #endif #ifndef __arch__swab32s -# define __arch__swab32s(x) do { *(x) = __swab32p((x)); } while (0) +# define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0) #endif #ifndef __arch__swab64s -# define __arch__swab64s(x) do { *(x) = __swab64p((x)); } while (0) +# define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0) #endif diff --git a/include/linux/capability.h b/include/linux/capability.h index a1e9dc3d4..945fabb5e 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -273,6 +273,10 @@ typedef __u32 kernel_cap_t; #define CAP_MKNOD 27 +/* Allow taking of leases on files */ + +#define CAP_LEASE 28 + #ifdef __KERNEL__ /* * Bounding set diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h new file mode 100644 index 000000000..989549b24 --- /dev/null +++ b/include/linux/cciss_ioctl.h @@ -0,0 +1,186 @@ +#ifndef CCISS_IOCTLH +#define CCISS_IOCTLH + +#include <linux/types.h> +#include <linux/ioctl.h> + +#define CCISS_IOC_MAGIC 'B' + + +typedef struct _cciss_pci_info_struct +{ + unsigned char bus; + unsigned char dev_fn; + __u32 board_id; +} cciss_pci_info_struct; + +typedef struct _cciss_coalint_struct +{ + __u32 delay; + __u32 count; +} cciss_coalint_struct; + +typedef char NodeName_type[16]; + +typedef __u32 Heartbeat_type; + +#define CISS_PARSCSIU2 0x0001 +#define CISS_PARCSCIU3 0x0002 +#define CISS_FIBRE1G 0x0100 +#define CISS_FIBRE2G 0x0200 +typedef __u32 BusTypes_type; + +typedef char FirmwareVer_type[4]; +typedef __u32 DriverVer_type; + + +#ifndef CCISS_CMD_H +// This defines are duplicated in cciss_cmd.h in the driver directory + +//general boundary defintions +#define SENSEINFOBYTES 32//note that this value may vary between host implementations + +//Command Status value +#define CMD_SUCCESS 0x0000 +#define CMD_TARGET_STATUS 0x0001 +#define CMD_DATA_UNDERRUN 0x0002 +#define CMD_DATA_OVERRUN 0x0003 +#define CMD_INVALID 0x0004 +#define CMD_PROTOCOL_ERR 0x0005 +#define CMD_HARDWARE_ERR 0x0006 +#define CMD_CONNECTION_LOST 0x0007 +#define CMD_ABORTED 0x0008 +#define CMD_ABORT_FAILED 0x0009 +#define CMD_UNSOLICITED_ABORT 0x000A +#define CMD_TIMEOUT 0x000B +#define CMD_UNABORTABLE 0x000C + +//transfer direction +#define XFER_NONE 0x00 +#define XFER_WRITE 0x01 +#define XFER_READ 0x02 +#define XFER_RSVD 0x03 + +//task attribute +#define ATTR_UNTAGGED 0x00 +#define ATTR_SIMPLE 0x04 +#define ATTR_HEADOFQUEUE 0x05 +#define ATTR_ORDERED 0x06 +#define ATTR_ACA 0x07 + +//cdb type +#define TYPE_CMD 0x00 +#define TYPE_MSG 0x01 + +// Type defs used in the following structs +#define BYTE __u8 +#define WORD __u16 +#define HWORD __u16 +#define DWORD __u32 + +#define CISS_MAX_LUN 16 + +#pragma pack(1) + +//Command List Structure +typedef union _SCSI3Addr_struct { + struct { + BYTE Bus:6; + BYTE Mode:2; // b00 + BYTE Dev; + } PeripDev; + struct { + BYTE DevMSB:6; + BYTE Mode:2; // b01 + BYTE DevLSB; + } LogDev; + struct { + BYTE Targ:6; + BYTE Mode:2; // b10 + BYTE Dev:5; + BYTE Bus:3; + } LogUnit; +} SCSI3Addr_struct; + +typedef struct _PhysDevAddr_struct { + DWORD TargetId:24; + DWORD Bus:6; + DWORD Mode:2; + SCSI3Addr_struct Target[2]; //2 level target device addr +} PhysDevAddr_struct; + +typedef struct _LogDevAddr_struct { + DWORD VolId:30; + DWORD Mode:2; + BYTE reserved[4]; +} LogDevAddr_struct; + +typedef union _LUNAddr_struct { + BYTE LunAddrBytes[8]; + SCSI3Addr_struct SCSI3Lun[4]; + PhysDevAddr_struct PhysDev; + LogDevAddr_struct LogDev; +} LUNAddr_struct; + +typedef struct _RequestBlock_struct { + BYTE CDBLen; + struct { + BYTE Type:3; + BYTE Attribute:3; + BYTE Direction:2; + } Type; + HWORD Timeout; + BYTE CDB[16]; +} RequestBlock_struct; + +typedef union _MoreErrInfo_struct{ + struct { + BYTE Reserved[3]; + BYTE Type; + DWORD ErrorInfo; + }Common_Info; + struct{ + BYTE Reserved[2]; + BYTE offense_size;//size of offending entry + BYTE offense_num; //byte # of offense 0-base + DWORD offense_value; + }Invalid_Cmd; +}MoreErrInfo_struct; +typedef struct _ErrorInfo_struct { + BYTE ScsiStatus; + BYTE SenseLen; + HWORD CommandStatus; + DWORD ResidualCnt; + MoreErrInfo_struct MoreErrInfo; + BYTE SenseInfo[SENSEINFOBYTES]; +} ErrorInfo_struct; + +#pragma pack() +#endif /* CCISS_CMD_H */ + +typedef struct _IOCTL_Command_struct { + LUNAddr_struct LUN_info; + RequestBlock_struct Request; + ErrorInfo_struct error_info; + WORD buf_size; /* size in bytes of the buf */ + BYTE *buf; +} IOCTL_Command_struct; + + +#define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct) + +#define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct) +#define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct) + +#define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type) +#define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type) + +#define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type) +#define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type) +#define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type) +#define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type) +#define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10) +#define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct) + + +#endif diff --git a/include/linux/coda.h b/include/linux/coda.h index a08558628..d9ab68c35 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -284,7 +284,7 @@ struct coda_statfs { */ #define CODA_ROOT 2 -#define CODA_SYNC 3 +#define CODA_OPEN_BY_FD 3 #define CODA_OPEN 4 #define CODA_CLOSE 5 #define CODA_IOCTL 6 @@ -298,11 +298,9 @@ struct coda_statfs { #define CODA_RENAME 14 #define CODA_MKDIR 15 #define CODA_RMDIR 16 -#define CODA_READDIR 17 #define CODA_SYMLINK 18 #define CODA_READLINK 19 #define CODA_FSYNC 20 -#define CODA_INACTIVE 21 #define CODA_VGET 22 #define CODA_SIGNAL 23 #define CODA_REPLACE 24 /* DOWNCALL */ @@ -315,12 +313,9 @@ struct coda_statfs { #define CODA_RESOLVE 32 #define CODA_REINTEGRATE 33 #define CODA_STATFS 34 -#define CODA_MAKE_CINODE 35 /* DOWNCALL */ -#define CODA_NCALLS 36 +#define CODA_NCALLS 35 -#define DOWNCALL(opcode) \ - ((opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) || \ - opcode == CODA_MAKE_CINODE) +#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) #define VC_MAXDATASIZE 8192 #define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ @@ -328,7 +323,7 @@ struct coda_statfs { #define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int)) -#if 0 +#if 0 #define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */ #define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */ #endif @@ -363,9 +358,6 @@ struct coda_root_in { struct coda_in_hdr in; }; -/* coda_sync: */ -/* Nothing needed for coda_sync */ - /* coda_open: */ struct coda_open_in { struct coda_in_hdr ih; @@ -542,20 +534,6 @@ struct coda_rmdir_out { struct coda_out_hdr out; }; -/* coda_readdir: */ -struct coda_readdir_in { - struct coda_in_hdr ih; - ViceFid VFid; - int count; - int offset; -}; - -struct coda_readdir_out { - struct coda_out_hdr oh; - int size; - caddr_t data; /* Place holder for data. */ -}; - /* coda_symlink: NO_OUT */ struct coda_symlink_in { struct coda_in_hdr ih; @@ -592,12 +570,6 @@ struct coda_fsync_out { struct coda_out_hdr out; }; -/* coda_inactive: NO_OUT */ -struct coda_inactive_in { - struct coda_in_hdr ih; - ViceFid VFid; -}; - /* coda_vget: */ struct coda_vget_in { struct coda_in_hdr ih; @@ -651,38 +623,24 @@ struct coda_purgefid_out { ViceFid CodaFid; }; -struct coda_make_cinode_out { +/* coda_replace: */ +/* CODA_REPLACE is a venus->kernel call */ +struct coda_replace_out { /* coda_replace is a venus->kernel call */ struct coda_out_hdr oh; - ViceFid CodaFid; - struct coda_vattr attr; - int fd; + ViceFid NewFid; + ViceFid OldFid; }; -/* coda_rdwr: */ -struct coda_rdwr_in { +/* coda_open_by_fd: */ +struct coda_open_by_fd_in { struct coda_in_hdr ih; - ViceFid VFid; - int rwflag; - int count; - int offset; - int ioflag; - caddr_t data; /* Place holder for data. */ + ViceFid VFid; + int flags; }; -struct coda_rdwr_out { +struct coda_open_by_fd_out { struct coda_out_hdr oh; - int rwflag; - int count; - caddr_t data; /* Place holder for data. */ -}; - - -/* coda_replace: */ -/* CODA_REPLACE is a venus->kernel call */ -struct coda_replace_out { /* coda_replace is a venus->kernel call */ - struct coda_out_hdr oh; - ViceFid NewFid; - ViceFid OldFid; + int fd; }; /* coda_open_by_path: */ @@ -729,13 +687,11 @@ union inputArgs { struct coda_rename_in coda_rename; struct coda_mkdir_in coda_mkdir; struct coda_rmdir_in coda_rmdir; - struct coda_readdir_in coda_readdir; struct coda_symlink_in coda_symlink; struct coda_readlink_in coda_readlink; struct coda_fsync_in coda_fsync; - struct coda_inactive_in coda_inactive; struct coda_vget_in coda_vget; - struct coda_rdwr_in coda_rdwr; + struct coda_open_by_fd_in coda_open_by_fd; struct coda_open_by_path_in coda_open_by_path; struct coda_statfs_in coda_statfs; }; @@ -749,7 +705,6 @@ union outputArgs { struct coda_lookup_out coda_lookup; struct coda_create_out coda_create; struct coda_mkdir_out coda_mkdir; - struct coda_readdir_out coda_readdir; struct coda_readlink_out coda_readlink; struct coda_vget_out coda_vget; struct coda_purgeuser_out coda_purgeuser; @@ -757,9 +712,8 @@ union outputArgs { struct coda_zapdir_out coda_zapdir; struct coda_zapvnode_out coda_zapvnode; struct coda_purgefid_out coda_purgefid; - struct coda_rdwr_out coda_rdwr; struct coda_replace_out coda_replace; - struct coda_make_cinode_out coda_make_cinode; + struct coda_open_by_fd_out coda_open_by_fd; struct coda_open_by_path_out coda_open_by_path; struct coda_statfs_out coda_statfs; }; @@ -805,5 +759,15 @@ struct PioctlData { #define IS_CTL_FID(fidp) ((fidp)->Volume == CTL_VOL &&\ (fidp)->Vnode == CTL_VNO &&\ (fidp)->Unique == CTL_UNI) + +/* Data passed to mount */ + +#define CODA_MOUNT_VERSION 1 + +struct coda_mount_data { + int version; + int fd; /* Opened device */ +}; + #endif diff --git a/include/linux/coda_cache.h b/include/linux/coda_cache.h index fe3b2f40c..95b593d14 100644 --- a/include/linux/coda_cache.h +++ b/include/linux/coda_cache.h @@ -10,22 +10,10 @@ #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; -}; - /* credential cache */ void coda_cache_enter(struct inode *inode, int mask); void coda_cache_clear_inode(struct inode *); -void coda_cache_clear_all(struct super_block *sb); -void coda_cache_clear_cred(struct super_block *sb, struct coda_cred *cred); +void coda_cache_clear_all(struct super_block *sb, struct coda_cred *cred); int coda_cache_check(struct inode *inode, int mask); /* for downcalls and attributes and lookups */ diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h index ac14c8e7f..4a776e87f 100644 --- a/include/linux/coda_fs_i.h +++ b/include/linux/coda_fs_i.h @@ -20,9 +20,12 @@ struct coda_inode_info { struct ViceFid c_fid; /* Coda identifier */ u_short c_flags; /* flags (see below) */ - 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 */ + struct list_head c_cilist; /* list of all coda inodes */ + struct inode *c_vnode; /* inode associated with cnode */ + unsigned int c_contcount; /* refcount for container inode */ + struct coda_cred c_cached_cred; /* credentials of cached perms */ + unsigned int c_cached_perm; /* cached access permissions */ int c_magic; /* to verify the data structure */ }; diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index 0b4057efc..3374036ce 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -40,6 +40,8 @@ int coda_release(struct inode *i, struct file *f); int coda_permission(struct inode *inode, int mask); int coda_revalidate_inode(struct dentry *); int coda_notify_change(struct dentry *, struct iattr *); +int coda_pioctl(struct inode * inode, struct file * filp, + unsigned int cmd, unsigned long arg); /* global variables */ extern int coda_debug; @@ -103,20 +105,20 @@ void coda_sysctl_clean(void); #define CODA_ALLOC(ptr, cast, size) \ do { \ - if (size < 3000) { \ + if (size < PAGE_SIZE) { \ ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \ - CDEBUG(D_MALLOC, "kmalloced: %lx at %p.\n", (long)size, ptr);\ - } else { \ + CDEBUG(D_MALLOC, "kmalloced: %lx at %p.\n", (long)size, ptr); \ + } else { \ ptr = (cast)vmalloc((unsigned long) size); \ - CDEBUG(D_MALLOC, "vmalloced: %lx at %p .\n", (long)size, ptr);}\ + CDEBUG(D_MALLOC, "vmalloced: %lx at %p .\n", (long)size, ptr);} \ if (ptr == 0) { \ - printk("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 ); \ + else memset( ptr, 0, size ); \ } while (0) -#define CODA_FREE(ptr,size) do {if (size < 3000) { kfree((ptr)); CDEBUG(D_MALLOC, "kfreed: %lx at %p.\n", (long) size, ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %lx at %p.\n", (long) size, ptr);} } while (0) +#define CODA_FREE(ptr,size) do {if (size < PAGE_SIZE) { kfree((ptr)); CDEBUG(D_MALLOC, "kfreed: %lx at %p.\n", (long) size, ptr); } else { vfree((ptr)); CDEBUG(D_MALLOC, "vfreed: %lx at %p.\n", (long) size, ptr);} } while (0) /* inode to cnode access functions */ diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index 73757bb53..db03f6af8 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -4,19 +4,13 @@ #define CODA_PSDEV_MAJOR 67 #define MAX_CODADEVS 5 /* how many do we allow */ -extern struct venus_comm coda_upc_comm; -extern struct coda_sb_info coda_super_info; #define CODA_SUPER_MAGIC 0x73757245 struct coda_sb_info { - struct inode * sbi_psdev; /* /dev/cfs? Venus/kernel device */ - int sbi_refct; struct venus_comm * sbi_vcomm; - struct inode * sbi_root; struct super_block *sbi_sb; - struct list_head sbi_cchead; - struct list_head sbi_volroothead; + struct list_head sbi_cihead; }; /* communication pending/processing queues */ @@ -26,6 +20,7 @@ struct venus_comm { struct list_head vc_pending; struct list_head vc_processing; int vc_inuse; + struct super_block *vc_sb; }; @@ -35,11 +30,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); - - /* upcalls */ int venus_rootfid(struct super_block *sb, ViceFid *fidp); int venus_getattr(struct super_block *sb, struct ViceFid *fid, @@ -112,6 +102,7 @@ struct coda_upcallstats { } ; extern struct coda_upcallstats coda_callstats; +extern struct venus_comm coda_comms[]; static inline void clstats(int opcode) { diff --git a/include/linux/cuda.h b/include/linux/cuda.h index 049448cc9..75549da3f 100644 --- a/include/linux/cuda.h +++ b/include/linux/cuda.h @@ -28,7 +28,8 @@ #ifdef __KERNEL__ -void find_via_cuda(void); +extern int find_via_cuda(void); +extern int via_cuda_start(void); extern int cuda_request(struct adb_request *req, void (*done)(struct adb_request *), int nbytes, ...); extern void cuda_poll(void); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 4c3f211cc..695d4bb67 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -163,11 +163,11 @@ extern int d_invalidate(struct dentry *); #define shrink_dcache() prune_dcache(0) struct zone_struct; /* dcache memory management */ -extern int shrink_dcache_memory(int, unsigned int); +extern void shrink_dcache_memory(int, unsigned int); extern void prune_dcache(int); /* icache memory management (defined in linux/fs/inode.c) */ -extern int shrink_icache_memory(int, int); +extern void shrink_icache_memory(int, int); extern void prune_icache(int); /* only used at mount-time */ diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index d9dfbb440..38164e6b2 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h @@ -46,14 +46,14 @@ extern unsigned int unix98_max_ptys; #endif #ifndef BUILDING_DEVPTS -extern inline void +static inline void devpts_pty_new(int line, kdev_t device) { if ( devpts_upcall_new ) return devpts_upcall_new(line,device); } -extern inline void +static inline void devpts_pty_kill(int line) { if ( devpts_upcall_kill ) @@ -63,10 +63,10 @@ devpts_pty_kill(int line) #else /* No /dev/pts filesystem at all */ -extern inline void +static inline void devpts_pty_new(int line, kdev_t device) { } -extern inline void +static inline void devpts_pty_kill(int line) { } #endif diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h new file mode 100644 index 000000000..5e231462b --- /dev/null +++ b/include/linux/dnotify.h @@ -0,0 +1,25 @@ +/* + * Directory notification for Linux + * + * Copyright 2000 (C) Stephen Rothwell + */ + +struct dnotify_struct { + struct dnotify_struct * dn_next; + int dn_magic; + unsigned long dn_mask; /* Events to be notified + see linux/fcntl.h */ + int dn_fd; + struct file * dn_filp; +}; + +#define DNOTIFY_MAGIC 0x444E4F54 + +extern void __inode_dir_notify(struct inode *, unsigned long); +extern int fcntl_dirnotify(int, struct file *, unsigned long); + +static inline void inode_dir_notify(struct inode *inode, unsigned long event) +{ + if ((inode)->i_dnotify_mask & (event)) + __inode_dir_notify(inode, event); +} diff --git a/include/linux/elf.h b/include/linux/elf.h index f22e7387e..45e9f1007 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -72,6 +72,8 @@ typedef __u64 Elf64_Word; #define EM_IA_64 50 /* HP/Intel IA-64 */ +#define EM_X8664 62 /* AMD x86-64 */ + /* * This is an interim value that we will use until the committee comes * up with a final number. diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 10d7bbb9d..69b35b7f7 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h @@ -16,8 +16,6 @@ #ifndef _LINUX_EXT2_FS_SB #define _LINUX_EXT2_FS_SB -#include <linux/ext2_fs.h> - /* * The following is not needed anymore since the descriptors buffer * heads are now dynamically allocated diff --git a/include/linux/fat_cvf.h b/include/linux/fat_cvf.h index 6349e45cf..bfaf4b057 100644 --- a/include/linux/fat_cvf.h +++ b/include/linux/fat_cvf.h @@ -14,8 +14,7 @@ struct cvf_format 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); + struct buffer_head *bh); void (*cvf_set_uptodate) (struct super_block *sb, struct buffer_head *bh, int val); diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index 9de3512e8..bdcf78b74 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h @@ -3,4 +3,24 @@ #include <asm/fcntl.h> +#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0) +#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1) + +/* + * Request nofications on a directory. + * See below for events that may be notified. + */ +#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2) + +/* + * Types of directory notifications that may be requested. + */ +#define DN_ACCESS 0x00000001 /* File accessed */ +#define DN_MODIFY 0x00000002 /* File modified */ +#define DN_CREATE 0x00000004 /* File created */ +#define DN_DELETE 0x00000008 /* File removed */ +#define DN_RENAME 0x00000010 /* File renamed */ +#define DN_ATTRIB 0x00000020 /* File changed attibutes */ +#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */ + #endif diff --git a/include/linux/fs.h b/include/linux/fs.h index 3ce2c58bd..eb2241226 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -54,6 +54,7 @@ struct files_stat_struct { }; extern struct files_stat_struct files_stat; extern int max_super_blocks, nr_super_blocks; +extern int leases_enable, dir_notify_enable, lease_break_time; #define NR_FILE 8192 /* this can well be larger on a larger system */ #define NR_RESERVED_FILES 10 /* reserved for root */ @@ -93,7 +94,7 @@ extern int max_super_blocks, nr_super_blocks; * as nfs_rename() will be cleaned up */ /* - * These are the fs-independent mount-flags: up to 16 flags are supported + * These are the fs-independent mount-flags: up to 32 flags are supported */ #define MS_RDONLY 1 /* Mount read-only */ #define MS_NOSUID 2 /* Ignore suid and sgid bits */ @@ -104,6 +105,7 @@ extern int max_super_blocks, nr_super_blocks; #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ #define MS_NOATIME 1024 /* Do not update access times. */ #define MS_NODIRATIME 2048 /* Do not update directory access times */ +#define MS_BIND 4096 /* * Flags that can be altered by MS_REMOUNT @@ -361,7 +363,8 @@ struct address_space { unsigned long nrpages; /* number of pages */ struct address_space_operations *a_ops; /* methods */ void *host; /* owner: inode, block_device */ - struct vm_area_struct *i_mmap; /* list of mappings */ + struct vm_area_struct *i_mmap; /* list of private mappings */ + struct vm_area_struct *i_mmap_shared; /* list of shared mappings */ spinlock_t i_shared_lock; /* and spinlock protecting it */ }; @@ -408,6 +411,9 @@ struct inode { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; + unsigned long i_dnotify_mask; /* Directory notify events */ + struct dnotify_struct *i_dnotify; /* for directory notifications */ + unsigned long i_state; unsigned int i_flags; @@ -497,6 +503,7 @@ extern int init_private_file(struct file *, struct dentry *, int); #define FL_BROKEN 4 /* broken flock() emulation */ #define FL_ACCESS 8 /* for processes suspended by mandatory locking */ #define FL_LOCKD 16 /* lock held by rpc.lockd */ +#define FL_LEASE 32 /* lease held on this file */ /* * The POSIX file lock owner is determined by @@ -511,6 +518,7 @@ struct file_lock { struct file_lock *fl_next; /* singly linked list for this inode */ struct list_head fl_link; /* doubly linked list of all locks */ struct list_head fl_block; /* circular list of blocked processes */ + struct list_head fl_list; /* block list member */ fl_owner_t fl_owner; unsigned int fl_pid; wait_queue_head_t fl_wait; @@ -524,6 +532,8 @@ struct file_lock { void (*fl_insert)(struct file_lock *); /* lock insertion callback */ void (*fl_remove)(struct file_lock *); /* lock removal callback */ + struct fasync_struct * fl_fasync; /* for lease break notifications */ + union { struct nfs_lock_info nfs_fl; } fl_u; @@ -537,6 +547,7 @@ struct file_lock { #endif extern struct list_head file_lock_list; +extern struct semaphore file_lock_sem; #include <linux/fcntl.h> @@ -547,12 +558,18 @@ extern int fcntl_getlk64(unsigned int, struct flock64 *); extern int fcntl_setlk64(unsigned int, unsigned int, struct flock64 *); /* fs/locks.c */ +extern void locks_init_lock(struct file_lock *); +extern void locks_copy_lock(struct file_lock *, struct file_lock *); extern void locks_remove_posix(struct file *, fl_owner_t); extern void locks_remove_flock(struct file *); extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); extern int posix_lock_file(struct file *, struct file_lock *, unsigned int); extern void posix_block_lock(struct file_lock *, struct file_lock *); extern void posix_unblock_lock(struct file_lock *); +extern int __get_lease(struct inode *inode, unsigned int flags); +extern time_t lease_get_mtime(struct inode *); +extern int lock_may_read(struct inode *, loff_t start, unsigned long count); +extern int lock_may_write(struct inode *, loff_t start, unsigned long count); struct fasync_struct { int magic; @@ -885,6 +902,12 @@ static inline int locks_verify_truncate(struct inode *inode, return 0; } +extern inline int get_lease(struct inode *inode, unsigned int mode) +{ + if (inode->i_flock && (inode->i_flock->fl_flags & FL_LEASE)) + return __get_lease(inode, mode); + return 0; +} /* fs/open.c */ @@ -984,8 +1007,8 @@ static inline void mark_buffer_protected(struct buffer_head * bh) __mark_buffer_protected(bh); } -extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh, int flag)); -extern void FASTCALL(mark_buffer_dirty(struct buffer_head *bh, int flag)); +extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh)); +extern void FASTCALL(mark_buffer_dirty(struct buffer_head *bh)); #define atomic_set_buffer_dirty(bh) test_and_set_bit(BH_Dirty, &(bh)->b_state) @@ -1049,9 +1072,20 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *); * This should be a per-architecture thing, to allow different * error and pointer decisions. */ -#define ERR_PTR(err) ((void *)((long)(err))) -#define PTR_ERR(ptr) ((long)(ptr)) -#define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000)) +static inline void *ERR_PTR(long error) +{ + return (void *) error; +} + +static inline long PTR_ERR(const void *ptr) +{ + return (long) ptr; +} + +static inline long IS_ERR(const void *ptr) +{ + return (unsigned long)ptr > (unsigned long)-1000L; +} /* * The bitmask for a lookup event: @@ -1161,6 +1195,7 @@ extern int block_sync_page(struct page *); int generic_block_bmap(struct address_space *, long, get_block_t *); int generic_commit_write(struct file *, struct page *, unsigned, unsigned); +int block_truncate_page(struct address_space *, loff_t, get_block_t *); extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 972dd0bfb..457521681 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -29,6 +29,7 @@ * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic */ +#include <linux/sched.h> #include <asm/io.h> struct gameport; diff --git a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h index 10f3f71ee..2a55e6018 100644 --- a/include/linux/hdlcdrv.h +++ b/include/linux/hdlcdrv.h @@ -132,7 +132,7 @@ struct hdlcdrv_bitbuffer { unsigned char buffer[HDLCDRV_BITBUFFER]; }; -extern inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf, +static inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf, unsigned int bit) { unsigned char new; @@ -147,7 +147,7 @@ extern inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf, } } -extern inline void hdlcdrv_add_bitbuffer_word(struct hdlcdrv_bitbuffer *buf, +static inline void hdlcdrv_add_bitbuffer_word(struct hdlcdrv_bitbuffer *buf, unsigned int bits) { buf->buffer[buf->wr] = bits & 0xff; @@ -250,7 +250,7 @@ struct hdlcdrv_state { /* -------------------------------------------------------------------- */ -extern inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb) +static inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb) { unsigned long flags; int ret; @@ -263,7 +263,7 @@ extern inline int hdlcdrv_hbuf_full(struct hdlcdrv_hdlcbuffer *hb) /* -------------------------------------------------------------------- */ -extern inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb) +static inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb) { unsigned long flags; int ret; @@ -276,7 +276,7 @@ extern inline int hdlcdrv_hbuf_empty(struct hdlcdrv_hdlcbuffer *hb) /* -------------------------------------------------------------------- */ -extern inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb) +static inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb) { unsigned long flags; unsigned short val; @@ -296,7 +296,7 @@ extern inline unsigned short hdlcdrv_hbuf_get(struct hdlcdrv_hdlcbuffer *hb) /* -------------------------------------------------------------------- */ -extern inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb, +static inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb, unsigned short val) { unsigned newp; @@ -313,12 +313,12 @@ extern inline void hdlcdrv_hbuf_put(struct hdlcdrv_hdlcbuffer *hb, /* -------------------------------------------------------------------- */ -extern inline void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits) +static inline void hdlcdrv_putbits(struct hdlcdrv_state *s, unsigned int bits) { hdlcdrv_hbuf_put(&s->hdlcrx.hbuf, bits); } -extern inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s) +static inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s) { unsigned int ret; @@ -336,19 +336,19 @@ extern inline unsigned int hdlcdrv_getbits(struct hdlcdrv_state *s) return ret; } -extern inline void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit) +static inline void hdlcdrv_channelbit(struct hdlcdrv_state *s, unsigned int bit) { #ifdef HDLCDRV_DEBUG hdlcdrv_add_bitbuffer(&s->bitbuf_channel, bit); #endif /* HDLCDRV_DEBUG */ } -extern inline void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd) +static inline void hdlcdrv_setdcd(struct hdlcdrv_state *s, int dcd) { s->hdlcrx.dcd = !!dcd; } -extern inline int hdlcdrv_ptt(struct hdlcdrv_state *s) +static inline int hdlcdrv_ptt(struct hdlcdrv_state *s) { return s->hdlctx.ptt || (s->hdlctx.calibrate > 0); } diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h index 65392fc39..0f619399e 100644 --- a/include/linux/hfs_fs.h +++ b/include/linux/hfs_fs.h @@ -320,12 +320,12 @@ 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, +static 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, +static 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) { diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h index 0c0b9bb91..cefce233d 100644 --- a/include/linux/hfs_sysdep.h +++ b/include/linux/hfs_sysdep.h @@ -52,7 +52,7 @@ typedef unsigned char hfs_lword_t[4]; extern long int hfs_alloc; #endif -extern inline void *hfs_malloc(unsigned int size) { +static 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__); @@ -60,7 +60,7 @@ extern inline void *hfs_malloc(unsigned int size) { return kmalloc(size, GFP_KERNEL); } -extern inline void hfs_free(void *ptr, unsigned int size) { +static inline void hfs_free(void *ptr, unsigned int size) { kfree(ptr); #if defined(DEBUG_ALL) || defined(DEBUG_MEM) hfs_warn("%ld bytes allocation at %s:%u\n", @@ -75,17 +75,17 @@ extern inline void hfs_free(void *ptr, unsigned int size) { * not a good thing to do. instead, we depend upon tz_minuteswest * having the correct daylight savings correction. */ -extern inline hfs_u32 hfs_from_utc(hfs_s32 time) +static inline hfs_u32 hfs_from_utc(hfs_s32 time) { return time - sys_tz.tz_minuteswest*60; } -extern inline hfs_s32 hfs_to_utc(hfs_u32 time) +static inline hfs_s32 hfs_to_utc(hfs_u32 time) { return time + sys_tz.tz_minuteswest*60; } -extern inline hfs_u32 hfs_time(void) { +static inline hfs_u32 hfs_time(void) { return htonl(hfs_from_utc(CURRENT_TIME)+2082844800U); } @@ -95,19 +95,19 @@ extern inline hfs_u32 hfs_time(void) { */ typedef wait_queue_head_t hfs_wait_queue; -extern inline void hfs_init_waitqueue(hfs_wait_queue *queue) { +static inline void hfs_init_waitqueue(hfs_wait_queue *queue) { init_waitqueue_head(queue); } -extern inline void hfs_sleep_on(hfs_wait_queue *queue) { +static inline void hfs_sleep_on(hfs_wait_queue *queue) { sleep_on(queue); } -extern inline void hfs_wake_up(hfs_wait_queue *queue) { +static inline void hfs_wake_up(hfs_wait_queue *queue) { wake_up(queue); } -extern inline void hfs_relinquish(void) { +static inline void hfs_relinquish(void) { schedule(); } @@ -117,11 +117,11 @@ extern inline void hfs_relinquish(void) { */ typedef struct super_block *hfs_sysmdb; -extern inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) { +static inline void hfs_mdb_dirty(hfs_sysmdb sys_mdb) { sys_mdb->s_dirt = 1; } -extern inline const char *hfs_mdb_name(hfs_sysmdb sys_mdb) { +static inline const char *hfs_mdb_name(hfs_sysmdb sys_mdb) { return kdevname(sys_mdb->s_dev); } @@ -141,19 +141,19 @@ typedef struct buffer_head *hfs_buffer; /* 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) { +static inline int hfs_buffer_ok(hfs_buffer buffer) { return (buffer != NULL); } -extern inline void hfs_buffer_put(hfs_buffer buffer) { +static inline void hfs_buffer_put(hfs_buffer buffer) { brelse(buffer); } -extern inline void hfs_buffer_dirty(hfs_buffer buffer) { - mark_buffer_dirty(buffer, 1); +static inline void hfs_buffer_dirty(hfs_buffer buffer) { + mark_buffer_dirty(buffer); } -extern inline void hfs_buffer_sync(hfs_buffer buffer) { +static inline void hfs_buffer_sync(hfs_buffer buffer) { while (buffer_locked(buffer)) { wait_on_buffer(buffer); } @@ -163,7 +163,7 @@ extern inline void hfs_buffer_sync(hfs_buffer buffer) { } } -extern inline void *hfs_buffer_data(const hfs_buffer buffer) { +static inline void *hfs_buffer_data(const hfs_buffer buffer) { return buffer->b_data; } @@ -199,15 +199,15 @@ extern inline void *hfs_buffer_data(const hfs_buffer buffer) { # error "Don't know if bytes are big- or little-endian!" #endif -extern inline int hfs_clear_bit(int bitnr, hfs_u32 *lword) { +static 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) { +static 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) { +static 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); } diff --git a/include/linux/highmem.h b/include/linux/highmem.h index a80434823..184407e40 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -19,7 +19,7 @@ extern struct buffer_head * create_bounce(int rw, struct buffer_head * bh_orig); #else /* CONFIG_HIGHMEM */ -extern inline unsigned int nr_free_highpages(void) { return 0; } +static inline unsigned int nr_free_highpages(void) { return 0; } #define prepare_highmem_swapout(page) page #define replace_with_highmem(page) page diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 0129c67b9..c8fa6b199 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h @@ -130,7 +130,7 @@ enum { extern struct ppp_channel_ops pppoe_chan_ops; -extern void pppox_proto_init(struct net_proto *np); +extern int pppox_proto_init(struct net_proto *np); #endif /* __KERNEL__ */ diff --git a/include/linux/inet.h b/include/linux/inet.h index 6a8e27bcd..acb93765f 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h @@ -46,7 +46,6 @@ extern void inet_proto_init(struct net_proto *pro); extern char *in_ntoa(__u32 in); -extern char *in_ntoa2(__u32 in, char *buf); extern __u32 in_aton(const char *str); #endif diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h index a70195334..2aca5e2c8 100644 --- a/include/linux/ixjuser.h +++ b/include/linux/ixjuser.h @@ -1,7 +1,8 @@ -/* +/****************************************************************************** + * * ixjuser.h * - * User-space include file for the Internet PhoneJACK and + * Device Driver for the Internet PhoneJACK and * Internet LineJACK Telephony Cards. * * (c) Copyright 1999 Quicknet Technologies, Inc. @@ -22,31 +23,48 @@ * at our website: http://www.quicknet.net * * Fixes: - */ + * + * IN NO EVENT SHALL QUICKNET TECHNOLOGIES, INC. BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF QUICKNET + * TECHNOLOGIES, INC.HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * QUICKNET TECHNOLOGIES, INC. SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND QUICKNET TECHNOLOGIES, INC. HAS NO OBLIGATION + * TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + *****************************************************************************/ -static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 3.4 1999/12/16 22:18:36 root Exp root $"; +static char ixjuser_h_rcsid[] = "$Id: ixjuser.h,v 3.11 2000/03/30 22:06:48 eokerson Exp $"; -#include <linux/telephony.h> +#include "telephony.h" -/*************************************************************************** - If you use the IXJCTL_TESTRAM command, the card must be power - cycled to reset the SRAM values before futher use. +/****************************************************************************** +* +* IOCTL's used for the Quicknet Cards +* +* If you use the IXJCTL_TESTRAM command, the card must be power cycled to +* reset the SRAM values before futher use. +* +******************************************************************************/ -***************************************************************************/ #define IXJCTL_DSP_RESET _IO ('q', 0xC0) -#define IXJCTL_RING PHONE_RING -#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE +#define IXJCTL_RING PHONE_RING +#define IXJCTL_HOOKSTATE PHONE_HOOKSTATE #define IXJCTL_MAXRINGS PHONE_MAXRINGS -#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE +#define IXJCTL_RING_CADENCE PHONE_RING_CADENCE #define IXJCTL_RING_START PHONE_RING_START #define IXJCTL_RING_STOP PHONE_RING_STOP #define IXJCTL_CARDTYPE _IOR ('q', 0xC1, int) -#define IXJCTL_SERIAL _IOR ('q', 0xC2, int) -#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int) -#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int) +#define IXJCTL_SERIAL _IOR ('q', 0xC2, int) +#define IXJCTL_DSP_TYPE _IOR ('q', 0xC3, int) +#define IXJCTL_DSP_VERSION _IOR ('q', 0xC4, int) +#define IXJCTL_VERSION _IOR ('q', 0xDA, char *) #define IXJCTL_DSP_IDLE _IO ('q', 0xC5) #define IXJCTL_TESTRAM _IO ('q', 0xC6) @@ -104,8 +122,22 @@ typedef struct { char enable; } IXJ_FILTER; +typedef struct { + char enable; + char en_filter; + unsigned int filter; + unsigned int on1; + unsigned int off1; + unsigned int on2; + unsigned int off2; + unsigned int on3; + unsigned int off3; +} IXJ_FILTER_CADENCE; + #define IXJCTL_SET_FILTER _IOW ('q', 0xC7, IXJ_FILTER *) #define IXJCTL_GET_FILTER_HIST _IOW ('q', 0xC8, int) +#define IXJCTL_FILTER_CADENCE _IOW ('q', 0xD6, IXJ_FILTER_CADENCE *) +#define IXJCTL_PLAY_CID _IO ('q', 0xD7) /****************************************************************************** * * This IOCTL allows you to reassign values in the tone index table. The @@ -222,7 +254,9 @@ typedef enum { hz1800 = 0x1405, hz1860 = 0xe0b, hz2100 = 0xf5f6, - hz2450 = 0xd3b3 + hz2130 = 0xf2f5, + hz2450 = 0xd3b3, + hz2750 = 0xb8e4 } IXJ_FREQ; typedef enum { @@ -344,6 +378,7 @@ typedef struct { #define AEC_LOW 1 #define AEC_MED 2 #define AEC_HIGH 3 +#define AEC_AUTO 4 /****************************************************************************** * * Call Progress Tones, DTMF, etc. @@ -533,16 +568,16 @@ typedef struct { /****************************************************************************** * -* The DAA Analog GAIN sets 2 parameters at one time, the receive gain (AGRR), +* The DAA Analog GAIN sets 2 parameters at one time, the recieve gain (AGRR), * and the transmit gain (AGX). OR together the components and pass them * as the parameter to IXJCTL_DAA_AGAIN. The default setting is both at 0dB. * ******************************************************************************/ #define IXJCTL_DAA_AGAIN _IOW ('q', 0xD2, int) -#define AGRR00DB 0x00 // Analog gain in receive direction 0dB -#define AGRR3_5DB 0x10 // Analog gain in receive direction 3.5dB -#define AGRR06DB 0x30 // Analog gain in receive direction 6dB +#define AGRR00DB 0x00 // Analog gain in recieve direction 0dB +#define AGRR3_5DB 0x10 // Analog gain in recieve direction 3.5dB +#define AGRR06DB 0x30 // Analog gain in recieve direction 6dB #define AGX00DB 0x00 // Analog gain in transmit direction 0dB #define AGX_6DB 0x04 // Analog gain in transmit direction -6dB @@ -551,18 +586,9 @@ typedef struct { #define IXJCTL_PSTN_LINETEST _IO ('q', 0xD3) -typedef struct { - char month[3]; - char day[3]; - char hour[3]; - char min[3]; - int numlen; - char number[11]; - int namelen; - char name[80]; -} IXJ_CID; - -#define IXJCTL_CID _IOR ('q', 0xD4, IXJ_CID *) +#define IXJCTL_CID _IOR ('q', 0xD4, PHONE_CID *) +#define IXJCTL_VMWI _IOR ('q', 0xD8, int) +#define IXJCTL_CIDCW _IOW ('q', 0xD9, PHONE_CID *) /****************************************************************************** * * The wink duration is tunable with this ioctl. The default wink duration diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ac6f029b9..aa337fe6c 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -9,6 +9,7 @@ #include <stdarg.h> #include <linux/linkage.h> +#include <linux/stddef.h> /* Optimization barrier */ /* The "volatile" is due to gcc bugs */ diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 4bc6187b3..bab128898 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -10,6 +10,7 @@ extern int request_module(const char * name); extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]); #ifdef CONFIG_HOTPLUG extern char hotplug_path []; +extern int call_usermodehelper(char *path, char *argv[], char *envp[]); #endif #else static inline int request_module(const char * name) { return -ENOSYS; } diff --git a/include/linux/locks.h b/include/linux/locks.h index 2094a4d19..9d342e669 100644 --- a/include/linux/locks.h +++ b/include/linux/locks.h @@ -29,7 +29,9 @@ extern inline void lock_buffer(struct buffer_head * bh) extern inline void unlock_buffer(struct buffer_head *bh) { clear_bit(BH_Lock, &bh->b_state); - wake_up(&bh->b_wait); + smp_mb__after_clear_bit(); + if (waitqueue_active(&bh->b_wait)) + wake_up(&bh->b_wait); } /* @@ -55,7 +57,12 @@ extern inline void lock_super(struct super_block * sb) extern inline void unlock_super(struct super_block * sb) { sb->s_lock = 0; - wake_up(&sb->s_wait); + /* + * No need of any barrier, we're protected by + * the big kernel lock here... unfortunately :) + */ + if (waitqueue_active(&sb->s_wait)) + wake_up(&sb->s_wait); } #endif /* _LINUX_LOCKS_H */ diff --git a/include/linux/major.h b/include/linux/major.h index 7b43e59d0..372e1841a 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -108,6 +108,15 @@ #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 +#define COMPAQ_CISS_MAJOR 104 +#define COMPAQ_CISS_MAJOR1 105 +#define COMPAQ_CISS_MAJOR2 106 +#define COMPAQ_CISS_MAJOR3 107 +#define COMPAQ_CISS_MAJOR4 108 +#define COMPAQ_CISS_MAJOR5 109 +#define COMPAQ_CISS_MAJOR6 110 +#define COMPAQ_CISS_MAJOR7 111 + #define DASD_MAJOR 94 /* Official assignations from Peter */ #define MDISK_MAJOR 95 /* Official assignations from Peter */ @@ -134,12 +143,14 @@ #define USB_ACM_AUX_MAJOR 167 #define USB_CHAR_MAJOR 180 -#define TUN_MAJOR 195 - #define UNIX98_PTY_MASTER_MAJOR 128 #define UNIX98_PTY_MAJOR_COUNT 8 #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) +#define VXVM_MAJOR 199 /* VERITAS volume i/o driver */ +#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ +#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ + #define MSR_MAJOR 202 #define CPUID_MAJOR 203 diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 99cd63717..b90790341 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -99,9 +99,14 @@ extern unsigned long minix_count_free_blocks(struct super_block *sb); extern struct buffer_head * minix_getblk(struct inode *, int, int); extern struct buffer_head * minix_bread(struct inode *, int, int); +extern void V1_minix_truncate(struct inode *); +extern void V2_minix_truncate(struct inode *); extern void minix_truncate(struct inode *); extern int minix_sync_inode(struct inode *); -extern int minix_sync_file(struct file *, struct dentry *, int); +extern int V1_minix_sync_file(struct inode *); +extern int V2_minix_sync_file(struct inode *); +extern int V1_minix_get_block(struct inode *, long, struct buffer_head *, int); +extern int V2_minix_get_block(struct inode *, long, struct buffer_head *, int); extern struct address_space_operations minix_aops; extern struct inode_operations minix_file_inode_operations; diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index f2bc32f72..3532658c6 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -31,6 +31,8 @@ /* drivers/sgi/char/usema.c */ #define SGI_USEMACLONE 151 +#define TUN_MINOR 200 + extern int misc_init(void); struct miscdevice diff --git a/include/linux/mm.h b/include/linux/mm.h index f606186cf..69d4d2490 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -15,7 +15,9 @@ extern unsigned long max_mapnr; extern unsigned long num_physpages; extern void * high_memory; extern int page_cluster; -extern struct list_head lru_cache; +/* The inactive_clean lists are per zone. */ +extern struct list_head active_list; +extern struct list_head inactive_dirty_list; #include <asm/page.h> #include <asm/pgtable.h> @@ -52,7 +54,8 @@ struct vm_area_struct { struct vm_area_struct * vm_avl_left; struct vm_area_struct * vm_avl_right; - /* For areas with inode, the list inode->i_mapping->i_mmap, + /* For areas with an address space and backing store, + * one of the address_space->i_mmap{,shared} lists, * for shm areas, the list of attaches, otherwise unused. */ struct vm_area_struct *vm_next_share; @@ -91,6 +94,7 @@ struct vm_area_struct { #define VM_RAND_READ 0x00010000 /* App will not benefit from clustered reads */ #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ +#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ #define VM_STACK_FLAGS 0x00000177 @@ -148,6 +152,7 @@ typedef struct page { atomic_t count; unsigned long flags; /* atomic flags, some possibly updated asynchronously */ struct list_head lru; + unsigned long age; wait_queue_head_t wait; struct page **pprev_hash; struct buffer_head * buffers; @@ -168,12 +173,12 @@ typedef struct page { #define PG_uptodate 3 #define PG_dirty 4 #define PG_decr_after 5 -#define PG_unused_01 6 -#define PG__unused_02 7 +#define PG_active 6 +#define PG_inactive_dirty 7 #define PG_slab 8 #define PG_swap_cache 9 #define PG_skip 10 -#define PG_unused_03 11 +#define PG_inactive_clean 11 #define PG_highmem 12 /* bits 21-30 unused */ #define PG_reserved 31 @@ -189,15 +194,25 @@ typedef struct page { #define PageLocked(page) test_bit(PG_locked, &(page)->flags) #define LockPage(page) set_bit(PG_locked, &(page)->flags) #define TryLockPage(page) test_and_set_bit(PG_locked, &(page)->flags) +/* + * The first mb is necessary to safely close the critical section opened by the + * TryLockPage(), the second mb is necessary to enforce ordering between + * the clear_bit and the read of the waitqueue (to avoid SMP races with a + * parallel wait_on_page). + */ #define UnlockPage(page) do { \ + smp_mb__before_clear_bit(); \ clear_bit(PG_locked, &(page)->flags); \ - wake_up(&page->wait); \ + smp_mb__after_clear_bit(); \ + if (waitqueue_active(&page->wait)) \ + wake_up(&page->wait); \ } while (0) #define PageError(page) test_bit(PG_error, &(page)->flags) #define SetPageError(page) set_bit(PG_error, &(page)->flags) #define ClearPageError(page) clear_bit(PG_error, &(page)->flags) #define PageReferenced(page) test_bit(PG_referenced, &(page)->flags) #define SetPageReferenced(page) set_bit(PG_referenced, &(page)->flags) +#define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) #define PageTestandClearReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) #define PageDecrAfter(page) test_bit(PG_decr_after, &(page)->flags) #define SetPageDecrAfter(page) set_bit(PG_decr_after, &(page)->flags) @@ -216,6 +231,18 @@ typedef struct page { #define PageTestandClearSwapCache(page) test_and_clear_bit(PG_swap_cache, &(page)->flags) +#define PageActive(page) test_bit(PG_active, &(page)->flags) +#define SetPageActive(page) set_bit(PG_active, &(page)->flags) +#define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) + +#define PageInactiveDirty(page) test_bit(PG_inactive_dirty, &(page)->flags) +#define SetPageInactiveDirty(page) set_bit(PG_inactive_dirty, &(page)->flags) +#define ClearPageInactiveDirty(page) clear_bit(PG_inactive_dirty, &(page)->flags) + +#define PageInactiveClean(page) test_bit(PG_inactive_clean, &(page)->flags) +#define SetPageInactiveClean(page) set_bit(PG_inactive_clean, &(page)->flags) +#define ClearPageInactiveClean(page) clear_bit(PG_inactive_clean, &(page)->flags) + #ifdef CONFIG_HIGHMEM #define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) #else @@ -375,7 +402,7 @@ extern int pgt_cache_water[2]; extern int check_pgt_cache(void); extern void free_area_init(unsigned long * zones_size); -extern void free_area_init_node(int nid, pg_data_t *pgdat, +extern void free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, unsigned long * zones_size, unsigned long zone_start_paddr, unsigned long *zholes_size); extern void mem_init(void); @@ -415,7 +442,6 @@ struct zone_t; /* filemap.c */ extern void remove_inode_page(struct page *); extern unsigned long page_unuse(struct page *); -extern int shrink_mmap(int, int); extern void truncate_inode_pages(struct address_space *, loff_t); /* generic vm_area_ops exported for stackable file systems */ @@ -443,11 +469,11 @@ extern struct page *filemap_nopage(struct vm_area_struct * area, #define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT) #define GFP_ATOMIC (__GFP_HIGH) -#define GFP_USER (__GFP_WAIT | __GFP_IO) -#define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) +#define GFP_USER ( __GFP_WAIT | __GFP_IO) +#define GFP_HIGHUSER ( __GFP_WAIT | __GFP_IO | __GFP_HIGHMEM) #define GFP_KERNEL (__GFP_HIGH | __GFP_WAIT | __GFP_IO) #define GFP_NFS (__GFP_HIGH | __GFP_WAIT | __GFP_IO) -#define GFP_KSWAPD (__GFP_IO) +#define GFP_KSWAPD ( __GFP_IO) /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 61f672a3c..4a8280d7d 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -28,13 +28,14 @@ typedef struct zone_struct { spinlock_t lock; unsigned long offset; unsigned long free_pages; - char low_on_memory; - char zone_wake_kswapd; + unsigned long inactive_clean_pages; + unsigned long inactive_dirty_pages; unsigned long pages_min, pages_low, pages_high; /* * free areas of different sizes */ + struct list_head inactive_clean_list; free_area_t free_area[MAX_ORDER]; /* @@ -99,9 +100,11 @@ extern pg_data_t *pgdat_list; * The following two are not meant for general usage. They are here as * prototypes for the discontig memory code. */ +struct page; extern void show_free_areas_core(int); extern void free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap, - unsigned long *zones_size, unsigned long paddr, unsigned long *zholes_size); + unsigned long *zones_size, unsigned long paddr, unsigned long *zholes_size, + struct page *pmap); #ifndef CONFIG_DISCONTIGMEM diff --git a/include/linux/module.h b/include/linux/module.h index fef8d2b20..5a52811a8 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -279,14 +279,6 @@ extern struct module *module_list; #define EXPORT_SYMBOL(var) #define EXPORT_SYMBOL_NOVERS(var) -#elif !defined(EXPORT_SYMTAB) - -/* If things weren't set up in the Makefiles to get EXPORT_SYMTAB defined, - then they weren't set up to run genksyms properly so MODVERSIONS breaks. */ -#define __EXPORT_SYMBOL(sym,str) error EXPORT_SYMTAB_not_defined -#define EXPORT_SYMBOL(var) error EXPORT_SYMTAB_not_defined -#define EXPORT_SYMBOL_NOVERS(var) error EXPORT_SYMTAB_not_defined - #else #define __EXPORT_SYMBOL(sym, str) \ diff --git a/include/linux/mount.h b/include/linux/mount.h index 8eff1ecc9..a4fc9a05c 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -27,8 +27,7 @@ struct vfsmount struct list_head mnt_child; /* and going through their mnt_child */ atomic_t mnt_count; int mnt_flags; - - char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ + char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ struct list_head mnt_list; uid_t mnt_owner; }; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ebe8428da..95c0e130b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -416,7 +416,6 @@ extern int dev_alloc_name(struct net_device *dev, const char *name); extern int dev_open(struct net_device *dev); extern int dev_close(struct net_device *dev); extern int dev_queue_xmit(struct sk_buff *skb); -extern void dev_loopback_xmit(struct sk_buff *skb); extern int register_netdevice(struct net_device *dev); extern int unregister_netdevice(struct net_device *dev); extern int register_netdevice_notifier(struct notifier_block *nb); diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index ddd0563a5..b61722b15 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -184,6 +184,12 @@ extern struct inode_operations nfs_symlink_inode_operations; extern int nfs_lock(struct file *, int, struct file_lock *); /* + * linux/fs/nfs/unlink.c + */ +extern int nfs_async_unlink(struct dentry *); +extern void nfs_complete_unlink(struct dentry *); + +/* * linux/fs/nfs/write.c */ extern int nfs_writepage(struct file *file, struct page *); diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 7b7df5b06..2b552936e 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h @@ -52,6 +52,7 @@ struct nfs_mount_data { #define NFS_MOUNT_VER3 0x0080 /* 3 */ #define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ #define NFS_MOUNT_NONLM 0x0200 /* 3 */ +#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ #define NFS_MOUNT_FLAGMASK 0xFFFF #endif diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 63c3e1c7b..9863c06af 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -334,6 +334,9 @@ struct nfs_rpc_ops { int (*create) (struct dentry *, struct qstr *, struct iattr *, int, struct nfs_fh *, struct nfs_fattr *); int (*remove) (struct dentry *, struct qstr *); + int (*unlink_setup) (struct rpc_message *, + struct dentry *, struct qstr *); + void (*unlink_done) (struct dentry *, struct rpc_message *); int (*rename) (struct dentry *, struct qstr *, struct dentry *, struct qstr *); int (*link) (struct dentry *, struct dentry *, struct qstr *); diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 5fb55c738..db948a701 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h @@ -38,7 +38,8 @@ #define NFSEXP_CROSSMNT 0x0200 #define NFSEXP_NOSUBTREECHECK 0x0400 #define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */ -#define NFSEXP_ALLFLAGS 0x0FFF +#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */ +#define NFSEXP_ALLFLAGS 0x1FFF #ifdef __KERNEL__ diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h new file mode 100644 index 000000000..cdce71e82 --- /dev/null +++ b/include/linux/nfsd/interface.h @@ -0,0 +1,23 @@ +/* + * include/linux/nfsd/interface.h + * + * defines interface between nfsd and other bits of + * the kernel. Particularly filesystems (eventually). + * + * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au> + */ + +#ifndef LINUX_NFSD_INTERFACE_H +#define LINUX_NFSD_INTERFACE_H + +#include <linux/config.h> + +#ifdef CONFIG_NFSD_MODULE + +extern struct nfsd_linkage { + long (*do_nfsservctl)(int cmd, void *argp, void *resp); +} * nfsd_linkage; + +#endif + +#endif /* LINUX_NFSD_INTERFACE_H */ diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index dacab2198..f183f57a5 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h @@ -21,7 +21,7 @@ #include <linux/nfsd/export.h> #include <linux/nfsd/auth.h> #include <linux/nfsd/stats.h> - +#include <linux/nfsd/interface.h> /* * nfsd version */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 1efa437bb..0c2dc46ae 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -298,6 +298,16 @@ #define DEVICE_COUNT_DMA 2 #define DEVICE_COUNT_RESOURCE 12 +#define PCI_ANY_ID (~0) + +#define pci_present pcibios_present + +#define pci_for_each_dev(dev) \ + for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next)) + +#define pci_for_each_dev_reverse(dev) \ + for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev)) + /* * The pci_dev structure is used to describe both PCI and ISAPnP devices. */ @@ -429,6 +439,27 @@ struct pbus_set_ranges_data unsigned long mem_start, mem_end; }; +struct pci_device_id { + unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */ + unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ + unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */ + unsigned long driver_data; /* Data private to the driver */ +}; + +struct pci_driver { + struct list_head node; + char *name; + const struct pci_device_id *id_table; /* NULL if wants all devices */ + int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ + void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ + void (*suspend)(struct pci_dev *dev); /* Device suspended */ + void (*resume)(struct pci_dev *dev); /* Device woken up */ +}; + + +/* these external functions are only available when PCI support is enabled */ +#ifdef CONFIG_PCI + void pcibios_init(void); void pcibios_fixup_bus(struct pci_bus *); int pcibios_enable_device(struct pci_dev *); @@ -444,7 +475,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); /* Backward compatibility, don't use in new code! */ int pcibios_present(void); -#define pci_present pcibios_present int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, unsigned char where, unsigned char *val); int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, @@ -488,8 +518,6 @@ struct pci_dev *pci_find_class (unsigned int class, const struct pci_dev *from); struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); int pci_find_capability (struct pci_dev *dev, int cap); -#define PCI_ANY_ID (~0) - int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val); int pci_read_config_word(struct pci_dev *dev, int where, u16 *val); int pci_read_config_dword(struct pci_dev *dev, int where, u32 *val); @@ -502,12 +530,6 @@ void pci_set_master(struct pci_dev *dev); int pci_set_power_state(struct pci_dev *dev, int state); int pci_assign_resource(struct pci_dev *dev, int i); -#define pci_for_each_dev(dev) \ - for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next)) - -#define pci_for_each_dev_reverse(dev) \ - for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev)) - /* Helper functions for low-level code (drivers/pci/setup.c) */ int pci_claim_resource(struct pci_dev *, int); @@ -518,24 +540,6 @@ void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), int (*)(struct pci_dev *, u8, u8)); /* New-style probing supporting hot-pluggable devices */ - -struct pci_device_id { - unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */ - unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ - unsigned int class, class_mask; /* (class,subclass,prog-if) triplet */ - unsigned long driver_data; /* Data private to the driver */ -}; - -struct pci_driver { - struct list_head node; - char *name; - const struct pci_device_id *id_table; /* NULL if wants all devices */ - int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ - void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ - void (*suspend)(struct pci_dev *dev); /* Device suspended */ - void (*resume)(struct pci_dev *dev); /* Device woken up */ -}; - int pci_register_driver(struct pci_driver *); void pci_unregister_driver(struct pci_driver *); void pci_insert_device(struct pci_dev *, struct pci_bus *); @@ -543,6 +547,8 @@ void pci_remove_device(struct pci_dev *); struct pci_driver *pci_dev_driver(const struct pci_dev *); const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); +#endif /* CONFIG_PCI */ + /* Include architecture-dependent settings and functions */ #include <asm/pci.h> @@ -553,14 +559,14 @@ const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, co */ #ifndef CONFIG_PCI -extern inline int pcibios_present(void) { return 0; } -extern inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn) +static inline int pcibios_present(void) { return 0; } +static inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn) { return PCIBIOS_DEVICE_NOT_FOUND; } #define _PCI_NOP(o,s,t) \ - extern inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \ + static inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } \ - extern inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \ + static inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } #define _PCI_NOP_ALL(o,x) _PCI_NOP(o,byte,u8 x) \ _PCI_NOP(o,word,u16 x) \ @@ -568,27 +574,27 @@ extern inline int pcibios_find_class (unsigned int class_code, unsigned short in _PCI_NOP_ALL(read, *) _PCI_NOP_ALL(write,) -extern inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from) +static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *from) { return NULL; } -extern inline struct pci_dev *pci_find_class(unsigned int class, const struct pci_dev *from) +static inline struct pci_dev *pci_find_class(unsigned int class, const struct pci_dev *from) { return NULL; } -extern inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) +static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) { return NULL; } -extern inline struct pci_dev *pci_find_subsys(unsigned int vendor, unsigned int device, +static inline struct pci_dev *pci_find_subsys(unsigned int vendor, unsigned int device, unsigned int ss_vendor, unsigned int ss_device, const struct pci_dev *from) { return NULL; } -extern inline void pci_set_master(struct pci_dev *dev) { } -extern inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } -extern inline int pci_module_init(struct pci_driver *drv) { return -ENODEV; } -extern inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} -extern inline int pci_register_driver(struct pci_driver *drv) { return 0;} -extern inline void pci_unregister_driver(struct pci_driver *drv) { } -extern inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; } -extern inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } +static inline void pci_set_master(struct pci_dev *dev) { } +static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; } +static inline int pci_module_init(struct pci_driver *drv) { return -ENODEV; } +static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} +static inline int pci_register_driver(struct pci_driver *drv) { return 0;} +static inline void pci_unregister_driver(struct pci_driver *drv) { } +static inline int scsi_to_pci_dma_dir(unsigned char scsi_dir) { return scsi_dir; } +static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } #else @@ -598,7 +604,7 @@ extern inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; * * This MUST stay in a header, as it checks for -DMODULE */ -extern inline int pci_module_init(struct pci_driver *drv) +static inline int pci_module_init(struct pci_driver *drv) { int rc = pci_register_driver (drv); @@ -636,6 +642,20 @@ extern inline int pci_module_init(struct pci_driver *drv) (pci_resource_end((dev),(bar)) - \ pci_resource_start((dev),(bar)) + 1)) +/* Similar to the helpers above, these manipulate per-pci_dev + * driver-specific data. Currently stored as pci_dev::driver_data, + * a void pointer, but it is not present on older kernels. + */ +static inline void *pci_get_drvdata (struct pci_dev *pdev) +{ + return pdev->driver_data; +} + +static inline void pci_set_drvdata (struct pci_dev *pdev, void *data) +{ + pdev->driver_data = data; +} + /* * The world is not perfect and supplies us with broken PCI devices. * For at least a part of these bugs we need a work-around, so both diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7f68d1951..329e39079 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -131,6 +131,7 @@ #define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40 #define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43 #define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011 +#define PCI_DEVICE_ID_COMPAQ_CISS 0xb060 #define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130 #define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150 @@ -333,9 +334,11 @@ #define PCI_DEVICE_ID_SI_300 0x0300 #define PCI_DEVICE_ID_SI_530 0x0530 #define PCI_DEVICE_ID_SI_540 0x0540 +#define PCI_DEVICE_ID_SI_540_VGA 0x5300 #define PCI_DEVICE_ID_SI_601 0x0601 #define PCI_DEVICE_ID_SI_620 0x0620 #define PCI_DEVICE_ID_SI_630 0x0630 +#define PCI_DEVICE_ID_SI_630_VGA 0x6300 #define PCI_DEVICE_ID_SI_5107 0x5107 #define PCI_DEVICE_ID_SI_5300 0x5300 #define PCI_DEVICE_ID_SI_5511 0x5511 @@ -461,6 +464,7 @@ #define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 #define PCI_DEVICE_ID_APPLE_GC 0x0002 #define PCI_DEVICE_ID_APPLE_HYDRA 0x000e +#define PCI_DEVICE_ID_APPLE_UNINORTH 0x0020 #define PCI_VENDOR_ID_NEXGEN 0x1074 #define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78 @@ -820,6 +824,11 @@ #define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011 #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 +#define PCI_VENDOR_ID_SBE 0x1176 +#define PCI_DEVICE_ID_SBE_WANXL100 0x0301 +#define PCI_DEVICE_ID_SBE_WANXL200 0x0302 +#define PCI_DEVICE_ID_SBE_WANXL400 0x0104 + #define PCI_VENDOR_ID_TOSHIBA 0x1179 #define PCI_DEVICE_ID_TOSHIBA_601 0x0601 #define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a @@ -911,6 +920,10 @@ #define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105 #define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200 #define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201 +#define PCI_DEVICE_ID_PC300_RX_2 0x0300 +#define PCI_DEVICE_ID_PC300_RX_1 0x0301 +#define PCI_DEVICE_ID_PC300_TE_2 0x0310 +#define PCI_DEVICE_ID_PC300_TE_1 0x0311 #define PCI_VENDOR_ID_ESSENTIAL 0x120f #define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001 @@ -1071,11 +1084,6 @@ #define PCI_DEVICE_ID_LAVA_QUAD_B 0x0202 /* 2x 16650, half of 4 port */ #define PCI_DEVICE_ID_LAVA_SSERIAL 0x0500 /* 1x 16550 */ #define PCI_DEVICE_ID_LAVA_PORT_650 0x0600 /* 1x 16650 */ - -#define PCI_VENDOR_ID_SYBA 0x1592 -#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 -#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 - #define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000 #define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002 /* The Lava Dual Parallel is */ #define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003 /* two PCI devices on a card */ @@ -1102,6 +1110,10 @@ #define PCI_VENDOR_ID_AFAVLAB 0x14db #define PCI_DEVICE_ID_AFAVLAB_TK9902 0x2120 +#define PCI_VENDOR_ID_SYBA 0x1592 +#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 +#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 + #define PCI_VENDOR_ID_MORETON 0x15aa #define PCI_DEVICE_ID_RASTEL_2PORT 0x2000 diff --git a/include/linux/pmu.h b/include/linux/pmu.h index ad4d12b67..cd1ac601a 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h @@ -10,6 +10,7 @@ /* * PMU commands */ +#define PMU_POWER_CTRL0 0x10 /* control power of some devices */ #define PMU_POWER_CTRL 0x11 /* control power of some devices */ #define PMU_ADB_CMD 0x20 /* send ADB packet */ #define PMU_ADB_POLL_OFF 0x21 /* disable ADB auto-poll */ @@ -26,15 +27,25 @@ #define PMU_INT_ACK 0x78 /* read interrupt bits */ #define PMU_SHUTDOWN 0x7e /* turn power off */ #define PMU_SLEEP 0x7f /* put CPU to sleep */ +#define PMU_POWER_EVENTS 0x8f /* Send power-event commands to PMU */ #define PMU_RESET 0xd0 /* reset CPU */ #define PMU_GET_BRIGHTBUTTON 0xd9 /* report brightness up/down pos */ #define PMU_GET_COVER 0xdc /* report cover open/closed */ +#define PMU_SYSTEM_READY 0xdf /* tell PMU we are awake */ + +/* Bits to use with the PMU_POWER_CTRL0 command */ +#define PMU_POW0_ON 0x80 /* OR this to power ON the device */ +#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */ +#define PMU_POW0_HARD_DRIVE 0x04 /* Hard drive power (on wallstreet/lombard ?) */ /* Bits to use with the PMU_POWER_CTRL command */ #define PMU_POW_ON 0x80 /* OR this to power ON the device */ #define PMU_POW_OFF 0x00 /* leave bit 7 to 0 to power it OFF */ #define PMU_POW_BACKLIGHT 0x01 /* backlight power */ +#define PMU_POW_CHARGER 0x02 /* battery charger power */ #define PMU_POW_IRLED 0x04 /* IR led power (on wallstreet) */ +#define PMU_POW_MEDIABAY 0x08 /* media bay power (wallstreet/lombard ?) */ + /* Bits in PMU interrupt and interrupt mask bytes */ #define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */ @@ -54,6 +65,25 @@ enum { PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */ }; +/* PMU PMU_POWER_EVENTS commands */ +enum { + PMU_PWR_GET_POWERUP_EVENTS = 0x00, + PMU_PWR_SET_POWERUP_EVENTS = 0x01, + PMU_PWR_CLR_POWERUP_EVENTS = 0x02, + PMU_PWR_GET_WAKEUP_EVENTS = 0x03, + PMU_PWR_SET_WAKEUP_EVENTS = 0x04, + PMU_PWR_CLR_WAKEUP_EVENTS = 0x05, +}; + +/* Power events wakeup bits */ +enum { + PMU_PWR_WAKEUP_KEY = 0x01, /* Wake on key press */ + PMU_PWR_WAKEUP_AC_INSERT = 0x02, /* Wake on AC adapter plug */ + PMU_PWR_WAKEUP_AC_CHANGE = 0x04, + PMU_PWR_WAKEUP_LID_OPEN = 0x08, + PMU_PWR_WAKEUP_RING = 0x10, +}; + /* * Ioctl commands for the /dev/pmu device */ @@ -61,34 +91,38 @@ enum { /* no param */ #define PMU_IOC_SLEEP _IO('B', 0) -/* out param: u32* backlight value: 0 to 31 */ +/* out param: u32* backlight value: 0 to 15 */ #define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, sizeof(__u32*)) -/* in param: u32 backlight value: 0 to 31 */ +/* in param: u32 backlight value: 0 to 15 */ #define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, sizeof(__u32)) -/* out param: u32* backlight value: 0 to 31 */ +/* out param: u32* PMU model */ #define PMU_IOC_GET_MODEL _IOR('B', 3, sizeof(__u32*)) /* out param: u32* has_adb: 0 or 1 */ #define PMU_IOC_HAS_ADB _IOR('B', 4, sizeof(__u32*)) #ifdef __KERNEL__ -int find_via_pmu(void); -int via_pmu_init(void); +extern int find_via_pmu(void); +extern int via_pmu_start(void); -int pmu_request(struct adb_request *req, +extern int pmu_request(struct adb_request *req, void (*done)(struct adb_request *), int nbytes, ...); -void pmu_poll(void); -void pmu_enable_backlight(int on); -void pmu_set_brightness(int level); +extern void pmu_poll(void); + +/* For use before switching interrupts off for a long time; + * warning: not stackable + */ +extern void pmu_suspend(void); +extern void pmu_resume(void); -void pmu_enable_irled(int on); +extern void pmu_enable_irled(int on); -void pmu_restart(void); -void pmu_shutdown(void); +extern void pmu_restart(void); +extern void pmu_shutdown(void); -int pmu_present(void); -int pmu_get_model(void); +extern int pmu_present(void); +extern int pmu_get_model(void); #ifdef CONFIG_PMAC_PBOOK /* @@ -135,4 +169,4 @@ int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier); #endif /* CONFIG_PMAC_PBOOK */ -#endif /* __KERNEL */ +#endif /* __KERNEL__ */ diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 6cc9767a3..ec87c2ddd 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -82,7 +82,7 @@ extern struct gendisk * find_gendisk (kdev_t dev); extern int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x); extern int md_error (kdev_t mddev, kdev_t rdev); -extern void md_run_setup(void); +extern int md_run_setup(void); extern void md_print_devices (void); diff --git a/include/linux/raid/md_compatible.h b/include/linux/raid/md_compatible.h index fbeac31a1..1dd422185 100644 --- a/include/linux/raid/md_compatible.h +++ b/include/linux/raid/md_compatible.h @@ -77,11 +77,7 @@ extern inline void md_init_signals (void) /* 011 */ #define md_signal_pending signal_pending -/* 012 */ -extern inline void md_set_global_readahead(int * table) -{ - max_readahead[MD_MAJOR] = table; -} +/* 012 - md_set_global_readahead - nowhere used */ /* 013 */ #define md_mdelay(x) mdelay(x) diff --git a/include/linux/sched.h b/include/linux/sched.h index 4357bb6fe..bb4537f24 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -33,12 +33,14 @@ extern unsigned long event; #define CLONE_VM 0x00000100 /* set if VM shared between processes */ #define CLONE_FS 0x00000200 /* set if fs info shared between processes */ #define CLONE_FILES 0x00000400 /* set if open files shared between processes */ -#define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */ +#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */ #define CLONE_PID 0x00001000 /* set if pid shared */ #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */ #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */ #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */ -#define CLONE_THREAD 0x00010000 /* set if we want to clone the "thread group" */ +#define CLONE_THREAD 0x00010000 /* Same thread group? */ + +#define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD) /* * These are the constant used to fake the fixed-point load-average @@ -296,6 +298,7 @@ struct task_struct { * that's just fine.) */ struct list_head run_list; + unsigned long sleep_time; struct task_struct *next_task, *prev_task; struct mm_struct *active_mm; @@ -354,6 +357,7 @@ struct task_struct { /* file system info */ int link_count; struct tty_struct *tty; /* NULL if no tty */ + unsigned int locks; /* How many file locks are being held */ /* ipc stuff */ struct sem_undo *semundo; struct sem_queue *semsleeping; @@ -366,8 +370,10 @@ struct task_struct { /* signal handlers */ spinlock_t sigmask_lock; /* Protects signal and blocked */ struct signal_struct *sig; - sigset_t signal, blocked; - struct signal_queue *sigqueue, **sigqueue_tail; + + sigset_t blocked; + struct sigpending pending; + unsigned long sas_ss_sp; size_t sas_ss_size; int (*notifier)(void *priv); @@ -455,10 +461,8 @@ struct task_struct { files: &init_files, \ sigmask_lock: SPIN_LOCK_UNLOCKED, \ sig: &init_signals, \ - signal: {{0}}, \ + pending: { NULL, &tsk.pending.head, {{0}}}, \ blocked: {{0}}, \ - sigqueue: NULL, \ - sigqueue_tail: &tsk.sigqueue, \ alloc_lock: SPIN_LOCK_UNLOCKED \ } @@ -577,11 +581,11 @@ static inline int signal_pending(struct task_struct *p) return (p->sigpending != 0); } -/* Reevaluate whether the task has signals pending delivery. - This is required every time the blocked sigset_t changes. - All callers should have t->sigmask_lock. */ - -static inline void recalc_sigpending(struct task_struct *t) +/* + * Re-calculate pending state from the set of locally pending + * signals, globally pending signals, and blocked signals. + */ +static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked) { unsigned long ready; long i; @@ -589,23 +593,31 @@ static inline void recalc_sigpending(struct task_struct *t) switch (_NSIG_WORDS) { default: for (i = _NSIG_WORDS, ready = 0; --i >= 0 ;) - ready |= t->signal.sig[i] &~ t->blocked.sig[i]; + ready |= signal->sig[i] &~ blocked->sig[i]; break; - case 4: ready = t->signal.sig[3] &~ t->blocked.sig[3]; - ready |= t->signal.sig[2] &~ t->blocked.sig[2]; - ready |= t->signal.sig[1] &~ t->blocked.sig[1]; - ready |= t->signal.sig[0] &~ t->blocked.sig[0]; + case 4: ready = signal->sig[3] &~ blocked->sig[3]; + ready |= signal->sig[2] &~ blocked->sig[2]; + ready |= signal->sig[1] &~ blocked->sig[1]; + ready |= signal->sig[0] &~ blocked->sig[0]; break; - case 2: ready = t->signal.sig[1] &~ t->blocked.sig[1]; - ready |= t->signal.sig[0] &~ t->blocked.sig[0]; + case 2: ready = signal->sig[1] &~ blocked->sig[1]; + ready |= signal->sig[0] &~ blocked->sig[0]; break; - case 1: ready = t->signal.sig[0] &~ t->blocked.sig[0]; + case 1: ready = signal->sig[0] &~ blocked->sig[0]; } + return ready != 0; +} + +/* Reevaluate whether the task has signals pending delivery. + This is required every time the blocked sigset_t changes. + All callers should have t->sigmask_lock. */ - t->sigpending = (ready != 0); +static inline void recalc_sigpending(struct task_struct *t) +{ + t->sigpending = has_pending_signals(&t->pending.signal, &t->blocked); } /* True if we are on the alternate signal stack. */ @@ -710,7 +722,7 @@ extern fd_set *alloc_fdset(int); extern int expand_fdset(struct files_struct *, int nr); extern void free_fdset(fd_set *, int); -extern int copy_thread(int, unsigned long, unsigned long, struct task_struct *, struct pt_regs *); +extern int copy_thread(int, unsigned long, unsigned long, unsigned long, struct task_struct *, struct pt_regs *); extern void flush_thread(void); extern void exit_thread(void); @@ -721,7 +733,7 @@ extern void exit_sighand(struct task_struct *); extern void daemonize(void); extern int do_execve(char *, char **, char **, struct pt_regs *); -extern int do_fork(unsigned long, unsigned long, struct pt_regs *); +extern int do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long); extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); @@ -810,6 +822,7 @@ do { \ static inline void del_from_runqueue(struct task_struct * p) { nr_running--; + p->sleep_time = jiffies; list_del(&p->run_list); p->run_list.next = NULL; } diff --git a/include/linux/signal.h b/include/linux/signal.h index d6e82ae05..f2d0766ef 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -9,12 +9,16 @@ * Real Time signals may be queued. */ -struct signal_queue -{ - struct signal_queue *next; +struct sigqueue { + struct sigqueue *next; siginfo_t info; }; +struct sigpending { + struct sigqueue *head, **tail; + sigset_t signal; +}; + /* * Define some primitives to manipulate sigset_t. */ @@ -24,7 +28,7 @@ struct signal_queue /* We don't use <asm/bitops.h> for these because there is no need to be atomic. */ -extern inline void sigaddset(sigset_t *set, int _sig) +static inline void sigaddset(sigset_t *set, int _sig) { unsigned long sig = _sig - 1; if (_NSIG_WORDS == 1) @@ -33,7 +37,7 @@ extern inline void sigaddset(sigset_t *set, int _sig) set->sig[sig / _NSIG_BPW] |= 1UL << (sig % _NSIG_BPW); } -extern inline void sigdelset(sigset_t *set, int _sig) +static inline void sigdelset(sigset_t *set, int _sig) { unsigned long sig = _sig - 1; if (_NSIG_WORDS == 1) @@ -42,7 +46,7 @@ extern inline void sigdelset(sigset_t *set, int _sig) set->sig[sig / _NSIG_BPW] &= ~(1UL << (sig % _NSIG_BPW)); } -extern inline int sigismember(sigset_t *set, int _sig) +static inline int sigismember(sigset_t *set, int _sig) { unsigned long sig = _sig - 1; if (_NSIG_WORDS == 1) @@ -51,7 +55,7 @@ extern inline int sigismember(sigset_t *set, int _sig) return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW)); } -extern inline int sigfindinword(unsigned long word) +static inline int sigfindinword(unsigned long word) { return ffz(~word); } @@ -64,7 +68,7 @@ extern inline int sigfindinword(unsigned long word) #include <linux/string.h> #define _SIG_SET_BINOP(name, op) \ -extern inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \ +static inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \ { \ unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \ unsigned long i; \ @@ -115,7 +119,7 @@ _SIG_SET_BINOP(signandsets, _sig_nand) #undef _sig_nand #define _SIG_SET_OP(name, op) \ -extern inline void name(sigset_t *set) \ +static inline void name(sigset_t *set) \ { \ unsigned long i; \ \ @@ -138,7 +142,7 @@ _SIG_SET_OP(signotset, _sig_not) #undef _SIG_SET_OP #undef _sig_not -extern inline void sigemptyset(sigset_t *set) +static inline void sigemptyset(sigset_t *set) { switch (_NSIG_WORDS) { default: @@ -150,7 +154,7 @@ extern inline void sigemptyset(sigset_t *set) } } -extern inline void sigfillset(sigset_t *set) +static inline void sigfillset(sigset_t *set) { switch (_NSIG_WORDS) { default: @@ -166,22 +170,22 @@ extern char * render_sigset_t(sigset_t *set, char *buffer); /* Some extensions for manipulating the low 32 signals in particular. */ -extern inline void sigaddsetmask(sigset_t *set, unsigned long mask) +static inline void sigaddsetmask(sigset_t *set, unsigned long mask) { set->sig[0] |= mask; } -extern inline void sigdelsetmask(sigset_t *set, unsigned long mask) +static inline void sigdelsetmask(sigset_t *set, unsigned long mask) { set->sig[0] &= ~mask; } -extern inline int sigtestsetmask(sigset_t *set, unsigned long mask) +static 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) +static inline void siginitset(sigset_t *set, unsigned long mask) { set->sig[0] = mask; switch (_NSIG_WORDS) { @@ -193,7 +197,7 @@ extern inline void siginitset(sigset_t *set, unsigned long mask) } } -extern inline void siginitsetinv(sigset_t *set, unsigned long mask) +static inline void siginitsetinv(sigset_t *set, unsigned long mask) { set->sig[0] = ~mask; switch (_NSIG_WORDS) { @@ -207,6 +211,15 @@ extern inline void siginitsetinv(sigset_t *set, unsigned long mask) #endif /* __HAVE_ARCH_SIG_SETOPS */ +static inline void init_sigpending(struct sigpending *sig) +{ + sigemptyset(&sig->signal); + sig->head = NULL; + sig->tail = &sig->head; +} + +extern long do_sigpending(void *, unsigned long); + #endif /* __KERNEL__ */ #endif /* _LINUX_SIGNAL_H */ diff --git a/include/linux/slab.h b/include/linux/slab.h index 4f4818873..9a6e61025 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -11,7 +11,6 @@ typedef struct kmem_cache_s kmem_cache_t; -#include <linux/config.h> #include <linux/mm.h> #include <linux/cache.h> @@ -76,14 +75,6 @@ extern kmem_cache_t *bh_cachep; extern kmem_cache_t *fs_cachep; extern kmem_cache_t *sigact_cachep; -#ifdef CONFIG_SMP -extern unsigned long slab_cache_drain_mask; -extern void slab_drain_local_cache(void); -#else -#define slab_cache_drain_mask 0 -#define slab_drain_local_cache() do { } while (0) -#endif - #endif /* __KERNEL__ */ #endif /* _LINUX_SLAB_H */ diff --git a/include/linux/smp.h b/include/linux/smp.h index 33e2ee28a..cf20a8bd6 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -10,6 +10,7 @@ #ifdef CONFIG_SMP +#include <linux/kernel.h> #include <asm/smp.h> /* diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 4cc0f16ad..3f8d354bd 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -45,6 +45,7 @@ struct rpc_clnt { cl_chatty : 1,/* be verbose */ cl_autobind : 1,/* use getport() */ cl_binding : 1,/* doing a getport() */ + cl_droppriv : 1,/* enable NFS suid hack */ cl_oneshot : 1,/* dispose after use */ cl_dead : 1;/* abandoned */ unsigned int cl_flags; /* misc client flags */ diff --git a/include/linux/swap.h b/include/linux/swap.h index 9226ce0a5..05317e725 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -65,13 +65,16 @@ struct swap_info_struct { extern int nr_swap_pages; FASTCALL(unsigned int nr_free_pages(void)); +FASTCALL(unsigned int nr_inactive_clean_pages(void)); FASTCALL(unsigned int nr_free_buffer_pages(void)); -FASTCALL(unsigned int nr_free_highpages(void)); -extern int nr_lru_pages; +extern int nr_active_pages; +extern int nr_inactive_dirty_pages; extern atomic_t nr_async_pages; extern struct address_space swapper_space; extern atomic_t page_cache_size; extern atomic_t buffermem_pages; +extern spinlock_t pagecache_lock; +extern void __remove_inode_page(struct page *); /* Incomplete types for prototype declarations: */ struct task_struct; @@ -83,9 +86,30 @@ struct zone_t; extern int shm_swap(int, int); /* linux/mm/swap.c */ +extern int memory_pressure; +extern void age_page_up(struct page *); +extern void age_page_up_nolock(struct page *); +extern void age_page_down(struct page *); +extern void age_page_down_nolock(struct page *); +extern void age_page_down_ageonly(struct page *); +extern void deactivate_page(struct page *); +extern void deactivate_page_nolock(struct page *); +extern void activate_page(struct page *); +extern void activate_page_nolock(struct page *); +extern void lru_cache_add(struct page *); +extern void __lru_cache_del(struct page *); +extern void lru_cache_del(struct page *); +extern void recalculate_vm_stats(void); extern void swap_setup(void); /* linux/mm/vmscan.c */ +extern struct page * reclaim_page(zone_t *); +extern wait_queue_head_t kswapd_wait; +extern wait_queue_head_t kreclaimd_wait; +extern int page_launder(int, int); +extern int free_shortage(void); +extern int inactive_shortage(void); +extern void wakeup_kswapd(int); extern int try_to_free_pages(unsigned int gfp_mask); /* linux/mm/page_io.c */ @@ -161,30 +185,102 @@ static inline int is_page_shared(struct page *page) extern spinlock_t pagemap_lru_lock; /* - * Helper macros for lru_pages handling. + * Page aging defines. + * Since we do exponential decay of the page age, we + * can chose a fairly large maximum. */ -#define lru_cache_add(page) \ -do { \ - spin_lock(&pagemap_lru_lock); \ - list_add(&(page)->lru, &lru_cache); \ - nr_lru_pages++; \ - spin_unlock(&pagemap_lru_lock); \ -} while (0) - -#define __lru_cache_del(page) \ -do { \ - list_del(&(page)->lru); \ - nr_lru_pages--; \ -} while (0) - -#define lru_cache_del(page) \ -do { \ - if (!PageLocked(page)) \ - BUG(); \ - spin_lock(&pagemap_lru_lock); \ - __lru_cache_del(page); \ - spin_unlock(&pagemap_lru_lock); \ -} while (0) +#define PAGE_AGE_START 2 +#define PAGE_AGE_ADV 3 +#define PAGE_AGE_MAX 64 + +/* + * List add/del helper macros. These must be called + * with the pagemap_lru_lock held! + */ +#define DEBUG_ADD_PAGE \ + if (PageActive(page) || PageInactiveDirty(page) || \ + PageInactiveClean(page)) BUG(); + +#define ZERO_PAGE_BUG \ + if (page_count(page) == 0) BUG(); + +#define add_page_to_active_list(page) { \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ + SetPageActive(page); \ + list_add(&(page)->lru, &active_list); \ + nr_active_pages++; \ +} + +#define add_page_to_inactive_dirty_list(page) { \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ + SetPageInactiveDirty(page); \ + list_add(&(page)->lru, &inactive_dirty_list); \ + nr_inactive_dirty_pages++; \ + page->zone->inactive_dirty_pages++; \ +} + +#define add_page_to_inactive_clean_list(page) { \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ + SetPageInactiveClean(page); \ + list_add(&(page)->lru, &page->zone->inactive_clean_list); \ + page->zone->inactive_clean_pages++; \ +} + +#define del_page_from_active_list(page) { \ + list_del(&(page)->lru); \ + ClearPageActive(page); \ + nr_active_pages--; \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ +} + +#define del_page_from_inactive_dirty_list(page) { \ + list_del(&(page)->lru); \ + ClearPageInactiveDirty(page); \ + nr_inactive_dirty_pages--; \ + page->zone->inactive_dirty_pages--; \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ +} + +#define del_page_from_inactive_clean_list(page) { \ + list_del(&(page)->lru); \ + ClearPageInactiveClean(page); \ + page->zone->inactive_clean_pages--; \ + DEBUG_ADD_PAGE \ + ZERO_PAGE_BUG \ +} + +/* + * In mm/swap.c::recalculate_vm_stats(), we substract + * inactive_target from memory_pressure every second. + * This means that memory_pressure is smoothed over + * 64 (1 << INACTIVE_SHIFT) seconds. + */ +#define INACTIVE_SHIFT 6 +#define inactive_min(a,b) ((a) < (b) ? (a) : (b)) +#define inactive_target inactive_min((memory_pressure >> INACTIVE_SHIFT), \ + (num_physpages / 4)) + +/* + * Ugly ugly ugly HACK to make sure the inactive lists + * don't fill up with unfreeable ramdisk pages. We really + * want to fix the ramdisk driver to mark its pages as + * unfreeable instead of using dirty buffer magic, but the + * next code-change time is when 2.5 is forked... + */ +#ifndef _LINUX_KDEV_T_H +#include <linux/kdev_t.h> +#endif +#ifndef _LINUX_MAJOR_H +#include <linux/major.h> +#endif + +#define page_ramdisk(page) \ + (page->buffers && (MAJOR(page->buffers->b_dev) == RAMDISK_MAJOR)) extern spinlock_t swaplock; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 91913e545..c15bd0e55 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -186,7 +186,8 @@ enum NET_CORE_MSG_COST=8, NET_CORE_MSG_BURST=9, NET_CORE_OPTMEM_MAX=10, - NET_CORE_HOT_LIST_LENGTH=11 + NET_CORE_HOT_LIST_LENGTH=11, + NET_CORE_DIVERT_VERSION=12 }; /* /proc/sys/net/ethernet */ @@ -512,7 +513,10 @@ enum FS_NRSUPER=9, /* int:current number of allocated super_blocks */ FS_MAXSUPER=10, /* int:maximum number of super_blocks that can be allocated */ FS_OVERFLOWUID=11, /* int: overflow UID */ - FS_OVERFLOWGID=12 /* int: overflow GID */ + FS_OVERFLOWGID=12, /* int: overflow GID */ + FS_LEASES=13, /* int: leases enabled */ + FS_DIR_NOTIFY=14, /* int: directory notification enabled */ + FS_LEASE_TIME=15, /* int: maximum time to wait for a lease break */ }; /* CTL_DEBUG names: */ @@ -522,7 +526,8 @@ enum { DEV_CDROM=1, DEV_HWMON=2, DEV_PARPORT=3, - DEV_RAID=4 + DEV_RAID=4, + DEV_MAC_HID=5 }; /* /proc/sys/dev/cdrom */ @@ -573,6 +578,16 @@ enum { DEV_PARPORT_DEVICE_TIMESLICE=1, }; +/* /proc/sys/dev/mac_hid */ +enum { + DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1, + DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2, + DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3, + DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4, + DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5, + DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6 +}; + #ifdef __KERNEL__ extern asmlinkage long sys_sysctl(struct __sysctl_args *); diff --git a/include/linux/tcp.h b/include/linux/tcp.h index e030ee09f..89b009e5f 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -125,5 +125,63 @@ enum { #define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ #define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ +#define TCP_INFO 11 /* Information about this connection. */ + +#define TCPI_OPT_TIMESTAMPS 1 +#define TCPI_OPT_SACK 2 +#define TCPI_OPT_WSCALE 4 +#define TCPI_OPT_ECN 8 + +enum tcp_ca_state +{ + TCP_CA_Open = 0, +#define TCPF_CA_Open (1<<TCP_CA_Open) + TCP_CA_Disorder = 1, +#define TCPF_CA_Disorder (1<<TCP_CA_Disorder) + TCP_CA_CWR = 2, +#define TCPF_CA_CWR (1<<TCP_CA_CWR) + TCP_CA_Recovery = 3, +#define TCPF_CA_Recovery (1<<TCP_CA_Recovery) + TCP_CA_Loss = 4 +#define TCPF_CA_Loss (1<<TCP_CA_Loss) +}; + +struct tcp_info +{ + __u8 tcpi_state; + __u8 tcpi_ca_state; + __u8 tcpi_retransmits; + __u8 tcpi_probes; + __u8 tcpi_backoff; + __u8 tcpi_options; + __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; + + __u32 tcpi_rto; + __u32 tcpi_ato; + __u32 tcpi_snd_mss; + __u32 tcpi_rcv_mss; + + __u32 tcpi_unacked; + __u32 tcpi_sacked; + __u32 tcpi_lost; + __u32 tcpi_retrans; + __u32 tcpi_fackets; + + /* Times. */ + __u32 tcpi_last_data_sent; + __u32 tcpi_last_ack_sent; /* Not remembered, sorry. */ + __u32 tcpi_last_data_recv; + __u32 tcpi_last_ack_recv; + + /* Metrics. */ + __u32 tcpi_pmtu; + __u32 tcpi_rcv_ssthresh; + __u32 tcpi_rtt; + __u32 tcpi_rttvar; + __u32 tcpi_snd_ssthresh; + __u32 tcpi_snd_cwnd; + __u32 tcpi_advmss; + __u32 tcpi_reordering; +}; #endif /* _LINUX_TCP_H */ diff --git a/include/linux/telephony.h b/include/linux/telephony.h index c3e4c5573..3dd5a969a 100644 --- a/include/linux/telephony.h +++ b/include/linux/telephony.h @@ -1,32 +1,33 @@ -/* - * telephony.h +/****************************************************************************** + * + * telephony.h * - * Basic Linux Telephony Interface + * Basic Linux Telephony Interface * - * (c) Copyright 1999 Quicknet Technologies, Inc. + * (c) Copyright 1999 Quicknet Technologies, Inc. * - * 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 - * 2 of the License, or (at your option) any later version. + * 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 + * 2 of the License, or (at your option) any later version. * - * Authors: Ed Okerson, <eokerson@quicknet.net> - * Greg Herlein, <gherlein@quicknet.net> + * Authors: Ed Okerson, <eokerson@quicknet.net> + * Greg Herlein, <gherlein@quicknet.net> * - * Contributors: Alan Cox, <acox@redhat.com> - * David Erhart, <derhart@quicknet.net> + * Contributors: Alan Cox, <alan@redhat.com> + * David W. Erhart, <derhart@quicknet.net> * * Version: 0.1.0 - December 19, 1999 * * Fixes: - */ + * + *****************************************************************************/ #ifndef TELEPHONY_H #define TELEPHONY_H -/* vendor identification numbers */ #define PHONE_VENDOR_IXJ 1 -#define PHONE_VENDOR_QUICKNET PHONE_IXJ +#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ #define PHONE_VENDOR_VOICETRONIX 2 #define PHONE_VENDOR_ACULAB 3 #define PHONE_VENDOR_DIGI 4 @@ -43,7 +44,6 @@ * *****************************************************************************/ - /****************************************************************************** * * The capabilities ioctls can inform you of the capabilities of each phone @@ -81,11 +81,23 @@ typedef enum { #define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *) #define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *) +typedef struct { + char month[3]; + char day[3]; + char hour[3]; + char min[3]; + int numlen; + char number[11]; + int namelen; + char name[80]; +} PHONE_CID; + #define PHONE_RING _IO ('q', 0x83) #define PHONE_HOOKSTATE _IO ('q', 0x84) #define PHONE_MAXRINGS _IOW ('q', 0x85, char) #define PHONE_RING_CADENCE _IOW ('q', 0x86, short) -#define PHONE_RING_START _IO ('q', 0x87) +#define OLD_PHONE_RING_START _IO ('q', 0x87) +#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *) #define PHONE_RING_STOP _IO ('q', 0x88) #define USA_RING_CADENCE 0xC0C0 @@ -167,6 +179,23 @@ struct phone_codec_data #define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *) #define PHONE_PSTN_LINETEST _IO ('q', 0xA8) +/****************************************************************************** +* +* This controls the VAD/CNG functionality of G.723.1. The driver will +* always pass full size frames, any unused bytes will be padded with zeros, +* and frames passed to the driver should also be padded with zeros. The +* frame type is encoded in the least significant two bits of the first +* WORD of the frame as follows: +* +* bits 1-0 Frame Type Data Rate Significant Words +* 00 0 G.723.1 6.3 12 +* 01 1 G.723.1 5.3 10 +* 10 2 VAD/CNG 2 +* 11 3 Repeat last CNG 2 bits +* +******************************************************************************/ +#define PHONE_VAD _IOW ('q', 0xA9, int) + /****************************************************************************** * @@ -198,7 +227,12 @@ struct phone_except unsigned int f1:1; unsigned int f2:1; unsigned int f3:1; - unsigned int reserved:23; + unsigned int flash:1; + unsigned int fc0:1; + unsigned int fc1:1; + unsigned int fc2:1; + unsigned int fc3:1; + unsigned int reserved:18; }; union telephony_exception { diff --git a/include/linux/time.h b/include/linux/time.h index 53a125a08..87f334547 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -45,7 +45,42 @@ jiffies_to_timespec(unsigned long jiffies, struct timespec *value) value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ); value->tv_sec = jiffies / HZ; } - + + +/* Converts Gregorian date to seconds since 1970-01-01 00:00:00. + * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 + * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. + * + * [For the Julian calendar (which was used in Russia before 1917, + * Britain & colonies before 1752, anywhere else before 1582, + * and is still in use by some communities) leave out the + * -year/100+year/400 terms, and add 10.] + * + * This algorithm was first published by Gauss (I think). + * + * WARNING: this function will overflow on 2106-02-07 06:28:16 on + * machines were long is 32-bit! (However, as time_t is signed, we + * will already get problems at other places on 2038-01-19 03:14:08) + */ +static inline unsigned long +mktime (unsigned int year, unsigned int mon, + unsigned int day, unsigned int hour, + unsigned int min, unsigned int sec) +{ + if (0 >= (int) (mon -= 2)) { /* 1..12 -> 11,12,1..10 */ + mon += 12; /* Puts Feb last since it has leap day */ + year -= 1; + } + + return ((( + (unsigned long) (year/4 - year/100 + year/400 + 367*mon/12 + day) + + year*365 - 719499 + )*24 + hour /* now have hours */ + )*60 + min /* now have minutes */ + )*60 + sec; /* finally seconds */ +} + + struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ diff --git a/include/linux/timex.h b/include/linux/timex.h index 653009adf..5e8c283da 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -51,6 +51,8 @@ #ifndef _LINUX_TIMEX_H #define _LINUX_TIMEX_H +#include <asm/param.h> + /* * The following defines establish the engineering parameters of the PLL * model. The HZ variable establishes the timer interrupt frequency, 100 Hz @@ -58,10 +60,20 @@ * OSF/1 kernel. The SHIFT_HZ define expresses the same value as the * nearest power of two in order to avoid hardware multiply operations. */ -#ifdef __alpha__ -# define SHIFT_HZ 10 /* log2(HZ) */ +#if HZ >= 24 && HZ < 48 +# define SHIFT_HZ 5 +#elif HZ >= 48 && HZ < 96 +# define SHIFT_HZ 6 +#elif HZ >= 96 && HZ < 192 +# define SHIFT_HZ 7 +#elif HZ >= 192 && HZ < 384 +# define SHIFT_HZ 8 +#elif HZ >= 384 && HZ < 768 +# define SHIFT_HZ 9 +#elif HZ >= 768 && HZ < 1536 +# define SHIFT_HZ 10 #else -# define SHIFT_HZ 7 /* log2(HZ) */ +# error You lose. #endif /* diff --git a/include/linux/toshiba.h b/include/linux/toshiba.h new file mode 100644 index 000000000..8865b6bb1 --- /dev/null +++ b/include/linux/toshiba.h @@ -0,0 +1,36 @@ +/* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops + * + * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk) + * + * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers + * on making sure the structure is aligned and packed. + * + * 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 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ + +#ifndef _LINUX_TOSHIBA_H +#define _LINUX_TOSHIBA_H + +#define TOSH_PROC "/proc/toshiba" +#define TOSH_DEVICE "/dev/toshiba" +#define TOSH_SMM _IOWR('t', 0x90, 24) + +typedef struct { + unsigned int eax; + unsigned int ebx __attribute__ ((packed)); + unsigned int ecx __attribute__ ((packed)); + unsigned int edx __attribute__ ((packed)); + unsigned int esi __attribute__ ((packed)); + unsigned int edi __attribute__ ((packed)); +} SMMRegisters; + +#endif diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index 85517135d..3eb8f14ae 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -114,7 +114,7 @@ static inline void run_task_queue(task_queue *list) f = p -> routine; save_p = p; p = p -> next; - mb(); + smp_mb(); save_p -> sync = 0; if (f) (*f)(arg); diff --git a/include/linux/usb.h b/include/linux/usb.h index c01871586..bc8d32db4 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -29,6 +29,7 @@ /* * USB recipients */ +#define USB_RECIP_MASK 0x1f #define USB_RECIP_DEVICE 0x00 #define USB_RECIP_INTERFACE 0x01 #define USB_RECIP_ENDPOINT 0x02 @@ -234,36 +235,36 @@ struct usb_device_descriptor { /* Endpoint descriptor */ struct usb_endpoint_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u8 bEndpointAddress; - __u8 bmAttributes; - __u16 wMaxPacketSize; - __u8 bInterval; - __u8 bRefresh; - __u8 bSynchAddress; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u8 bEndpointAddress __attribute__ ((packed)); + __u8 bmAttributes __attribute__ ((packed)); + __u16 wMaxPacketSize __attribute__ ((packed)); + __u8 bInterval __attribute__ ((packed)); + __u8 bRefresh __attribute__ ((packed)); + __u8 bSynchAddress __attribute__ ((packed)); unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; /* Interface descriptor */ struct usb_interface_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u8 bInterfaceNumber; - __u8 bAlternateSetting; - __u8 bNumEndpoints; - __u8 bInterfaceClass; - __u8 bInterfaceSubClass; - __u8 bInterfaceProtocol; - __u8 iInterface; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u8 bInterfaceNumber __attribute__ ((packed)); + __u8 bAlternateSetting __attribute__ ((packed)); + __u8 bNumEndpoints __attribute__ ((packed)); + __u8 bInterfaceClass __attribute__ ((packed)); + __u8 bInterfaceSubClass __attribute__ ((packed)); + __u8 bInterfaceProtocol __attribute__ ((packed)); + __u8 iInterface __attribute__ ((packed)); struct usb_endpoint_descriptor *endpoint; unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; struct usb_interface { struct usb_interface_descriptor *altsetting; @@ -278,20 +279,20 @@ struct usb_interface { /* Configuration descriptor information.. */ struct usb_config_descriptor { - __u8 bLength; - __u8 bDescriptorType; - __u16 wTotalLength; - __u8 bNumInterfaces; - __u8 bConfigurationValue; - __u8 iConfiguration; - __u8 bmAttributes; - __u8 MaxPower; + __u8 bLength __attribute__ ((packed)); + __u8 bDescriptorType __attribute__ ((packed)); + __u16 wTotalLength __attribute__ ((packed)); + __u8 bNumInterfaces __attribute__ ((packed)); + __u8 bConfigurationValue __attribute__ ((packed)); + __u8 iConfiguration __attribute__ ((packed)); + __u8 bmAttributes __attribute__ ((packed)); + __u8 MaxPower __attribute__ ((packed)); struct usb_interface *interface; unsigned char *extra; /* Extra descriptors */ int extralen; -} __attribute__ ((packed)); +}; /* String descriptor */ struct usb_string_descriptor { @@ -345,9 +346,9 @@ typedef int (*usb_device_irq)(int, void *, int, void *); */ #define USB_DISABLE_SPD 0x0001 #define USB_ISO_ASAP 0x0002 -#define USB_URB_EARLY_COMPLETE 0x0004 #define USB_ASYNC_UNLINK 0x0008 #define USB_QUEUE_BULK 0x0010 +#define USB_NO_FSBR 0x0020 #define USB_TIMEOUT_KILLED 0x1000 // only set by HCD! typedef struct @@ -553,6 +554,7 @@ struct usb_device { }; extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum); +extern struct usb_endpoint_descriptor *usb_epnum_to_ep_desc(struct usb_device *dev, unsigned epnum); extern int usb_register(struct usb_driver *); extern void usb_deregister(struct usb_driver *); @@ -775,13 +777,13 @@ extern void usbdevfs_cleanup(void); #else /* CONFIG_USB_DEVICEFS */ -extern inline void usbdevfs_add_bus(struct usb_bus *bus) {} -extern inline void usbdevfs_remove_bus(struct usb_bus *bus) {} -extern inline void usbdevfs_add_device(struct usb_device *dev) {} -extern inline void usbdevfs_remove_device(struct usb_device *dev) {} +static inline void usbdevfs_add_bus(struct usb_bus *bus) {} +static inline void usbdevfs_remove_bus(struct usb_bus *bus) {} +static inline void usbdevfs_add_device(struct usb_device *dev) {} +static inline void usbdevfs_remove_device(struct usb_device *dev) {} -extern inline int usbdevfs_init(void) { return 0; } -extern inline void usbdevfs_cleanup(void) { } +static inline int usbdevfs_init(void) { return 0; } +static inline void usbdevfs_cleanup(void) { } #endif /* CONFIG_USB_DEVICEFS */ diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 4ad7577df..487ee8215 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h @@ -80,6 +80,7 @@ struct usbdevfs_connectinfo { #define USBDEVFS_URB_DISABLE_SPD 1 #define USBDEVFS_URB_ISO_ASAP 2 +#define USBDEVFS_URB_QUEUE_BULK 0x10 #define USBDEVFS_URB_TYPE_ISO 0 #define USBDEVFS_URB_TYPE_INTERRUPT 1 diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index bba1e159e..f87bd8571 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -26,9 +26,6 @@ extern void vmfree_area_pages(unsigned long address, unsigned long size); extern int vmalloc_area_pages(unsigned long address, unsigned long size, int gfp_mask, pgprot_t prot); -extern struct vm_struct * vmlist; - - /* * Allocate any pages */ diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index 626b2524d..87561dd4e 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h @@ -32,7 +32,7 @@ #endif #ifndef VT_BUF_HAVE_MEMSETW -extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count) +static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) { count /= 2; while (count--) @@ -41,7 +41,7 @@ extern inline void scr_memsetw(u16 *s, u16 c, unsigned int count) #endif #ifndef VT_BUF_HAVE_MEMCPYW -extern inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count) +static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count) { count /= 2; while (count--) @@ -50,7 +50,7 @@ extern inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count) #endif #ifndef VT_BUF_HAVE_MEMMOVEW -extern inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count) +static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count) { if (d < s) scr_memcpyw(d, s, count); @@ -65,14 +65,14 @@ extern inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count) #endif #ifndef VT_BUF_HAVE_MEMCPYF -extern inline void scr_memcpyw_from(u16 *d, const u16 *s, unsigned int count) +static inline void scr_memcpyw_from(u16 *d, const u16 *s, unsigned int count) { count /= 2; while (count--) *d++ = scr_readw(s++); } -extern inline void scr_memcpyw_to(u16 *d, const u16 *s, unsigned int count) +static inline void scr_memcpyw_to(u16 *d, const u16 *s, unsigned int count) { count /= 2; while (count--) diff --git a/include/linux/wait.h b/include/linux/wait.h index a3687bf53..8629f3241 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -158,7 +158,7 @@ static inline int waitqueue_active(wait_queue_head_t *q) return !list_empty(&q->task_list); } -extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) +static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) { #if WAITQUEUE_DEBUG if (!head || !new) @@ -174,7 +174,7 @@ extern inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) /* * Used for wake-one threads: */ -extern inline void __add_wait_queue_tail(wait_queue_head_t *head, +static inline void __add_wait_queue_tail(wait_queue_head_t *head, wait_queue_t *new) { #if WAITQUEUE_DEBUG @@ -188,7 +188,7 @@ extern inline void __add_wait_queue_tail(wait_queue_head_t *head, list_add_tail(&new->task_list, &head->task_list); } -extern inline void __remove_wait_queue(wait_queue_head_t *head, +static inline void __remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) { #if WAITQUEUE_DEBUG diff --git a/include/linux/zftape.h b/include/linux/zftape.h index ec5d2ffe0..b057c6536 100644 --- a/include/linux/zftape.h +++ b/include/linux/zftape.h @@ -56,7 +56,7 @@ struct mtblksz { extern int zft_init(void); -extern inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz) +static inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz) { if (blk_sz == 1) { return value; @@ -66,7 +66,7 @@ extern inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz) } } -extern inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz) +static inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz) { if (blk_sz == 1) { return value; |