diff options
Diffstat (limited to 'include/linux')
48 files changed, 1066 insertions, 621 deletions
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index da8730aef..81f463cd5 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h @@ -32,7 +32,7 @@ #define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */ #define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */ #define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */ -#define AC97_PCM_LR_DAC_RATE 0x0032 /* PCM LR DAC Rate */ +#define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR ADC Rate */ #define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */ #define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */ #define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */ diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 0a9eb9762..4d5ada52b 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -257,7 +257,7 @@ enum { #define ATM_ATMOPT_CLP 1 /* set CLP bit */ -typedef struct { unsigned short bits; } atm_vcc_flags_t; +typedef struct { unsigned int bits; } atm_vcc_flags_t; struct atm_vcc { @@ -286,7 +286,6 @@ struct atm_vcc { struct sk_buff_head recvq; /* receive queue */ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ wait_queue_head_t sleep; /* if socket is busy */ - wait_queue_head_t wsleep; /* if waiting for write buffer space */ struct sock *sk; /* socket backpointer */ struct atm_vcc *prev,*next; /* SVC part --- may move later ------------------------------------- */ diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 04e9963de..0644ae74c 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -54,6 +54,7 @@ extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm); extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); extern void compute_creds(struct linux_binprm *binprm); extern int do_coredump(long signr, struct pt_regs * regs); +extern void set_binfmt(struct linux_binfmt *new); #if 0 diff --git a/include/linux/blk.h b/include/linux/blk.h index fd9e46712..777469870 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -53,6 +53,7 @@ extern int nbd_init(void); extern int ez_init(void); extern int bpcd_init(void); extern int ps2esdi_init(void); +extern int jsfd_init(void); #if defined(CONFIG_ARCH_S390) extern int mdisk_init(void); diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index a1d9b2939..00c3df0cc 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -905,7 +905,7 @@ struct cdrom_mechstat_header { #endif __u8 curlba[3]; __u8 nslots; - __u8 short slot_tablelen; + __u16 slot_tablelen; }; struct cdrom_slot { diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f28b3bd9e..9ed7e0726 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -177,8 +177,8 @@ extern void d_rehash(struct dentry *); * @entry: dentry to add * @inode: The inode to attach to this dentry * - * This adds the entry to the hash queues and initializes "d_inode". - * The entry was actually filled in earlier during "d_alloc()" + * This adds the entry to the hash queues and initializes @inode. + * The entry was actually filled in earlier during d_alloc(). */ static __inline__ void d_add(struct dentry * entry, struct inode * inode) @@ -207,9 +207,9 @@ extern char * __d_path(struct dentry *, struct vfsmount *, struct dentry *, /** * dget - get a reference to a dentry - * @dentry: dentry to get a reference too + * @dentry: dentry to get a reference to * - * Given a dentry or NULL pointer increment the reference count + * Given a dentry or %NULL pointer increment the reference count * if appropriate and return the dentry. A dentry will not be * destroyed when it has references. */ @@ -225,7 +225,7 @@ static __inline__ struct dentry * dget(struct dentry *dentry) * d_unhashed - is dentry hashed * @dentry: entry to check * - * Returns true if the dentry passed is not currently hashed + * Returns true if the dentry passed is not currently hashed. */ static __inline__ int d_unhashed(struct dentry *dentry) diff --git a/include/linux/file.h b/include/linux/file.h index 1a11904b6..a6998496c 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -33,12 +33,12 @@ extern inline struct file * fcheck(unsigned int fd) return file; } -extern inline struct file * frip(unsigned int fd) +extern inline struct file * frip(struct files_struct *files, unsigned int fd) { struct file * file = NULL; - if (fd < current->files->max_fds) - file = xchg(¤t->files->fd[fd], NULL); + if (fd < files->max_fds) + file = xchg(&files->fd[fd], NULL); return file; } diff --git a/include/linux/fs.h b/include/linux/fs.h index 57bade5c6..3f135fa01 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -20,7 +20,6 @@ #include <linux/stat.h> #include <linux/cache.h> #include <linux/stddef.h> -#include <linux/string.h> #include <asm/atomic.h> #include <asm/bitops.h> @@ -99,6 +98,7 @@ extern int max_super_blocks, nr_super_blocks; #define MS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon * as nfs_rename() will be cleaned up */ +#define S_DEAD (1<<16) /* removed, but still open directory */ /* * Flags that can be altered by MS_REMOUNT @@ -141,6 +141,7 @@ extern int max_super_blocks, nr_super_blocks; #define IS_NOATIME(inode) __IS_FLG(inode, MS_NOATIME) #define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) +#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) /* the read-only stuff doesn't really belong here, but any other place is probably as bad and I don't want to create yet another include file. */ @@ -172,6 +173,7 @@ extern int max_super_blocks, nr_super_blocks; #ifdef __KERNEL__ +#include <linux/string.h> #include <asm/semaphore.h> #include <asm/byteorder.h> @@ -179,9 +181,9 @@ extern void update_atime (struct inode *); #define UPDATE_ATIME(inode) update_atime (inode) extern void buffer_init(unsigned long); -extern void inode_init(void); +extern void inode_init(unsigned long); extern void file_table_init(void); -extern void dcache_init(void); +extern void dcache_init(unsigned long); /* bh state bits */ #define BH_Uptodate 0 /* 1 if the buffer contains valid data */ @@ -336,8 +338,9 @@ struct page; struct address_space; struct address_space_operations { - int (*writepage) (struct dentry *, struct page *); + int (*writepage)(struct file *, struct dentry *, struct page *); int (*readpage)(struct dentry *, struct page *); + int (*sync_page)(struct page *); int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); int (*commit_write)(struct file *, struct page *, unsigned, unsigned); /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ @@ -551,6 +554,8 @@ struct nameidata { struct dentry *dentry; struct vfsmount *mnt; struct qstr last; + unsigned int flags; + int last_type; }; #define FASYNC_MAGIC 0x4601 @@ -689,6 +694,11 @@ struct block_device_operations { int (*revalidate) (kdev_t); }; +/* + * NOTE: + * read, write, poll, fsync, readv, writev can be called + * without the big kernel lock held in all filesystems. + */ struct file_operations { loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char *, size_t, loff_t *); @@ -841,7 +851,8 @@ asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */ extern int do_close(unsigned int, int); /* yes, it's really unsigned */ extern int do_truncate(struct dentry *, loff_t start); extern int get_unused_fd(void); -extern void put_unused_fd(unsigned int); +extern void __put_unused_fd(struct files_struct *, unsigned int); /* locked outside */ +extern void put_unused_fd(unsigned int); /* locked inside */ extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); @@ -857,6 +868,7 @@ extern int unregister_blkdev(unsigned int, const char *); extern struct block_device *bdget(dev_t); extern void bdput(struct block_device *); extern int blkdev_open(struct inode *, struct file *); +extern int blkdev_close(struct inode * inode, struct file * filp); extern struct file_operations def_blk_fops; extern struct file_operations def_fifo_fops; extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); @@ -878,7 +890,6 @@ extern void init_special_inode(struct inode *, umode_t, int); extern void make_bad_inode(struct inode *); extern int is_bad_inode(struct inode *); -extern struct file_operations connecting_fifo_fops; extern struct file_operations read_fifo_fops; extern struct file_operations write_fifo_fops; extern struct file_operations rdwr_fifo_fops; @@ -947,7 +958,6 @@ extern void invalidate_inode_pages(struct inode *); #define invalidate_buffers(dev) __invalidate_buffers((dev), 0) #define destroy_buffers(dev) __invalidate_buffers((dev), 1) extern void __invalidate_buffers(kdev_t dev, int); -extern int floppy_is_wp(int); extern void sync_inodes(kdev_t); extern void write_inode_now(struct inode *); extern void sync_dev(kdev_t); @@ -991,10 +1001,14 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *); */ #define LOOKUP_FOLLOW (1) #define LOOKUP_DIRECTORY (2) -#define LOOKUP_SLASHOK (4) -#define LOOKUP_CONTINUE (8) -#define LOOKUP_POSITIVE (16) -#define LOOKUP_PARENT (32) +#define LOOKUP_CONTINUE (4) +#define LOOKUP_POSITIVE (8) +#define LOOKUP_PARENT (16) +#define LOOKUP_NOALT (32) +/* + * Type of the last component on LOOKUP_PARENT + */ +enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT }; /* * "descriptor" for what we're up to with a read for sendfile(). @@ -1014,9 +1028,12 @@ typedef struct { typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, unsigned long); +/* needed for stackable file system support */ +extern loff_t default_llseek(struct file *file, loff_t offset, int origin); + extern struct dentry * lookup_dentry(const char *, unsigned int); extern int walk_init(const char *, unsigned, struct nameidata *); -extern int walk_name(const char *, unsigned, struct nameidata *); +extern int walk_name(const char *, struct nameidata *); extern struct dentry * lookup_one(const char *, struct dentry *); extern struct dentry * __namei(const char *, unsigned int); @@ -1071,12 +1088,15 @@ typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int); /* Generic buffer handling for block filesystems.. */ extern int block_flushpage(struct page *, unsigned long); +extern int block_fsync(struct file *filp, struct dentry *dentry); extern int block_symlink(struct inode *, const char *, int); extern int block_write_full_page(struct page*, get_block_t*); extern int block_read_full_page(struct page*, get_block_t*); extern int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); extern int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, unsigned long *); +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); diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h new file mode 100644 index 000000000..e9c32f386 --- /dev/null +++ b/include/linux/fs_struct.h @@ -0,0 +1,59 @@ +#ifndef _LINUX_FS_STRUCT_H +#define _LINUX_FS_STRUCT_H +#ifdef __KERNEL__ + +struct fs_struct { + atomic_t count; + int umask; + struct dentry * root, * pwd, * altroot; + struct vfsmount * rootmnt, * pwdmnt, * altrootmnt; +}; + +#define INIT_FS { \ + ATOMIC_INIT(1), \ + 0022, \ + NULL, NULL, NULL, NULL, NULL, NULL \ +} + +extern void exit_fs(struct task_struct *); +extern void set_fs_altroot(void); + +/* + * Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values. + * It can block. Requires the big lock held. + */ + +static inline void set_fs_root(struct fs_struct *fs, + struct vfsmount *mnt, + struct dentry *dentry) +{ + struct dentry *old_root = fs->root; + struct vfsmount *old_rootmnt = fs->rootmnt; + fs->rootmnt = mntget(mnt); + fs->root = dget(dentry); + dput(old_root); + mntput(old_rootmnt); +} + +/* + * Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values. + * It can block. Requires the big lock held. + */ + +static inline void set_fs_pwd(struct fs_struct *fs, + struct vfsmount *mnt, + struct dentry *dentry) +{ + struct dentry *old_pwd = fs->pwd; + struct vfsmount *old_pwdmnt = fs->pwdmnt; + fs->pwdmnt = mntget(mnt); + fs->pwd = dget(dentry); + dput(old_pwd); + mntput(old_pwdmnt); +} + +struct fs_struct *copy_fs_struct(struct fs_struct *old); +void put_fs_struct(struct fs_struct *fs); + +#endif +#endif diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index 70635b491..e28f6bfff 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h @@ -96,6 +96,8 @@ #define SMART_AUTOSAVE 0xd2 #define SMART_SAVE 0xd3 #define SMART_IMMEDIATE_OFFLINE 0xd4 +#define SMART_READ_LOG_SECTOR 0xd5 +#define SMART_WRITE_LOG_SECTOR 0xd6 #define SMART_ENABLE 0xd8 #define SMART_DISABLE 0xd9 #define SMART_STATUS 0xda diff --git a/include/linux/hdsmart.h b/include/linux/hdsmart.h index 10bd7249d..509b591d2 100644 --- a/include/linux/hdsmart.h +++ b/include/linux/hdsmart.h @@ -1,61 +1,139 @@ +/* + * linux/include/linux/hdsmart.h + * + * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org> + * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> + * + * 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. + * + * You should have received a copy of the GNU General Public License + * (for example /usr/src/linux/COPYING); if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + #ifndef _LINUX_HDSMART_H #define _LINUX_HDSMART_H -/* - * This file contains some defines for the AT-hd-controller. - * Various sources. - */ +/* smart_attribute is the vendor specific in SFF-8035 spec */ +struct ata_smart_attribute { + unsigned char id; + unsigned short status_flag; + unsigned char normalized; + unsigned char worse_normal; + unsigned char raw[6]; + unsigned char reserv; +} __attribute__ ((packed)); + +/* smart_values is format of the read drive Atrribute command */ +struct ata_smart_values { + unsigned short revnumber; + struct ata_smart_attribute vendor_attributes [30]; + unsigned char offline_data_collection_status; + unsigned char self_test_exec_status; + unsigned short total_time_to_complete_off_line; + unsigned char vendor_specific_366; + unsigned char offline_data_collection_capability; + unsigned short smart_capability; + unsigned char errorlog_capability; + unsigned char vendor_specific_371; + unsigned char short_test_completion_time; + unsigned char extend_test_completion_time; + unsigned char reserved_374_385 [12]; + unsigned char vendor_specific_386_509 [125]; + unsigned char chksum; +} __attribute__ ((packed)); + +/* Smart Threshold data structures */ +/* Vendor attribute of SMART Threshold */ +struct ata_smart_threshold_entry { + unsigned char id; + unsigned char normalized_threshold; + unsigned char reserved[10]; +} __attribute__ ((packed)); + +/* Format of Read SMART THreshold Command */ +struct ata_smart_thresholds { + unsigned short revnumber; + struct ata_smart_threshold_entry thres_entries[30]; + unsigned char reserved[149]; + unsigned char chksum; +} __attribute__ ((packed)); + +struct ata_smart_errorlog_command_struct { + unsigned char devicecontrolreg; + unsigned char featuresreg; + unsigned char sector_count; + unsigned char sector_number; + unsigned char cylinder_low; + unsigned char cylinder_high; + unsigned char drive_head; + unsigned char commandreg; + unsigned int timestamp; +} __attribute__ ((packed)); -#define NR_ATTRIBUTES 30 - -typedef struct threshold_s { - unsigned char id; - unsigned char threshold; - unsigned char reserved[10]; -} __attribute__ ((packed)) threshold_t; - -typedef struct thresholds_s { - unsigned short revision; - threshold_t thresholds[NR_ATTRIBUTES]; - unsigned char reserved[18]; - unsigned char vendor[131]; - unsigned char checksum; -} __attribute__ ((packed)) thresholds_t; - -typedef struct value_s { - unsigned char id; - unsigned short status; - unsigned char value; - unsigned char vendor[8]; -} __attribute__ ((packed)) value_t; - -typedef struct values_s { - unsigned short revision; - value_t values[NR_ATTRIBUTES]; - unsigned char offline_status; - unsigned char vendor1; - unsigned short offline_timeout; - unsigned char vendor2; - unsigned char offline_capability; - unsigned short smart_capability; - unsigned char reserved[16]; - unsigned char vendor[125]; - unsigned char checksum; -} __attribute__ ((packed)) values_t; +struct ata_smart_errorlog_error_struct { + unsigned char error_condition; + unsigned char extended_error[14]; + unsigned char state; + unsigned short timestamp; +} __attribute__ ((packed)); + +struct ata_smart_errorlog_struct { + struct ata_smart_errorlog_command_struct commands[6]; + struct ata_smart_errorlog_error_struct error_struct; +} __attribute__ ((packed)); + +struct ata_smart_errorlog { + unsigned char revnumber; + unsigned char error_log_pointer; + struct ata_smart_errorlog_struct errorlog_struct[5]; + unsigned short ata_error_count; + unsigned short non_fatal_count; + unsigned short drive_timeout_count; + unsigned char reserved[53]; +} __attribute__ ((packed)); + +struct ata_smart_selftestlog_struct { + unsigned char selftestnumber; + unsigned char selfteststatus; + unsigned short timestamp; + unsigned char selftestfailurecheckpoint; + unsigned int lbafirstfailure; + unsigned char vendorspecific[15]; +} __attribute__ ((packed)); + +struct ata_smart_selftestlog { + unsigned short revnumber; + struct ata_smart_selftestlog_struct selftest_struct[21]; + unsigned char vendorspecific[2]; + unsigned char mostrecenttest; + unsigned char resevered[2]; + unsigned char chksum; +} __attribute__ ((packed)); #if !defined(__KERNEL__) || defined(_IDE_DISK_C) - -#define NR_OFFLINE_TEXTS 5 -struct { - unsigned char value; - char *text; -} offline_status_text[NR_OFFLINE_TEXTS] = { - { 0x00, "NeverStarted" }, - { 0x02, "Completed" }, - { 0x04, "Suspended" }, - { 0x05, "Aborted" }, - { 0x06, "Failed" } -}; +/* smartctl version number */ +#define VERSION_MAJOR 1 +#define VERSION_MINOR 2 + +/* Number of ata device to scan */ +int numdevices; + +/* how often SMART is checks in seconds */ +int checktime = 1800; + +typedef struct atadevices_s { + int fd; + char devicename[14]; + int selftest; + struct hd_driveid drive; + struct ata_smart_values smartval; + struct ata_smart_thresholds smartthres; +} atadevices_t; + #endif /* !defined(__KERNEL__) || defined(_IDE_DISK_C) */ #endif /* _LINUX_HDSMART_H */ diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h new file mode 100644 index 000000000..5ac8d9cef --- /dev/null +++ b/include/linux/i2o-dev.h @@ -0,0 +1,397 @@ +/* + * I2O user space accessible structures/APIs + * + * (c) Copyright 1999, 2000 Red Hat Software + * + * 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 header file defines the I2O APIs that are available to both + * the kernel and user level applications. Kernel specific structures + * are defined in i2o_osm. OSMs should include _only_ i2o_osm.h which + * automatically includs this file. + * + */ + +#ifndef _I2O_DEV_H +#define _I2O_DEV_H + +/* How many controllers are we allowing */ +#define MAX_I2O_CONTROLLERS 32 + +#include <linux/ioctl.h> + +/* + * I2O Control IOCTLs and structures + */ +#define I2O_MAGIC_NUMBER 'i' +#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS]) +#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct) +#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct) +#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget) +#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget) +#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer) +#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer) +#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer) +#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32) +#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html) +#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id) +#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info) + +struct i2o_cmd_hrtlct +{ + unsigned int iop; /* IOP unit number */ + void *resbuf; /* Buffer for result */ + unsigned int *reslen; /* Buffer length in bytes */ +}; + +struct i2o_cmd_psetget +{ + unsigned int iop; /* IOP unit number */ + unsigned int tid; /* Target device TID */ + void *opbuf; /* Operation List buffer */ + unsigned int oplen; /* Operation List buffer length in bytes */ + void *resbuf; /* Result List buffer */ + unsigned int *reslen; /* Result List buffer length in bytes */ +}; + +struct i2o_sw_xfer +{ + unsigned int iop; /* IOP unit number */ + unsigned char flags; /* Flags field */ + unsigned char sw_type; /* Software type */ + unsigned int sw_id; /* Software ID */ + void *buf; /* Pointer to software buffer */ + unsigned int *swlen; /* Length of software data */ + unsigned int *maxfrag; /* Maximum fragment count */ + unsigned int *curfrag; /* Current fragment count */ +}; + +struct i2o_html +{ + unsigned int iop; /* IOP unit number */ + unsigned int tid; /* Target device ID */ + unsigned int page; /* HTML page */ + void *resbuf; /* Buffer for reply HTML page */ + unsigned int *reslen; /* Length in bytes of reply buffer */ + void *qbuf; /* Pointer to HTTP query string */ + unsigned int qlen; /* Length in bytes of query string buffer */ +}; + +#define I2O_EVT_Q_LEN 32 + +struct i2o_evt_id +{ + unsigned int iop; + unsigned int tid; + unsigned int evt_mask; +}; + +/* Event data size = frame size - message header + evt indicator */ +#define I2O_EVT_DATA_SIZE 88 + +struct i2o_evt_info +{ + struct i2o_evt_id id; + unsigned char evt_data[I2O_EVT_DATA_SIZE]; + unsigned int data_size; +}; + +struct i2o_evt_get +{ + struct i2o_evt_info info; + int pending; + int lost; +}; + + +/************************************************************************** + * HRT related constants and structures + **************************************************************************/ +#define I2O_BUS_LOCAL 0 +#define I2O_BUS_ISA 1 +#define I2O_BUS_EISA 2 +#define I2O_BUS_MCA 3 +#define I2O_BUS_PCI 4 +#define I2O_BUS_PCMCIA 5 +#define I2O_BUS_NUBUS 6 +#define I2O_BUS_CARDBUS 7 +#define I2O_BUS_UNKNOWN 0x80 + +#ifndef __KERNEL__ + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; + +#endif /* __KERNEL__ */ + +typedef struct _i2o_pci_bus { + u8 PciFunctionNumber; + u8 PciDeviceNumber; + u8 PciBusNumber; + u8 reserved; + u16 PciVendorID; + u16 PciDeviceID; +} i2o_pci_bus; + +typedef struct _i2o_local_bus { + u16 LbBaseIOPort; + u16 reserved; + u32 LbBaseMemoryAddress; +} i2o_local_bus; + +typedef struct _i2o_isa_bus { + u16 IsaBaseIOPort; + u8 CSN; + u8 reserved; + u32 IsaBaseMemoryAddress; +} i2o_isa_bus; + +typedef struct _i2o_eisa_bus_info { + u16 EisaBaseIOPort; + u8 reserved; + u8 EisaSlotNumber; + u32 EisaBaseMemoryAddress; +} i2o_eisa_bus; + +typedef struct _i2o_mca_bus { + u16 McaBaseIOPort; + u8 reserved; + u8 McaSlotNumber; + u32 McaBaseMemoryAddress; +} i2o_mca_bus; + +typedef struct _i2o_other_bus { + u16 BaseIOPort; + u16 reserved; + u32 BaseMemoryAddress; +} i2o_other_bus; + +typedef struct _i2o_hrt_entry { + u32 adapter_id; + u32 parent_tid:12; + u32 state:4; + u32 bus_num:8; + u32 bus_type:8; + union { + i2o_pci_bus pci_bus; + i2o_local_bus local_bus; + i2o_isa_bus isa_bus; + i2o_eisa_bus eisa_bus; + i2o_mca_bus mca_bus; + i2o_other_bus other_bus; + } bus; +} i2o_hrt_entry; + +typedef struct _i2o_hrt { + u16 num_entries; + u8 entry_len; + u8 hrt_version; + u32 change_ind; + i2o_hrt_entry hrt_entry[1]; +} i2o_hrt; + +typedef struct _i2o_lct_entry { + u32 entry_size:16; + u32 tid:12; + u32 reserved:4; + u32 change_ind; + u32 device_flags; + u32 class_id:12; + u32 version:4; + u32 vendor_id:16; + u32 sub_class; + u32 user_tid:12; + u32 parent_tid:12; + u32 bios_info:8; + u8 identity_tag[8]; + u32 event_capabilities; +} i2o_lct_entry; + +typedef struct _i2o_lct { + u32 table_size:16; + u32 boot_tid:12; + u32 lct_ver:4; + u32 iop_flags; + u32 change_ind; + i2o_lct_entry lct_entry[1]; +} i2o_lct; + +typedef struct _i2o_status_block { + u16 org_id; + u16 reserved; + u16 iop_id:12; + u16 reserved1:4; + u16 host_unit_id; + u16 segment_number:12; + u16 i2o_version:4; + u8 iop_state; + u8 msg_type; + u16 inbound_frame_size; + u8 init_code; + u8 reserved2; + u32 max_inbound_frames; + u32 cur_inbound_frames; + u32 max_outbound_frames; + char product_id[24]; + u32 expected_lct_size; + u32 iop_capabilities; + u32 desired_mem_size; + u32 current_mem_size; + u32 current_mem_base; + u32 desired_io_size; + u32 current_io_size; + u32 current_io_base; + u32 reserved3:24; + u32 cmd_status:8; +} i2o_status_block; + +/* Event indicator mask flags */ +#define I2O_EVT_IND_STATE_CHANGE 0x80000000 +#define I2O_EVT_IND_GENERAL_WARNING 0x40000000 +#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000 +#define I2O_EVT_IND_LOCK_RELEASE 0x10000000 +#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000 +#define I2O_EVT_IND_DEVICE_RESET 0x04000000 +#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000 +#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000 +#define I2O_EVT_IND_VENDOR_EVT 0x00800000 +#define I2O_EVT_IND_DEVICE_STATE 0x00400000 + +/* Executive event indicitors */ +#define I2O_EVT_IND_EXEC_RESOURCE_LIMITS 0x00000001 +#define I2O_EVT_IND_EXEC_CONNECTION_FAIL 0x00000002 +#define I2O_EVT_IND_EXEC_ADAPTER_FAULT 0x00000004 +#define I2O_EVT_IND_EXEC_POWER_FAIL 0x00000008 +#define I2O_EVT_IND_EXEC_RESET_PENDING 0x00000010 +#define I2O_EVT_IND_EXEC_RESET_IMMINENT 0x00000020 +#define I2O_EVT_IND_EXEC_HW_FAIL 0x00000040 +#define I2O_EVT_IND_EXEC_XCT_CHANGE 0x00000080 +#define I2O_EVT_IND_EXEC_NEW_LCT_ENTRY 0x00000100 +#define I2O_EVT_IND_EXEC_MODIFIED_LCT 0x00000200 +#define I2O_EVT_IND_EXEC_DDM_AVAILABILITY 0x00000400 + +/* Random Block Storage Event Indicators */ +#define I2O_EVT_IND_BSA_VOLUME_LOAD 0x00000001 +#define I2O_EVT_IND_BSA_VOLUME_UNLOAD 0x00000002 +#define I2O_EVT_IND_BSA_VOLUME_UNLOAD_REQ 0x00000004 +#define I2O_EVT_IND_BSA_CAPACITY_CHANGE 0x00000008 +#define I2O_EVT_IND_BSA_SCSI_SMART 0x00000010 + +/* Event data for generic events */ +#define I2O_EVT_STATE_CHANGE_NORMAL 0x00 +#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01 +#define I2O_EVT_STATE_CHANGE_RESTART 0x02 +#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03 +#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04 +#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05 +#define I2O_EVT_STATE_CHANGE_FAILED 0x10 +#define I2O_EVT_STATE_CHANGE_FAULTED 0x11 + +#define I2O_EVT_GEN_WARNING_NORMAL 0x00 +#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01 +#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02 + +#define I2O_EVT_CAPABILITY_OTHER 0x01 +#define I2O_EVT_CAPABILITY_CHANGED 0x02 + +#define I2O_EVT_SENSOR_STATE_CHANGED 0x01 + +/* + * I2O classes / subclasses + */ + +/* Class ID and Code Assignments + * (LCT.ClassID.Version field) + */ +#define I2O_CLASS_VERSION_10 0x00 +#define I2O_CLASS_VERSION_11 0x01 + +/* Class code names + * (from v1.5 Table 6-1 Class Code Assignments.) + */ + +#define I2O_CLASS_EXECUTIVE 0x000 +#define I2O_CLASS_DDM 0x001 +#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010 +#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011 +#define I2O_CLASS_LAN 0x020 +#define I2O_CLASS_WAN 0x030 +#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040 +#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041 +#define I2O_CLASS_SCSI_PERIPHERAL 0x051 +#define I2O_CLASS_ATE_PORT 0x060 +#define I2O_CLASS_ATE_PERIPHERAL 0x061 +#define I2O_CLASS_FLOPPY_CONTROLLER 0x070 +#define I2O_CLASS_FLOPPY_DEVICE 0x071 +#define I2O_CLASS_BUS_ADAPTER_PORT 0x080 +#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090 +#define I2O_CLASS_PEER_TRANSPORT 0x091 + +/* + * Rest of 0x092 - 0x09f reserved for peer-to-peer classes + */ + +#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff + +/* + * Subclasses + */ + +#define I2O_SUBCLASS_i960 0x001 +#define I2O_SUBCLASS_HDM 0x020 +#define I2O_SUBCLASS_ISM 0x021 + +/* Operation functions */ + +#define I2O_PARAMS_FIELD_GET 0x0001 +#define I2O_PARAMS_LIST_GET 0x0002 +#define I2O_PARAMS_MORE_GET 0x0003 +#define I2O_PARAMS_SIZE_GET 0x0004 +#define I2O_PARAMS_TABLE_GET 0x0005 +#define I2O_PARAMS_FIELD_SET 0x0006 +#define I2O_PARAMS_LIST_SET 0x0007 +#define I2O_PARAMS_ROW_ADD 0x0008 +#define I2O_PARAMS_ROW_DELETE 0x0009 +#define I2O_PARAMS_TABLE_CLEAR 0x000A + +/* + * I2O serial number conventions / formats + * (circa v1.5) + */ + +#define I2O_SNFORMAT_UNKNOWN 0 +#define I2O_SNFORMAT_BINARY 1 +#define I2O_SNFORMAT_ASCII 2 +#define I2O_SNFORMAT_UNICODE 3 +#define I2O_SNFORMAT_LAN48_MAC 4 +#define I2O_SNFORMAT_WAN 5 + +/* + * Plus new in v2.0 (Yellowstone pdf doc) + */ + +#define I2O_SNFORMAT_LAN64_MAC 6 +#define I2O_SNFORMAT_DDM 7 +#define I2O_SNFORMAT_IEEE_REG64 8 +#define I2O_SNFORMAT_IEEE_REG128 9 +#define I2O_SNFORMAT_UNKNOWN2 0xff + +/* + * I2O Get Status State values + */ + +#define ADAPTER_STATE_INITIALIZING 0x01 +#define ADAPTER_STATE_RESET 0x02 +#define ADAPTER_STATE_HOLD 0x04 +#define ADAPTER_STATE_READY 0x05 +#define ADAPTER_STATE_OPERATIONAL 0x08 +#define ADAPTER_STATE_FAILED 0x10 +#define ADAPTER_STATE_FAULTED 0x11 + +#endif /* _I2O_DEV_H */ diff --git a/include/linux/i2o.h b/include/linux/i2o.h index b73ca4732..f55c5de88 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -1,281 +1,33 @@ +/* + * I2O kernel space accessible structures/APIs + * + * (c) Copyright 1999, 2000 Red Hat Software + * + * 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 header file defined the I2O APIs/structures for use by + * the I2O kernel modules. + * + */ + #ifndef _I2O_H #define _I2O_H +#ifdef __KERNEL__ /* This file to be included by kernel only */ -/* - * Tunable parameters first - */ +#include <linux/i2o-dev.h> /* How many different OSM's are we allowing */ #define MAX_I2O_MODULES 64 -/* How many controllers are we allowing */ -#define MAX_I2O_CONTROLLERS 32 - -#include <linux/ioctl.h> - -/* - * I2O Control IOCTLs and structures - */ -#define I2O_MAGIC_NUMBER 'i' -#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS]) -#define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct) -#define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct) -#define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget) -#define I2OPARMGET _IOWR(I2O_MAGIC_NUMBER,4,struct i2o_cmd_psetget) -#define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer) -#define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer) -#define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer) -#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32) -#define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html) -#define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id) -#define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info) - -struct i2o_cmd_hrtlct -{ - unsigned int iop; /* IOP unit number */ - void *resbuf; /* Buffer for result */ - unsigned int *reslen; /* Buffer length in bytes */ -}; - -struct i2o_cmd_psetget -{ - unsigned int iop; /* IOP unit number */ - unsigned int tid; /* Target device TID */ - void *opbuf; /* Operation List buffer */ - unsigned int oplen; /* Operation List buffer length in bytes */ - void *resbuf; /* Result List buffer */ - unsigned int *reslen; /* Result List buffer length in bytes */ -}; - -struct i2o_sw_xfer -{ - unsigned int iop; /* IOP unit number */ - unsigned char flags; /* Flags field */ - unsigned char sw_type; /* Software type */ - unsigned int sw_id; /* Software ID */ - void *buf; /* Pointer to software buffer */ - unsigned int *swlen; /* Length of software data */ - unsigned int *maxfrag; /* Maximum fragment count */ - unsigned int *curfrag; /* Current fragment count */ -}; - -struct i2o_html -{ - unsigned int iop; /* IOP unit number */ - unsigned int tid; /* Target device ID */ - unsigned int page; /* HTML page */ - void *resbuf; /* Buffer for reply HTML page */ - unsigned int *reslen; /* Length in bytes of reply buffer */ - void *qbuf; /* Pointer to HTTP query string */ - unsigned int qlen; /* Length in bytes of query string buffer */ -}; - -#define I2O_EVT_Q_LEN 32 - -struct i2o_evt_id -{ - unsigned int iop; - unsigned int tid; - unsigned int evt_mask; -}; - -// -// Event data size = frame size - message header + evt indicator -#define I2O_EVT_DATA_SIZE 88 - -struct i2o_evt_info -{ - struct i2o_evt_id id; - unsigned char evt_data[I2O_EVT_DATA_SIZE]; - unsigned int data_size; -}; - -struct i2o_evt_get -{ - struct i2o_evt_info info; - int pending; - int lost; -}; - - -/************************************************************************** - * HRT related constants and structures - **************************************************************************/ -#define I2O_BUS_LOCAL 0 -#define I2O_BUS_ISA 1 -#define I2O_BUS_EISA 2 -#define I2O_BUS_MCA 3 -#define I2O_BUS_PCI 4 -#define I2O_BUS_PCMCIA 5 -#define I2O_BUS_NUBUS 6 -#define I2O_BUS_CARDBUS 7 -#define I2O_BUS_UNKNOWN 0x80 - -#ifndef __KERNEL__ -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -#endif /* __KERNEL__ */ - -typedef struct _i2o_pci_bus { - u8 PciFunctionNumber; - u8 PciDeviceNumber; - u8 PciBusNumber; - u8 reserved; - u16 PciVendorID; - u16 PciDeviceID; -} i2o_pci_bus; - -typedef struct _i2o_local_bus { - u16 LbBaseIOPort; - u16 reserved; - u32 LbBaseMemoryAddress; -} i2o_local_bus; - -typedef struct _i2o_isa_bus { - u16 IsaBaseIOPort; - u8 CSN; - u8 reserved; - u32 IsaBaseMemoryAddress; -} i2o_isa_bus; - -typedef struct _i2o_eisa_bus_info { - u16 EisaBaseIOPort; - u8 reserved; - u8 EisaSlotNumber; - u32 EisaBaseMemoryAddress; -} i2o_eisa_bus; - -typedef struct _i2o_mca_bus { - u16 McaBaseIOPort; - u8 reserved; - u8 McaSlotNumber; - u32 McaBaseMemoryAddress; -} i2o_mca_bus; - -typedef struct _i2o_other_bus { - u16 BaseIOPort; - u16 reserved; - u32 BaseMemoryAddress; -} i2o_other_bus; - -typedef struct _i2o_hrt_entry { - u32 adapter_id; - u32 parent_tid:12; - u32 state:4; - u32 bus_num:8; - u32 bus_type:8; - union { - i2o_pci_bus pci_bus; - i2o_local_bus local_bus; - i2o_isa_bus isa_bus; - i2o_eisa_bus eisa_bus; - i2o_mca_bus mca_bus; - i2o_other_bus other_bus; - } bus; -} i2o_hrt_entry; - -typedef struct _i2o_hrt { - u16 num_entries; - u8 entry_len; - u8 hrt_version; - u32 change_ind; - i2o_hrt_entry hrt_entry[1]; -} i2o_hrt; - -typedef struct _i2o_lct_entry { - u32 entry_size:16; - u32 tid:12; - u32 reserved:4; - u32 change_ind; - u32 device_flags; - u32 class_id:12; - u32 version:4; - u32 vendor_id:16; - u32 sub_class; - u32 user_tid:12; - u32 parent_tid:12; - u32 bios_info:8; - u8 identity_tag[8]; - u32 event_capabilities; -} i2o_lct_entry; - -typedef struct _i2o_lct { - u32 table_size:16; - u32 boot_tid:12; - u32 lct_ver:4; - u32 iop_flags; - u32 current_change_ind; - i2o_lct_entry lct_entry[1]; -} i2o_lct; - -typedef struct _i2o_status_block { - u16 org_id; - u16 reserved; - u16 iop_id:12; - u16 reserved1:4; - u16 host_unit_id; - u16 segment_number:12; - u16 i2o_version:4; - u8 iop_state; - u8 msg_type; - u16 inbound_frame_size; - u8 init_code; - u8 reserved2; - u32 max_inbound_frames; - u32 cur_inbound_frames; - u32 max_outbound_frames; - char product_id[24]; - u32 expected_lct_size; - u32 iop_capabilities; - u32 desired_mem_size; - u32 current_mem_size; - u32 current_mem_base; - u32 desired_io_size; - u32 current_io_size; - u32 current_io_base; - u32 reserved3:24; - u32 cmd_status:8; -} i2o_status_block; - -/* Event indicator mask flags */ -#define I2O_EVT_IND_STATE_CHANGE 0x80000000 -#define I2O_EVT_IND_GENERAL_WARNING 0x40000000 -#define I2O_EVT_IND_CONFIGURATION_FLAG 0x20000000 -#define I2O_EVT_IND_LOCK_RELEASE 0x10000000 -#define I2O_EVT_IND_CAPABILITY_CHANGE 0x08000000 -#define I2O_EVT_IND_DEVICE_RESET 0x04000000 -#define I2O_EVT_IND_EVT_MASK_MODIFIED 0x02000000 -#define I2O_EVT_IND_FIELD_MODIFIED 0x01000000 -#define I2O_EVT_IND_VENDOR_EVT 0x00800000 -#define I2O_EVT_IND_DEVICE_STATE 0x00400000 - -/* Event data for generic events */ -#define I2O_EVT_STATE_CHANGE_NORMAL 0x00 -#define I2O_EVT_STATE_CHANGE_SUSPENDED 0x01 -#define I2O_EVT_STATE_CHANGE_RESTART 0x02 -#define I2O_EVT_STATE_CHANGE_NA_RECOVER 0x03 -#define I2O_EVT_STATE_CHANGE_NA_NO_RECOVER 0x04 -#define I2O_EVT_STATE_CHANGE_QUIESCE_REQUEST 0x05 -#define I2O_EVT_STATE_CHANGE_FAILED 0x10 -#define I2O_EVT_STATE_CHANGE_FAULTED 0x11 - -#define I2O_EVT_GEN_WARNING_NORMAL 0x00 -#define I2O_EVT_GEN_WARNING_ERROR_THRESHOLD 0x01 -#define I2O_EVT_GEN_WARNING_MEDIA_FAULT 0x02 - -#define I2O_EVT_CAPABILITY_OTHER 0x01 -#define I2O_EVT_CAPABILITY_CHANGED 0x02 - -#define I2O_EVT_SENSOR_STATE_CHANGED 0x01 - -#ifdef __KERNEL__ /* ioctl stuff only thing exported to users */ +/* How many OSMs can register themselves for device status updates? */ #define I2O_MAX_MANAGERS 4 -/* - * I2O Interface Objects - */ - +#include <asm/semaphore.h> /* Needed for MUTEX init macros */ #include <linux/config.h> #include <linux/notifier.h> #include <asm/atomic.h> @@ -283,7 +35,6 @@ typedef struct _i2o_status_block { /* * message structures */ - struct i2o_message { u8 version_offset; @@ -298,12 +49,11 @@ struct i2o_message /* * Each I2O device entity has one or more of these. There is one - * per device. *FIXME* how to handle multiple types on one unit. + * per device. */ - struct i2o_device { - i2o_lct_entry *lct_data;/* Device LCT information */ + i2o_lct_entry lct_data; /* Device LCT information */ u32 flags; int i2oversion; /* I2O version supported. Actually there * should be high and low version */ @@ -329,15 +79,20 @@ struct i2o_pci { int irq; #ifdef CONFIG_MTRR - int mtrr_reg; + int mtrr_reg0; + int mtrr_reg1; #endif }; +/* + * Transport types supported by I2O stack + */ +#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */ + /* - * Each I2O controller has one of these objects + * Each I2O controller has one of these objects */ - struct i2o_controller { char name[16]; @@ -345,40 +100,43 @@ struct i2o_controller int type; int enabled; -#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */ - struct notifier_block *event_notifer; /* Events */ atomic_t users; struct i2o_device *devices; /* I2O device chain */ struct i2o_controller *next; /* Controller chain */ - volatile u32 *post_port; /* Messaging ports */ - volatile u32 *reply_port; - volatile u32 *irq_mask; /* Interrupt port */ + volatile u32 *post_port; /* Inbout port */ + volatile u32 *reply_port; /* Outbound port */ + volatile u32 *irq_mask; /* Interrupt register */ + + /* Dynamic LCT related data */ + struct semaphore lct_sem; + int lct_pid; + int lct_running; i2o_status_block *status_block; /* IOP status block */ - i2o_lct *lct; - i2o_hrt *hrt; + i2o_lct *lct; /* Logical Config Table */ + i2o_lct *dlct; /* Temp LCT */ + i2o_hrt *hrt; /* HW Resource Table */ u32 mem_offset; /* MFA offset */ u32 mem_phys; /* MFA physical */ - u32 priv_mem; - u32 priv_mem_size; - u32 priv_io; - u32 priv_io_size; - struct proc_dir_entry* proc_entry; /* /proc dir */ union { /* Bus information */ struct i2o_pci pci; } bus; + /* Bus specific destructor */ void (*destructor)(struct i2o_controller *); + /* Bus specific attach/detach */ int (*bind)(struct i2o_controller *, struct i2o_device *); + /* Bus specific initiator */ int (*unbind)(struct i2o_controller *, struct i2o_device *); + /* Bus specific enable/disable */ void (*bus_enable)(struct i2o_controller *c); void (*bus_disable)(struct i2o_controller *c); @@ -387,12 +145,32 @@ struct i2o_controller int inbound_size; /* Inbound queue size */ }; +/* + * OSM resgistration block + * + * Each OSM creates at least one of these and registers it with the + * I2O core through i2o_register_handler. An OSM may want to + * register more than one if it wants a fast path to a reply + * handler by having a separate initiator context for each + * class function. + */ struct i2o_handler { + /* Message reply handler */ void (*reply)(struct i2o_handler *, struct i2o_controller *, struct i2o_message *); - char *name; - int context; /* Low 8 bits of the transaction info */ - u32 class; /* I2O classes that this driver handles */ + + /* New device notification handler */ + void (*new_dev_notify)(struct i2o_controller *, struct i2o_device *); + + /* Device deltion handler */ + void (*dev_del_notify)(struct i2o_controller *, struct i2o_device *); + + /* Reboot notification handler */ + void (*reboot_notify)(void); + + char *name; /* OSM name */ + int context; /* Low 8 bits of the transaction info */ + u32 class; /* I2O classes that this driver handles */ /* User data follows */ }; @@ -416,10 +194,14 @@ struct i2o_core_func_table void (*run_queue)(struct i2o_controller *c); int (*delete)(struct i2o_controller *); }; -#endif +#endif // MODULE /* * I2O System table entry + * + * The system table contains information about all the IOPs in the + * system. It is sent to all IOPs so that they can create peer2peer + * connections between them. */ struct i2o_sys_tbl_entry { @@ -498,130 +280,55 @@ extern inline void i2o_flush_reply(struct i2o_controller *c, u32 m) I2O_REPLY_WRITE32(c,m); } -extern int i2o_install_controller(struct i2o_controller *); -extern int i2o_delete_controller(struct i2o_controller *); -extern void i2o_unlock_controller(struct i2o_controller *); extern struct i2o_controller *i2o_find_controller(int); -extern int i2o_status_get(struct i2o_controller *); +extern void i2o_unlock_controller(struct i2o_controller *); +extern struct i2o_controller *i2o_controller_chain; extern int i2o_num_controllers; +extern int i2o_status_get(struct i2o_controller *); extern int i2o_install_handler(struct i2o_handler *); extern int i2o_remove_handler(struct i2o_handler *); -extern int i2o_claim_device(struct i2o_device *, struct i2o_handler *, u32); -extern int i2o_release_device(struct i2o_device *, struct i2o_handler *, u32); +extern int i2o_claim_device(struct i2o_device *, struct i2o_handler *); +extern int i2o_release_device(struct i2o_device *, struct i2o_handler *); +extern int i2o_device_notify_on(struct i2o_device *, struct i2o_handler *); +extern int i2o_device_notify_off(struct i2o_device *, struct i2o_handler *); extern int i2o_post_this(struct i2o_controller *, u32 *, int); extern int i2o_post_wait(struct i2o_controller *, u32 *, int, int); -extern int i2o_issue_params(int, struct i2o_controller *, int, void *, - int, void *, int); extern int i2o_query_scalar(struct i2o_controller *, int, int, int, void *, int); extern int i2o_set_scalar(struct i2o_controller *, int, int, int, void *, int); - extern int i2o_query_table(int, struct i2o_controller *, int, int, int, void *, int, void *, int); extern int i2o_clear_table(struct i2o_controller *, int, int); extern int i2o_row_add_table(struct i2o_controller *, int, int, int, void *, int); +extern int i2o_row_delete_table(struct i2o_controller *, int, int, int, void *, + int); +extern int i2o_issue_params(int, struct i2o_controller *, int, void *, + int, void *, int); -extern int i2o_event_register(struct i2o_controller *, int, int, u32); -extern int i2o_event_ack(struct i2o_controller *, int, int, u32, void *, int); +extern int i2o_event_register(struct i2o_controller *, u32, u32, u32, u32); +extern int i2o_event_ack(struct i2o_controller *, u32 *); -extern void i2o_run_queue(struct i2o_controller *); extern void i2o_report_status(const char *, const char *, u32 *); extern void i2o_dump_message(u32 *); - extern const char *i2o_get_class_name(int); +extern int i2o_install_controller(struct i2o_controller *); +extern int i2o_activate_controller(struct i2o_controller *); +extern void i2o_run_queue(struct i2o_controller *); +extern int i2o_delete_controller(struct i2o_controller *); -/* - * I2O classes / subclasses - */ - -/* Class ID and Code Assignments - * (LCT.ClassID.Version field) - */ -#define I2O_CLASS_VERSION_10 0x00 -#define I2O_CLASS_VERSION_11 0x01 - -/* Class code names - * (from v1.5 Table 6-1 Class Code Assignments.) - */ - -#define I2O_CLASS_EXECUTIVE 0x000 -#define I2O_CLASS_DDM 0x001 -#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010 -#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011 -#define I2O_CLASS_LAN 0x020 -#define I2O_CLASS_WAN 0x030 -#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040 -#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041 -#define I2O_CLASS_SCSI_PERIPHERAL 0x051 -#define I2O_CLASS_ATE_PORT 0x060 -#define I2O_CLASS_ATE_PERIPHERAL 0x061 -#define I2O_CLASS_FLOPPY_CONTROLLER 0x070 -#define I2O_CLASS_FLOPPY_DEVICE 0x071 -#define I2O_CLASS_BUS_ADAPTER_PORT 0x080 -#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090 -#define I2O_CLASS_PEER_TRANSPORT 0x091 - -/* Rest of 0x092 - 0x09f reserved for peer-to-peer classes - */ - -#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff - -/* Subclasses - */ - -#define I2O_SUBCLASS_i960 0x001 -#define I2O_SUBCLASS_HDM 0x020 -#define I2O_SUBCLASS_ISM 0x021 - -/* Operation functions */ - -#define I2O_PARAMS_FIELD_GET 0x0001 -#define I2O_PARAMS_LIST_GET 0x0002 -#define I2O_PARAMS_MORE_GET 0x0003 -#define I2O_PARAMS_SIZE_GET 0x0004 -#define I2O_PARAMS_TABLE_GET 0x0005 -#define I2O_PARAMS_FIELD_SET 0x0006 -#define I2O_PARAMS_LIST_SET 0x0007 -#define I2O_PARAMS_ROW_ADD 0x0008 -#define I2O_PARAMS_ROW_DELETE 0x0009 -#define I2O_PARAMS_TABLE_CLEAR 0x000A /* - * I2O serial number conventions / formats - * (circa v1.5) + * I2O Function codes */ -#define I2O_SNFORMAT_UNKNOWN 0 -#define I2O_SNFORMAT_BINARY 1 -#define I2O_SNFORMAT_ASCII 2 -#define I2O_SNFORMAT_UNICODE 3 -#define I2O_SNFORMAT_LAN48_MAC 4 -#define I2O_SNFORMAT_WAN 5 - -/* Plus new in v2.0 (Yellowstone pdf doc) - */ - -#define I2O_SNFORMAT_LAN64_MAC 6 -#define I2O_SNFORMAT_DDM 7 -#define I2O_SNFORMAT_IEEE_REG64 8 -#define I2O_SNFORMAT_IEEE_REG128 9 -#define I2O_SNFORMAT_UNKNOWN2 0xff - -/* Transaction Reply Lists (TRL) Control Word structure */ - -#define TRL_SINGLE_FIXED_LENGTH 0x00 -#define TRL_SINGLE_VARIABLE_LENGTH 0x40 -#define TRL_MULTIPLE_FIXED_LENGTH 0x80 - /* - * Messaging API values - */ - + * Executive Class + */ #define I2O_CMD_ADAPTER_ASSIGN 0xB3 #define I2O_CMD_ADAPTER_READ 0xB2 #define I2O_CMD_ADAPTER_RELEASE 0xB5 @@ -656,6 +363,9 @@ extern const char *i2o_get_class_name(int); #define I2O_CMD_SYS_QUIESCE 0xC3 #define I2O_CMD_SYS_TAB_SET 0xA3 +/* + * Utility Class + */ #define I2O_CMD_UTIL_NOP 0x00 #define I2O_CMD_UTIL_ABORT 0x01 #define I2O_CMD_UTIL_CLAIM 0x09 @@ -671,10 +381,16 @@ extern const char *i2o_get_class_name(int); #define I2O_CMD_UTIL_LOCK_RELEASE 0x19 #define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY 0x15 +/* + * SCSI Host Bus Adapter Class + */ #define I2O_CMD_SCSI_EXEC 0x81 #define I2O_CMD_SCSI_ABORT 0x83 #define I2O_CMD_SCSI_BUSRESET 0x27 +/* + * Random Block Storage Class + */ #define I2O_CMD_BLOCK_READ 0x30 #define I2O_CMD_BLOCK_WRITE 0x31 #define I2O_CMD_BLOCK_CFLUSH 0x37 @@ -688,24 +404,11 @@ extern const char *i2o_get_class_name(int); /* * Init Outbound Q status */ - #define I2O_CMD_OUTBOUND_INIT_IN_PROGRESS 0x01 #define I2O_CMD_OUTBOUND_INIT_REJECTED 0x02 #define I2O_CMD_OUTBOUND_INIT_FAILED 0x03 #define I2O_CMD_OUTBOUND_INIT_COMPLETE 0x04 -/* - * I2O Get Status State values - */ - -#define ADAPTER_STATE_INITIALIZING 0x01 -#define ADAPTER_STATE_RESET 0x02 -#define ADAPTER_STATE_HOLD 0x04 -#define ADAPTER_STATE_READY 0x05 -#define ADAPTER_STATE_OPERATIONAL 0x08 -#define ADAPTER_STATE_FAILED 0x10 -#define ADAPTER_STATE_FAULTED 0x11 - /* I2O API function return values */ #define I2O_RTN_NO_ERROR 0 @@ -796,8 +499,10 @@ extern const char *i2o_get_class_name(int); /* Message header defines for VersionOffset */ #define I2OVER15 0x0001 #define I2OVER20 0x0002 + /* Default is 1.5, FIXME: Need support for both 1.5 and 2.0 */ #define I2OVERSION I2OVER15 + #define SGL_OFFSET_0 I2OVERSION #define SGL_OFFSET_4 (0x0040 | I2OVERSION) #define SGL_OFFSET_5 (0x0050 | I2OVERSION) @@ -810,6 +515,12 @@ extern const char *i2o_get_class_name(int); #define TRL_OFFSET_5 (0x0050 | I2OVERSION) #define TRL_OFFSET_6 (0x0060 | I2OVERSION) +/* Transaction Reply Lists (TRL) Control Word structure */ +#define TRL_SINGLE_FIXED_LENGTH 0x00 +#define TRL_SINGLE_VARIABLE_LENGTH 0x40 +#define TRL_MULTIPLE_FIXED_LENGTH 0x80 + + /* msg header defines for MsgFlags */ #define MSG_STATIC 0x0100 #define MSG_64BIT_CNTXT 0x0200 @@ -844,5 +555,4 @@ extern const char *i2o_get_class_name(int); #define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT #endif /* __KERNEL__ */ - #endif /* _I2O_H */ diff --git a/include/linux/ide.h b/include/linux/ide.h index bdb72ef5f..ea395aaa8 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -300,13 +300,6 @@ typedef struct ide_drive_s { struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ void *settings; /* /proc/ide/ drive settings */ char driver_req[10]; /* requests specific driver */ -#if 1 - struct thresholds_s *smart_thresholds; - struct values_s *smart_values; -#else - thresholds_t smart_thresholds; - values_t smart_values; -#endif int last_lun; /* last logical unit */ int forced_lun; /* if hdxlun was given at boot */ } ide_drive_t; @@ -538,6 +531,7 @@ typedef int (ide_ioctl_proc)(ide_drive_t *, struct inode *, struct file *, unsi typedef int (ide_open_proc)(struct inode *, struct file *, ide_drive_t *); typedef void (ide_release_proc)(struct inode *, struct file *, ide_drive_t *); typedef int (ide_check_media_change_proc)(ide_drive_t *); +typedef void (ide_revalidate_proc)(ide_drive_t *); typedef void (ide_pre_reset_proc)(ide_drive_t *); typedef unsigned long (ide_capacity_proc)(ide_drive_t *); typedef ide_startstop_t (ide_special_proc)(ide_drive_t *); @@ -557,6 +551,7 @@ typedef struct ide_driver_s { ide_open_proc *open; ide_release_proc *release; ide_check_media_change_proc *media_change; + ide_revalidate_proc *revalidate; ide_pre_reset_proc *pre_reset; ide_capacity_proc *capacity; ide_special_proc *special; @@ -735,6 +730,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err); int ide_wait_cmd (ide_drive_t *drive, int cmd, int nsect, int feature, int sectors, byte *buf); void ide_delay_50ms (void); +int system_bus_clock(void); int ide_driveid_update (ide_drive_t *drive); int ide_ata66_check (ide_drive_t *drive, int cmd, int nsect, int feature); diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 96974638a..2995d563d 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -2,6 +2,7 @@ #ifndef _LINUX_INTERRUPT_H #define _LINUX_INTERRUPT_H +#include <linux/config.h> #include <linux/kernel.h> #include <linux/smp.h> #include <linux/cache.h> @@ -154,7 +155,7 @@ struct tasklet_head extern struct tasklet_head tasklet_vec[NR_CPUS]; extern struct tasklet_head tasklet_hi_vec[NR_CPUS]; -#ifdef __SMP__ +#ifdef CONFIG_SMP #define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state)) #define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { /* NOTHING */ } #define tasklet_unlock(t) clear_bit(TASKLET_STATE_RUN, &(t)->state) @@ -213,7 +214,7 @@ extern void tasklet_kill(struct tasklet_struct *t); extern void tasklet_init(struct tasklet_struct *t, void (*func)(unsigned long), unsigned long data); -#ifdef __SMP__ +#ifdef CONFIG_SMP #define SMP_TIMER_NAME(name) name##__thr @@ -224,12 +225,12 @@ static void name (unsigned long dummy) \ tasklet_schedule(&(task)); \ } -#else /* __SMP__ */ +#else /* CONFIG_SMP */ #define SMP_TIMER_NAME(name) name #define SMP_TIMER_DEFINE(name, task) -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ /* Old BH definitions */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 02341868d..11a85411f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -83,6 +83,12 @@ asmlinkage int printk(const char * fmt, ...) ((unsigned char *)&addr)[2], \ ((unsigned char *)&addr)[3] +#define HIPQUAD(addr) \ + ((unsigned char *)&addr)[3], \ + ((unsigned char *)&addr)[2], \ + ((unsigned char *)&addr)[1], \ + ((unsigned char *)&addr)[0] + #endif /* __KERNEL__ */ #define SI_LOAD_SHIFT 16 diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 8c58edf5e..2491372a9 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -1,6 +1,7 @@ #ifndef _LINUX_KERNEL_STAT_H #define _LINUX_KERNEL_STAT_H +#include <linux/config.h> #include <asm/irq.h> #include <linux/smp.h> #include <linux/threads.h> @@ -25,7 +26,9 @@ struct kernel_stat { unsigned int dk_drive_wblk[DK_NDRIVE]; unsigned int pgpgin, pgpgout; unsigned int pswpin, pswpout; +#if !defined(CONFIG_ARCH_S390) unsigned int irqs[NR_CPUS][NR_IRQS]; +#endif unsigned int ipackets, opackets; unsigned int ierrors, oerrors; unsigned int collisions; @@ -34,6 +37,7 @@ struct kernel_stat { extern struct kernel_stat kstat; +#if !defined(CONFIG_ARCH_S390) /* * Number of interrupts per specific IRQ source, since bootup */ @@ -46,5 +50,6 @@ extern inline int kstat_irqs (int irq) return sum; } +#endif #endif /* _LINUX_KERNEL_STAT_H */ diff --git a/include/linux/major.h b/include/linux/major.h index fc6e616ac..0338e266a 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -119,6 +119,8 @@ #define AURORA_MAJOR 79 +#define JSFD_MAJOR 99 + #define PHONE_MAJOR 100 #define LVM_CHAR_MAJOR 109 /* Logical Volume Manager */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 453b31d7c..278eb959b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -15,6 +15,7 @@ extern unsigned long max_mapnr; extern unsigned long num_physpages; extern void * high_memory; extern int page_cluster; +extern struct list_head lru_cache; #include <asm/page.h> #include <asm/pgtable.h> @@ -89,6 +90,8 @@ struct vm_area_struct { #define VM_SEQ_READ 0x00008000 /* App will access data sequentially */ #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_STACK_FLAGS 0x00000177 #define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ) @@ -400,7 +403,7 @@ extern int remap_page_range(unsigned long from, unsigned long to, unsigned long extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot); extern void vmtruncate(struct inode * inode, loff_t offset); -extern int handle_mm_fault(struct task_struct *tsk,struct vm_area_struct *vma, unsigned long address, int write_access); +extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); extern int make_pages_present(unsigned long addr, unsigned long end); extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len); @@ -443,7 +446,8 @@ out: return ret; } -extern int do_munmap(unsigned long, size_t); +extern int do_munmap(struct mm_struct *, unsigned long, size_t); + extern unsigned long do_brk(unsigned long, unsigned long); struct zone_t; @@ -538,7 +542,7 @@ static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * m return vma; } -extern struct vm_area_struct *find_extend_vma(struct task_struct *tsk, unsigned long addr); +extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); #define buffer_under_min() (atomic_read(&buffermem_pages) * 100 < \ buffer_mem.min_percent * num_physpages) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 05a846297..61f672a3c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -31,7 +31,6 @@ typedef struct zone_struct { char low_on_memory; char zone_wake_kswapd; unsigned long pages_min, pages_low, pages_high; - struct list_head lru_cache; /* * free areas of different sizes diff --git a/include/linux/mount.h b/include/linux/mount.h index 547163d2e..ddd2cad4d 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -17,7 +17,7 @@ struct vfsmount char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ char *mnt_dirname; /* Name of directory mounted on */ struct super_block *mnt_sb; /* pointer to superblock */ - struct vfsmount *mnt_next; /* pointer to next in linkedlist */ + struct list_head mnt_list; }; /* MOUNT_REWRITE: fill these */ diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index adcfb751d..f2f822b12 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -293,7 +293,6 @@ extern unsigned char fat_uni2esc[]; extern unsigned char fat_esc2uni[]; /* fatfs_syms.c */ -extern int init_fat_fs(void); extern void cleanup_fat_fs(void); /* nls.c */ diff --git a/include/linux/net.h b/include/linux/net.h index 0269a037e..16d0859cc 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -104,8 +104,6 @@ struct proto_ops { char *optval, int optlen); int (*getsockopt) (struct socket *sock, int level, int optname, char *optval, int *optlen); - int (*fcntl) (struct socket *sock, unsigned int cmd, - unsigned long arg); int (*sendmsg) (struct socket *sock, struct msghdr *m, int total_len, struct scm_cookie *scm); int (*recvmsg) (struct socket *sock, struct msghdr *m, int total_len, int flags, struct scm_cookie *scm); int (*mmap) (struct file *file, struct socket *sock, struct vm_area_struct * vma); @@ -194,8 +192,6 @@ SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ char *optval, int optlen), (sock, level, optname, optval, optlen)) \ SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \ char *optval, int *optlen), (sock, level, optname, optval, optlen)) \ -SOCKCALL_WRAP(name, fcntl, (struct socket *sock, unsigned int cmd, \ - unsigned long arg), (sock, cmd, arg)) \ SOCKCALL_WRAP(name, sendmsg, (struct socket *sock, struct msghdr *m, int len, struct scm_cookie *scm), \ (sock, m, len, scm)) \ SOCKCALL_WRAP(name, recvmsg, (struct socket *sock, struct msghdr *m, int len, int flags, struct scm_cookie *scm), \ @@ -203,25 +199,24 @@ SOCKCALL_WRAP(name, recvmsg, (struct socket *sock, struct msghdr *m, int len, in SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \ (file, sock, vma)) \ \ -static struct proto_ops name##_ops = { \ - fam, \ - \ - __lock_##name##_release, \ - __lock_##name##_bind, \ - __lock_##name##_connect, \ - __lock_##name##_socketpair, \ - __lock_##name##_accept, \ - __lock_##name##_getname, \ - __lock_##name##_poll, \ - __lock_##name##_ioctl, \ - __lock_##name##_listen, \ - __lock_##name##_shutdown, \ - __lock_##name##_setsockopt, \ - __lock_##name##_getsockopt, \ - __lock_##name##_fcntl, \ - __lock_##name##_sendmsg, \ - __lock_##name##_recvmsg, \ - __lock_##name##_mmap, \ +static struct proto_ops name##_ops = { \ + family: fam, \ + \ + release: __lock_##name##_release, \ + bind: __lock_##name##_bind, \ + connect: __lock_##name##_connect, \ + socketpair: __lock_##name##_socketpair, \ + accept: __lock_##name##_accept, \ + getname: __lock_##name##_getname, \ + poll: __lock_##name##_poll, \ + ioctl: __lock_##name##_ioctl, \ + listen: __lock_##name##_listen, \ + shutdown: __lock_##name##_shutdown, \ + setsockopt: __lock_##name##_setsockopt, \ + getsockopt: __lock_##name##_getsockopt, \ + sendmsg: __lock_##name##_sendmsg, \ + recvmsg: __lock_##name##_recvmsg, \ + mmap: __lock_##name##_mmap, \ }; #endif diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h index 3c1b4a4c6..f5fd96690 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h @@ -37,10 +37,10 @@ struct ip_conntrack_protocol struct iphdr *iph, size_t len, enum ip_conntrack_info ctinfo); - /* Called when a new connection for this protocol found; returns - * TRUE if it's OK. If so, packet() called next. */ - int (*new)(struct ip_conntrack *conntrack, - struct iphdr *iph, size_t len); + /* Called when a new connection for this protocol found; + * returns timeout. If so, packet() called next. */ + unsigned long (*new)(struct ip_conntrack *conntrack, + struct iphdr *iph, size_t len); /* Module (if any) which this is connected to. */ struct module *me; diff --git a/include/linux/netfilter_ipv4/ipt_state.h b/include/linux/netfilter_ipv4/ipt_state.h index ad11d316a..e298baf17 100644 --- a/include/linux/netfilter_ipv4/ipt_state.h +++ b/include/linux/netfilter_ipv4/ipt_state.h @@ -1,8 +1,7 @@ #ifndef _IPT_STATE_H #define _IPT_STATE_H -#define _IPT_STATE_BIT(ctinfo) (1 << ((ctinfo)+1)) -#define IPT_STATE_BIT(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? _IPT_STATE_BIT((ctinfo)-IP_CT_IS_REPLY) : _IPT_STATE_BIT(ctinfo)) +#define IPT_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) #define IPT_STATE_INVALID (1 << 0) struct ipt_state_info diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 5f9a5dded..653e6045b 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -45,6 +45,7 @@ * The upper limit on timeouts for the exponential backoff algorithm. */ #define NFS_MAX_RPC_TIMEOUT (6*HZ) +#define NFS_READ_DELAY (2*HZ) #define NFS_WRITEBACK_DELAY (5*HZ) #define NFS_WRITEBACK_LOCKDELAY (60*HZ) #define NFS_COMMIT_DELAY (5*HZ) @@ -174,12 +175,9 @@ extern int nfs_lock(struct file *, int, struct file_lock *); /* * linux/fs/nfs/write.c */ -extern int nfs_writepage(struct dentry *, struct page *); -extern int nfs_check_failed_request(struct inode *); -extern struct nfs_page* nfs_find_request(struct inode *, struct page *); -extern void nfs_release_request(struct nfs_page *req); +extern int nfs_writepage(struct file *file, struct dentry *, struct page *); extern int nfs_flush_incompatible(struct file *file, struct page *page); -extern int nfs_updatepage(struct file *, struct page *, unsigned long, unsigned int); +extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); /* * Try to write back everything synchronously (but check the * return value!) @@ -193,6 +191,12 @@ extern int nfs_commit_timeout(struct inode *, int); #endif static inline int +nfs_have_read(struct inode *inode) +{ + return !list_empty(&inode->u.nfs_i.read); +} + +static inline int nfs_have_writebacks(struct inode *inode) { return !list_empty(&inode->u.nfs_i.writeback); @@ -229,6 +233,8 @@ nfs_wb_file(struct inode *inode, struct file *file) * linux/fs/nfs/read.c */ extern int nfs_readpage(struct dentry *, struct page *); +extern int nfs_pagein_inode(struct inode *, unsigned long, unsigned int); +extern int nfs_pagein_timeout(struct inode *); /* * linux/fs/mount_clnt.c @@ -275,7 +281,7 @@ nfs_time_to_secs(__u64 time) /* NFS root */ -extern int nfs_root_mount(struct super_block *sb); +extern void * nfs_root_data(void); #define nfs_wait_event(clnt, wq, condition) \ ({ \ diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index 05e259900..2e10b1963 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h @@ -53,11 +53,13 @@ struct nfs_inode_info { /* * This is the list of dirty unwritten pages. */ + struct list_head read; struct list_head dirty; struct list_head commit; struct list_head writeback; - unsigned int ndirty, + unsigned int nread, + ndirty, ncommit, npages; diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index da76c1d62..c1e835d3a 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -9,7 +9,9 @@ struct nfs_server { struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ int flags; /* various flags */ unsigned int rsize; /* read size */ + unsigned int rpages; /* read size (in pages) */ unsigned int wsize; /* write size */ + unsigned int wpages; /* write size (in pages) */ unsigned int dtsize; /* readdir size */ unsigned int bsize; /* server block size */ unsigned int acregmin; /* attr cache timeouts */ diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h new file mode 100644 index 000000000..475fced7c --- /dev/null +++ b/include/linux/nfs_page.h @@ -0,0 +1,102 @@ +/* + * linux/include/linux/nfs_page.h + * + * Copyright (C) 2000 Trond Myklebust + * + * NFS page cache wrapper. + */ + +#ifndef _LINUX_NFS_PAGE_H +#define _LINUX_NFS_PAGE_H + + +#include <linux/list.h> +#include <linux/mm.h> +#include <linux/wait.h> +#include <linux/sunrpc/auth.h> +#include <linux/nfs_xdr.h> + +/* + * Valid flags for a dirty buffer + */ +#define PG_BUSY 0x0001 + +struct nfs_page { + struct list_head wb_hash, /* Inode */ + wb_list, /* Defines state of page: */ + *wb_list_head; /* read/write/commit */ + struct file *wb_file; + struct dentry *wb_dentry; + struct rpc_cred *wb_cred; + struct page *wb_page; /* page to read in/write out */ + wait_queue_head_t wb_wait; /* wait queue */ + unsigned long wb_timeout; /* when to read/write/commit */ + unsigned int wb_offset, /* Offset of read/write */ + wb_bytes, /* Length of request */ + wb_count, /* reference count */ + wb_flags; + struct nfs_writeverf wb_verf; /* Commit cookie */ +}; + +#define NFS_WBACK_BUSY(req) ((req)->wb_flags & PG_BUSY) + +extern struct nfs_page *nfs_create_request(struct dentry *dentry, + struct page *page, + unsigned int offset, + unsigned int count); +extern void nfs_release_request(struct nfs_page *req); + + +extern void nfs_list_add_request(struct nfs_page *req, + struct list_head *head); +extern void nfs_list_remove_request(struct nfs_page *req); + +extern int nfs_scan_list_timeout(struct list_head *head, + struct list_head *dst, + struct inode *inode); +extern int nfs_scan_list(struct list_head *src, struct list_head *dst, + struct file *file, unsigned long idx_start, + unsigned int npages); +extern int nfs_coalesce_requests(struct list_head *src, struct list_head *dst, + unsigned int maxpages); + +extern spinlock_t nfs_wreq_lock; + +/* + * Lock the page of an asynchronous request + */ +static __inline__ int +nfs_lock_request(struct nfs_page *req) +{ + if (NFS_WBACK_BUSY(req)) + return 0; + req->wb_count++; + req->wb_flags |= PG_BUSY; + return 1; +} + +static __inline__ void +nfs_unlock_request(struct nfs_page *req) +{ + if (!NFS_WBACK_BUSY(req)) { + printk(KERN_ERR "NFS: Invalid unlock attempted\n"); + return; + } + req->wb_flags &= ~PG_BUSY; + wake_up(&req->wb_wait); + nfs_release_request(req); +} + +static __inline__ struct nfs_page * +nfs_list_entry(struct list_head *head) +{ + return list_entry(head, struct nfs_page, wb_list); +} + +static __inline__ struct nfs_page * +nfs_inode_wb_entry(struct list_head *head) +{ + return list_entry(head, struct nfs_page, wb_hash); +} + +#endif /* _LINUX_NFS_PAGE_H */ diff --git a/include/linux/parport.h b/include/linux/parport.h index f228dc42e..0597addd4 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -380,8 +380,26 @@ extern int parport_claim_or_block(struct pardevice *dev); extern void parport_release(struct pardevice *dev); -/* parport_yield relinquishes the port if it would be helpful to other - drivers. The return value is the same as for parport_claim. */ +/** + * parport_yield - relinquish a parallel port temporarily + * @dev: a device on the parallel port + * + * This function relinquishes the port if it would be helpful to other + * drivers to do so. Afterwards it tries to reclaim the port using + * parport_claim(), and the return value is the same as for + * parport_claim(). If it fails, the port is left unclaimed and it is + * the driver's responsibility to reclaim the port. + * + * The parport_yield() and parport_yield_blocking() functions are for + * marking points in the driver at which other drivers may claim the + * port and use their devices. Yielding the port is similar to + * releasing it and reclaiming it, but is more efficient because no + * action is taken if there are no other devices needing the port. In + * fact, nothing is done even if there are other devices waiting but + * the current device is still within its "timeslice". The default + * timeslice is half a second, but it can be adjusted via the /proc + * interface. + **/ extern __inline__ int parport_yield(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); @@ -391,8 +409,15 @@ extern __inline__ int parport_yield(struct pardevice *dev) return parport_claim(dev); } -/* parport_yield_blocking is the same but uses parport_claim_or_block - instead of parport_claim. */ +/** + * parport_yield_blocking - relinquish a parallel port temporarily + * @dev: a device on the parallel port + * + * This function relinquishes the port if it would be helpful to other + * drivers to do so. Afterwards it tries to reclaim the port using + * parport_claim_or_block(), and the return value is the same as for + * parport_claim_or_block(). + **/ extern __inline__ int parport_yield_blocking(struct pardevice *dev) { unsigned long int timeslip = (jiffies - dev->time); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2b37bcf20..e5c5b723b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -808,6 +808,8 @@ #define PCI_VENDOR_ID_ARTOP 0x1191 #define PCI_DEVICE_ID_ARTOP_ATP8400 0x0004 #define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 +#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 +#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 #define PCI_VENDOR_ID_ZEITNET 0x1193 #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 diff --git a/include/linux/personality.h b/include/linux/personality.h index 7607cf6ff..58cab509e 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h @@ -3,7 +3,7 @@ #include <linux/linkage.h> #include <linux/ptrace.h> - +#include <asm/current.h> /* Flags for bug emulation. These occupy the top three bytes. */ #define STICKY_TIMEOUTS 0x4000000 @@ -22,6 +22,7 @@ #define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS) #define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS) #define PER_BSD (0x0006) +#define PER_SUNOS (PER_BSD | STICKY_TIMEOUTS) #define PER_XENIX (0x0007 | STICKY_TIMEOUTS) #define PER_LINUX32 (0x0008) #define PER_IRIX32 (0x0009 | STICKY_TIMEOUTS) /* IRIX5 32-bit */ @@ -51,11 +52,17 @@ struct exec_domain { extern struct exec_domain default_exec_domain; -extern struct exec_domain *lookup_exec_domain(unsigned long personality); extern int register_exec_domain(struct exec_domain *it); extern int unregister_exec_domain(struct exec_domain *it); #define put_exec_domain(it) \ if (it && it->module) __MOD_DEC_USE_COUNT(it->module); +#define get_exec_domain(it) \ + if (it && it->module) __MOD_INC_USE_COUNT(it->module); +extern void __set_personality(unsigned long personality); +#define set_personality(pers) do { \ + if (current->personality != pers) \ + __set_personality(pers); \ +} while (0) asmlinkage long sys_personality(unsigned long personality); #endif /* _PERSONALITY_H */ diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index 6ba4ebbcd..9478513f9 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h @@ -17,12 +17,6 @@ /* ioctls */ -/* compat */ -#define REGISTER_DEV _IO (MD_MAJOR, 1) -#define START_MD _IO (MD_MAJOR, 2) -#define STOP_MD _IO (MD_MAJOR, 3) - - /* status */ #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t) #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t) diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 55510558c..ea2226d1f 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -28,6 +28,17 @@ struct rtc_time { }; /* + * This data structure is inspired by the EFI (v0.92) wakeup + * alarm API. + */ +struct rtc_wkalrm { + unsigned char enabled; /* 0 = alarm disable, 1 = alarm disabled */ + unsigned char pending; /* 0 = alarm pending, 1 = alarm not pending */ + struct rtc_time time; /* time the alarm is set to */ +}; + + +/* * ioctl calls that are permitted to the /dev/rtc interface, if * CONFIG_RTC/CONFIG_EFI_RTC was enabled. */ @@ -50,4 +61,7 @@ struct rtc_time { #define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */ #define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */ +#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)/* Set wakeup alarm*/ +#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)/* Get wakeup alarm*/ + #endif /* _LINUX_RTC_H_ */ diff --git a/include/linux/sched.h b/include/linux/sched.h index aa30e2cc1..d249961e3 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -5,6 +5,7 @@ extern unsigned long event; +#include <linux/config.h> #include <linux/binfmts.h> #include <linux/personality.h> #include <linux/threads.h> @@ -23,6 +24,7 @@ extern unsigned long event; #include <linux/sem.h> #include <linux/signal.h> #include <linux/securebits.h> +#include <linux/fs_struct.h> /* * cloning flags: @@ -84,7 +86,7 @@ extern int last_pid; #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) -#ifdef __SMP__ +#ifdef CONFIG_SMP #define set_task_state(tsk, state_value) \ set_mb((tsk)->state, (state_value)) #else @@ -94,7 +96,7 @@ extern int last_pid; #define __set_current_state(state_value) \ do { current->state = (state_value); } while (0) -#ifdef __SMP__ +#ifdef CONFIG_SMP #define set_current_state(state_value) \ set_mb(current->state, (state_value)) #else @@ -181,19 +183,6 @@ struct files_struct { { NULL, } \ } -struct fs_struct { - atomic_t count; - int umask; - struct dentry * root, * pwd; - struct vfsmount * rootmnt, * pwdmnt; -}; - -#define INIT_FS { \ - ATOMIC_INIT(1), \ - 0022, \ - NULL, NULL, NULL, NULL \ -} - /* Maximum number of active map areas.. This is a random (large) number */ #define MAX_MAP_COUNT (65536) @@ -214,7 +203,7 @@ struct mm_struct { unsigned long start_code, end_code, start_data, end_data; unsigned long start_brk, brk, start_stack; unsigned long arg_start, arg_end, env_start, env_end; - unsigned long rss, total_vm, locked_vm; + unsigned long min_flt, maj_flt, rss, total_vm, locked_vm; unsigned long def_flags; unsigned long cpu_vm_mask; unsigned long swap_cnt; /* number of pages to swap on next pass */ @@ -236,7 +225,7 @@ struct mm_struct { 0, 0, 0, 0, \ 0, 0, 0, \ 0, 0, 0, 0, \ - 0, 0, 0, \ + 0, 0, 0, 0, 0, \ 0, 0, 0, 0, NULL } struct signal_struct { @@ -321,6 +310,7 @@ struct task_struct { /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; + int hog:1; /* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; @@ -711,7 +701,6 @@ extern void flush_thread(void); extern void exit_thread(void); extern void exit_mm(struct task_struct *); -extern void exit_fs(struct task_struct *); extern void exit_files(struct task_struct *); extern void exit_sighand(struct task_struct *); diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f229d4f82..20029fd67 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -99,6 +99,12 @@ struct sk_buff { struct dst_entry *dst; + /* + * This is the control buffer. It is free to use for every + * layer. Please put your private variables there. If you + * want to keep them across layers you have to do a skb_clone() + * first. This is owned by whoever has the skb queued ATM. + */ char cb[48]; unsigned int len; /* Length of actual data */ @@ -130,13 +136,6 @@ struct sk_buff { unsigned int nf_debug; #endif #endif /*CONFIG_NETFILTER*/ -#if defined(CONFIG_SHAPER) || defined(CONFIG_SHAPER_MODULE) - __u32 shapelatency; /* Latency on frame */ - __u32 shapeclock; /* Time it should go out */ - __u32 shapelen; /* Frame length in clocks */ - __u32 shapestamp; /* Stamp for shaper */ - __u16 shapepend; /* Pending */ -#endif #if defined(CONFIG_HIPPI) union{ @@ -211,7 +210,7 @@ extern __inline__ atomic_t *skb_datarefp(struct sk_buff *skb) * skb_queue_empty - check if a queue is empty * @list: queue head * - * Returns true if the queue is empty, false otherwise + * Returns true if the queue is empty, false otherwise. */ extern __inline__ int skb_queue_empty(struct sk_buff_head *list) @@ -240,7 +239,7 @@ extern __inline__ struct sk_buff *skb_get(struct sk_buff *skb) /** * kfree_skb - free an sk_buff - * @skb: The buffer to free + * @skb: buffer to free * * Drop a reference to the buffer and free it if the usage count has * hit zero. @@ -261,9 +260,9 @@ extern __inline__ void kfree_skb_fast(struct sk_buff *skb) /** * skb_cloned - is the buffer a clone - * @skb: Buffer to check + * @skb: buffer to check * - * Returns true if the buffer was generated with skb_clone and is + * Returns true if the buffer was generated with skb_clone() and is * one of multiple shared copies of the buffer. Cloned buffers are * shared data so must not be written to under normal circumstances. */ @@ -328,9 +327,9 @@ extern __inline__ struct sk_buff *skb_share_check(struct sk_buff *skb, int pri) * copy of the data, drops a reference count on the old copy and returns * the new copy with the reference count at 1. If the buffer is not a clone * the original buffer is returned. When called with a spinlock held or - * from interrupt state pri must be GFP_ATOMIC + * from interrupt state @pri must be %GFP_ATOMIC * - * NULL is returned on a memory allocation failure. + * %NULL is returned on a memory allocation failure. */ extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri) @@ -347,12 +346,12 @@ extern __inline__ struct sk_buff *skb_unshare(struct sk_buff *skb, int pri) * skb_peek * @list_: list to peek at * - * Peek an sk_buff. Unlike most other operations you _MUST_ + * Peek an &sk_buff. Unlike most other operations you _MUST_ * be careful with this one. A peek leaves the buffer on the * list and someone else may run off with it. You must hold * the appropriate locks or have a private queue to do this. * - * Returns NULL for an empty list or a pointer to the head element. + * Returns %NULL for an empty list or a pointer to the head element. * The reference count is not incremented and the reference is therefore * volatile. Use with caution. */ @@ -369,12 +368,12 @@ extern __inline__ struct sk_buff *skb_peek(struct sk_buff_head *list_) * skb_peek_tail * @list_: list to peek at * - * Peek an sk_buff. Unlike most other operations you _MUST_ + * Peek an &sk_buff. Unlike most other operations you _MUST_ * be careful with this one. A peek leaves the buffer on the * list and someone else may run off with it. You must hold * the appropriate locks or have a private queue to do this. * - * Returns NULL for an empty list or a pointer to the tail element. + * Returns %NULL for an empty list or a pointer to the tail element. * The reference count is not incremented and the reference is therefore * volatile. Use with caution. */ @@ -391,7 +390,7 @@ extern __inline__ struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) * skb_queue_len - get queue length * @list_: list to measure * - * Return the length of an sk_buff queue. + * Return the length of an &sk_buff queue. */ extern __inline__ __u32 skb_queue_len(struct sk_buff_head *list_) @@ -446,7 +445,7 @@ extern __inline__ void __skb_queue_head(struct sk_buff_head *list, struct sk_buf * @newsk: buffer to queue * * Queue a buffer at the start of the list. This function takes the - * list lock and can be used safely with other locking sk_buff functions + * list lock and can be used safely with other locking &sk_buff functions * safely. * * A buffer cannot be placed on two lists at the same time. @@ -493,7 +492,7 @@ extern __inline__ void __skb_queue_tail(struct sk_buff_head *list, struct sk_buf * @newsk: buffer to queue * * Queue a buffer at the tail of the list. This function takes the - * list lock and can be used safely with other locking sk_buff functions + * list lock and can be used safely with other locking &sk_buff functions * safely. * * A buffer cannot be placed on two lists at the same time. @@ -514,7 +513,7 @@ extern __inline__ void skb_queue_tail(struct sk_buff_head *list, struct sk_buff * * Remove the head of the list. This function does not take any locks * so must be used with appropriate locks held only. The head item is - * returned or NULL if the list is empty. + * returned or %NULL if the list is empty. */ extern __inline__ struct sk_buff *__skb_dequeue(struct sk_buff_head *list) @@ -543,7 +542,7 @@ extern __inline__ struct sk_buff *__skb_dequeue(struct sk_buff_head *list) * * Remove the head of the list. The list lock is taken so the function * may be used safely with other locking list functions. The head item is - * returned or NULL if the list is empty. + * returned or %NULL if the list is empty. */ extern __inline__ struct sk_buff *skb_dequeue(struct sk_buff_head *list) @@ -675,7 +674,7 @@ extern __inline__ void skb_unlink(struct sk_buff *skb) * * Remove the tail of the list. This function does not take any locks * so must be used with appropriate locks held only. The tail item is - * returned or NULL if the list is empty. + * returned or %NULL if the list is empty. */ extern __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) @@ -692,7 +691,7 @@ extern __inline__ struct sk_buff *__skb_dequeue_tail(struct sk_buff_head *list) * * Remove the head of the list. The list lock is taken so the function * may be used safely with other locking list functions. The tail item is - * returned or NULL if the list is empty. + * returned or %NULL if the list is empty. */ extern __inline__ struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list) @@ -725,7 +724,7 @@ extern __inline__ unsigned char *__skb_put(struct sk_buff *skb, unsigned int len * * This function extends the used data area of the buffer. If this would * exceed the total buffer size the kernel will panic. A pointer to the - * first byte of the extra data is returned + * first byte of the extra data is returned. */ extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len) @@ -752,8 +751,8 @@ extern __inline__ unsigned char *__skb_push(struct sk_buff *skb, unsigned int le * @len: amount of data to add * * This function extends the used data area of the buffer at the buffer - * start. If this would exceed the total buffer headroom the kernel will - * panic. A pointer to the first byte of the extra data is returned + * start. If this would exceed the total buffer headroom the kernel will + * panic. A pointer to the first byte of the extra data is returned. */ extern __inline__ unsigned char *skb_push(struct sk_buff *skb, unsigned int len) @@ -777,10 +776,10 @@ extern __inline__ char *__skb_pull(struct sk_buff *skb, unsigned int len) * @skb: buffer to use * @len: amount of data to remove * - * This function removes data from the start of a buffer, returning + * This function removes data from the start of a buffer, returning * the memory to the headroom. A pointer to the next data in the buffer * is returned. Once the data has been pulled future pushes will overwrite - * the old data + * the old data. */ extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len) @@ -794,7 +793,7 @@ extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len * skb_headroom - bytes at buffer head * @skb: buffer to check * - * Return the number of bytes of free space at the head of an sk_buff + * Return the number of bytes of free space at the head of an &sk_buff. */ extern __inline__ int skb_headroom(const struct sk_buff *skb) @@ -819,7 +818,7 @@ extern __inline__ int skb_tailroom(const struct sk_buff *skb) * @skb: buffer to alter * @len: bytes to move * - * Increase the headroom of an empty sk_buff by reducing the tail + * Increase the headroom of an empty &sk_buff by reducing the tail * room. This is only allowed for an empty buffer. */ @@ -856,8 +855,8 @@ extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len) * skb_orphan - orphan a buffer * @skb: buffer to orphan * - * If a buffer currently has an owner then we call the owners - * destructor function and make the skb unowned. The buffer continues + * If a buffer currently has an owner then we call the owner's + * destructor function and make the @skb unowned. The buffer continues * to exist but is no longer charged to its former owner. */ @@ -874,7 +873,7 @@ extern __inline__ void skb_orphan(struct sk_buff *skb) * skb_purge - empty a list * @list: list to empty * - * Delete all buffers on an sk_buff list. Each buffer is removed from + * Delete all buffers on an &sk_buff list. Each buffer is removed from * the list and one reference dropped. This function takes the list * lock and is atomic with respect to other list locking functions. */ @@ -891,7 +890,7 @@ extern __inline__ void skb_queue_purge(struct sk_buff_head *list) * __skb_purge - empty a list * @list: list to empty * - * Delete all buffers on an sk_buff list. Each buffer is removed from + * Delete all buffers on an &sk_buff list. Each buffer is removed from * the list and one reference dropped. This function does not take the * list lock and the caller must hold the relevant locks to use it. */ @@ -908,12 +907,12 @@ extern __inline__ void __skb_queue_purge(struct sk_buff_head *list) * dev_alloc_skb - allocate an skbuff for sending * @length: length to allocate * - * Allocate a new sk_buff and assign it a usage count of one. The + * Allocate a new &sk_buff and assign it a usage count of one. The * buffer has unspecified headroom built in. Users should allocate * the headroom they think they need without accounting for the * built in space. The built in space is used for optimisations. * - * NULL is returned in there is no free memory. Although this function + * %NULL is returned in there is no free memory. Although this function * allocates memory it can be called from an interrupt. */ @@ -934,7 +933,7 @@ extern __inline__ struct sk_buff *dev_alloc_skb(unsigned int length) * * If the buffer passed lacks sufficient headroom or is a clone then * it is copied and the additional headroom made available. If there - * is no free memory NULL is returned. The new buffer is returned if + * is no free memory %NULL is returned. The new buffer is returned if * a copy was made (and the old one dropped a reference). The existing * buffer is returned otherwise. * diff --git a/include/linux/smp.h b/include/linux/smp.h index 5f8a10198..6b0617caf 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -6,7 +6,9 @@ * Alan Cox. <alan@redhat.com> */ -#ifdef __SMP__ +#include <linux/config.h> + +#ifdef CONFIG_SMP #include <asm/smp.h> diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 320c69612..d1bb03872 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h @@ -1,7 +1,9 @@ #ifndef __LINUX_SMPLOCK_H #define __LINUX_SMPLOCK_H -#ifndef __SMP__ +#include <linux/config.h> + +#ifndef CONFIG_SMP #define lock_kernel() do { } while(0) #define unlock_kernel() do { } while(0) @@ -13,6 +15,6 @@ #include <asm/smplock.h> -#endif /* __SMP__ */ +#endif /* CONFIG_SMP */ #endif diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index ff319aaa1..b4a190d65 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -1,6 +1,8 @@ #ifndef __LINUX_SPINLOCK_H #define __LINUX_SPINLOCK_H +#include <linux/config.h> + /* * These are the generic versions of the spinlocks and read-write * locks.. @@ -29,7 +31,7 @@ #define write_unlock_irq(lock) do { write_unlock(lock); local_irq_enable(); } while (0) #define write_unlock_bh(lock) do { write_unlock(lock); local_bh_enable(); } while (0) -#ifdef __SMP__ +#ifdef CONFIG_SMP #include <asm/spinlock.h> #else /* !SMP */ diff --git a/include/linux/string.h b/include/linux/string.h index e5002746b..88eb21c28 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -31,6 +31,7 @@ extern void * memcpy(void *,const void *,__kernel_size_t); extern void * memmove(void *,const void *,__kernel_size_t); extern void * memscan(void *,int,__kernel_size_t); extern int memcmp(const void *,const void *,__kernel_size_t); +extern void * memchr(const void *,int,__kernel_size_t); /* * Include machine specific inline routines diff --git a/include/linux/swap.h b/include/linux/swap.h index d24ff0e0a..5d5f97cdb 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -51,6 +51,7 @@ struct swap_info_struct { kdev_t swap_device; spinlock_t sdev_lock; struct dentry * swap_file; + struct vfsmount *swap_vfsmnt; unsigned short * swap_map; unsigned int lowest_bit; unsigned int highest_bit; @@ -86,6 +87,7 @@ extern void swap_setup (void); /* linux/mm/vmscan.c */ extern int try_to_free_pages(unsigned int gfp_mask, zone_t *zone); +extern int swap_out(unsigned int gfp_mask, int priority); /* linux/mm/page_io.c */ extern void rw_swap_page(int, struct page *, int); @@ -166,7 +168,7 @@ extern spinlock_t pagemap_lru_lock; #define lru_cache_add(page) \ do { \ spin_lock(&pagemap_lru_lock); \ - list_add(&(page)->lru, &page->zone->lru_cache); \ + list_add(&(page)->lru, &lru_cache); \ nr_lru_pages++; \ spin_unlock(&pagemap_lru_lock); \ } while (0) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index eb51e575f..92e44456b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -119,7 +119,7 @@ enum enum { VM_SWAPCTL=1, /* struct: Set vm swapping control */ - VM_SWAPOUT=2, /* int: Background pageout interval */ + VM_SWAPOUT=2, /* int: Linear or sqrt() swapout for hogs */ VM_FREEPG=3, /* struct: Set free page thresholds */ VM_BDFLUSH=4, /* struct: Control buffer cache flushing */ VM_OVERCOMMIT_MEMORY=5, /* Turn off the virtual memory safety limit */ diff --git a/include/linux/threads.h b/include/linux/threads.h index f1f502eb6..b6ed9116c 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -1,12 +1,14 @@ #ifndef _LINUX_THREADS_H #define _LINUX_THREADS_H +#include <linux/config.h> + /* * The default limit for the nr of threads is now in * /proc/sys/kernel/max-threads. */ -#ifdef __SMP__ +#ifdef CONFIG_SMP #define NR_CPUS 32 /* Max processors that can be running in SMP */ #else #define NR_CPUS 1 diff --git a/include/linux/timer.h b/include/linux/timer.h index f9e7efdaa..e6eb00da0 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -1,6 +1,8 @@ #ifndef _LINUX_TIMER_H #define _LINUX_TIMER_H +#include <linux/config.h> + /* * Old-style timers. Please don't use for any new code. * @@ -69,7 +71,7 @@ extern inline void init_timer(struct timer_list * timer) { timer->next = NULL; timer->prev = NULL; -#ifdef __SMP__ +#ifdef CONFIG_SMP timer->running = 0; #endif } @@ -79,17 +81,17 @@ extern inline int timer_pending(const struct timer_list * timer) return timer->prev != NULL; } -#ifdef __SMP__ +#ifdef CONFIG_SMP #define timer_exit(t) do { (t)->running = 0; mb(); } while (0) #define timer_set_running(t) do { (t)->running = 1; mb(); } while (0) #define timer_is_running(t) ((t)->running != 0) #define timer_synchronize(t) while (timer_is_running(t)) barrier() extern int del_timer_sync(struct timer_list * timer); #else -#define timer_exit(t) do { } while (0) -#define timer_set_running(t) do { } while (0) +#define timer_exit(t) (void)(t) +#define timer_set_running(t) (void)(t) #define timer_is_running(t) (0) -#define timer_synchronize(t) barrier() +#define timer_synchronize(t) do { (void)(t); barrier(); } while(0) #define del_timer_sync(t) del_timer(t) #endif diff --git a/include/linux/usb.h b/include/linux/usb.h index b9db220f2..e67e96bdc 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -160,7 +160,7 @@ typedef struct wait_queue *wait_queue_head_t; #define __set_current_state(state_value) \ do { current->state = state_value; } while (0) -#ifdef __SMP__ +#ifdef CONFIG_SMP #define set_current_state(state_value) \ set_mb(current->state, state_value) #else @@ -618,7 +618,7 @@ int usb_get_current_frame_number (struct usb_device *usb_dev); * - current Data0/1 state (1 bit) * - direction (1 bit) * - speed (1 bit) - * - max packet size (2 bits: 8, 16, 32 or 64) + * - max packet size (2 bits: 8, 16, 32 or 64) [Historical; now gone.] * - pipe type (2 bits: control, interrupt, bulk, isochronous) * * That's 18 bits. Really. Nothing more. And the USB people have @@ -628,7 +628,7 @@ int usb_get_current_frame_number (struct usb_device *usb_dev); * Let's not fall in that trap. We'll just encode it as a simple * unsigned int. The encoding is: * - * - max size: bits 0-1 (00 = 8, 01 = 16, 10 = 32, 11 = 64) + * - max size: bits 0-1 (00 = 8, 01 = 16, 10 = 32, 11 = 64) [Historical; now gone.] * - direction: bit 7 (0 = Host-to-Device [Out], 1 = Device-to-Host [In]) * - device: bits 8-14 * - endpoint: bits 15-18 @@ -647,11 +647,6 @@ int usb_get_current_frame_number (struct usb_device *usb_dev); #define PIPE_CONTROL 2 #define PIPE_BULK 3 -#define USB_ISOCHRONOUS 0 -#define USB_INTERRUPT 1 -#define USB_CONTROL 2 -#define USB_BULK 3 - #define usb_maxpacket(dev, pipe, out) (out \ ? (dev)->epmaxpacketout[usb_pipeendpoint(pipe)] \ : (dev)->epmaxpacketin [usb_pipeendpoint(pipe)] ) diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 682620995..7a73db598 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -373,6 +373,7 @@ struct video_code #define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ #define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ #define VID_HARDWARE_OV511 27 +#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ /* * Initialiser list diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 830e48e43..dffdc0b2c 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -35,7 +35,9 @@ #ifndef _WANPIPE_H #define _WANPIPE_H -#ifdef __SMP__ +#include <linux/config.h> + +#ifdef CONFIG_SMP #include <asm/spinlock.h> /* Support for SMP Locking */ #endif @@ -251,7 +253,7 @@ typedef struct sdla unsigned short force_enable_irq; char TracingEnabled; /* flag for enabling trace */ global_stats_t statistics; /* global statistics */ -#ifdef __SMP__ +#ifdef CONFIG_SMP spinlock_t lock; /* Support for SMP Locking */ #endif void* mbox; /* -> mailbox */ diff --git a/include/linux/x25.h b/include/linux/x25.h index 6f3f300b0..49bb2a4b3 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h @@ -1,5 +1,9 @@ /* * These are the public elements of the Linux kernel X.25 implementation. + * + * History + * mar/20/00 Daniela Squassoni Disabling/enabling of facilities + * negotiation. */ #ifndef X25_KERNEL_H @@ -49,12 +53,27 @@ struct sockaddr_x25 { /* * DTE/DCE subscription options. + * + * As this is missing lots of options, user should expect major + * changes of this structure in 2.5.x which might break compatibilty. + * The somewhat ugly dimension 200-sizeof() is needed to maintain + * backward compatibility. */ struct x25_subscrip_struct { - char device[200]; + char device[200-sizeof(unsigned long)]; + unsigned long global_facil_mask; /* 0 to disable negotiation */ unsigned int extended; }; +/* values for above global_facil_mask */ + +#define X25_MASK_REVERSE 0x01 +#define X25_MASK_THROUGHPUT 0x02 +#define X25_MASK_PACKET_SIZE 0x04 +#define X25_MASK_WINDOW_SIZE 0x08 + + + /* * Routing table control structure. */ |