diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-12-16 05:34:03 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-12-16 05:34:03 +0000 |
commit | 967c65a99059fd459b956c1588ce0ba227912c4e (patch) | |
tree | 8224d013ff5d255420713d05610c7efebd204d2a /include/linux | |
parent | e20c1cc1656a66a2773bca4591a895cbc12696ff (diff) |
Merge with Linux 2.1.72, part 1.
Diffstat (limited to 'include/linux')
64 files changed, 1426 insertions, 4008 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h index 99fe14917..e1c96a4c1 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -1,29 +1,86 @@ -#ifndef __LINUX_ACCT_H -#define __LINUX_ACCT_H +/* + * BSD Process Accounting for Linux - Definitions + * + * Author: Marco van Wieringen (mvw@planets.elm.net) + * + * This header file contains the definitions needed to implement + * BSD-style process accounting. The kernel accounting code and all + * user-level programs that try to do something useful with the + * process accounting log must include this file. + * + * Copyright (C) 1995 - 1997 Marco van Wieringen - ELM Consultancy B.V. + * + */ -#define ACCT_COMM 16 +#ifndef _LINUX_ACCT_H +#define _LINUX_ACCT_H + +#include <linux/types.h> + +/* + * comp_t is a 16-bit "floating" point number with a 3-bit base 8 + * exponent and a 13-bit fraction. See linux/kernel/acct.c for the + * specific encoding system used. + */ + +typedef __u16 comp_t; + +/* + * accounting file record + * + * This structure contains all of the information written out to the + * process accounting file whenever a process exits. + */ + +#define ACCT_COMM 16 struct acct { - char ac_comm[ACCT_COMM]; /* Accounting command name */ - time_t ac_utime; /* Accounting user time */ - time_t ac_stime; /* Accounting system time */ - time_t ac_etime; /* Accounting elapsed time */ - time_t ac_btime; /* Beginning time */ - uid_t ac_uid; /* Accounting user ID */ - gid_t ac_gid; /* Accounting group ID */ - dev_t ac_tty; /* controlling tty */ - char ac_flag; /* Accounting flag */ - long ac_minflt; /* Accounting minor pagefaults */ - long ac_majflt; /* Accounting major pagefaults */ - long ac_exitcode; /* Accounting process exitcode */ + char ac_flag; /* Accounting Flags */ +/* + * No binary format break with 2.0 - but when we hit 32bit uid we'll + * have to bite one + */ + __u16 ac_uid; /* Accounting Real User ID */ + __u16 ac_gid; /* Accounting Real Group ID */ + __u16 ac_tty; /* Accounting Control Terminal */ + __u32 ac_btime; /* Accounting Process Creation Time */ + comp_t ac_utime; /* Accounting User Time */ + comp_t ac_stime; /* Accounting System Time */ + comp_t ac_etime; /* Accounting Elapsed Time */ + comp_t ac_mem; /* Accounting Average Memory Usage */ + comp_t ac_io; /* Accounting Chars Transferred */ + comp_t ac_rw; /* Accounting Blocks Read or Written */ + comp_t ac_minflt; /* Accounting Minor Pagefaults */ + comp_t ac_majflt; /* Accounting Major Pagefaults */ + comp_t ac_swaps; /* Accounting Number of Swaps */ + __u32 ac_exitcode; /* Accounting Exitcode */ + char ac_comm[ACCT_COMM + 1]; /* Accounting Command Name */ + char ac_pad[10]; /* Accounting Padding Bytes */ }; -#define AFORK 0001 /* has executed fork, but no exec */ -#define ASU 0002 /* used super-user privileges */ -#define ACORE 0004 /* dumped core */ -#define AXSIG 0010 /* killed by a signal */ +/* + * accounting flags + */ + /* bit set when the process ... */ +#define AFORK 0x01 /* ... executed fork, but did not exec */ +#define ASU 0x02 /* ... used super-user privileges */ +#define ACOMPAT 0x04 /* ... used compatibility mode (VAX only not used) */ +#define ACORE 0x08 /* ... dumped core */ +#define AXSIG 0x10 /* ... was killed by a signal */ -#define AHZ 100 +#define AHZ 100 +#ifdef __KERNEL__ + +#include <linux/config.h> + +#ifdef CONFIG_BSD_PROCESS_ACCT +extern int acct_process(long exitcode); +#else +#define acct_process(x) do { } while (0) #endif + +#endif /* __KERNEL */ + +#endif /* _LINUX_ACCT_H */ diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h index cfb891c4e..ec637973d 100644 --- a/include/linux/affs_fs.h +++ b/include/linux/affs_fs.h @@ -27,23 +27,26 @@ struct DateStamp u32 ds_Tick; }; - /* --- Prototypes ----------------------------------------------------------------------------- */ /* amigaffs.c */ extern int affs_get_key_entry(int bsize, void *data, int entry_pos); -extern int affs_get_file_name(int bsize, void *fh_data, char **name); +extern int affs_get_file_name(int bsize, void *fh_data, unsigned char **name); extern u32 affs_checksum_block(int bsize, void *data, s32 *ptype, s32 *stype); extern void affs_fix_checksum(int bsize, void *data, int cspos); extern void secs_to_datestamp(time_t secs, struct DateStamp *ds); extern int prot_to_mode(unsigned int prot); extern u32 mode_to_prot(int mode); -extern int affs_fix_hash_pred(struct inode *startino, int startoffset, - s32 key, s32 newkey); -extern int affs_fix_link_pred(struct inode *startino, s32 key, s32 newkey); +extern int affs_insert_hash(unsigned long dir_ino, struct buffer_head *header, + struct inode *inode); +extern int affs_remove_hash(struct buffer_head *bh, struct inode *inode); +extern int affs_remove_link(struct buffer_head *bh, struct inode *inode); +extern int affs_remove_header(struct buffer_head *bh, struct inode *inode); extern void affs_error(struct super_block *sb, const char *function, const char *fmt, ...); extern void affs_warning(struct super_block *sb, const char *function, const char *fmt, ...); +extern int affs_check_name(const unsigned char *name, int len); +extern int affs_copy_name(unsigned char *bstr, const unsigned char *name); /* bitmap. c */ @@ -56,39 +59,44 @@ extern void affs_make_zones(struct super_block *sb); /* namei.c */ -extern int affs_hash_name(const char *name, int len, int intl, int hashsize); -extern int affs_lookup(struct inode *dir,const char *name, int len, - struct inode **result); -extern int affs_unlink(struct inode *dir, const char *name, int len); -extern int affs_create(struct inode *dir, const char *name, int len, int mode, - struct inode **result); -extern int affs_mkdir(struct inode *dir, const char *name, int len, int mode); -extern int affs_rmdir(struct inode *dir, const char *name, int len); +extern int affs_hash_name(const unsigned char *name, int len, int intl, int hashsize); +extern int affs_lookup(struct inode *dir, struct dentry *dentry); +extern int affs_unlink(struct inode *dir, struct dentry *dentry); +extern int affs_create(struct inode *dir, struct dentry *dentry, int mode); +extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode); +extern int affs_rmdir(struct inode *dir, struct dentry *dentry); extern int affs_link(struct inode *oldinode, struct inode *dir, - const char *name, int len); -extern int affs_symlink(struct inode *dir, const char *name, int len, - const char *symname); -extern int affs_rename(struct inode *old_dir, const char *old_name, int old_len, - struct inode *new_dir, const char *new_name, int new_len); + struct dentry *dentry); +extern int affs_symlink(struct inode *dir, struct dentry *dentry, + const char *symname); +extern int affs_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry); /* inode.c */ -extern struct buffer_head *affs_bread(kdev_t dev, int block, int size); -extern void affs_brelse(struct buffer_head *buf); -extern unsigned long affs_parent_ino(struct inode *dir); -extern struct inode *affs_new_inode(const struct inode *dir); -extern int affs_add_entry(struct inode *dir, struct inode *link, - struct inode *inode, const char *name, - int len, s32 type); +extern struct buffer_head *affs_bread(kdev_t dev, int block, int size); +extern void affs_brelse(struct buffer_head *buf); +extern unsigned long affs_parent_ino(struct inode *dir); +extern struct inode *affs_new_inode(const struct inode *dir); +extern int affs_notify_change(struct inode *inode, struct iattr *attr); +extern int affs_add_entry(struct inode *dir, struct inode *link, + struct inode *inode, struct dentry *dentry, s32 type); +extern void affs_put_inode(struct inode *inode); +extern void affs_delete_inode(struct inode *inode); +extern void affs_read_inode(struct inode *inode); +extern void affs_write_inode(struct inode *inode); + +/* super.c */ + +extern int affs_fs(void); /* file.c */ -extern void affs_truncate(struct inode *); -extern void affs_truncate_ofs(struct inode *); +extern void affs_truncate(struct inode *); /* dir.c */ -extern void affs_dir_truncate(struct inode *); +extern void affs_dir_truncate(struct inode *); /* jump tables */ @@ -99,5 +107,4 @@ extern struct inode_operations affs_symlink_inode_operations; extern struct inode_operations affs_chrdev_inode_operations; extern struct inode_operations affs_blkdev_inode_operations; -extern int init_affs_fs(void); #endif diff --git a/include/linux/affs_fs_sb.h b/include/linux/affs_fs_sb.h index 75af71dba..7ab261209 100644 --- a/include/linux/affs_fs_sb.h +++ b/include/linux/affs_fs_sb.h @@ -68,5 +68,6 @@ struct affs_sb_info { #define SF_OFS 0x0200 /* Old filesystem */ #define SF_PREFIX 0x0400 /* Buffer for prefix is allocated */ #define SF_VERBOSE 0x0800 /* Talk about fs when mounting */ +#define SF_READONLY 0x1000 /* Don't allow to remount rw */ #endif diff --git a/include/linux/amigaffs.h b/include/linux/amigaffs.h index 8e39a6fe2..a6b16e066 100644 --- a/include/linux/amigaffs.h +++ b/include/linux/amigaffs.h @@ -4,10 +4,18 @@ #include <asm/byteorder.h> #include <linux/types.h> +/* AmigaOS allows file names with up to 30 characters length. + * Names longer than that will be silently truncated. If you + * want to disallow this, comment out the following #define. + * Creating filesystem objects with longer names will then + * result in an error (ENAMETOOLONG). + */ +/*#define AFFS_NO_TRUNCATE */ + /* Ugly macros make the code more pretty. */ #define GET_END_PTR(st,p,sz) ((st *)((char *)(p)+((sz)-sizeof(st)))) -#define AFFS_GET_HASHENTRY(data,hashkey) htonl(((struct dir_front *)data)->hashtable[hashkey]) +#define AFFS_GET_HASHENTRY(data,hashkey) be32_to_cpu(((struct dir_front *)data)->hashtable[hashkey]) #define AFFS_BLOCK(data,ino,blk) ((struct file_front *)data)->blocks[AFFS_I2HSIZE(ino)-1-(blk)] #define FILE_END(p,i) GET_END_PTR(struct file_end,p,AFFS_I2BSIZE(i)) @@ -16,6 +24,7 @@ #define LINK_END(p,i) GET_END_PTR(struct hlink_end,p,AFFS_I2BSIZE(i)) #define ROOT_END_S(p,s) GET_END_PTR(struct root_end,p,(s)->s_blocksize) #define DATA_FRONT(bh) ((struct data_front *)(bh)->b_data) +#define DIR_FRONT(bh) ((struct dir_front *)(bh)->b_data) /* Only for easier debugging if need be */ #define affs_bread bread @@ -206,14 +215,14 @@ struct data_front #define AFFS_UMAYWRITE(prot) (((prot) & (FIBF_WRITE|FIBF_DELETE)) == (FIBF_WRITE|FIBF_DELETE)) #define AFFS_UMAYREAD(prot) ((prot) & FIBF_READ) -#define AFFS_UMAYEXECUTE(prot) (((prot) & (FIBF_SCRIPT|FIBF_READ)) == (FIBF_SCRIPT|FIBF_READ)) +#define AFFS_UMAYEXECUTE(prot) ((prot) & FIBF_EXECUTE) #define AFFS_GMAYWRITE(prot) (((prot)&(FIBF_GRP_WRITE|FIBF_GRP_DELETE))==\ (FIBF_GRP_WRITE|FIBF_GRP_DELETE)) #define AFFS_GMAYREAD(prot) ((prot) & FIBF_GRP_READ) -#define AFFS_GMAYEXECUTE(prot) (((prot)&(FIBF_SCRIPT|FIBF_GRP_READ))==(FIBF_SCRIPT|FIBF_GRP_READ)) +#define AFFS_GMAYEXECUTE(prot) ((prot) & FIBF_EXECUTE) #define AFFS_OMAYWRITE(prot) (((prot)&(FIBF_OTR_WRITE|FIBF_OTR_DELETE))==\ (FIBF_OTR_WRITE|FIBF_OTR_DELETE)) #define AFFS_OMAYREAD(prot) ((prot) & FIBF_OTR_READ) -#define AFFS_OMAYEXECUTE(prot) (((prot)&(FIBF_SCRIPT|FIBF_OTR_READ))==(FIBF_SCRIPT|FIBF_OTR_READ)) +#define AFFS_OMAYEXECUTE(prot) ((prot) & FIBF_EXECUTE) #endif diff --git a/include/linux/aztcd.h b/include/linux/aztcd.h index 71fe5a0df..e69de29bb 100644 --- a/include/linux/aztcd.h +++ b/include/linux/aztcd.h @@ -1,154 +0,0 @@ -/* $Id: aztcd.h,v 2.50 1996/05/17 16:15:43 root Exp root $ - * - * Definitions for a AztechCD268 CD-ROM interface - * Copyright (C) 1994, 1995 Werner Zimmermann - * - * based on Mitsumi CDROM driver by Martin Harriss - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * History: W.Zimmermann adaption to Aztech CD268-01A Version 1.3 - * October 1994 Email: zimmerma@rz.fht-esslingen.de - */ - -/* *** change this to set the I/O port address of your CD-ROM drive*/ -#define AZT_BASE_ADDR 0x320 - -/* Uncomment this, if your CDROM is connected to a Soundwave32-soundcard - and configure AZT_BASE_ADDR and AZT_SW32_BASE_ADDR */ -/*#define AZT_SW32 1 -*/ - -#ifdef AZT_SW32 -#define AZT_SW32_BASE_ADDR 0x220 /*I/O port base address of your soundcard*/ -#endif - -/* Set this to 1, if you want your tray to be locked, set to 0 to prevent tray - from locking */ -#define AZT_ALLOW_TRAY_LOCK 1 - -/*Set this to 1 to allow auto-eject when unmounting a disk, set to 0, if you - don't want the auto-eject feature*/ -#define AZT_AUTO_EJECT 0 - -/*Set this to 1, if you want to use incompatible ioctls for reading in raw and - cooked mode */ -#define AZT_PRIVATE_IOCTLS 1 - -/*Set this to 1, if you want multisession support by the ISO fs. Even if you set - this value to '0' you can use multisession CDs. In that case the drive's firm- - ware will do the appropriate redirection automatically. The CD will then look - like a single session CD (but nevertheless all data may be read). Please read - chapter '5.1 Multisession support' in README.aztcd for details. Normally it's - uncritical to leave this setting untouched */ -#define AZT_MULTISESSION 1 - -/*---------------------------------------------------------------------------*/ -/*-----nothing to be configured for normal applications below this line------*/ - - -/* Increase this if you get lots of timeouts; if you get kernel panic, replace - STEN_LOW_WAIT by STEN_LOW in the source code */ -#define AZT_STATUS_DELAY 400 /*for timer wait, STEN_LOW_WAIT*/ -#define AZT_TIMEOUT 8000000 /*for busy wait STEN_LOW, DTEN_LOW*/ -#define AZT_FAST_TIMEOUT 10000 /*for reading the version string*/ - -/* number of times to retry a command before giving up */ -#define AZT_RETRY_ATTEMPTS 3 - -/* port access macros */ -#define CMD_PORT azt_port -#define DATA_PORT azt_port -#define STATUS_PORT azt_port+1 -#define MODE_PORT azt_port+2 -#ifdef AZT_SW32 - #define AZT_SW32_INIT (unsigned int) (0xFF00 & (AZT_BASE_ADDR*16)) - #define AZT_SW32_CONFIG_REG AZT_SW32_BASE_ADDR+0x16 /*Soundwave32 Config. Register*/ - #define AZT_SW32_ID_REG AZT_SW32_BASE_ADDR+0x04 /*Soundwave32 ID Version Register*/ -#endif - -/* status bits */ -#define AST_CMD_CHECK 0x80 /* 1 = command error */ -#define AST_DOOR_OPEN 0x40 /* 1 = door is open */ -#define AST_NOT_READY 0x20 /* 1 = no disk in the drive */ -#define AST_DSK_CHG 0x02 /* 1 = disk removed or changed */ -#define AST_MODE 0x01 /* 0=MODE1, 1=MODE2 */ -#define AST_MODE_BITS 0x1C /* Mode Bits */ -#define AST_INITIAL 0x0C /* initial, only valid ... */ -#define AST_BUSY 0x04 /* now playing, only valid - in combination with mode - bits */ -/* flag bits */ -#define AFL_DATA 0x02 /* data available if low */ -#define AFL_STATUS 0x04 /* status available if low */ -#define AFL_OP_OK 0x01 /* OP_OK command correct*/ -#define AFL_PA_OK 0x02 /* PA_OK parameter correct*/ -#define AFL_OP_ERR 0x05 /* error in command*/ -#define AFL_PA_ERR 0x06 /* error in parameters*/ -#define POLLED 0x04 /* polled mode */ - -/* commands */ -#define ACMD_SOFT_RESET 0x10 /* reset drive */ -#define ACMD_PLAY_READ 0x20 /* read data track in cooked mode */ -#define ACMD_PLAY_READ_RAW 0x21 /* reading in raw mode*/ -#define ACMD_SEEK 0x30 /* seek msf address*/ -#define ACMD_SEEK_TO_LEADIN 0x31 /* seek to leadin track*/ -#define ACMD_GET_ERROR 0x40 /* get error code */ -#define ACMD_GET_STATUS 0x41 /* get status */ -#define ACMD_GET_Q_CHANNEL 0x50 /* read info from q channel */ -#define ACMD_EJECT 0x60 /* eject/open tray */ -#define ACMD_CLOSE 0x61 /* close tray */ -#define ACMD_LOCK 0x71 /* lock tray closed */ -#define ACMD_UNLOCK 0x72 /* unlock tray */ -#define ACMD_PAUSE 0x80 /* pause */ -#define ACMD_STOP 0x81 /* stop play */ -#define ACMD_PLAY_AUDIO 0x90 /* play audio track */ -#define ACMD_SET_VOLUME 0x93 /* set audio level */ -#define ACMD_GET_VERSION 0xA0 /* get firmware version */ -#define ACMD_SET_DISK_TYPE 0xA1 /* set disk data mode */ - -#define MAX_TRACKS 104 - -struct msf { - unsigned char min; - unsigned char sec; - unsigned char frame; -}; - -struct azt_Play_msf { - struct msf start; - struct msf end; -}; - -struct azt_DiskInfo { - unsigned char first; - unsigned char next; - unsigned char last; - struct msf diskLength; - struct msf firstTrack; - unsigned char multi; - struct msf nextSession; - struct msf lastSession; - unsigned char xa; - unsigned char audio; -}; - -struct azt_Toc { - unsigned char ctrl_addr; - unsigned char track; - unsigned char pointIndex; - struct msf trackTime; - struct msf diskTime; -}; diff --git a/include/linux/baycom.h b/include/linux/baycom.h index 20d927f50..9754f9384 100644 --- a/include/linux/baycom.h +++ b/include/linux/baycom.h @@ -1,7 +1,7 @@ /* * The Linux BAYCOM driver for the Baycom serial 1200 baud modem * and the parallel 9600 baud modem - * (C) 1996 by Thomas Sailer, HB9JNX + * (C) 1997 by Thomas Sailer, HB9JNX/AE4WA */ #ifndef _BAYCOM_H diff --git a/include/linux/blk.h b/include/linux/blk.h index 0625942de..8893b170a 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -36,7 +36,9 @@ #endif /* IDE_DRIVER */ #define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0) - +#ifdef CONFIG_CDROM +extern int cdrom_init(void); +#endif CONFIG_CDROM #ifdef CONFIG_CDU31A extern int cdu31a_init(void); #endif CONFIG_CDU31A diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 1c2ede5e0..f41342b53 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -1,108 +1,140 @@ /* * -- <linux/cdrom.h> - * general (not only SCSI) header library for linux CDROM drivers - * (C) 1992 David Giller rafetmad@oxy.edu - * 1994, 1995 Eberhard Moenkeberg emoenke@gwdg.de - * + * General header file for linux CD-ROM drivers + * Copyright (C) 1992 David Giller, rafetmad@oxy.edu + * 1994, 1995 Eberhard Moenkeberg, emoenke@gwdg.de + * 1996 David van Leeuwen, david@tm.tno.nl + * 1997 Erik Andersen, andersee@debian.org */ - + #ifndef _LINUX_CDROM_H #define _LINUX_CDROM_H +/******************************************************* + * As of Linux 2.1.x, all Linux CD-ROM application programs will use this + * (and only this) include file. It is my hope to provide Linux with + * a uniform interface between software accessing CD-ROMs and the various + * device drivers that actually talk to the drives. There may still be + * 23 different kinds of strange CD-ROM drives, but at least there will + * now be one, and only one, Linux CD-ROM interface. + * + * Additionally, as of Linux 2.1.x, all Linux application programs + * should use the O_NONBLOCK option when opening a CD-ROM device + * for subsequent ioctl commands. This allows for neat system errors + * like "No medium found" or "Wrong medium type" upon attempting to + * mount or play an empty slot, mount an audio disc, or play a data disc. + * Generally, changing an application program to support O_NONBLOCK + * is as easy as the following: + * - drive = open("/dev/cdrom", O_RDONLY); + * + drive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK); + * It is worth the small change. + * + * Patches for many common CD programs (provided by David A. van Leeuwen) + * can be found at: ftp://ftp.gwdg.de/pub/linux/cdrom/drivers/cm206/ + * + *******************************************************/ + +/* When a driver supports a certain function, but the cdrom drive we are + * using doesn't, we will return the error EDRIVE_CANT_DO_THIS. We will + * borrow the "Operation not supported" error from the network folks to + * accomplish this. Maybe someday we will get a more targeted error code, + * but this will do for now... */ +#define EDRIVE_CANT_DO_THIS EOPNOTSUPP + +/******************************************************* + * The CD-ROM IOCTL commands -- these should be supported by + * all the various cdrom drivers. For the CD-ROM ioctls, we + * will commandeer byte 0x53, or 'S'. + *******************************************************/ +#define CDROMPAUSE 0x5301 /* Pause Audio Operation */ +#define CDROMRESUME 0x5302 /* Resume paused Audio Operation */ +#define CDROMPLAYMSF 0x5303 /* Play Audio MSF (struct cdrom_msf) */ +#define CDROMPLAYTRKIND 0x5304 /* Play Audio Track/index + (struct cdrom_ti) */ +#define CDROMREADTOCHDR 0x5305 /* Read TOC header + (struct cdrom_tochdr) */ +#define CDROMREADTOCENTRY 0x5306 /* Read TOC entry + (struct cdrom_tocentry) */ +#define CDROMSTOP 0x5307 /* Stop the cdrom drive */ +#define CDROMSTART 0x5308 /* Start the cdrom drive */ +#define CDROMEJECT 0x5309 /* Ejects the cdrom media */ +#define CDROMVOLCTRL 0x530a /* Control output volume + (struct cdrom_volctrl) */ +#define CDROMSUBCHNL 0x530b /* Read subchannel data + (struct cdrom_subchnl) */ +#define CDROMREADMODE2 0x530c /* Read CDROM mode 2 data (2336 Bytes) + (struct cdrom_read) */ +#define CDROMREADMODE1 0x530d /* Read CDROM mode 1 data (2048 Bytes) + (struct cdrom_read) */ +#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */ +#define CDROMEJECT_SW 0x530f /* enable(1)/disable(0) auto-ejecting */ +#define CDROMMULTISESSION 0x5310 /* Obtain the start-of-last-session + address of multi session disks + (struct cdrom_multisession) */ +#define CDROM_GET_MCN 0x5311 /* Obtain the "Universal Product Code" + if available (struct cdrom_mcn) */ +#define CDROM_GET_UPC CDROM_GET_MCN /* This one is depricated, + but here anyway for compatability */ +#define CDROMRESET 0x5312 /* hard-reset the drive */ +#define CDROMVOLREAD 0x5313 /* Get the drive's volume setting + (struct cdrom_volctrl) */ +#define CDROMREADRAW 0x5314 /* read data in raw mode (2352 Bytes) + (struct cdrom_read) */ +/* + * These ioctls are used only used in aztcd.c and optcd.c + */ +#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */ +#define CDROMSEEK 0x5316 /* seek msf address */ + /* - * some fix numbers + * This ioctl is only used by the scsi-cd driver. + It is for playing audio in logical block addressing mode. */ -#define CD_MINS 74 /* max. minutes per CD, not really a limit */ -#define CD_SECS 60 /* seconds per minute */ -#define CD_FRAMES 75 /* frames per second */ - -#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame, not transfered by the drive */ -#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */ -#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */ -#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */ -#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD)/* sync bytes + header of XA frame */ - -#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */ -#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */ -/* most drives don't deliver everything: */ -#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /* 2340 */ -#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /* 2336 */ -/* Optics drive also has a 'read all' mode: */ -#define CD_FRAMESIZE_RAWER 2646 /* bytes per frame */ - -#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */ -#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */ -#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */ -#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */ - -#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */ -#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */ - -#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */ -#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */ - -#define CD_FRAMESIZE_XA CD_FRAMESIZE_RAW1 /* obsolete name */ -#define CD_BLOCK_OFFSET CD_MSF_OFFSET /* obsolete name */ +#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */ -/* - * the raw frame layout: - * - * - audio (red): | audio_sample_bytes | - * | 2352 | - * - * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC | - * | 12 - 4 - 2048 - 4 - 8 - 276 | - * - * - data (yellow, mode2): | sync - head - data | - * | 12 - 4 - 2336 | - * - * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC | - * | 12 - 4 - 8 - 2048 - 4 - 276 | - * - * - XA data (green, mode2 form2): | sync - head - sub - data - EDC | - * | 12 - 4 - 8 - 2324 - 4 | - * - * Sector types (format) - Forces the CD-ROM to read the specified sector type, - * attempt to read any other format ends with an error - * - * format sector type user data size (bytes) - * ----------------------------------------------------------------------------- - * 1 CD DA (Red Book) 2352 (CD_FRAMESIZE_RAW) - * 2 Mode1 Form1 (Yellow Book) 2048 (CD_FRAMESIZE) - * 3 Mode1 Form2 (Yellow Book) 2336 (CD_FRAMESIZE_RAW0) - * 4 Mode2 Form1 (Green Book) 2048 (CD_FRAMESIZE) - * 5 Mode2 Form2 (Green Book) 2328 (2324+4 spare bytes) - * - * - * Data Selection Field (pc.c[9]) - This value controls the actual number - * of bytes transferred from the CD-ROM - * - * bit 7 6 5 4 3 2 1 0 - * ---------------------------------------------------------------------------- - * | Sync | Sub | Header | User | EDC & | Error | Block | reserved - * | | Header | | Data | ECC | Flags | Error | - * \-------------------------------------------/\---------------/ - * | | - * V V - * stored on CD (2532) generated during error correction - * - * The maximal number of bytes returned by CD-ROM is 2646 (CD_FRAMESIZE_RAWER), - * when pc.c[9] = 0xfa. - * +/* + * These ioctls are used only used in optcd.c */ - +#define CDROMREADALL 0x5318 /* read all 2646 bytes */ +#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ -/* - * CDROM IOCTL structures +/* + * These ioctls are implemented through the uniform CD-ROM driver + * They _will_ be adopted by all CD-ROM drivers, when all the CD-ROM + * drivers are eventually ported to the uniform CD-ROM driver interface. */ +#define CDROM_SET_OPTIONS 0x5320 /* Set behavior options */ +#define CDROM_CLEAR_OPTIONS 0x5321 /* Clear behavior options */ +#define CDROM_SELECT_SPEED 0x5322 /* Set the CD-ROM speed */ +#define CDROM_SELECT_DISC 0x5323 /* Select disc (for juke-boxes) */ +#define CDROM_MEDIA_CHANGED 0x5325 /* Check is media changed */ +#define CDROM_DRIVE_STATUS 0x5326 /* Get tray position, etc. */ +#define CDROM_DISC_STATUS 0x5327 /* Get disc type, etc. */ +#define CDROM_CHANGER_NSLOTS 0x5328 /* Get number of slots */ + +/* This ioctl is only used by sbpcd at the moment */ +#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */ + +/******************************************************* + * CDROM IOCTL structures + *******************************************************/ -struct cdrom_blk +/* Address in MSF format */ +struct cdrom_msf0 { - unsigned from; - unsigned short len; + u_char minute; + u_char second; + u_char frame; }; +/* Address in either MSF or logical format */ +union cdrom_addr +{ + struct cdrom_msf0 msf; + int lba; +}; +/* This struct is used by the CDROMPLAYMSF ioctl */ struct cdrom_msf { u_char cdmsf_min0; /* start minute */ @@ -113,6 +145,7 @@ struct cdrom_msf u_char cdmsf_frame1; /* end frame */ }; +/* This struct is used by the CDROMPLAYTRKIND ioctl */ struct cdrom_ti { u_char cdti_trk0; /* start track */ @@ -121,51 +154,23 @@ struct cdrom_ti u_char cdti_ind1; /* end index */ }; +/* This struct is used by the CDROMREADTOCHDR ioctl */ struct cdrom_tochdr { u_char cdth_trk0; /* start track */ u_char cdth_trk1; /* end track */ }; -struct cdrom_msf0 /* address in MSF format */ -{ - u_char minute; - u_char second; - u_char frame; -}; - -union cdrom_addr /* address in either MSF or logical format */ -{ - struct cdrom_msf0 msf; - int lba; -}; - -struct cdrom_tocentry +/* This struct is used by the CDROMVOLCTRL and CDROMVOLREAD ioctls */ +struct cdrom_volctrl { - u_char cdte_track; - u_char cdte_adr :4; - u_char cdte_ctrl :4; - u_char cdte_format; - union cdrom_addr cdte_addr; - u_char cdte_datamode; + u_char channel0; + u_char channel1; + u_char channel2; + u_char channel3; }; -/* - * CD-ROM address types (cdrom_tocentry.cdte_format) - */ -#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */ -#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */ - -/* - * bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) - */ -#define CDROM_DATA_TRACK 0x04 - -/* - * The leadout track is always 0xAA, regardless of # of tracks on disc - */ -#define CDROM_LEADOUT 0xAA - +/* This struct is used by the CDROMSUBCHNL ioctl */ struct cdrom_subchnl { u_char cdsc_format; @@ -178,28 +183,19 @@ struct cdrom_subchnl union cdrom_addr cdsc_reladdr; }; -struct cdrom_mcn { - u_char medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */ -}; - -/* - * audio states (from SCSI-2, but seen with other drives, too) - */ -#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */ -#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */ -#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */ -#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */ -#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */ -#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */ -struct cdrom_volctrl +/* This struct is used by the CDROMREADTOCENTRY ioctl */ +struct cdrom_tocentry { - u_char channel0; - u_char channel1; - u_char channel2; - u_char channel3; + u_char cdte_track; + u_char cdte_adr :4; + u_char cdte_ctrl :4; + u_char cdte_format; + union cdrom_addr cdte_addr; + u_char cdte_datamode; }; +/* This struct is used by the CDROMREADMODE1, and CDROMREADMODE2 ioctls */ struct cdrom_read { int cdread_lba; @@ -207,269 +203,217 @@ struct cdrom_read int cdread_buflen; }; -/* - * extensions for transferring audio frames - * currently used by sbpcd.c, cdu31a.c, ide-cd.c - */ +/* This struct is used by the CDROMREADAUDIO ioctl */ struct cdrom_read_audio { union cdrom_addr addr; /* frame address */ - u_char addr_format; /* CDROM_LBA or CDROM_MSF */ - int nframes; /* number of 2352-byte-frames to read at once, limited by the drivers */ - u_char *buf; /* frame buffer (size: nframes*2352 bytes) */ + u_char addr_format; /* CDROM_LBA or CDROM_MSF */ + int nframes; /* number of 2352-byte-frames to read at once */ + u_char *buf; /* frame buffer (size: nframes*2352 bytes) */ }; -/* - * this has to be the "arg" of the CDROMMULTISESSION ioctl - * for obtaining multi session info. - * The returned "addr" is valid only if "xa_flag" is true. - */ +/* This struct is used with the CDROMMULTISESSION ioctl */ struct cdrom_multisession { - union cdrom_addr addr; /* frame address: start-of-last-session (not the new "frame 16"!)*/ - u_char xa_flag; /* 1: "is XA disk" */ - u_char addr_format; /* CDROM_LBA or CDROM_MSF */ + union cdrom_addr addr; /* frame address: start-of-last-session + (not the new "frame 16"!). Only valid + if the "xa_flag" is true. */ + u_char xa_flag; /* 1: "is XA disk" */ + u_char addr_format; /* CDROM_LBA or CDROM_MSF */ }; -#ifdef FIVETWELVE -#define CDROM_MODE1_SIZE 512 -#else -#define CDROM_MODE1_SIZE 2048 -#endif FIVETWELVE -#define CDROM_MODE2_SIZE 2336 - -/* - * CD-ROM IOCTL commands - * For IOCTL calls, we will commandeer byte 0x53, or 'S'. - */ - -#define CDROMPAUSE 0x5301 -#define CDROMRESUME 0x5302 -#define CDROMPLAYMSF 0x5303 /* (struct cdrom_msf) */ -#define CDROMPLAYTRKIND 0x5304 /* (struct cdrom_ti) */ - -#define CDROMREADTOCHDR 0x5305 /* (struct cdrom_tochdr) */ -#define CDROMREADTOCENTRY 0x5306 /* (struct cdrom_tocentry) */ - -#define CDROMSTOP 0x5307 /* stop the drive motor */ -#define CDROMSTART 0x5308 /* turn the motor on */ - -#define CDROMEJECT 0x5309 /* eject CD-ROM media */ - -#define CDROMVOLCTRL 0x530a /* (struct cdrom_volctrl) */ - -#define CDROMSUBCHNL 0x530b /* (struct cdrom_subchnl) */ - -#define CDROMREADMODE2 0x530c /* (struct cdrom_read) */ - /* read type-2 data */ +/* This struct is used with the CDROM_GET_MCN ioctl. + * Very few audio discs actually have Universal Product Code information, + * which should just be the Medium Catalog Number on the box. Also note + * that the way the codeis written on CD is _not_ uniform across all discs! + */ +struct cdrom_mcn +{ + u_char medium_catalog_number[14]; /* 13 ASCII digits, null-terminated */ +}; -#define CDROMREADMODE1 0x530d /* (struct cdrom_read) */ - /* read type-1 data */ +/* This is used by the CDROMPLAYBLK ioctl */ +struct cdrom_blk +{ + unsigned from; + unsigned short len; +}; -#define CDROMREADAUDIO 0x530e /* (struct cdrom_read_audio) */ /* - * enable (1) / disable (0) auto-ejecting - */ -#define CDROMEJECT_SW 0x530f /* arg: 0 or 1 */ - -/* - * obtain the start-of-last-session address of multi session disks - */ -#define CDROMMULTISESSION 0x5310 /* (struct cdrom_multisession) */ + * A CD-ROM physical sector size is 2048, 2052, 2056, 2324, 2332, 2336, + * 2340, or 2352 bytes long. -/* - * obtain the "universal product code" number - * (only some data disks have it coded) +* Sector types of the standard CD-ROM data formats: + * + * format sector type user data size (bytes) + * ----------------------------------------------------------------------------- + * 1 (Red Book) CD-DA 2352 (CD_FRAMESIZE_RAW) + * 2 (Yellow Book) Mode1 Form1 2048 (CD_FRAMESIZE) + * 3 (Yellow Book) Mode1 Form2 2336 (CD_FRAMESIZE_RAW0) + * 4 (Green Book) Mode2 Form1 2048 (CD_FRAMESIZE) + * 5 (Green Book) Mode2 Form2 2328 (2324+4 spare bytes) + * + * + * The layout of the standard CD-ROM data formats: + * ----------------------------------------------------------------------------- + * - audio (red): | audio_sample_bytes | + * | 2352 | + * + * - data (yellow, mode1): | sync - head - data - EDC - zero - ECC | + * | 12 - 4 - 2048 - 4 - 8 - 276 | + * + * - data (yellow, mode2): | sync - head - data | + * | 12 - 4 - 2336 | + * + * - XA data (green, mode2 form1): | sync - head - sub - data - EDC - ECC | + * | 12 - 4 - 8 - 2048 - 4 - 276 | + * + * - XA data (green, mode2 form2): | sync - head - sub - data - Spare | + * | 12 - 4 - 8 - 2324 - 4 | + * */ -#define CDROM_GET_UPC 0x5311 /* 8 bytes returned */ -#define CDROMRESET 0x5312 /* hard-reset the drive */ -#define CDROMVOLREAD 0x5313 /* let the drive tell its volume setting */ - /* (struct cdrom_volctrl) */ +/* Some generally useful CD-ROM information -- mostly based on the above */ +#define CD_MINS 74 /* max. minutes per CD, not really a limit */ +#define CD_SECS 60 /* seconds per minute */ +#define CD_FRAMES 75 /* frames per second */ +#define CD_SYNC_SIZE 12 /* 12 sync bytes per raw data frame */ +#define CD_MSF_OFFSET 150 /* MSF numbering offset of first frame */ +#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */ +#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */ +#define CD_FRAMESIZE_SUB 96 /* subchannel data "frame" size */ +#define CD_HEAD_SIZE 4 /* header (address) bytes per raw data frame */ +#define CD_SUBHEAD_SIZE 8 /* subheader bytes per raw XA data frame */ +#define CD_EDC_SIZE 4 /* bytes EDC per most raw data frame types */ +#define CD_ZERO_SIZE 8 /* bytes zero per yellow book mode 1 frame */ +#define CD_ECC_SIZE 276 /* bytes ECC per most raw data frame types */ +#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */ +#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */ +#define CD_FRAMESIZE_RAWER 2646 /* The maximum possible returned bytes */ +/* most drives don't deliver everything: */ +#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE) /*2340*/ +#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE) /*2336*/ -/* - * these ioctls are used in aztcd.c and optcd.c - */ -#define CDROMREADRAW 0x5314 /* read data in raw mode */ -#define CDROMREADCOOKED 0x5315 /* read data in cooked mode */ -#define CDROMSEEK 0x5316 /* seek msf address */ - -/* - * for playing audio in logical block addressing mode - */ -#define CDROMPLAYBLK 0x5317 /* (struct cdrom_blk) */ +#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE) /* "before data" part of raw XA frame */ +#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE) /* "after data" part of raw XA frame */ +#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD) /* sync bytes + header of XA frame */ -/* - * these ioctls are used in optcd.c - */ -#define CDROMREADALL 0x5318 /* read all 2646 bytes */ -#define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ +/* CD-ROM address types (cdrom_tocentry.cdte_format) */ +#define CDROM_LBA 0x01 /* "logical block": first frame is #0 */ +#define CDROM_MSF 0x02 /* "minute-second-frame": binary, not bcd here! */ +/* bit to tell whether track is data or audio (cdrom_tocentry.cdte_ctrl) */ +#define CDROM_DATA_TRACK 0x04 -/* - * CD-ROM-specific SCSI command opcodes - */ +/* The leadout track is always 0xAA, regardless of # of tracks on disc */ +#define CDROM_LEADOUT 0xAA -/* - * Group 2 (10-byte). All of these are called 'optional' by SCSI-II. - */ +/* audio states (from SCSI-2, but seen with other drives, too) */ +#define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */ +#define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */ +#define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */ +#define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */ +#define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */ +#define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */ + +/* CD-ROM-specific SCSI command opcodes */ #define SCMD_READ_TOC 0x43 /* read table of contents */ #define SCMD_PLAYAUDIO_MSF 0x47 /* play data at time offset */ #define SCMD_PLAYAUDIO_TI 0x48 /* play data at track/index */ #define SCMD_PAUSE_RESUME 0x4B /* pause/resume audio */ #define SCMD_READ_SUBCHANNEL 0x42 /* read SC info on playing disc */ #define SCMD_PLAYAUDIO10 0x45 /* play data at logical block */ -#define SCMD_READ_HEADER 0x44 /* read TOC header */ - -/* - * Group 5 - */ -#define SCMD_PLAYAUDIO12 0xA5 /* play data at logical block */ -#define SCMD_PLAYTRACK_REL12 0xA9 /* play track at relative offset */ - -/* - * Group 6 Commands - */ -#define SCMD_CD_PLAYBACK_CONTROL 0xC9 /* Sony vendor-specific audio */ -#define SCMD_CD_PLAYBACK_STATUS 0xC4 /* control opcodes */ -/* - * CD-ROM capacity structure. - */ -struct scsi_capacity -{ - u_long capacity; - u_long lbasize; -}; - -/* - * CD-ROM MODE_SENSE/MODE_SELECT parameters - */ -#define ERR_RECOVERY_PARMS 0x01 -#define DISCO_RECO_PARMS 0x02 -#define FORMAT_PARMS 0x03 -#define GEOMETRY_PARMS 0x04 -#define CERTIFICATION_PARMS 0x06 -#define CACHE_PARMS 0x38 +/* capability flags used with the uniform CD-ROM driver */ +#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */ +#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */ +#define CDC_LOCK 0x4 /* disable manual eject */ +#define CDC_SELECT_SPEED 0x8 /* programmable speed */ +#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */ +#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */ +#define CDC_MCN 0x40 /* Medium Catalog Number */ +#define CDC_MEDIA_CHANGED 0x80 /* media changed */ +#define CDC_PLAY_AUDIO 0x100 /* audio functions */ +#define CDC_RESET 0x200 /* hard reset device */ +#define CDC_IOCTLS 0x400 /* driver has non-standard ioctls */ +#define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ + +/* drive status possibilities used with the uniform CD-ROM driver */ +#define CDS_NO_INFO 0 /* if not implemented */ +#define CDS_NO_DISC 1 +#define CDS_TRAY_OPEN 2 +#define CDS_DRIVE_NOT_READY 3 +#define CDS_DISC_OK 4 + +/* disc status possibilities, other than CDS_NO_DISC and CDS_NO_INFO */ +#define CDS_AUDIO 100 +#define CDS_DATA_1 101 +#define CDS_DATA_2 102 +#define CDS_XA_2_1 103 +#define CDS_XA_2_2 104 + +/* User-configurable behavior options for the uniform CD-ROM driver */ +#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */ +#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */ +#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */ +#define CDO_LOCK 0x8 /* lock tray on open files */ +#define CDO_CHECK_TYPE 0x10 /* check type on open for data */ + +/* Special codes used when specifying changer slots. */ +#define CDSL_NONE ((int) (~0U>>1)-1) +#define CDSL_CURRENT ((int) (~0U>>1)) + +#ifdef __KERNEL__ +/* Uniform cdrom data structures for cdrom.c */ +struct cdrom_device_info { + struct cdrom_device_ops *ops; /* link to device_ops */ + struct cdrom_device_info *next; /* next device_info for this major */ + void *handle; /* driver-dependent data */ +/* specifications */ + kdev_t dev; /* device number */ + int mask; /* mask of capability: disables them */ + int speed; /* maximum speed for reading data */ + int capacity; /* number of discs in jukebox */ +/* device-related storage */ + int options : 30; /* options flags */ + unsigned mc_flags : 2; /* media change buffer flags */ + int use_count; /* number of times device opened */ + char name[20]; /* name of the device type */ -/* - * standard mode-select header prepended to all mode-select commands - */ -struct ccs_modesel_head -{ - u_char _r1; /* reserved */ - u_char medium; /* device-specific medium type */ - u_char _r2; /* reserved */ - u_char block_desc_length; /* block descriptor length */ - u_char density; /* device-specific density code */ - u_char number_blocks_hi; /* number of blocks in this block desc */ - u_char number_blocks_med; - u_char number_blocks_lo; - u_char _r3; - u_char block_length_hi; /* block length for blocks in this desc */ - u_char block_length_med; - u_char block_length_lo; -}; - -/* - * error recovery parameters - */ -struct ccs_err_recovery -{ - u_char _r1 : 2; /* reserved */ - u_char page_code : 6; /* page code */ - u_char page_length; /* page length */ - u_char awre : 1; /* auto write realloc enabled */ - u_char arre : 1; /* auto read realloc enabled */ - u_char tb : 1; /* transfer block */ - u_char rc : 1; /* read continuous */ - u_char eec : 1; /* enable early correction */ - u_char per : 1; /* post error */ - u_char dte : 1; /* disable transfer on error */ - u_char dcr : 1; /* disable correction */ - u_char retry_count; /* error retry count */ - u_char correction_span; /* largest recov. to be attempted, bits */ - u_char head_offset_count; /* head offset (2's C) for each retry */ - u_char strobe_offset_count; /* data strobe */ - u_char recovery_time_limit; /* time limit on recovery attempts */ }; -/* - * disco/reco parameters - */ -struct ccs_disco_reco -{ - u_char _r1 : 2; /* reserved */ - u_char page_code : 6; /* page code */ - u_char page_length; /* page length */ - u_char buffer_full_ratio; /* write buffer reconnect threshold */ - u_char buffer_empty_ratio; /* read */ - u_short bus_inactivity_limit; /* limit on bus inactivity time */ - u_short disconnect_time_limit; /* minimum disconnect time */ - u_short connect_time_limit; /* minimum connect time */ - u_short _r2; /* reserved */ +struct cdrom_device_ops { +/* routines */ + int (*open) (struct cdrom_device_info *, int); + void (*release) (struct cdrom_device_info *); + int (*drive_status) (struct cdrom_device_info *, int); + int (*media_changed) (struct cdrom_device_info *, int); + int (*tray_move) (struct cdrom_device_info *, int); + int (*lock_door) (struct cdrom_device_info *, int); + int (*select_speed) (struct cdrom_device_info *, int); + int (*select_disc) (struct cdrom_device_info *, int); + int (*get_last_session) (struct cdrom_device_info *, + struct cdrom_multisession *); + int (*get_mcn) (struct cdrom_device_info *, + struct cdrom_mcn *); + /* hard reset device */ + int (*reset) (struct cdrom_device_info *); + /* play stuff */ + int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); + /* dev-specific */ + int (*dev_ioctl) (struct cdrom_device_info *, + unsigned int, unsigned long); +/* driver specifications */ + const int capability; /* capability flags */ + int n_minors; /* number of active minor devices */ }; -/* - * drive geometry parameters - */ -struct ccs_geometry -{ - u_char _r1 : 2; /* reserved */ - u_char page_code : 6; /* page code */ - u_char page_length; /* page length */ - u_char cyl_ub; /* #cyls */ - u_char cyl_mb; - u_char cyl_lb; - u_char heads; /* #heads */ - u_char precomp_cyl_ub; /* precomp start */ - u_char precomp_cyl_mb; - u_char precomp_cyl_lb; - u_char current_cyl_ub; /* reduced current start */ - u_char current_cyl_mb; - u_char current_cyl_lb; - u_short step_rate; /* stepping motor rate */ - u_char landing_cyl_ub; /* landing zone */ - u_char landing_cyl_mb; - u_char landing_cyl_lb; - u_char _r2; - u_char _r3; - u_char _r4; -}; +/* the general file operations structure: */ +extern struct file_operations cdrom_fops; -/* - * cache parameters - */ -struct ccs_cache -{ - u_char _r1 : 2; /* reserved */ - u_char page_code : 6; /* page code */ - u_char page_length; /* page length */ - u_char mode; /* cache control byte */ - u_char threshold; /* prefetch threshold */ - u_char max_prefetch; /* maximum prefetch size */ - u_char max_multiplier; /* maximum prefetch multiplier */ - u_char min_prefetch; /* minimum prefetch size */ - u_char min_multiplier; /* minimum prefetch multiplier */ - u_char _r2[8]; -}; +extern int register_cdrom(struct cdrom_device_info *cdi); +extern int unregister_cdrom(struct cdrom_device_info *cdi); +#endif /* End of kernel only stuff */ #endif _LINUX_CDROM_H -/*==========================================================================*/ -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-indent-level: 8 - * c-brace-imaginary-offset: 0 - * c-brace-offset: -8 - * c-argdecl-indent: 8 - * c-label-offset: -8 - * c-continued-statement-offset: 8 - * c-continued-brace-offset: 0 - * End: - */ diff --git a/include/linux/cdu31a.h b/include/linux/cdu31a.h index 269e7b614..e69de29bb 100644 --- a/include/linux/cdu31a.h +++ b/include/linux/cdu31a.h @@ -1,389 +0,0 @@ -/* - * Definitions for a Sony interface CDROM drive. - * - * Corey Minyard (minyard@wf-rch.cirr.com) - * - * Copyright (C) 1993 Corey Minyard - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* - * General defines. - */ -#define SONY_XA_DISK_TYPE 0x20 - -/* - * Offsets (from the base address) and bits for the various write registers - * of the drive. - */ -#define SONY_CMD_REG_OFFSET 0 -#define SONY_PARAM_REG_OFFSET 1 -#define SONY_WRITE_REG_OFFSET 2 -#define SONY_CONTROL_REG_OFFSET 3 -# define SONY_ATTN_CLR_BIT 0x01 -# define SONY_RES_RDY_CLR_BIT 0x02 -# define SONY_DATA_RDY_CLR_BIT 0x04 -# define SONY_ATTN_INT_EN_BIT 0x08 -# define SONY_RES_RDY_INT_EN_BIT 0x10 -# define SONY_DATA_RDY_INT_EN_BIT 0x20 -# define SONY_PARAM_CLR_BIT 0x40 -# define SONY_DRIVE_RESET_BIT 0x80 - -/* - * Offsets (from the base address) and bits for the various read registers - * of the drive. - */ -#define SONY_STATUS_REG_OFFSET 0 -# define SONY_ATTN_BIT 0x01 -# define SONY_RES_RDY_BIT 0x02 -# define SONY_DATA_RDY_BIT 0x04 -# define SONY_ATTN_INT_ST_BIT 0x08 -# define SONY_RES_RDY_INT_ST_BIT 0x10 -# define SONY_DATA_RDY_INT_ST_BIT 0x20 -# define SONY_DATA_REQUEST_BIT 0x40 -# define SONY_BUSY_BIT 0x80 -#define SONY_RESULT_REG_OFFSET 1 -#define SONY_READ_REG_OFFSET 2 -#define SONY_FIFOST_REG_OFFSET 3 -# define SONY_PARAM_WRITE_RDY_BIT 0x01 -# define SONY_PARAM_REG_EMPTY_BIT 0x02 -# define SONY_RES_REG_NOT_EMP_BIT 0x04 -# define SONY_RES_REG_FULL_BIT 0x08 - -#define LOG_START_OFFSET 150 /* Offset of first logical sector */ - -#define SONY_DETECT_TIMEOUT (8*HZ/10) /* Maximum amount of time - that drive detection code - will wait for response - from drive (in 1/100th's - of seconds). */ - -#define SONY_JIFFIES_TIMEOUT 1000 /* Maximum number of times the - drive will wait/try for an - operation */ -#define SONY_RESET_TIMEOUT 100 /* Maximum number of times the - drive will wait/try a reset - operation */ -#define SONY_READY_RETRIES 20000 /* How many times to retry a - spin waiting for a register - to come ready */ - -#define MAX_CDU31A_RETRIES 3 /* How many times to retry an - operation */ - -/* Commands to request or set drive control parameters and disc information */ -#define SONY_REQ_DRIVE_CONFIG_CMD 0x00 /* Returns s_sony_drive_config */ -#define SONY_REQ_DRIVE_MODE_CMD 0x01 -#define SONY_REQ_DRIVE_PARAM_CMD 0x02 -#define SONY_REQ_MECH_STATUS_CMD 0x03 -#define SONY_REQ_AUDIO_STATUS_CMD 0x04 -#define SONY_SET_DRIVE_PARAM_CMD 0x10 -#define SONY_REQ_TOC_DATA_CMD 0x20 /* Returns s_sony_toc */ -#define SONY_REQ_SUBCODE_ADDRESS_CMD 0x21 /* Returns s_sony_subcode */ -#define SONY_REQ_UPC_EAN_CMD 0x22 -#define SONY_REQ_ISRC_CMD 0x23 -#define SONY_REQ_TOC_DATA_SPEC_CMD 0x24 - -/* Commands to request information from the drive */ -#define SONY_READ_TOC_CMD 0x30 -#define SONY_SEEK_CMD 0x31 -#define SONY_READ_CMD 0x32 -#define SONY_READ_BLKERR_STAT_CMD 0x34 -#define SONY_ABORT_CMD 0x35 -#define SONY_READ_TOC_SPEC_CMD 0x36 - -/* Commands to control audio */ -#define SONY_AUDIO_PLAYBACK_CMD 0x40 -#define SONY_AUDIO_STOP_CMD 0x41 -#define SONY_AUDIO_SCAN_CMD 0x42 - -/* Miscellaneous control commands */ -#define SONY_EJECT_CMD 0x50 -#define SONY_SPIN_UP_CMD 0x51 -#define SONY_SPIN_DOWN_CMD 0x52 - -/* Diagnostic commands */ -#define SONY_WRITE_BUFFER_CMD 0x60 -#define SONY_READ_BUFFER_CMD 0x61 -#define SONY_DIAGNOSTICS_CMD 0x62 - - -/* - * The following are command parameters for the set drive parameter command - */ -#define SONY_SD_DECODE_PARAM 0x00 -#define SONY_SD_INTERFACE_PARAM 0x01 -#define SONY_SD_BUFFERING_PARAM 0x02 -#define SONY_SD_AUDIO_PARAM 0x03 -#define SONY_SD_AUDIO_VOLUME 0x04 -#define SONY_SD_MECH_CONTROL 0x05 -#define SONY_SD_AUTO_SPIN_DOWN_TIME 0x06 - -/* - * The following are parameter bits for the mechanical control command - */ -#define SONY_AUTO_SPIN_UP_BIT 0x01 -#define SONY_AUTO_EJECT_BIT 0x02 -#define SONY_DOUBLE_SPEED_BIT 0x04 - -/* - * The following extract information from the drive configuration about - * the drive itself. - */ -#define SONY_HWC_GET_LOAD_MECH(c) (c.hw_config[0] & 0x03) -#define SONY_HWC_EJECT(c) (c.hw_config[0] & 0x04) -#define SONY_HWC_LED_SUPPORT(c) (c.hw_config[0] & 0x08) -#define SONY_HWC_DOUBLE_SPEED(c) (c.hw_config[0] & 0x10) -#define SONY_HWC_GET_BUF_MEM_SIZE(c) ((c.hw_config[0] & 0xc0) >> 6) -#define SONY_HWC_AUDIO_PLAYBACK(c) (c.hw_config[1] & 0x01) -#define SONY_HWC_ELECTRIC_VOLUME(c) (c.hw_config[1] & 0x02) -#define SONY_HWC_ELECTRIC_VOLUME_CTL(c) (c.hw_config[1] & 0x04) - -#define SONY_HWC_CADDY_LOAD_MECH 0x00 -#define SONY_HWC_TRAY_LOAD_MECH 0x01 -#define SONY_HWC_POPUP_LOAD_MECH 0x02 -#define SONY_HWC_UNKWN_LOAD_MECH 0x03 - -#define SONY_HWC_8KB_BUFFER 0x00 -#define SONY_HWC_32KB_BUFFER 0x01 -#define SONY_HWC_64KB_BUFFER 0x02 -#define SONY_HWC_UNKWN_BUFFER 0x03 - -/* - * This is the complete status returned from the drive configuration request - * command. - */ -struct s_sony_drive_config -{ - unsigned char exec_status[2]; - char vendor_id[8]; - char product_id[16]; - char product_rev_level[8]; - unsigned char hw_config[2]; -}; - -/* The following is returned from the request subcode address command */ -struct s_sony_subcode -{ - unsigned char exec_status[2]; - unsigned char address :4; - unsigned char control :4; - unsigned char track_num; - unsigned char index_num; - unsigned char rel_msf[3]; - unsigned char reserved1; - unsigned char abs_msf[3]; -}; - -#define MAX_TRACKS 100 /* The maximum tracks a disk may have. */ -/* - * The following is returned from the request TOC (Table Of Contents) command. - * (last_track_num-first_track_num+1) values are valid in tracks. - */ -struct s_sony_toc -{ - unsigned char exec_status[2]; - unsigned char address0 :4; - unsigned char control0 :4; - unsigned char point0; - unsigned char first_track_num; - unsigned char disk_type; - unsigned char dummy0; - unsigned char address1 :4; - unsigned char control1 :4; - unsigned char point1; - unsigned char last_track_num; - unsigned char dummy1; - unsigned char dummy2; - unsigned char address2 :4; - unsigned char control2 :4; - unsigned char point2; - unsigned char lead_out_start_msf[3]; - struct - { - unsigned char address :4; - unsigned char control :4; - unsigned char track; - unsigned char track_start_msf[3]; - } tracks[MAX_TRACKS]; - - unsigned int lead_out_start_lba; -}; - -struct s_sony_session_toc -{ - unsigned char exec_status[2]; - unsigned char session_number; - unsigned char address0 :4; - unsigned char control0 :4; - unsigned char point0; - unsigned char first_track_num; - unsigned char disk_type; - unsigned char dummy0; - unsigned char address1 :4; - unsigned char control1 :4; - unsigned char point1; - unsigned char last_track_num; - unsigned char dummy1; - unsigned char dummy2; - unsigned char address2 :4; - unsigned char control2 :4; - unsigned char point2; - unsigned char lead_out_start_msf[3]; - unsigned char addressb0 :4; - unsigned char controlb0 :4; - unsigned char pointb0; - unsigned char next_poss_prog_area_msf[3]; - unsigned char num_mode_5_pointers; - unsigned char max_start_outer_leadout_msf[3]; - unsigned char addressb1 :4; - unsigned char controlb1 :4; - unsigned char pointb1; - unsigned char dummyb0_1[4]; - unsigned char num_skip_interval_pointers; - unsigned char num_skip_track_assignments; - unsigned char dummyb0_2; - unsigned char addressb2 :4; - unsigned char controlb2 :4; - unsigned char pointb2; - unsigned char tracksb2[7]; - unsigned char addressb3 :4; - unsigned char controlb3 :4; - unsigned char pointb3; - unsigned char tracksb3[7]; - unsigned char addressb4 :4; - unsigned char controlb4 :4; - unsigned char pointb4; - unsigned char tracksb4[7]; - unsigned char addressc0 :4; - unsigned char controlc0 :4; - unsigned char pointc0; - unsigned char dummyc0[7]; - struct - { - unsigned char address :4; - unsigned char control :4; - unsigned char track; - unsigned char track_start_msf[3]; - } tracks[MAX_TRACKS]; - - unsigned int start_track_lba; - unsigned int lead_out_start_lba; -}; - - -/* - * The following are errors returned from the drive. - */ - -/* Command error group */ -#define SONY_ILL_CMD_ERR 0x10 -#define SONY_ILL_PARAM_ERR 0x11 - -/* Mechanism group */ -#define SONY_NOT_LOAD_ERR 0x20 -#define SONY_NO_DISK_ERR 0x21 -#define SONY_NOT_SPIN_ERR 0x22 -#define SONY_SPIN_ERR 0x23 -#define SONY_SPINDLE_SERVO_ERR 0x25 -#define SONY_FOCUS_SERVO_ERR 0x26 -#define SONY_EJECT_MECH_ERR 0x29 -#define SONY_AUDIO_PLAYING_ERR 0x2a -#define SONY_EMERGENCY_EJECT_ERR 0x2c - -/* Seek error group */ -#define SONY_FOCUS_ERR 0x30 -#define SONY_FRAME_SYNC_ERR 0x31 -#define SONY_SUBCODE_ADDR_ERR 0x32 -#define SONY_BLOCK_SYNC_ERR 0x33 -#define SONY_HEADER_ADDR_ERR 0x34 - -/* Read error group */ -#define SONY_ILL_TRACK_R_ERR 0x40 -#define SONY_MODE_0_R_ERR 0x41 -#define SONY_ILL_MODE_R_ERR 0x42 -#define SONY_ILL_BLOCK_SIZE_R_ERR 0x43 -#define SONY_MODE_R_ERR 0x44 -#define SONY_FORM_R_ERR 0x45 -#define SONY_LEAD_OUT_R_ERR 0x46 -#define SONY_BUFFER_OVERRUN_R_ERR 0x47 - -/* Data error group */ -#define SONY_UNREC_CIRC_ERR 0x53 -#define SONY_UNREC_LECC_ERR 0x57 - -/* Subcode error group */ -#define SONY_NO_TOC_ERR 0x60 -#define SONY_SUBCODE_DATA_NVAL_ERR 0x61 -#define SONY_FOCUS_ON_TOC_READ_ERR 0x63 -#define SONY_FRAME_SYNC_ON_TOC_READ_ERR 0x64 -#define SONY_TOC_DATA_ERR 0x65 - -/* Hardware failure group */ -#define SONY_HW_FAILURE_ERR 0x70 -#define SONY_LEAD_IN_A_ERR 0x91 -#define SONY_LEAD_OUT_A_ERR 0x92 -#define SONY_DATA_TRACK_A_ERR 0x93 - -/* - * The following are returned from the Read With Block Error Status command. - * They are not errors but information (Errors from the 0x5x group above may - * also be returned - */ -#define SONY_NO_CIRC_ERR_BLK_STAT 0x50 -#define SONY_NO_LECC_ERR_BLK_STAT 0x54 -#define SONY_RECOV_LECC_ERR_BLK_STAT 0x55 -#define SONY_NO_ERR_DETECTION_STAT 0x59 - -/* - * The following is not an error returned by the drive, but by the code - * that talks to the drive. It is returned because of a timeout. - */ -#define SONY_TIMEOUT_OP_ERR 0x01 -#define SONY_SIGNAL_OP_ERR 0x02 -#define SONY_BAD_DATA_ERR 0x03 - - -/* - * The following are attention code for asynchronous events from the drive. - */ - -/* Standard attention group */ -#define SONY_EMER_EJECT_ATTN 0x2c -#define SONY_HW_FAILURE_ATTN 0x70 -#define SONY_MECH_LOADED_ATTN 0x80 -#define SONY_EJECT_PUSHED_ATTN 0x81 - -/* Audio attention group */ -#define SONY_AUDIO_PLAY_DONE_ATTN 0x90 -#define SONY_LEAD_IN_ERR_ATTN 0x91 -#define SONY_LEAD_OUT_ERR_ATTN 0x92 -#define SONY_DATA_TRACK_ERR_ATTN 0x93 -#define SONY_AUDIO_PLAYBACK_ERR_ATTN 0x94 - -/* Auto spin up group */ -#define SONY_SPIN_UP_COMPLETE_ATTN 0x24 -#define SONY_SPINDLE_SERVO_ERR_ATTN 0x25 -#define SONY_FOCUS_SERVO_ERR_ATTN 0x26 -#define SONY_TOC_READ_DONE_ATTN 0x62 -#define SONY_FOCUS_ON_TOC_READ_ERR_ATTN 0x63 -#define SONY_SYNC_ON_TOC_READ_ERR_ATTN 0x65 - -/* Auto eject group */ -#define SONY_SPIN_DOWN_COMPLETE_ATTN 0x27 -#define SONY_EJECT_COMPLETE_ATTN 0x28 -#define SONY_EJECT_MECH_ERR_ATTN 0x29 diff --git a/include/linux/cm206.h b/include/linux/cm206.h index 671a46f31..e69de29bb 100644 --- a/include/linux/cm206.h +++ b/include/linux/cm206.h @@ -1,177 +0,0 @@ -/* cm206.h Header file for cm206.c. - Copyright (c) 1995 David van Leeuwen -*/ - -#ifndef LINUX_CM206_H -#define LINUX_CM206_H - -#include <linux/ioctl.h> - -/* First, the cm260 stuff */ -/* The ports and irq used. Although CM206_BASE and CM206_IRQ are defined - below, the values are not used unless autoprobing is turned off and - no LILO boot options or module command line options are given. Change - these values to your own as last resort if autoprobing and options - don't work. */ - -#define CM206_BASE 0x340 -#define CM206_IRQ 11 - -#define r_data_status (cm206_base) -#define r_uart_receive (cm206_base+0x2) -#define r_fifo_output_buffer (cm206_base+0x4) -#define r_line_status (cm206_base+0x6) -#define r_data_control (cm206_base+0x8) -#define r_uart_transmit (cm206_base+0xa) -#define r_test_clock (cm206_base+0xc) -#define r_test_control (cm206_base+0xe) - -/* the data_status flags */ -#define ds_ram_size 0x4000 -#define ds_toc_ready 0x2000 -#define ds_fifo_empty 0x1000 -#define ds_sync_error 0x800 -#define ds_crc_error 0x400 -#define ds_data_error 0x200 -#define ds_fifo_overflow 0x100 -#define ds_data_ready 0x80 - -/* the line_status flags */ -#define ls_attention 0x10 -#define ls_parity_error 0x8 -#define ls_overrun 0x4 -#define ls_receive_buffer_full 0x2 -#define ls_transmitter_buffer_empty 0x1 - -/* the data control register flags */ -#define dc_read_q_channel 0x4000 -#define dc_mask_sync_error 0x2000 -#define dc_toc_enable 0x1000 -#define dc_no_stop_on_error 0x800 -#define dc_break 0x400 -#define dc_initialize 0x200 -#define dc_mask_transmit_ready 0x100 -#define dc_flag_enable 0x80 - -/* Define the default data control register flags here */ -#define dc_normal (dc_mask_sync_error | dc_no_stop_on_error | \ - dc_mask_transmit_ready) - -/* now some constants related to the cm206 */ -/* another drive status byte, echoed by the cm206 on most commands */ - -#define dsb_error_condition 0x1 -#define dsb_play_in_progress 0x4 -#define dsb_possible_media_change 0x8 -#define dsb_disc_present 0x10 -#define dsb_drive_not_ready 0x20 -#define dsb_tray_locked 0x40 -#define dsb_tray_not_closed 0x80 - -#define dsb_not_useful (dsb_drive_not_ready | dsb_tray_not_closed) - -/* the cm206 command set */ - -#define c_close_tray 0 -#define c_lock_tray 0x01 -#define c_unlock_tray 0x04 -#define c_open_tray 0x05 -#define c_seek 0x10 -#define c_read_data 0x20 -#define c_force_1x 0x21 -#define c_force_2x 0x22 -#define c_auto_mode 0x23 -#define c_play 0x30 -#define c_set_audio_mode 0x31 -#define c_read_current_q 0x41 -#define c_stream_q 0x42 -#define c_drive_status 0x50 -#define c_disc_status 0x51 -#define c_audio_status 0x52 -#define c_drive_configuration 0x53 -#define c_read_upc 0x60 -#define c_stop 0x70 -#define c_calc_checksum 0xe5 - -#define c_gimme 0xf8 - -/* finally, the (error) condition that the drive can be in * - * OK, this is not always an error, but let's prefix it with e_ */ - -#define e_none 0 -#define e_illegal_command 0x01 -#define e_sync 0x02 -#define e_seek 0x03 -#define e_parity 0x04 -#define e_focus 0x05 -#define e_header_sync 0x06 -#define e_code_incompatibility 0x07 -#define e_reset_done 0x08 -#define e_bad_parameter 0x09 -#define e_radial 0x0a -#define e_sub_code 0x0b -#define e_no_data_track 0x0c -#define e_scan 0x0d -#define e_tray_open 0x0f -#define e_no_disc 0x10 -#define e_tray stalled 0x11 - -/* drive configuration masks */ - -#define dcf_revision_code 0x7 -#define dcf_transfer_rate 0x60 -#define dcf_motorized_tray 0x80 - -/* disc status byte */ - -#define cds_multi_session 0x2 -#define cds_all_audio 0x8 -#define cds_xa_mode 0xf0 - -/* finally some ioctls for the driver */ - -#define CM206CTL_GET_STAT _IO( 0x20, 0 ) -#define CM206CTL_GET_LAST_STAT _IO( 0x20, 1 ) - -/* for kernel 1.2.n */ -#if !defined(CDROM_GET_UPC) -#define CDROM_GET_UPC _IO( 'S', 0x11 ) -#define CDROMRESET _IO( 'S', 0x12 ) -#endif - -#ifdef STATISTICS - -/* This is an ugly way to guarantee that the names of the statistics - * are the same in the code and in the diagnostics program. */ - -#ifdef __KERNEL__ -#define x(a) st_ ## a -#define y enum -#else -#define x(a) #a -#define y char * stats_name[] = -#endif - -y {x(interrupt), x(data_ready), x(fifo_overflow), x(data_error), - x(crc_error), x(sync_error), x(lost_intr), x(echo), - x(write_timeout), x(receive_timeout), x(read_timeout), - x(dsb_timeout), x(stop_0xff), x(back_read_timeout), - x(sector_transferred), x(read_restarted), x(read_background), - x(bh), x(open), x(ioctl_multisession), x(attention) -#ifdef __KERNEL__ - , x(last_entry) -#endif - }; - -#ifdef __KERNEL__ -#define NR_STATS st_last_entry -#else -#define NR_STATS (sizeof(stats_name)/sizeof(char*)) -#endif - -#undef y -#undef x - -#endif STATISTICS - -#endif LINUX_CM206_H diff --git a/include/linux/console.h b/include/linux/console.h index 16f1754ec..fc5cd4b2d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -62,36 +62,40 @@ extern struct consw *conswitchp; struct tty_struct; int tioclinux(struct tty_struct *tty, unsigned long arg); -/* The interface for /dev/console(s) and printk output */ +/* + * Array of consoles built from command line options (console=) + */ +struct console_cmdline +{ + char name[8]; /* Name of the driver */ + int index; /* Minor dev. to use */ + char *options; /* Options for the driver */ +}; +#define MAX_CMDLINECONSOLES 8 +extern struct console_cmdline console_list[MAX_CMDLINECONSOLES]; + +/* + * The interface for a console, or any other device that + * wants to capture console messages (printer driver?) + */ + +#define CON_PRINTBUFFER (1) +#define CON_FIRST (2) +#define CON_ENABLED (4) struct console { - /* - * This function should not return before the string is written. - */ - void (*write)(const char*, unsigned); - - /* To unblank the console in case of panic */ - void (*unblank)(void); - - /* - * Only the console that was registered last with wait_key != - * NULL will be used. This blocks until there is a character - * to give back, it does not schedule. - */ - void (*wait_key)(void); - - /* - * Return the device to use when opening /dev/console. Only the - * last registered console will do. - */ - int (*device)(void); - - /* - * For a linked list of consoles for multiple output. Any console - * not at the head of the list is used only for output. - */ - struct console *next; + char name[8]; + void (*write)(struct console *, const char *, unsigned); + int (*read)(struct console *, const char *, unsigned); + kdev_t (*device)(struct console *); + int (*wait_key)(struct console *); + void (*unblank)(void); + int (*setup)(struct console *, char *); + short flags; + short index; + int cflag; + struct console *next; }; extern void register_console(struct console *); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 456596073..53a2ce3e3 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -1,6 +1,8 @@ #ifndef __LINUX_DCACHE_H #define __LINUX_DCACHE_H +#ifdef __KERNEL__ + /* * linux/include/linux/dcache.h * @@ -25,14 +27,14 @@ struct qstr { #define init_name_hash() 0 /* partial hash update function. Assume roughly 4 bits per character */ -static inline unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) +static __inline__ unsigned long partial_name_hash(unsigned char c, unsigned long prevhash) { prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4)); return prevhash ^ c; } /* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ -static inline unsigned long end_name_hash(unsigned long hash) +static __inline__ unsigned long end_name_hash(unsigned long hash) { if (sizeof(hash) > sizeof(unsigned int)) hash += hash >> 4*sizeof(hash); @@ -40,7 +42,7 @@ static inline unsigned long end_name_hash(unsigned long hash) } /* Compute the hash for a name string. */ -static inline unsigned int full_name_hash(const char * name, unsigned int len) +static __inline__ unsigned int full_name_hash(const char * name, unsigned int len) { unsigned long hash = init_name_hash(); while (len--) @@ -102,7 +104,7 @@ struct dentry_operations { * to invalidate a dentry for some reason (NFS * timeouts or autofs deletes). */ -static inline void d_drop(struct dentry * dentry) +static __inline__ void d_drop(struct dentry * dentry) { list_del(&dentry->d_hash); INIT_LIST_HEAD(&dentry->d_hash); @@ -152,7 +154,7 @@ extern int d_validate(struct dentry *dentry, struct dentry *dparent, extern char * d_path(struct dentry * entry, char * buf, int buflen); /* Allocation counts.. */ -static inline struct dentry * dget(struct dentry *dentry) +static __inline__ struct dentry * dget(struct dentry *dentry) { if (dentry) dentry->d_count++; @@ -161,4 +163,6 @@ static inline struct dentry * dget(struct dentry *dentry) extern void dput(struct dentry *); +#endif /* __KERNEL__ */ + #endif /* __LINUX_DCACHE_H */ diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index e0a3ab3c5..c0384391d 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -38,6 +38,8 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct device *dev, extern int eth_header_cache(struct dst_entry *dst, struct neighbour *neigh, struct hh_cache *hh); +extern int eth_header_parse(struct sk_buff *skb, + unsigned char *haddr); extern struct device * init_etherdev(struct device *, int); #ifdef CONFIG_IP_ROUTER diff --git a/include/linux/fs.h b/include/linux/fs.h index 7f93af7fa..28b6f1e50 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -551,7 +551,7 @@ struct file_operations { ssize_t (*read) (struct file *, char *, size_t, loff_t *); ssize_t (*write) (struct file *, const char *, size_t, loff_t *); int (*readdir) (struct file *, void *, filldir_t); - unsigned int (*poll) (struct file *, poll_table *); + unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); diff --git a/include/linux/ftape.h b/include/linux/ftape.h index 36ade3437..a26f2e51b 100644 --- a/include/linux/ftape.h +++ b/include/linux/ftape.h @@ -159,7 +159,7 @@ typedef union { # undef CONFIG_FT_FDC_DMA # define CONFIG_FT_FDC_DMA 3 # endif -#elif CONIFG_FT_MACH2 == 1 /* CONFIG_FT_PROBE_FC10 == 1 */ +#elif CONFIG_FT_MACH2 == 1 /* CONFIG_FT_PROBE_FC10 == 1 */ # if CONFIG_FT_FDC_BASE == 0 # undef CONFIG_FT_FDC_BASE # define CONFIG_FT_FDC_BASE 0x1E0 diff --git a/include/linux/gscd.h b/include/linux/gscd.h index fccc742a5..e69de29bb 100644 --- a/include/linux/gscd.h +++ b/include/linux/gscd.h @@ -1,110 +0,0 @@ -/* - * Definitions for a GoldStar R420 CD-ROM interface - * - * Copyright (C) 1995 Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de> - * Eberhard Moenkeberg <emoenke@gwdg.de> - * - * Published under the GPL. - * - */ - - -/* The Interface Card default address is 0x340. This will work for most - applications. Address selection is accomplished by jumpers PN801-1 to - PN801-4 on the GoldStar Interface Card. - Appropriate settings are: 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360 - 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0 */ - -/* insert here the I/O port address */ -#define GSCD_BASE_ADDR 0x340 - -/* change this to set the dma-channel */ -#define GSCD_DMA_CHANNEL 3 /* not used */ - -/************** nothing to set up below here *********************/ - -/* port access macro */ -#define GSCDPORT(x) (gscd_port + (x)) - -/* - * commands - * the lower nibble holds the command length - */ -#define CMD_STATUS 0x01 -#define CMD_READSUBQ 0x02 /* 1: ?, 2: UPC, 5: ? */ -#define CMD_SEEK 0x05 /* read_mode M-S-F */ -#define CMD_READ 0x07 /* read_mode M-S-F nsec_h nsec_l */ -#define CMD_RESET 0x11 -#define CMD_SETMODE 0x15 -#define CMD_PLAY 0x17 /* M-S-F M-S-F */ -#define CMD_LOCK_CTL 0x22 /* 0: unlock, 1: lock */ -#define CMD_IDENT 0x31 -#define CMD_SETSPEED 0x32 /* 0: auto */ /* ??? */ -#define CMD_GETMODE 0x41 -#define CMD_PAUSE 0x51 -#define CMD_READTOC 0x61 -#define CMD_DISKINFO 0x71 -#define CMD_TRAY_CTL 0x81 - -/* - * disk_state: - */ -#define ST_PLAYING 0x80 -#define ST_UNLOCKED 0x40 -#define ST_NO_DISK 0x20 -#define ST_DOOR_OPEN 0x10 -#define ST_x08 0x08 -#define ST_x04 0x04 -#define ST_INVALID 0x02 -#define ST_x01 0x01 - -/* - * cmd_type: - */ -#define TYPE_INFO 0x01 -#define TYPE_DATA 0x02 - -/* - * read_mode: - */ -#define MOD_POLLED 0x80 -#define MOD_x08 0x08 -#define MOD_RAW 0x04 - -#define READ_DATA(port, buf, nr) insb(port, buf, nr) - -#define SET_TIMER(func, jifs) \ - ((timer_table[GSCD_TIMER].expires = jiffies + jifs), \ - (timer_table[GSCD_TIMER].fn = func), \ - (timer_active |= 1<<GSCD_TIMER)) - -#define CLEAR_TIMER timer_active &= ~(1<<GSCD_TIMER) - -#define MAX_TRACKS 104 - -struct msf { - unsigned char min; - unsigned char sec; - unsigned char frame; -}; - -struct gscd_Play_msf { - struct msf start; - struct msf end; -}; - -struct gscd_DiskInfo { - unsigned char first; - unsigned char last; - struct msf diskLength; - struct msf firstTrack; -}; - -struct gscd_Toc { - unsigned char ctrl_addr; - unsigned char track; - unsigned char pointIndex; - struct msf trackTime; - struct msf diskTime; -}; - diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index 80fbfc79b..cedbd1e2c 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h @@ -73,7 +73,8 @@ #define ABRT_ERR 0x04 /* Command aborted */ #define ID_ERR 0x10 /* ID field not found */ #define ECC_ERR 0x40 /* Uncorrectable ECC error */ -#define BBD_ERR 0x80 /* block marked bad */ +#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ +#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ struct hd_geometry { unsigned char heads; @@ -149,11 +150,28 @@ struct hd_driveid { unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */ unsigned short eide_pio; /* min cycle time (ns), no IORDY */ unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */ - unsigned short reserved69; /* reserved (word 69) */ - unsigned short reserved70; /* reserved (word 70) */ - /* unsigned short reservedxx[57];*/ /* reserved (words 71-127) */ - /* unsigned short vendor7 [32];*/ /* vendor unique (words 128-159) */ - /* unsigned short reservedyy[96];*/ /* reserved (words 160-255) */ + unsigned short word69; + unsigned short word70; + /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */ + unsigned short word71; + unsigned short word72; + unsigned short word73; + unsigned short word74; + unsigned short word75; + unsigned short word76; + unsigned short word77; + unsigned short word78; + unsigned short word79; + unsigned short word80; + unsigned short word81; + unsigned short word82; + unsigned short word83; + unsigned short word84; + unsigned short word85; + unsigned short word86; + unsigned short word87; + unsigned short dma_ultra; + unsigned short reserved[167]; }; /* diff --git a/include/linux/hfmodem.h b/include/linux/hfmodem.h index 739dc5acd..7b35f1169 100644 --- a/include/linux/hfmodem.h +++ b/include/linux/hfmodem.h @@ -100,6 +100,7 @@ struct hfmodem_ioctl_sample_params { /* --------------------------------------------------------------------- */ #ifdef __KERNEL__ +#include <linux/parport.h> #define DMA_MODE_AUTOINIT 0x10 @@ -133,6 +134,7 @@ struct hfmodem_state { unsigned int pariobase; unsigned int midiiobase; unsigned int flags; + struct pardevice *pardev; } ptt_out; struct { diff --git a/include/linux/igmp.h b/include/linux/igmp.h index b4a16b565..8be2d1b87 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -38,7 +38,7 @@ struct igmphdr #define IGMP_PIM 0x14 /* PIM routing */ #define IGMP_TRACE 0x15 #define IGMP_HOST_NEW_MEMBERSHIP_REPORT 0x16 /* New version of 0x11 */ -#define IGMP_HOST_LEAVE_MESSAGE 0x17 /* An extra BSD seems to send */ +#define IGMP_HOST_LEAVE_MESSAGE 0x17 #define IGMP_MTRACE_RESP 0x1e #define IGMP_MTRACE 0x1f @@ -54,9 +54,6 @@ struct igmphdr #define IGMP_SLEEPING_MEMBER 0x04 #define IGMP_AWAKENING_MEMBER 0x05 -#define IGMP_OLD_ROUTER 0x00 -#define IGMP_NEW_ROUTER 0x01 - #define IGMP_MINLEN 8 #define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */ @@ -65,7 +62,7 @@ struct igmphdr #define IGMP_TIMER_SCALE 10 /* denotes that the igmphdr->timer field */ /* specifies time in 10th of seconds */ -#define IGMP_AGE_THRESHOLD 540 /* If this host don't hear any IGMP V1 */ +#define IGMP_AGE_THRESHOLD 400 /* If this host don't hear any IGMP V1 */ /* message in this period of time, */ /* revert to IGMP v2 router. */ @@ -79,40 +76,53 @@ struct igmphdr */ #ifdef __KERNEL__ + +/* ip_mc_socklist is real list now. Speed is not argument; + this list never used in fast path code + */ + struct ip_mc_socklist { - unsigned long multiaddr[IP_MAX_MEMBERSHIPS]; /* This is a speed trade off */ - struct device *multidev[IP_MAX_MEMBERSHIPS]; + struct ip_mc_socklist *next; + int count; + struct ip_mreqn multi; }; struct ip_mc_list { - struct device *interface; - unsigned long multiaddr; - struct ip_mc_list *next; - struct timer_list timer; - int users; - char tm_running; - char reporter; + struct in_device *interface; + unsigned long multiaddr; + struct ip_mc_list *next; + struct timer_list timer; + int users; + char tm_running; + char reporter; + char unsolicit_count; }; -struct ip_router_info +extern __inline__ int ip_check_mc(struct device *dev, u32 mc_addr) { - struct device *dev; - int type; /* type of router which is querier on this interface */ - int time; /* # of slow timeouts since last old query */ - struct timer_list timer; - struct ip_router_info *next; -}; - -extern struct ip_mc_list *ip_mc_head; + struct in_device *in_dev = dev->ip_ptr; + struct ip_mc_list *im; + if (in_dev) { + for (im=in_dev->mc_list; im; im=im->next) + if (im->multiaddr == mc_addr) + return 1; + } + return 0; +} extern int igmp_rcv(struct sk_buff *, unsigned short); -extern void ip_mc_drop_device(struct device *dev); -extern int ip_mc_join_group(struct sock *sk, struct device *dev, unsigned long addr); -extern int ip_mc_leave_group(struct sock *sk, struct device *dev,unsigned long addr); +extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); +extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); extern void ip_mc_drop_socket(struct sock *sk); extern void ip_mr_init(void); +extern void ip_mc_init_dev(struct in_device *); +extern void ip_mc_destroy_dev(struct in_device *); +extern void ip_mc_up(struct in_device *); +extern void ip_mc_down(struct in_device *); +extern int ip_mc_dec_group(struct in_device *in_dev, u32 addr); +extern void ip_mc_inc_group(struct in_device *in_dev, u32 addr); #endif #endif diff --git a/include/linux/in.h b/include/linux/in.h index 0b77670e1..2cc007a43 100644 --- a/include/linux/in.h +++ b/include/linux/in.h @@ -31,9 +31,13 @@ enum { IPPROTO_PUP = 12, /* PUP protocol */ IPPROTO_UDP = 17, /* User Datagram Protocol */ IPPROTO_IDP = 22, /* XNS IDP protocol */ + IPPROTO_RSVP = 46, /* RSVP protocol */ + IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */ IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */ + IPPROTO_PIM = 103, /* Protocol Independent Multicast */ + IPPROTO_RAW = 255, /* Raw IP packets */ IPPROTO_MAX }; @@ -48,15 +52,15 @@ struct in_addr { #define IP_TTL 2 #define IP_HDRINCL 3 #define IP_OPTIONS 4 -#define IP_LOCALADDR 5 /* Cannot remove; a lot of apps still use it. ANK */ +#define IP_ROUTER_ALERT 5 #define IP_RECVOPTS 6 #define IP_RETOPTS 7 -#define IP_RXINFO 8 -#define IP_TXINFO IP_RXINFO -/* Gated uses it. Remove later or preserve for 4.4BSD compatibility??? */ -#define IP_RECVDSTADDR 9 +#define IP_PKTINFO 8 +#define IP_PKTOPTIONS 9 #define IP_PMTUDISC 10 #define IP_RECVERR 11 +#define IP_RECVTTL 12 +#define IP_RECVTOS 13 /* BSD compatibility */ #define IP_RECVRETOPTS IP_RETOPTS @@ -71,9 +75,6 @@ struct in_addr { #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 -#define IP_MULTICAST_IFN 37 -#define IP_ADD_MEMBERSHIPN 38 -#define IP_DROP_MEMBERSHIPN 39 /* These need to appear somewhere around here */ #define IP_DEFAULT_MULTICAST_TTL 1 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 4c71abf5d..a3cabfbc1 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -34,6 +34,7 @@ enum { DIGI_BH, SERIAL_BH, RISCOM8_BH, + SPECIALIX_BH, ESP_BH, NET_BH, IMMEDIATE_BH, diff --git a/include/linux/isp16.h b/include/linux/isp16.h index 9945bb34c..e69de29bb 100644 --- a/include/linux/isp16.h +++ b/include/linux/isp16.h @@ -1,75 +0,0 @@ -/* -- isp16.h - * - * Header for detection and initialisation of cdrom interface (only) on - * ISP16 (MAD16, Mozart) sound card. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* These are the default values */ -#define ISP16_CDROM_TYPE "Sanyo" -#define ISP16_CDROM_IO_BASE 0x340 -#define ISP16_CDROM_IRQ 0 -#define ISP16_CDROM_DMA 0 - -/* Some (Media)Magic */ -/* define types of drive the interface on an ISP16 card may be looking at */ -#define ISP16_DRIVE_X 0x00 -#define ISP16_SONY 0x02 -#define ISP16_PANASONIC0 0x02 -#define ISP16_SANYO0 0x02 -#define ISP16_MITSUMI 0x04 -#define ISP16_PANASONIC1 0x06 -#define ISP16_SANYO1 0x06 -#define ISP16_DRIVE_NOT_USED 0x08 /* not used */ -#define ISP16_DRIVE_SET_MASK 0xF1 /* don't change 0-bit or 4-7-bits*/ -/* ...for port */ -#define ISP16_DRIVE_SET_PORT 0xF8D -/* set io parameters */ -#define ISP16_BASE_340 0x00 -#define ISP16_BASE_330 0x40 -#define ISP16_BASE_360 0x80 -#define ISP16_BASE_320 0xC0 -#define ISP16_IRQ_X 0x00 -#define ISP16_IRQ_5 0x04 /* shouldn't be used to avoid sound card conflicts */ -#define ISP16_IRQ_7 0x08 /* shouldn't be used to avoid sound card conflicts */ -#define ISP16_IRQ_3 0x0C -#define ISP16_IRQ_9 0x10 -#define ISP16_IRQ_10 0x14 -#define ISP16_IRQ_11 0x18 -#define ISP16_DMA_X 0x03 -#define ISP16_DMA_3 0x00 -#define ISP16_DMA_5 0x00 -#define ISP16_DMA_6 0x01 -#define ISP16_DMA_7 0x02 -#define ISP16_IO_SET_MASK 0x20 /* don't change 5-bit */ -/* ...for port */ -#define ISP16_IO_SET_PORT 0xF8E -/* enable the card */ -#define ISP16_C928__ENABLE_PORT 0xF90 /* ISP16 with OPTi 82C928 chip */ -#define ISP16_C929__ENABLE_PORT 0xF91 /* ISP16 with OPTi 82C929 chip */ -#define ISP16_ENABLE_CDROM 0x80 /* seven bit */ - -/* the magic stuff */ -#define ISP16_CTRL_PORT 0xF8F -#define ISP16_C928__CTRL 0xE2 /* ISP16 with OPTi 82C928 chip */ -#define ISP16_C929__CTRL 0xE3 /* ISP16 with OPTi 82C929 chip */ - -#define ISP16_IO_BASE 0xF8D -#define ISP16_IO_SIZE 5 /* ports used from 0xF8D up to 0xF91 */ - -void isp16_setup(char *str, int *ints); -int isp16_init(void); diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 956b0f310..cf21ecf73 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -50,10 +50,6 @@ extern int vsprintf(char *buf, const char *, va_list); extern int session_of_pgrp(int pgrp); -extern int kill_proc(int pid, int sig, int priv); -extern int kill_pg(int pgrp, int sig, int priv); -extern int kill_sl(int sess, int sig, int priv); - asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))); diff --git a/include/linux/limits.h b/include/linux/limits.h index b99a12bc0..5848688e7 100644 --- a/include/linux/limits.h +++ b/include/linux/limits.h @@ -14,4 +14,6 @@ #define PATH_MAX 4095 /* # chars in a path name */ #define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */ +#define RTSIG_MAX 32 + #endif diff --git a/include/linux/list.h b/include/linux/list.h index 00b879310..e77559a68 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -1,6 +1,8 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H +#ifdef __KERNEL__ + /* * Simple doubly linked list implementation. * @@ -28,7 +30,7 @@ struct list_head { * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_add(struct list_head * new, +static __inline__ void __list_add(struct list_head * new, struct list_head * prev, struct list_head * next) { @@ -41,7 +43,7 @@ static inline void __list_add(struct list_head * new, /* * Insert a new entry after the specified head.. */ -static inline void list_add(struct list_head *new, struct list_head *head) +static __inline__ void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } @@ -53,18 +55,19 @@ static inline void list_add(struct list_head *new, struct list_head *head) * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_del(struct list_head * prev, struct list_head * next) +static __inline__ void __list_del(struct list_head * prev, + struct list_head * next) { next->prev = prev; prev->next = next; } -static inline void list_del(struct list_head *entry) +static __inline__ void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } -static inline int list_empty(struct list_head *head) +static __inline__ int list_empty(struct list_head *head) { return head->next == head; } @@ -72,7 +75,7 @@ static inline int list_empty(struct list_head *head) /* * Splice in "list" into "head" */ -static inline void list_splice(struct list_head *list, struct list_head *head) +static __inline__ void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; @@ -91,4 +94,6 @@ static inline void list_splice(struct list_head *list, struct list_head *head) #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) +#endif /* __KERNEL__ */ + #endif diff --git a/include/linux/major.h b/include/linux/major.h index c561163e6..5fa870474 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -75,6 +75,9 @@ #define MKISS_MAJOR 55 #define DSP56K_MAJOR 55 /* DSP56001 processor device */ +#define SPECIALIX_NORMAL_MAJOR 75 +#define SPECIALIX_CALLOUT_MAJOR 76 + /* * Tests for SCSI devices. */ diff --git a/include/linux/mcd.h b/include/linux/mcd.h index b87d6bbe4..e69de29bb 100644 --- a/include/linux/mcd.h +++ b/include/linux/mcd.h @@ -1,116 +0,0 @@ -/* - * Definitions for a Mitsumi CD-ROM interface - * - * Copyright (C) 1992 Martin Harriss - * - * martin@bdsi.com - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* *** change this to set the I/O port address */ -#define MCD_BASE_ADDR 0x300 - -/* *** change this to set the interrupt number */ -#define MCD_INTR_NR 11 - -/* *** make the following line uncommented, if you're sure, - * *** all configuration is done */ -/* #define I_WAS_HERE */ - -/* Increase this if you get lots of timeouts */ -#define MCD_STATUS_DELAY 200 - -/* number of times to retry a command before giving up */ -#define MCD_RETRY_ATTEMPTS 5 - -/* port access macro */ -#define MCDPORT(x) (mcd_port + (x)) - -/* status bits */ - -#define MST_CMD_CHECK 0x01 /* command error */ -#define MST_BUSY 0x02 /* now playing */ -#define MST_READ_ERR 0x04 /* read error */ -#define MST_DSK_TYPE 0x08 -#define MST_SERVO_CHECK 0x10 -#define MST_DSK_CHG 0x20 /* disk removed or changed */ -#define MST_READY 0x40 /* disk in the drive */ -#define MST_DOOR_OPEN 0x80 /* door is open */ - -/* flag bits */ - -#define MFL_DATA 0x02 /* data available */ -#define MFL_STATUS 0x04 /* status available */ - -/* commands */ - -#define MCMD_GET_DISK_INFO 0x10 /* read info from disk */ -#define MCMD_GET_Q_CHANNEL 0x20 /* read info from q channel */ -#define MCMD_GET_STATUS 0x40 -#define MCMD_SET_MODE 0x50 -#define MCMD_SOFT_RESET 0x60 -#define MCMD_STOP 0x70 /* stop play */ -#define MCMD_CONFIG_DRIVE 0x90 -#define MCMD_SET_VOLUME 0xAE /* set audio level */ -#define MCMD_PLAY_READ 0xC0 /* play or read data */ -#define MCMD_GET_VERSION 0xDC -#define MCMD_EJECT 0xF6 /* eject (FX drive) */ - -/* borrowed from hd.c */ - -#define READ_DATA(port, buf, nr) \ -insb(port, buf, nr) - -#define SET_TIMER(func, jifs) \ - ((timer_table[MCD_TIMER].expires = jiffies + jifs), \ - (timer_table[MCD_TIMER].fn = func), \ - (timer_active |= 1<<MCD_TIMER)) - -#define CLEAR_TIMER timer_active &= ~(1<<MCD_TIMER) - -#define MAX_TRACKS 104 - -struct msf { - unsigned char min; - unsigned char sec; - unsigned char frame; -}; - -struct mcd_Play_msf { - struct msf start; - struct msf end; -}; - -struct mcd_DiskInfo { - unsigned char first; - unsigned char last; - struct msf diskLength; - struct msf firstTrack; -}; - -struct mcd_Toc { - unsigned char ctrl_addr; - unsigned char track; - unsigned char pointIndex; - struct msf trackTime; - struct msf diskTime; -}; - -#ifndef I_WAS_HERE -#warning You have not edited mcd.h -#warning Perhaps irq and i/o settings are wrong. -#endif diff --git a/include/linux/mcdx.h b/include/linux/mcdx.h index b1b431326..e69de29bb 100644 --- a/include/linux/mcdx.h +++ b/include/linux/mcdx.h @@ -1,184 +0,0 @@ -/* - * Definitions for the Mitsumi CDROM interface - * Copyright (C) 1995 1996 Heiko Schlittermann <heiko@lotte.sax.de> - * VERSION: @VERSION@ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Thanks to - * The Linux Community at all and ... - * Martin Harris (he wrote the first Mitsumi Driver) - * Eberhard Moenkeberg (he gave me much support and the initial kick) - * Bernd Huebner, Ruediger Helsch (Unifix-Software Gmbh, they - * improved the original driver) - * Jon Tombs, Bjorn Ekwall (module support) - * Daniel v. Mosnenck (he sent me the Technical and Programming Reference) - * Gerd Knorr (he lent me his PhotoCD) - * Nils Faerber and Roger E. Wolff (extensively tested the LU portion) - * Andreas Kies (testing the mysterious hang up's) - * ... somebody forgotten? - * Marcin Dalecki - * - */ - -/* - * The following lines are for user configuration - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * {0|1} -- 1 if you want the driver detect your drive, may crash and - * needs a long time to seek. The higher the address the longer the - * seek. - * - * WARNING: AUTOPROBE doesn't work. - */ -#define MCDX_AUTOPROBE 0 - -/* - * Drive specific settings according to the jumpers on the controller - * board(s). - * o MCDX_NDRIVES : number of used entries of the following table - * o MCDX_DRIVEMAP : table of {i/o base, irq} per controller - * - * NOTE: I didn't get a drive at irq 9(2) working. Not even alone. - */ -#if MCDX_AUTOPROBE == 0 - #define MCDX_NDRIVES 1 - #define MCDX_DRIVEMAP { \ - {0x300, 11}, \ - {0x304, 05}, \ - {0x000, 00}, \ - {0x000, 00}, \ - {0x000, 00}, \ - } -#else - #error Autoprobing is not implemented yet. -#endif - -#ifndef MCDX_QUIET -#define MCDX_QUIET 1 -#endif - -#ifndef MCDX_DEBUG -#define MCDX_DEBUG 0 -#endif - -/* *** make the following line uncommented, if you're sure, - * *** all configuration is done */ -/* #define I_WAS_HERE */ -#define I_WAS_HERE /* delete this line, it's for heiko only */ - -/* The name of the device */ -#define MCDX "mcdx" - -/* Flags for DEBUGGING */ -#define INIT 0 -#define MALLOC 0 -#define IOCTL 0 -#define PLAYTRK 0 -#define SUBCHNL 0 -#define TOCHDR 0 -#define MS 0 -#define PLAYMSF 0 -#define READTOC 0 -#define OPENCLOSE 0 -#define HW 0 -#define TALK 0 -#define IRQ 0 -#define XFER 0 -#define REQUEST 0 -#define SLEEP 0 - -/* The following addresses are taken from the Mitsumi Reference - * and describe the possible i/o range for the controller. - */ -#define MCDX_IO_BEGIN ((char*) 0x300) /* first base of i/o addr */ -#define MCDX_IO_END ((char*) 0x3fc) /* last base of i/o addr */ - -/* Per controller 4 bytes i/o are needed. */ -#define MCDX_IO_SIZE 4 - -/* - * Bits - */ - -/* The status byte, returned from every command, set if - * the description is true */ -#define MCDX_RBIT_OPEN 0x80 /* door is open */ -#define MCDX_RBIT_DISKSET 0x40 /* disk set (recognised) */ -#define MCDX_RBIT_CHANGED 0x20 /* disk was changed */ -#define MCDX_RBIT_CHECK 0x10 /* disk rotates, servo is on */ -#define MCDX_RBIT_AUDIOTR 0x08 /* current track is audio */ -#define MCDX_RBIT_RDERR 0x04 /* read error, refer SENSE KEY */ -#define MCDX_RBIT_AUDIOBS 0x02 /* currently playing audio */ -#define MCDX_RBIT_CMDERR 0x01 /* command, param or format error */ - -/* The I/O Register holding the h/w status of the drive, - * can be read at i/o base + 1 */ -#define MCDX_RBIT_DOOR 0x10 /* door is open */ -#define MCDX_RBIT_STEN 0x04 /* if 0, i/o base contains drive status */ -#define MCDX_RBIT_DTEN 0x02 /* if 0, i/o base contains data */ - -/* - * The commands. - */ - -#define OPCODE 1 /* offset of opcode */ -#define MCDX_CMD_REQUEST_TOC 1, 0x10 -#define MCDX_CMD_REQUEST_STATUS 1, 0x40 -#define MCDX_CMD_RESET 1, 0x60 -#define MCDX_CMD_REQUEST_DRIVE_MODE 1, 0xc2 -#define MCDX_CMD_SET_INTERLEAVE 2, 0xc8, 0 -#define MCDX_CMD_DATAMODE_SET 2, 0xa0, 0 - #define MCDX_DATAMODE1 0x01 - #define MCDX_DATAMODE2 0x02 -#define MCDX_CMD_LOCK_DOOR 2, 0xfe, 0 - -#define READ_AHEAD 4 /* 8 Sectors (4K) */ - -/* Useful macros */ -#define e_door(x) ((x) & MCDX_RBIT_OPEN) -#define e_check(x) (~(x) & MCDX_RBIT_CHECK) -#define e_notset(x) (~(x) & MCDX_RBIT_DISKSET) -#define e_changed(x) ((x) & MCDX_RBIT_CHANGED) -#define e_audio(x) ((x) & MCDX_RBIT_AUDIOTR) -#define e_audiobusy(x) ((x) & MCDX_RBIT_AUDIOBS) -#define e_cmderr(x) ((x) & MCDX_RBIT_CMDERR) -#define e_readerr(x) ((x) & MCDX_RBIT_RDERR) - -/** no drive specific */ -#define MCDX_CDBLK 2048 /* 2048 cooked data each blk */ - -#define MCDX_DATA_TIMEOUT (HZ/10) /* 0.1 second */ - -/* - * Access to the msf array - */ -#define MSF_MIN 0 /* minute */ -#define MSF_SEC 1 /* second */ -#define MSF_FRM 2 /* frame */ - -/* - * Errors - */ -#define MCDX_E 1 /* unspec error */ -#define MCDX_ST_EOM 0x0100 /* end of media */ -#define MCDX_ST_DRV 0x00ff /* mask to query the drive status */ - -#ifndef I_WAS_HERE -#warning You have not edited mcdx.h -#warning Perhaps irq and i/o settings are wrong. -#endif - -/* ex:set ts=4 sw=4: */ diff --git a/include/linux/mroute.h b/include/linux/mroute.h index c0dc052b2..55193867d 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h @@ -10,6 +10,9 @@ * * See the mrouted code for the original history. * + * Protocol Independent Multicast (PIM) data structures included + * Carlos Picoto (cap@di.fc.ul.pt) + * */ #define MRT_BASE 200 @@ -57,16 +60,9 @@ struct vifctl { struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ }; -#define VIFF_TUNNEL 0x1 /* IPIP tunnel */ -#define VIFF_SRCRT 0x2 /* NI */ - - -/* PIM Vif Flags */ -#define VIFF_DR 0x0010 /* designated router */ -#define VIFF_NOMRT 0x0020 /* no neighbor on vif */ -#define VIFF_DOWN 0x0040 /* interface is down */ -#define VIFF_DISABLED 0x0080 /* disabled interafce */ -#define VIFF_REGISTER 0x00A0 /* MIssing cap@di.fc.ul.pt */ +#define VIFF_TUNNEL 0x1 /* IPIP tunnel */ +#define VIFF_SRCRT 0x2 /* NI */ +#define VIFF_REGISTER 0x4 /* register vif */ /* * Cache manipulation structures for mrouted and PIMd @@ -111,23 +107,13 @@ struct sioc_vif_req }; /* - * To get RPF from unicast routing table (PIM: cap@di.fc.ul.pt) - */ -struct sioc_rpf_req -{ - unsigned long source; /* Source address */ - unsigned long rpfneighbor; /* RPF */ - vifi_t iif; /* Incoming Interface */ -}; - -/* * This is the format the mroute daemon expects to see IGMP control * data. Magically happens to be like an IP packet as per the original */ struct igmpmsg { - unsigned long unused1,unused2; + __u32 unused1,unused2; unsigned char im_msgtype; /* What is this */ unsigned char im_mbz; /* Must be zero */ unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */ @@ -147,22 +133,19 @@ extern int ipmr_ioctl(struct sock *sk, int cmd, unsigned long arg); extern void mroute_close(struct sock *sk); extern void ipmr_forward(struct sk_buff *skb, int is_frag); extern int ip_mr_find_tunnel(__u32, __u32); +extern void ip_mr_init(void); struct vif_device { - union - { - struct device *dev; /* Device we are using */ - struct rtable *rt; /* Route for tunnel */ - } u; + struct device *dev; /* Device we are using */ unsigned long bytes_in,bytes_out; unsigned long pkt_in,pkt_out; /* Statistics */ unsigned long rate_limit; /* Traffic shaping (NI) */ unsigned char threshold; /* TTL threshold */ unsigned short flags; /* Control flags */ - unsigned long local,remote; /* Addresses(remote for tunnels)*/ - unsigned long uptime; + __u32 local,remote; /* Addresses(remote for tunnels)*/ + int link; /* Physical interface index */ }; struct mfc_cache @@ -175,11 +158,9 @@ struct mfc_cache int mfc_flags; /* Flags on line */ struct sk_buff_head mfc_unresolved; /* Unresolved buffers */ int mfc_queuelen; /* Unresolved buffer counter */ - unsigned mfc_last_assert; + unsigned long mfc_last_assert; int mfc_minvif; int mfc_maxvif; - unsigned long uptime; - unsigned long expire; unsigned long mfc_bytes; unsigned long mfc_pkt; unsigned long mfc_wrong_if; @@ -188,6 +169,7 @@ struct mfc_cache #define MFC_QUEUED 1 #define MFC_RESOLVED 2 +#define MFC_NOTIFY 4 #define MFC_LINES 64 @@ -211,4 +193,31 @@ struct mfc_cache #define IGMPMSG_WRONGVIF 2 /* For PIM assert processing (unused) */ #define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */ +#ifdef __KERNEL__ + +#define PIM_V1_VERSION __constant_htonl(0x10000000) +#define PIM_V1_REGISTER 1 + +#define PIM_VERSION 2 +#define PIM_REGISTER 1 + +#define PIM_NULL_REGISTER __constant_htonl(0x40000000) + +/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ + +struct pimreghdr +{ + __u8 type; + __u8 reserved; + __u16 csum; + __u32 flags; +}; + +extern int pim_rcv(struct sk_buff * , unsigned short); +extern int pim_rcv_v1(struct sk_buff * , unsigned short len); + +struct rtmsg; +extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm); +#endif + #endif diff --git a/include/linux/net.h b/include/linux/net.h index 82a4b7570..015f2d8b2 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -18,11 +18,11 @@ #ifndef _LINUX_NET_H #define _LINUX_NET_H - -#include <linux/wait.h> #include <linux/socket.h> -#define NPROTO 16 /* should be enough for now.. */ +struct poll_table_struct; + +#define NPROTO 32 /* should be enough for now.. */ #define SYS_SOCKET 1 /* sys_socket(2) */ @@ -93,7 +93,7 @@ struct proto_ops { int flags); int (*getname) (struct socket *sock, struct sockaddr *uaddr, int *usockaddr_len, int peer); - unsigned int (*poll) (struct socket *sock, poll_table *wait); + unsigned int (*poll) (struct socket *sock, struct poll_table_struct *wait); int (*ioctl) (struct socket *sock, unsigned int cmd, unsigned long arg); int (*listen) (struct socket *sock, int len); diff --git a/include/linux/net_alias.h b/include/linux/net_alias.h index 54ba8525c..e69de29bb 100644 --- a/include/linux/net_alias.h +++ b/include/linux/net_alias.h @@ -1,187 +0,0 @@ -/* - * NET_ALIAS network device aliasing definitions. - * - * - * Version: @(#)net_alias.h 0.43 12/20/95 - * - * Author: Juan Jose Ciarlante, <jjciarla@raiz.uncu.edu.ar> - * - * - * 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. - * - */ - -#ifndef _NET_ALIAS_H -#define _NET_ALIAS_H - -#include <linux/config.h> - -#ifdef CONFIG_NET_ALIAS -#include <linux/types.h> -#include <linux/if.h> -#include <linux/netdevice.h> - -/* - * max. alias slot number allowed - */ - -#define NET_ALIAS_MAX_SLOT 256 - -struct net_alias; -struct net_alias_info; -struct net_alias_type; - - -/* - * Main alias structure - * Note that *defines* dev & devname. - */ - -struct net_alias -{ - struct device dev; /* alias device defn*/ - char name[IFNAMSIZ]; /* device name defn */ - unsigned hash; /* my hash value: for quick rehash */ - unsigned slot; /* slot number */ - void *data; /* private data */ - struct device *main_dev; /* pointer to main device */ - struct net_alias_type *nat; /* alias type object bound */ - struct net_alias *next; /* next alias (hashed linked list) */ -}; - - -/* - * alias structure pointed by main device - * it holds main device's alias hash table - */ - -struct net_alias_info -{ - int n_aliases; /* num aliases */ - struct device *taildev; /* my last (alias) device */ - struct net_alias *hash_tab[16]; /* hashed alias table */ -}; - -/* - * net_alias_type class - * Declares a generic (AF_ independent) structure that will - * manage generic to family-specific behavior. - */ - -struct net_alias_type -{ - int type; /* aliasing type: address family */ - int n_attach; /* number of aliases attached */ - char name[16]; /* af_name */ - __u32 (*get_addr32) /* get __u32 addr 'representation'*/ - (struct net_alias_type *this, struct sockaddr*); - int (*dev_addr_chk) /* address checking func: */ - (struct net_alias_type *this, struct device *, struct sockaddr *); - struct device * (*dev_select) /* closest alias selector*/ - (struct net_alias_type *this, struct device *, struct sockaddr *sa); - int (*alias_init_1) /* called after alias creation: */ - (struct net_alias_type *this,struct net_alias *alias, struct sockaddr *sa); - int (*alias_done_1) /* called before alias deletion */ - (struct net_alias_type *this, struct net_alias *alias); - int (*alias_print_1) - (struct net_alias_type *this, struct net_alias *alias, char *buf, int len); - struct net_alias_type *next; /* link */ -}; - - -/* - * is dev an alias? - */ - -#ifdef CONFIG_NET_ALIAS - -extern __inline__ int net_alias_is(struct device *dev) -{ - return (dev->my_alias != NULL); -} - -/* - * Does dev have aliases? - */ - -extern __inline__ int net_alias_has(struct device *dev) -{ - return (dev->alias_info != NULL); -} - -/* - * Returns MY 'true' main device - * intended for alias devices - */ - -extern __inline__ struct device *net_alias_main_dev(struct device *dev) -{ - return (net_alias_is(dev))? dev->my_alias->main_dev : dev; -} - - -/* - * Returns NEXT 'true' device - * intended for true devices - */ - -extern __inline__ struct device *net_alias_nextdev(struct device *dev) -{ - return (dev->alias_info)? dev->alias_info->taildev->next : dev->next; -} - -/* - * Sets NEXT 'true' device - * Intended for main devices (treat main device as block: dev+aliases). - */ - -extern __inline__ struct device *net_alias_nextdev_set(struct device *dev, struct device *nextdev) -{ - struct device *pdev = dev; - if (net_alias_has(dev)) - { - pdev = dev->alias_info->taildev; /* point to last dev alias */ - } - pdev->next = nextdev; - return nextdev; -} - -#else - -#define net_alias_has(dev) (0) -#define net_alias_is(dev) (0) -#define net_alias_main_dev(dev) (dev) -#endif - - -extern void net_alias_init(void); - -extern struct device * net_alias_dev_get(char *dev_name, int aliasing_ok, int *err, struct sockaddr *sa, void *data); -extern int net_alias_dev_rehash(struct device *dev, struct sockaddr *sa); - -extern int net_alias_getinfo(char *buf, char **, off_t , int , int ); -extern int net_alias_types_getinfo(char *buf, char **, off_t , int , int ); - -extern int register_net_alias_type(struct net_alias_type *nat, int type); -extern int unregister_net_alias_type(struct net_alias_type *nat); - -extern struct device * net_alias_dev_chk(struct device *main_dev, struct sockaddr *sa, int flags_on, int flags_off); -extern struct device * net_alias_dev_chk32(struct device *main_dev, int family, __u32 addr32, int flags_on, int flags_off); - -extern struct device * net_alias_dev_rcv_sel(struct device *main_dev, struct sockaddr *sa_src, struct sockaddr *sa_dst); -extern struct device * net_alias_dev_rcv_sel32(struct device *main_dev, int family, __u32 src, __u32 dst); - - - -#else - -#define net_alias_is(a) 0 -#define net_alias_main_dev(dev) (dev) -#define net_alias_has(dev) 0 - -#endif - -#endif /* _NET_ALIAS_H */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4a530fe8f..9d1f67cc0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -27,6 +27,7 @@ #include <linux/config.h> #include <linux/if.h> #include <linux/if_ether.h> +#include <linux/if_packet.h> #include <asm/atomic.h> @@ -34,7 +35,6 @@ * For future expansion when we will have different priorities. */ -#define DEV_NUMBUFFS 3 /* Number of queues per device */ #define MAX_ADDR_LEN 7 /* Largest hardware address length */ /* @@ -59,18 +59,6 @@ #define MAX_HEADER (LL_MAX_HEADER + 48) #endif -#define IS_MYADDR 1 /* address is (one of) our own */ -#define IS_LOOPBACK 2 /* address is for LOOPBACK */ -#define IS_BROADCAST 3 /* address is a valid broadcast */ -#define IS_INVBCAST 4 /* Wrong netmask bcast not for us (unused)*/ -#define IS_MULTICAST 5 /* Multicast IP address */ - -/* NOTE: move to ipv4_device.h */ - -#define IFF_IP_ADDR_OK 1 -#define IFF_IP_MASK_OK 2 -#define IFF_IP_BRD_OK 4 - struct neighbour; /* @@ -188,10 +176,11 @@ struct device /* The device initialization function. Called only once. */ int (*init)(struct device *dev); + void (*destructor)(struct device *dev); /* Interface index. Unique device identifier */ int ifindex; - struct device *next_up; + int iflink; /* * Some hardware also needs these fields, but they are not @@ -215,7 +204,7 @@ struct device unsigned long last_rx; /* Time of last Rx */ unsigned short flags; /* interface flags (a la BSD) */ - unsigned short family; /* address family ID (AF_INET) */ + unsigned short gflags; unsigned short metric; /* routing metric (not used) */ unsigned short mtu; /* interface MTU value */ unsigned short type; /* interface hardware type */ @@ -227,34 +216,25 @@ struct device unsigned char pad; /* make dev_addr aligned to 8 bytes */ unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ unsigned char addr_len; /* hardware address length */ - unsigned long pa_addr; /* protocol address */ - - unsigned long pa_brdaddr; /* protocol broadcast addr */ - unsigned long pa_dstaddr; /* protocol P-P other side addr */ - unsigned long pa_mask; /* protocol netmask */ - unsigned short pa_alen; /* protocol address length */ struct dev_mc_list *mc_list; /* Multicast mac addresses */ int mc_count; /* Number of installed mcasts */ - - struct ip_mc_list *ip_mc_list; /* IP multicast filter chain */ - unsigned ip_flags; /* IP layer control flags */ - __u32 tx_queue_len; /* Max frames per queue allowed */ + int promiscuity; + int allmulti; /* For load balancing driver pair support */ unsigned long pkt_queue; /* Packets queued */ struct device *slave; /* Slave device */ - struct net_alias_info *alias_info; /* main dev alias info */ - struct net_alias *my_alias; /* alias devs */ /* Protocol specific pointers */ void *atalk_ptr; /* Appletalk link */ - void *ip_ptr; /* Not used yet */ + void *ip_ptr; /* IPv4 specific data */ - /* Pointer to the interface buffers. */ - struct sk_buff_head buffs[DEV_NUMBUFFS]; + struct Qdisc *qdisc; + struct Qdisc *qdisc_sleeping; + unsigned long tx_queue_len; /* Max frames per queue allowed */ /* Pointers to interface service routines. */ int (*open)(struct device *dev); @@ -289,6 +269,8 @@ struct device #define HAVE_CHANGE_MTU int (*change_mtu)(struct device *dev, int new_mtu); + int (*hard_header_parse)(struct sk_buff *skb, + unsigned char *haddr); }; @@ -309,16 +291,8 @@ struct packet_type extern struct device loopback_dev; /* The loopback */ extern struct device *dev_base; /* All devices */ extern struct packet_type *ptype_base[16]; /* Hashed types */ - -/* NOTE: move to INET specific header; - __ip_chk_addr is deprecated, do not use if it's possible. - */ - -extern int __ip_chk_addr(unsigned long addr); -extern struct device *ip_dev_find(unsigned long addr, char *name); -/* This is the wrong place but it'll do for the moment */ -extern void ip_mc_allhost(struct device *dev); -extern int devinet_ioctl(unsigned int cmd, void *); +extern int netdev_dropping; +extern int net_cpu_congestion; extern struct device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); @@ -330,16 +304,28 @@ extern int dev_open(struct device *dev); extern int dev_close(struct device *dev); extern int dev_queue_xmit(struct sk_buff *skb); extern void dev_loopback_xmit(struct sk_buff *skb); - +extern int register_netdevice(struct device *dev); +extern int unregister_netdevice(struct device *dev); +extern int register_netdevice_notifier(struct notifier_block *nb); +extern int unregister_netdevice_notifier(struct notifier_block *nb); +extern int dev_new_index(void); +extern struct device *dev_get_by_index(int ifindex); +extern int register_gifconf(int family, int (*func)(struct device *dev, char *bufptr, int len)); +extern int dev_restart(struct device *dev); + #define HAVE_NETIF_RX 1 extern void netif_rx(struct sk_buff *skb); extern void net_bh(void); extern void dev_tint(struct device *dev); extern int dev_get_info(char *buffer, char **start, off_t offset, int length, int dummy); extern int dev_ioctl(unsigned int cmd, void *); +extern int dev_change_flags(struct device *, unsigned); +extern void dev_queue_xmit_nit(struct sk_buff *skb, struct device *dev); extern void dev_init(void); +extern int netdev_nit; + /* Locking protection for page faults during outputs to devices unloaded during the fault */ extern atomic_t dev_lockct; @@ -365,30 +351,24 @@ extern __inline__ void dev_unlock_list(void) * * FIXME: What if this is being run as a real time process ?? * Linus: We need a way to force a yield here ? + * + * FIXME: Though dev_lockct is atomic varible, locking procedure + * is not atomic. */ - + extern __inline__ void dev_lock_wait(void) { - while(atomic_read(&dev_lockct)) + while (atomic_read(&dev_lockct)) { + current->counter = 0; schedule(); + } } -/* - * Buffer initialisation function. This used to appear in all the - * drivers but is now an inline in case we ever want to change the - * schemes used. - */ - extern __inline__ void dev_init_buffers(struct device *dev) { - int i; - for(i=0;i<DEV_NUMBUFFS;i++) - { - skb_queue_head_init(&dev->buffs[i]); - } + /* DO NOTHING */ } - /* These functions live elsewhere (drivers/net/net_init.c, but related) */ extern void ether_setup(struct device *dev); @@ -399,8 +379,6 @@ extern int ether_config(struct device *dev, struct ifmap *map); /* Support for loadable net-drivers */ extern int register_netdev(struct device *dev); extern void unregister_netdev(struct device *dev); -extern int register_netdevice_notifier(struct notifier_block *nb); -extern int unregister_netdevice_notifier(struct notifier_block *nb); extern int register_trdev(struct device *dev); extern void unregister_trdev(struct device *dev); /* Functions used for multicast support */ @@ -408,10 +386,11 @@ extern void dev_mc_upload(struct device *dev); extern void dev_mc_delete(struct device *dev, void *addr, int alen, int all); extern void dev_mc_add(struct device *dev, void *addr, int alen, int newonly); extern void dev_mc_discard(struct device *dev); +extern void dev_set_promiscuity(struct device *dev, int inc); +extern void dev_set_allmulti(struct device *dev, int inc); /* Load a device via the kerneld */ extern void dev_load(const char *name); -extern int dev_new_index(void); -extern struct device * dev_get_by_index(int ifindex); + #endif /* __KERNEL__ */ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 711687af8..8766af2b4 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -1,20 +1,174 @@ #ifndef __LINUX_NETLINK_H #define __LINUX_NETLINK_H +#define NETLINK_ROUTE 0 /* Routing/device hook */ +#define NETLINK_SKIP 1 /* Reserved for ENskip */ +#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ +#define NETLINK_FIREWALL 3 /* Firewalling hook */ +#define NETLINK_ARPD 8 +#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ +#define NETLINK_IP6_FW 13 +#define NETLINK_TAPBASE 16 /* 16 to 31 are ethertap */ + +#define MAX_LINKS 32 + +struct sockaddr_nl +{ + sa_family_t nl_family; /* AF_NETLINK */ + unsigned short nl_pad; /* zero */ + __kernel_pid_t nl_pid; /* process pid */ + unsigned nl_groups; /* multicast groups mask */ +}; + struct nlmsghdr { - unsigned long nlmsg_len; /* Length of message including header */ - unsigned long nlmsg_type; /* Message type */ - unsigned long nlmsg_seq; /* Sequence number */ - unsigned long nlmsg_pid; /* Sending process PID */ - unsigned char nlmsg_data[0]; + __u32 nlmsg_len; /* Length of message including header */ + __u16 nlmsg_type; /* Message content */ + __u16 nlmsg_flags; /* Additional flags */ + __u32 nlmsg_seq; /* Sequence number */ + __kernel_pid_t nlmsg_pid; /* Sending process PID */ +}; + +/* Flags values */ + +#define NLM_F_REQUEST 1 /* It is request message. */ +#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ +#define NLM_F_ACK 4 /* If succeed, reply with ack */ +#define NLM_F_ECHO 8 /* Echo this request */ + +/* Modifiers to GET request */ +#define NLM_F_ROOT 0x100 /* specify tree root */ +#define NLM_F_MATCH 0x200 /* return all matching */ +#define NLM_F_ATOMIC 0x400 /* atomic GET */ +#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH) + +/* Modifiers to NEW request */ +#define NLM_F_REPLACE 0x100 /* Override existing */ +#define NLM_F_EXCL 0x200 /* Do not touch, if it exists */ +#define NLM_F_CREATE 0x400 /* Create, if it does not exist */ + +/* + 4.4BSD ADD NLM_F_CREATE|NLM_F_EXCL + 4.4BSD CHANGE NLM_F_REPLACE + + True CHANGE NLM_F_CREATE|NLM_F_REPLACE + Append NLM_F_CREATE + Check NLM_F_EXCL + */ + +#define NLMSG_ALIGNTO 4 +#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) +#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr))) +#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) +#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) +#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ + (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len))) +#define NLMSG_OK(nlh,len) ((nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ + (nlh)->nlmsg_len <= (len)) + +#define NLMSG_NOOP 0x1 /* Nothing. */ +#define NLMSG_ERROR 0x2 /* Error */ +#define NLMSG_DONE 0x3 /* End of a dump */ +#define NLMSG_OVERRUN 0x4 /* Data lost */ + +struct nlmsgerr +{ + int error; + struct nlmsghdr msg; +}; + +#define NET_MAJOR 36 /* Major 36 is reserved for networking */ + +#ifdef __KERNEL__ + +struct netlink_skb_parms +{ + struct ucred creds; /* Skb credentials */ + pid_t pid; + unsigned groups; + pid_t dst_pid; + unsigned dst_groups; }; -#define NLMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) +#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) +#define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) -#define NLMSG_ACK 0x01 /* int - error code */ -#define NLMSG_OVERRUN 0x02 /* unsigned long[2] - start and end - * of lost message sequence numbers. - */ + +extern int netlink_attach(int unit, int (*function)(int,struct sk_buff *skb)); +extern void netlink_detach(int unit); +extern int netlink_post(int unit, struct sk_buff *skb); +extern int init_netlink(void); +extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len)); +extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); +extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, pid_t pid, int nonblock); +extern void netlink_broadcast(struct sock *ssk, struct sk_buff *skb, pid_t pid, + unsigned group, int allocation); +extern void netlink_set_err(struct sock *ssk, pid_t pid, unsigned group, int code); + +/* + * skb should fit one page. This choice is good for headerless malloc. + * + * FIXME: What is the best size for SLAB???? --ANK + */ +#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) + + +struct netlink_callback +{ + struct sk_buff *skb; + struct nlmsghdr *nlh; + int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); + int (*done)(struct netlink_callback *cb); + long args[4]; +}; + +#if 0 + +void* nlmsg_broadcast(struct sock*, unsigned long type, int len, unsigned groups); +struct skb_buff *nlmsg_alloc(unsigned long type, int len, + unsigned long seq, unsigned long pid, int allocation); +void __nlmsg_transmit(struct sock*, int allocation); + +extern __inline__ void nlmsg_release(struct sk_buff *skb) +{ + atomic_dec(skb->users); +} + +extern __inline__ void nlmsg_transmit(struct sk_buff *sk, int allocation) +{ + if (sk->write_queue.qlen) + __nlmsg_transmit(sk, allocation); +} #endif + +extern __inline__ struct nlmsghdr * +__nlmsg_put(struct sk_buff *skb, pid_t pid, u32 seq, int type, int len) +{ + struct nlmsghdr *nlh; + int size = NLMSG_LENGTH(len); + + nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); + nlh->nlmsg_type = type; + nlh->nlmsg_len = size; + nlh->nlmsg_flags = 0; + nlh->nlmsg_pid = pid; + nlh->nlmsg_seq = seq; + return nlh; +} + +#define NLMSG_PUT(skb, pid, seq, type, len) \ +({ if (skb_tailroom(skb) < NLMSG_SPACE(len)) goto nlmsg_failure; \ + __nlmsg_put(skb, pid, seq, type, len); }) + +extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, + struct nlmsghdr *nlh, + int (*dump)(struct sk_buff *skb, struct netlink_callback*), + int (*done)(struct netlink_callback*)); + + +extern void netlink_proto_init(struct net_proto *pro); + +#endif /* __KERNEL__ */ + +#endif /* __LINUX_NETLINK_H */ diff --git a/include/linux/netrom.h b/include/linux/netrom.h index ffa8e4a89..6939b32f6 100644 --- a/include/linux/netrom.h +++ b/include/linux/netrom.h @@ -7,7 +7,6 @@ #ifndef NETROM_KERNEL_H #define NETROM_KERNEL_H -#define PF_NETROM AF_NETROM #define NETROM_MTU 236 #define NETROM_T1 1 diff --git a/include/linux/optcd.h b/include/linux/optcd.h index 00dd3aed8..e69de29bb 100644 --- a/include/linux/optcd.h +++ b/include/linux/optcd.h @@ -1,52 +0,0 @@ -/* linux/include/linux/optcd.h - Optics Storage 8000 AT CDROM driver - $Id: optcd.h,v 1.2 1996/01/15 18:43:44 root Exp root $ - - Copyright (C) 1995 Leo Spiekman (spiekman@dutette.et.tudelft.nl) - - - Configuration file for linux/drivers/cdrom/optcd.c -*/ - -#ifndef _LINUX_OPTCD_H -#define _LINUX_OPTCD_H - - -/* I/O base of drive. Drive uses base to base+2. - This setting can be overridden with the kernel or insmod command - line option 'optcd=<portbase>'. Use address of 0 to disable driver. */ -#define OPTCD_PORTBASE 0x340 - - -/* enable / disable parts of driver by define / undef */ -#define MULTISESSION /* multisession support (ALPHA) */ - - -/* Change 0 to 1 to debug various parts of the driver */ -#define DEBUG_DRIVE_IF 0 /* Low level drive interface */ -#define DEBUG_CONV 0 /* Address conversions */ -#define DEBUG_BUFFERS 0 /* Buffering and block size conversion */ -#define DEBUG_REQUEST 0 /* Request mechanism */ -#define DEBUG_STATE 0 /* State machine */ -#define DEBUG_TOC 0 /* Q-channel and Table of Contents */ -#define DEBUG_MULTIS 0 /* Multisession code */ -#define DEBUG_VFS 0 /* VFS interface */ - - -/* Don't touch these unless you know what you're doing. */ - -/* Various timeout loop repetition counts. */ -#define BUSY_TIMEOUT 10000000 /* for busy wait */ -#define FAST_TIMEOUT 100000 /* ibid. for probing */ -#define SLEEP_TIMEOUT 6000 /* for timer wait */ -#define MULTI_SEEK_TIMEOUT 1000 /* for timer wait */ -#define READ_TIMEOUT 6000 /* for poll wait */ -#define STOP_TIMEOUT 2000 /* for poll wait */ -#define RESET_WAIT 5000 /* busy wait at drive reset */ - -/* # of buffers for block size conversion. 6 is optimal for my setup (P75), - giving 280 kb/s, with 0.4% CPU usage. Experiment to find your optimal - setting */ -#define N_BUFS 6 - - -#endif _LINUX_OPTCD_H diff --git a/include/linux/parport.h b/include/linux/parport.h index dc88589ae..6a2bbd183 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -1,4 +1,4 @@ -/* $Id: parport.h,v 1.2.6.3.2.2 1997/04/18 15:03:53 phil Exp $ */ +/* $Id: parport.h,v 1.3 1997/10/19 18:02:00 phil Exp $ */ #ifndef _PARPORT_H_ #define _PARPORT_H_ @@ -160,7 +160,7 @@ struct parport_dir { /* A parallel port */ struct parport { - unsigned int base; /* base address */ + unsigned long base; /* base address */ unsigned int size; /* IO extent */ char *name; int irq; /* interrupt (or -1 for none) */ @@ -266,11 +266,11 @@ extern int parport_proc_cleanup(void); extern int parport_proc_register(struct parport *pp); extern int parport_proc_unregister(struct parport *pp); -/* Prototypes from parport_ksyms.c */ extern void dec_parport_count(void); extern void inc_parport_count(void); extern int parport_probe(struct parport *port, char *buffer, int len); extern void parport_probe_one(struct parport *port); +extern void (*parport_probe_hook)(struct parport *port); #endif /* _PARPORT_H_ */ diff --git a/include/linux/pci.h b/include/linux/pci.h index b1f401847..164a32768 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -43,8 +43,8 @@ -#ifndef PCI_H -#define PCI_H +#ifndef LINUX_PCI_H +#define LINUX_PCI_H /* * Under PCI, each device has 256 bytes of configuration address space, @@ -241,11 +241,13 @@ #define PCI_DEVICE_ID_NCR_53C895 0x000c #define PCI_DEVICE_ID_NCR_53C885 0x000d #define PCI_DEVICE_ID_NCR_53C875 0x000f +#define PCI_DEVICE_ID_NCR_53C876 0x008f #define PCI_VENDOR_ID_ATI 0x1002 #define PCI_DEVICE_ID_ATI_68800 0x4158 #define PCI_DEVICE_ID_ATI_215CT222 0x4354 #define PCI_DEVICE_ID_ATI_210888CX 0x4358 +#define PCI_DEVICE_ID_ATI_215GB 0x4742 #define PCI_DEVICE_ID_ATI_215GP 0x4750 #define PCI_DEVICE_ID_ATI_215GT 0x4754 #define PCI_DEVICE_ID_ATI_215GTB 0x4755 @@ -257,6 +259,8 @@ #define PCI_DEVICE_ID_VLSI_82C593 0x0006 #define PCI_DEVICE_ID_VLSI_82C594 0x0007 #define PCI_DEVICE_ID_VLSI_82C597 0x0009 +#define PCI_DEVICE_ID_VLSI_82C541 0x000c +#define PCI_DEVICE_ID_VLSI_82C543 0x000d #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702 #define PCI_VENDOR_ID_ADL 0x1005 @@ -307,6 +311,7 @@ #define PCI_VENDOR_ID_IBM 0x1014 #define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a +#define PCI_DEVICE_ID_IBM_TR 0x0018 #define PCI_DEVICE_ID_IBM_82G2675 0x001d #define PCI_DEVICE_ID_IBM_82351 0x0022 @@ -321,6 +326,7 @@ #define PCI_DEVICE_ID_TRIDENT_9420 0x9420 #define PCI_DEVICE_ID_TRIDENT_9440 0x9440 #define PCI_DEVICE_ID_TRIDENT_9660 0x9660 +#define PCI_DEVICE_ID_TRIDENT_9750 0x9750 #define PCI_VENDOR_ID_AI 0x1025 #define PCI_DEVICE_ID_AI_M1435 0x1435 @@ -342,6 +348,7 @@ #define PCI_DEVICE_ID_MIRO_36050 0x5601 #define PCI_VENDOR_ID_NEC 0x1033 +#define PCI_DEVICE_ID_NEC_PCX2 0x0046 #define PCI_VENDOR_ID_FD 0x1036 #define PCI_DEVICE_ID_FD_36C70 0x0000 @@ -358,12 +365,16 @@ #define PCI_DEVICE_ID_SI_5511 0x5511 #define PCI_DEVICE_ID_SI_5513 0x5513 #define PCI_DEVICE_ID_SI_5571 0x5571 +#define PCI_DEVICE_ID_SI_5597 0x5597 #define PCI_DEVICE_ID_SI_7001 0x7001 #define PCI_VENDOR_ID_HP 0x103c #define PCI_DEVICE_ID_HP_J2585A 0x1030 #define PCI_DEVICE_ID_HP_J2585B 0x1031 +#define PCI_VENDOR_ID_HOLTEK 0x9412 +#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 + #define PCI_VENDOR_ID_PCTECH 0x1042 #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 #define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 @@ -376,6 +387,9 @@ #define PCI_DEVICE_ID_OPTI_82C557 0xc557 #define PCI_DEVICE_ID_OPTI_82C558 0xc558 #define PCI_DEVICE_ID_OPTI_82C621 0xc621 +#define PCI_DEVICE_ID_OPTI_82C700 0xc700 +#define PCI_DEVICE_ID_OPTI_82C701 0xc701 +#define PCI_DEVICE_ID_OPTI_82C814 0xc814 #define PCI_DEVICE_ID_OPTI_82C822 0xc822 #define PCI_VENDOR_ID_SGS 0x104a @@ -388,6 +402,8 @@ #define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130 #define PCI_VENDOR_ID_TI 0x104c +#define PCI_DEVICE_ID_TI_TVP4010 0x3d04 +#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 #define PCI_DEVICE_ID_TI_PCI1130 0xac12 #define PCI_DEVICE_ID_TI_PCI1131 0xac15 @@ -404,7 +420,7 @@ #define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 #define PCI_VENDOR_ID_PROMISE 0x105a -#define PCI_DEVICE_ID_PROMISE_IDE_UDMA 0x4d33 +#define PCI_DEVICE_ID_PROMISE_20246 0x4d33 #define PCI_DEVICE_ID_PROMISE_5300 0x5300 #define PCI_VENDOR_ID_N9 0x105d @@ -518,10 +534,14 @@ #define PCI_VENDOR_ID_MITSUBISHI 0x10ba +#define PCI_VENDOR_ID_SURECOM 0x10bd +#define PCI_DEVICE_ID_SURECOM_NE34 0x0e34 + #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003 +#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004 #define PCI_VENDOR_ID_ASP 0x10cd #define PCI_DEVICE_ID_ASP_ABP940 0x1200 @@ -531,6 +551,8 @@ #define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001 #define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002 +#define PCI_VENDOR_ID_NVIDIA 0x10de + #define PCI_VENDOR_ID_IMS 0x10e0 #define PCI_DEVICE_ID_IMS_8849 0x8849 @@ -627,6 +649,7 @@ #define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210 #define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422 #define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424 +#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d #define PCI_VENDOR_ID_VMIC 0x114a #define PCI_DEVICE_ID_VMIC_VME 0x7587 @@ -656,6 +679,9 @@ #define PCI_VENDOR_ID_GALILEO 0x11ab #define PCI_DEVICE_ID_GALILEO_GT64011 0x4146 +#define PCI_VENDOR_ID_LITEON 0x11ad +#define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002 + #define PCI_VENDOR_ID_NP 0x11bc #define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001 @@ -663,6 +689,9 @@ #define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000 #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 +#define PCI_VENDOR_ID_AURAVISION 0x11d1 +#define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7 + #define PCI_VENDOR_ID_IKON 0x11d5 #define PCI_DEVICE_ID_IKON_10115 0x0115 #define PCI_DEVICE_ID_IKON_10117 0x0117 @@ -706,8 +735,8 @@ #define PCI_VENDOR_ID_PICTUREL 0x12c5 #define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081 -#define PCI_VENDOR_ID_NVIDIA 0x12d2 -#define PCI_DEVICE_ID_NVIDIA_RIVA128 0x0018 +#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 +#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 @@ -775,6 +804,8 @@ #define PCI_DEVICE_ID_INTEL_82371AB 0x7111 #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 +#define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180 +#define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181 #define PCI_DEVICE_ID_INTEL_P6 0x84c4 #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 @@ -784,6 +815,7 @@ #define PCI_VENDOR_ID_ADAPTEC 0x9004 #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 +#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800 #define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 #define PCI_DEVICE_ID_ADAPTEC_7861 0x6178 #define PCI_DEVICE_ID_ADAPTEC_7870 0x7078 @@ -791,6 +823,7 @@ #define PCI_DEVICE_ID_ADAPTEC_7872 0x7278 #define PCI_DEVICE_ID_ADAPTEC_7873 0x7378 #define PCI_DEVICE_ID_ADAPTEC_7874 0x7478 +#define PCI_DEVICE_ID_ADAPTEC_7895 0x7895 #define PCI_DEVICE_ID_ADAPTEC_7880 0x8078 #define PCI_DEVICE_ID_ADAPTEC_7881 0x8178 #define PCI_DEVICE_ID_ADAPTEC_7882 0x8278 @@ -805,6 +838,7 @@ #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 +#ifdef __KERNEL__ /* * The PCI interface treats multi-function devices as independent * devices. The slot/function address of each device is encoded @@ -895,5 +929,5 @@ extern const char *pci_strvendor (unsigned int vendor); extern const char *pci_strdev (unsigned int vendor, unsigned int device); extern int get_pci_list (char *buf); - -#endif /* PCI_H */ +#endif /* __KERNEL__ */ +#endif /* LINUX_PCI_H */ diff --git a/include/linux/pi2.h b/include/linux/pi2.h index 1740cc0b2..e69de29bb 100644 --- a/include/linux/pi2.h +++ b/include/linux/pi2.h @@ -1,130 +0,0 @@ - -#define DMA_BUFF_SIZE 2200 - -#define ON 1 -#define OFF 0 - - -/* Register offset info, specific to the PI - * E.g., to read the data port on channel A, use - * inportb(pichan[dev].base + CHANA + DATA) - */ -#define CHANB 0 /* Base of channel B regs */ -#define CHANA 2 /* Base of channel A regs */ - -/* 8530 ports on each channel */ -#define CTL 0 -#define DATA 1 - -#define DMAEN 0x4 /* Offset off DMA Enable register */ - -/* Timer chip offsets */ -#define TMR0 0x8 /* Offset of timer 0 register */ -#define TMR1 0x9 /* Offset of timer 1 register */ -#define TMR2 0xA /* Offset of timer 2 register */ -#define TMRCMD 0xB /* Offset of timer command register */ - -/* Timer chip equates */ -#define SC0 0x00 /* Select counter 0 */ -#define SC1 0x40 /* Select counter 1 */ -#define SC2 0x80 /* Select counter 2 */ -#define CLATCH 0x00 /* Counter latching operation */ -#define MSB 0x20 /* Read/load MSB only */ -#define LSB 0x10 /* Read/load LSB only */ -#define LSB_MSB 0x30 /* Read/load LSB, then MSB */ -#define MODE0 0x00 /* Interrupt on terminal count */ -#define MODE1 0x02 /* Programmable one shot */ -#define MODE2 0x04 /* Rate generator */ -#define MODE3 0x06 /* Square wave rate generator */ -#define MODE4 0x08 /* Software triggered strobe */ -#define MODE5 0x0a /* Hardware triggered strobe */ -#define BCD 0x01 /* BCD counter */ - -/* DMA controller registers */ -#define DMA_STAT 8 /* DMA controller status register */ -#define DMA_CMD 8 /* DMA controller command register */ -#define DMA_MASK 10 /* DMA controller mask register */ -#define DMA_MODE 11 /* DMA controller mode register */ -#define DMA_RESETFF 12 /* DMA controller first/last flip flop */ -/* DMA data */ -#define DMA_DISABLE (0x04) /* Disable channel n */ -#define DMA_ENABLE (0x00) /* Enable channel n */ -/* Single transfers, incr. address, auto init, writes, ch. n */ -#define DMA_RX_MODE (0x54) -/* Single transfers, incr. address, no auto init, reads, ch. n */ -#define DMA_TX_MODE (0x48) - -#define SINGLE 3686400 -#define DOUBLE 7372800 - -#define SIOCGPIPARAM 0x5000 /* get PI parameters */ -#define SIOCSPIPARAM 0x5001 /* set */ -#define SIOCGPIBAUD 0x5002 /* get only baud rate */ -#define SIOCSPIBAUD 0x5003 -#define SIOCGPIDMA 0x5004 /* get only DMA */ -#define SIOCSPIDMA 0x5005 -#define SIOCGPIIRQ 0x5006 /* get only IRQ */ -#define SIOCSPIIRQ 0x5007 - -struct pi_req { - int cmd; - int speed; - int clockmode; - int txdelay; - unsigned char persist; - int slotime; - int squeldelay; - int dmachan; - int irq; -}; - -#ifdef __KERNEL__ - -/* Information that needs to be kept for each channel. */ -struct pi_local { - struct net_device_stats stats; - long open_time; /* Useless example local info. */ - unsigned long xtal; - - struct mbuf *rcvbuf;/* Buffer for current rx packet */ - struct mbuf *rxdmabuf1; /* DMA rx buffer */ - struct mbuf *rxdmabuf2; /* DMA rx buffer */ - - int bufsiz; /* Size of rcvbuf */ - char *rcp; /* Pointer into rcvbuf */ - - struct sk_buff_head sndq; /* Packets awaiting transmission */ - int sndcnt; /* Number of packets on sndq */ - struct sk_buff *sndbuf; /* Current buffer being transmitted */ - char *txdmabuf; /* Transmit DMA buffer */ - char *txptr; /* Used by B port tx */ - int txcnt; - char tstate; /* Transmitter state */ -#define IDLE 0 /* Transmitter off, no data pending */ -#define ACTIVE 1 /* Transmitter on, sending data */ -#define UNDERRUN 2 /* Transmitter on, flushing CRC */ -#define FLAGOUT 3 /* CRC sent - attempt to start next frame */ -#define DEFER 4 /* Receive Active - DEFER Transmit */ -#define ST_TXDELAY 5 /* Sending leading flags */ -#define CRCOUT 6 - char rstate; /* Set when !DCD goes to 0 (TRUE) */ -/* Normal state is ACTIVE if Receive enabled */ -#define RXERROR 2 /* Error -- Aborting current Frame */ -#define RXABORT 3 /* ABORT sequence detected */ -#define TOOBIG 4 /* too large a frame to store */ - int dev; /* Device number */ - int base; /* Base of I/O registers */ - int cardbase; /* Base address of card */ - int stata; /* address of Channel A status regs */ - int statb; /* address of Channel B status regs */ - int speed; /* Line speed, bps */ - int clockmode; /* tapr 9600 modem clocking option */ - int txdelay; /* Transmit Delay 10 ms/cnt */ - unsigned char persist; /* Persistence (0-255) as a % */ - int slotime; /* Delay to wait on persistence hit */ - int squeldelay; /* Delay after XMTR OFF for squelch tail */ - struct iface *iface; /* Associated interface */ - int dmachan; /* DMA channel for this port */ -}; - -#endif diff --git a/include/linux/poll.h b/include/linux/poll.h index 2001fedfb..01c4d1519 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h @@ -1 +1,106 @@ +#ifndef _LINUX_POLL_H + #include <asm/poll.h> + +#ifdef __KERNEL__ + +#include <linux/wait.h> +#include <linux/string.h> +#include <asm/uaccess.h> + + +struct poll_table_entry { + struct wait_queue wait; + struct wait_queue ** wait_address; +}; + +typedef struct poll_table_struct { + unsigned int nr; + struct poll_table_entry * entry; +} poll_table; + +#define __MAX_POLL_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct poll_table_entry)) + +extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p) +{ + struct poll_table_entry * entry; + + if (!p || !wait_address) + return; + if (p->nr >= __MAX_POLL_TABLE_ENTRIES) + return; + entry = p->entry + p->nr; + entry->wait_address = wait_address; + entry->wait.task = current; + entry->wait.next = NULL; + add_wait_queue(wait_address,&entry->wait); + p->nr++; +} + + +/* + * For the kernel fd_set we use a fixed set-size for allocation purposes. + * This set-size doesn't necessarily bear any relation to the size the user + * uses, but should preferably obviously be larger than any possible user + * size (NR_OPEN bits). + * + * We need 6 bitmaps (in/out/ex for both incoming and outgoing), and we + * allocate one page for all the bitmaps. Thus we have 8*PAGE_SIZE bits, + * to be divided by 6. And we'd better make sure we round to a full + * long-word (in fact, we'll round to 64 bytes). + */ + + +#define KFDS_64BLOCK ((PAGE_SIZE/(6*64))*64) +#define KFDS_NR (KFDS_64BLOCK*8 > NR_OPEN ? NR_OPEN : KFDS_64BLOCK*8) +typedef unsigned long kernel_fd_set[KFDS_NR/__NFDBITS]; + +typedef struct { + kernel_fd_set in, out, ex; + kernel_fd_set res_in, res_out, res_ex; +} fd_set_buffer; + + +/* + * We do a VERIFY_WRITE here even though we are only reading this time: + * we'll write to it eventually.. + * + * Use "unsigned long" accesses to let user-mode fd_set's be long-aligned. + */ +static inline +int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) +{ + /* round up nr to nearest "unsigned long" */ + nr = (nr + 8*sizeof(long) - 1) / (8*sizeof(long)) * sizeof(long); + if (ufdset) { + int error; + error = verify_area(VERIFY_WRITE, ufdset, nr); + if (!error) + error = __copy_from_user(fdset, ufdset, nr); + return error; + } + memset(fdset, 0, nr); + return 0; +} + +static inline +void set_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) +{ + if (ufdset) { + nr = (nr + 8*sizeof(long) - 1) / (8*sizeof(long))*sizeof(long); + __copy_to_user(ufdset, fdset, nr); + } +} + +static inline +void zero_fd_set(unsigned long nr, unsigned long *fdset) +{ + nr = (nr + 8*sizeof(long) - 1) / (8*sizeof(long)) * sizeof(long); + memset(fdset, 0, nr); +} + +extern int do_select(int n, fd_set_buffer *fds, unsigned long timeout); + +#endif /* KERNEL */ + +#endif /* _LINUX_POLL_H */ diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index dc0d41d9e..902e63f39 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -81,9 +81,6 @@ enum net_directory_inos { PROC_NET_UNIX = 128, PROC_NET_ARP, PROC_NET_ROUTE, - PROC_NET_RTCLASSES, - PROC_NET_RTLOCAL, - PROC_NET_RTRULES, PROC_NET_DEV, PROC_NET_RAW, PROC_NET_RAW6, @@ -118,8 +115,6 @@ enum net_directory_inos { PROC_NET_SOCKSTAT6, PROC_NET_RTCACHE, PROC_NET_AX25_BPQETHER, - PROC_NET_ALIAS_TYPES, - PROC_NET_ALIASES, PROC_NET_IP_MASQ_APP, PROC_NET_RT6, PROC_NET_RT6_TREE, diff --git a/include/linux/pt.h b/include/linux/pt.h index 9ab17f501..e69de29bb 100644 --- a/include/linux/pt.h +++ b/include/linux/pt.h @@ -1,174 +0,0 @@ -/* - * pt.h: Linux device driver for the Gracilis PackeTwin - * Copyright (C) 1995 Craig Small VK2XLZ (vk2xlz@vk2xlz.ampr.org.) - * - * Please read the notice appearing at the top of the file pt.c - */ -#define DMA_BUFF_SIZE 2200 - -#define ON 1 -#define OFF 0 - - -/* Register offset info, specific to the PT - * E.g., to read the data port on channel A, use - * inportb(pichan[dev].base + CHANA + DATA) - */ -#define CHANB 0 /* Base of channel B regs */ -#define CHANA 2 /* Base of channel A regs */ - -/* 8530 ports on each channel */ -#define CTL 0 -#define DATA 1 - -#define DMAEN 0x8 /* Offset off DMA Enable register */ - -/* Timer chip offsets */ -#define TMR0 0x4 /* Offset of timer 0 register */ -#define TMR1 0x5 /* Offset of timer 1 register */ -#define TMR2 0x6 /* Offset of timer 2 register */ -#define TMRCMD 0x7 /* Offset of timer command register */ -#define INT_REG 0x8 -#define TMR1CLR 0x9 -#define TMR2CLR 0xa - -/* Interrupt register equates */ -#define PT_SCC_MSK 0x1 -#define PT_TMR1_MSK 0x2 -#define PT_TMR2_MSK 0x4 - -/* Serial/interrupt register equates */ -#define PT_DTRA_ON 0x1 -#define PT_DTRB_ON 0x2 -#define PT_EXTCLKA 0x4 -#define PT_EXTCLKB 0x8 -#define PT_LOOPA_ON 0x10 -#define PT_LOOPB_ON 0x20 -#define PT_EI 0x80 - -/* Timer chip equates */ -#define SC0 0x00 /* Select counter 0 */ -#define SC1 0x40 /* Select counter 1 */ -#define SC2 0x80 /* Select counter 2 */ -#define CLATCH 0x00 /* Counter latching operation */ -#define MSB 0x20 /* Read/load MSB only */ -#define LSB 0x10 /* Read/load LSB only */ -#define LSB_MSB 0x30 /* Read/load LSB, then MSB */ -#define MODE0 0x00 /* Interrupt on terminal count */ -#define MODE1 0x02 /* Programmable one shot */ -#define MODE2 0x04 /* Rate generator */ -#define MODE3 0x06 /* Square wave rate generator */ -#define MODE4 0x08 /* Software triggered strobe */ -#define MODE5 0x0a /* Hardware triggered strobe */ -#define BCD 0x01 /* BCD counter */ - -/* DMA controller registers */ -#define DMA_STAT 8 /* DMA controller status register */ -#define DMA_CMD 8 /* DMA controller command register */ -#define DMA_MASK 10 /* DMA controller mask register */ -#define DMA_MODE 11 /* DMA controller mode register */ -#define DMA_RESETFF 12 /* DMA controller first/last flip flop */ -/* DMA data */ -#define DMA_DISABLE (0x04) /* Disable channel n */ -#define DMA_ENABLE (0x00) /* Enable channel n */ -/* Single transfers, incr. address, auto init, writes, ch. n */ -#define DMA_RX_MODE (0x54) -/* Single transfers, incr. address, no auto init, reads, ch. n */ -#define DMA_TX_MODE (0x48) - -/* Write registers */ -#define DMA_CFG 0x08 -#define SERIAL_CFG 0x09 -#define INT_CFG 0x09 /* shares with serial config */ -#define DMA_CLR_FF 0x0a - -#define SINGLE 3686400 -#define DOUBLE 7372800 -#define XTAL ((long) 6144000L) - -#define SIOCGPIPARAM 0x5000 /* get PI parameters */ -#define SIOCSPIPARAM 0x5001 /* set */ -#define SIOCGPIBAUD 0x5002 /* get only baud rate */ -#define SIOCSPIBAUD 0x5003 -#define SIOCGPIDMA 0x5004 /* get only DMA */ -#define SIOCSPIDMA 0x5005 -#define SIOCGPIIRQ 0x5006 /* get only IRQ */ -#define SIOCSPIIRQ 0x5007 - -struct pt_req -{ - int cmd; - int speed; - int clockmode; - int txdelay; - unsigned char persist; - int slotime; - int squeldelay; - int dmachan; - int irq; -}; - -/* SCC Interrupt vectors, if we have set 'status low' */ -#define CHBTxIV 0x00 -#define CHBEXTIV 0x02 -#define CHBRxIV 0x04 -#define CHBSRCIV 0x06 -#define CHATxIV 0x08 -#define CHAEXTIV 0x0a -#define CHARxIV 0x0c -#define CHASRCIV 0x0e - - -#ifdef __KERNEL__ - -/* Information that needs to be kept for each channel. */ -struct pt_local -{ - struct net_device_stats stats; /* %%%dp*/ - long open_time; /* Useless example local info. */ - unsigned long xtal; - - struct mbuf *rcvbuf;/* Buffer for current rx packet */ - struct mbuf *rxdmabuf1; /* DMA rx buffer */ - struct mbuf *rxdmabuf2; /* DMA rx buffer */ - - int bufsiz; /* Size of rcvbuf */ - char *rcp; /* Pointer into rcvbuf */ - struct sk_buff_head sndq; /* Packets awaiting transmission */ - int sndcnt; /* Number of packets on sndq */ - struct sk_buff *sndbuf; /* Current buffer being transmitted */ - char *txdmabuf; /* Transmit DMA buffer */ - char *txptr; /* Used by B port tx */ - int txcnt; - char tstate; /* Transmitter state */ -#define IDLE 0 /* Transmitter off, no data pending */ -#define ACTIVE 1 /* Transmitter on, sending data */ -#define UNDERRUN 2 /* Transmitter on, flushing CRC */ -#define FLAGOUT 3 /* CRC sent - attempt to start next frame */ -#define DEFER 4 /* Receive Active - DEFER Transmit */ -#define ST_TXDELAY 5 /* Sending leading flags */ -#define CRCOUT 6 - char rstate; /* Set when !DCD goes to 0 (TRUE) */ -/* Normal state is ACTIVE if Receive enabled */ -#define RXERROR 2 /* Error -- Aborting current Frame */ -#define RXABORT 3 /* ABORT sequence detected */ -#define TOOBIG 4 /* too large a frame to store */ - - int dev; /* Device number */ - int base; /* Base of I/O registers */ - int cardbase; /* Base address of card */ - int stata; /* address of Channel A status regs */ - int statb; /* address of Channel B status regs */ - int speed; /* Line speed, bps */ - int clockmode; /* tapr 9600 modem clocking option */ - int txdelay; /* Transmit Delay 10 ms/cnt */ - unsigned char persist; /* Persistence (0-255) as a % */ - int slotime; /* Delay to wait on persistence hit */ - int squeldelay; /* Delay after XMTR OFF for squelch tail */ - struct iface *iface; /* Associated interface */ - int dmachan; /* DMA channel for this port */ - char saved_RR0; /* The saved version of RR) that we compare with */ - int nrzi; /* Do we use NRZI (or NRZ) */ -}; - -#endif diff --git a/include/linux/rose.h b/include/linux/rose.h index 61abbc0d3..69d592f67 100644 --- a/include/linux/rose.h +++ b/include/linux/rose.h @@ -7,7 +7,6 @@ #ifndef ROSE_KERNEL_H #define ROSE_KERNEL_H -#define PF_ROSE AF_ROSE #define ROSE_MTU 251 #define ROSE_DEFER 1 diff --git a/include/linux/route.h b/include/linux/route.h index 4432d1900..2582f9a89 100644 --- a/include/linux/route.h +++ b/include/linux/route.h @@ -33,9 +33,7 @@ struct rtentry unsigned short rt_flags; short rt_pad2; unsigned long rt_pad3; - unsigned char rt_tos; - unsigned char rt_class; - short rt_pad4; + void *rt_pad4; short rt_metric; /* +1 for binary compatibility! */ char *rt_dev; /* forcing the device at add */ unsigned long rt_mtu; /* per route MTU/Window */ @@ -44,13 +42,11 @@ struct rtentry #endif unsigned long rt_window; /* Window clamping */ unsigned short rt_irtt; /* Initial RTT */ - }; #define RTF_UP 0x0001 /* route usable */ #define RTF_GATEWAY 0x0002 /* destination is a gateway */ - #define RTF_HOST 0x0004 /* host entry (net otherwise) */ #define RTF_REINSTATE 0x0008 /* reinstate route after tmout */ #define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */ @@ -60,138 +56,12 @@ struct rtentry #define RTF_WINDOW 0x0080 /* per route window clamping */ #define RTF_IRTT 0x0100 /* Initial round trip time */ #define RTF_REJECT 0x0200 /* Reject route */ -#define RTF_STATIC 0x0400 /* Manually injected route */ -#define RTF_XRESOLVE 0x0800 /* External resolver */ -#define RTF_NOFORWARD 0x1000 /* Forwarding inhibited */ -#define RTF_THROW 0x2000 /* Go to next class */ -#define RTF_NOPMTUDISC 0x4000 /* Do not send packets with DF */ - -#define RTF_MAGIC 0x8000 /* Route added/deleted authomatically, - * when interface changes its state. - */ /* * <linux/ipv6_route.h> uses RTF values >= 64k */ -#define RTCF_VALVE 0x00200000 -#define RTCF_MASQ 0x00400000 -#define RTCF_NAT 0x00800000 -#define RTCF_DOREDIRECT 0x01000000 -#define RTCF_LOG 0x02000000 -#define RTCF_DIRECTSRC 0x04000000 - -#define RTF_LOCAL 0x80000000 -#define RTF_INTERFACE 0x40000000 -#define RTF_MULTICAST 0x20000000 -#define RTF_BROADCAST 0x10000000 -#define RTF_NAT 0x08000000 - -#define RTF_ADDRCLASSMASK 0xF8000000 -#define RT_ADDRCLASS(flags) ((__u32)flags>>23) - -#define RT_TOS(tos) ((tos)&IPTOS_TOS_MASK) - -#define RT_LOCALADDR(flags) ((flags&RTF_ADDRCLASSMASK) == (RTF_LOCAL|RTF_INTERFACE)) - -#define RT_CLASS_UNSPEC 0 -#define RT_CLASS_DEFAULT 253 - -#define RT_CLASS_MAIN 254 -#define RT_CLASS_LOCAL 255 -#define RT_CLASS_MAX 255 - -#ifdef _LINUX_IN_H /* hack to check that in.h included */ -/* - * This structure is passed from the kernel to user space by netlink - * routing/device announcements - */ - -struct in_rtmsg -{ - struct in_addr rtmsg_prefix; - struct in_addr rtmsg_gateway; - unsigned rtmsg_flags; - unsigned long rtmsg_mtu; - unsigned long rtmsg_window; - unsigned short rtmsg_rtt; - short rtmsg_metric; - unsigned char rtmsg_tos; - unsigned char rtmsg_class; - unsigned char rtmsg_prefixlen; - unsigned char rtmsg_reserved; - int rtmsg_ifindex; -}; - - -struct in_ifmsg -{ - struct sockaddr ifmsg_lladdr; - struct in_addr ifmsg_prefix; - struct in_addr ifmsg_brd; - unsigned ifmsg_flags; - unsigned long ifmsg_mtu; - short ifmsg_metric; - unsigned char ifmsg_prefixlen; - unsigned char ifmsg_reserved; - int ifmsg_index; - char ifmsg_name[16]; -}; - -enum rtrule_actions -{ - RTP_GO, - RTP_NAT, - RTP_DROP, - RTP_UNREACHABLE, - RTP_PROHIBIT, - RTP_MASQUERADE -}; - -#define RTRF_LOG 1 /* Log route creations */ -#define RTRF_VALVE 2 /* One-way route */ - -struct in_rtrulemsg -{ - struct in_addr rtrmsg_src; - struct in_addr rtrmsg_dst; - struct in_addr rtrmsg_srcmap; - int rtrmsg_ifindex; - unsigned char rtrmsg_srclen; - unsigned char rtrmsg_dstlen; - unsigned char rtrmsg_tos; - unsigned char rtrmsg_class; - unsigned char rtrmsg_flags; - unsigned char rtrmsg_action; - unsigned char rtrmsg_preference; - unsigned char rtrmsg_rtmsgs; - struct in_rtmsg rtrmsg_rtmsg[1]; -}; - -struct in_rtctlmsg -{ - unsigned rtcmsg_flags; - int rtcmsg_delay; -}; - -#define RTCTL_ECHO 1 /* Echo route changes */ -#define RTCTL_FLUSH 2 /* Send flush updates */ -#define RTCTL_ACK 4 /* Send acks */ -#define RTCTL_DELAY 8 /* Set netlink delay */ -#define RTCTL_OWNER 0x10 /* Set netlink reader */ -#endif - -#define RTMSG_ACK NLMSG_ACK -#define RTMSG_OVERRUN NLMSG_OVERRUN -#define RTMSG_NEWDEVICE 0x11 -#define RTMSG_DELDEVICE 0x12 -#define RTMSG_NEWROUTE 0x21 -#define RTMSG_DELROUTE 0x22 -#define RTMSG_NEWRULE 0x31 -#define RTMSG_DELRULE 0x32 -#define RTMSG_CONTROL 0x40 -#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed */ #endif /* _LINUX_ROUTE_H */ diff --git a/include/linux/sbpcd.h b/include/linux/sbpcd.h index e9021316d..e69de29bb 100644 --- a/include/linux/sbpcd.h +++ b/include/linux/sbpcd.h @@ -1,858 +0,0 @@ -/* - * sbpcd.h Specify interface address and interface type here. - */ - -/* - * Attention! This file contains user-serviceable parts! - * I recommend to make use of it... - * If you feel helpless, look into linux/Documentation/cdrom/sbpcd - * (good idea anyway, at least before mailing me). - * - * The definitions for the first controller can get overridden by - * the kernel command line ("lilo boot option"). - * Examples: - * sbpcd=0x300,LaserMate - * or - * sbpcd=0x230,SoundBlaster - * or - * sbpcd=0x338,SoundScape - * or - * sbpcd=0x2C0,Teac16bit - * - * If sbpcd gets used as a module, you can load it with - * insmod sbpcd.o sbpcd=0x300,0 - * or - * insmod sbpcd.o sbpcd=0x230,1 - * or - * insmod sbpcd.o sbpcd=0x338,2 - * or - * insmod sbpcd.o sbpcd=0x2C0,3 - * respective to override the configured address and type. - */ - -/* - * define your CDROM port base address as CDROM_PORT - * and specify the type of your interface card as SBPRO. - * - * address: - * ======== - * SBPRO type addresses typically are 0x0230 (=0x220+0x10), 0x0250, ... - * LASERMATE type (CI-101P, WDH-7001C) addresses typically are 0x0300, ... - * SOUNDSCAPE addresses are from the LASERMATE type and range. You have to - * specify the REAL address here, not the configuration port address. Look - * at the CDROM driver's invoking line within your DOS CONFIG.SYS, or let - * sbpcd auto-probe, if you are not firm with the address. - * There are some soundcards on the market with 0x0630, 0x0650, ...; their - * type is not obvious (both types are possible). - * - * example: if your SBPRO audio address is 0x220, specify 0x230 and SBPRO 1. - * if your soundcard has its CDROM port above 0x300, specify - * that address and try SBPRO 0 first. - * if your SoundScape configuration port is at 0x330, specify - * 0x338 and SBPRO 2. - * - * interface type: - * =============== - * set SBPRO to 1 for "true" SoundBlaster card - * set SBPRO to 0 for "compatible" soundcards and - * for "poor" (no sound) interface cards. - * set SBPRO to 2 for Ensonic SoundScape or SPEA Media FX cards - * set SBPRO to 3 for Teac 16bit interface cards - * - * Almost all "compatible" sound boards need to set SBPRO to 0. - * If SBPRO is set wrong, the drives will get found - but any - * data access will give errors (audio access will work). - * The "OmniCD" no-sound interface card from CreativeLabs and most Teac - * interface cards need SBPRO 1. - * - * sound base: - * =========== - * The SOUND_BASE definition tells if we should try to turn the CD sound - * channels on. It will only be of use regarding soundcards with a SbPro - * compatible mixer. - * - * Example: #define SOUND_BASE 0x220 enables the sound card's CD channels - * #define SOUND_BASE 0 leaves the soundcard untouched - */ -#if !(SBPCD_ISSUE-1) /* first (or if you have only one) interface board: */ -#define CDROM_PORT 0x340 /* <-----------<< port address */ -#define SBPRO 0 /* <-----------<< interface type */ -#define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x220 /* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE-2) /* ==================== second interface board: === */ -#define CDROM_PORT 0x344 /* <-----------<< port address */ -#define SBPRO 0 /* <-----------<< interface type */ -#define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE-3) /* ===================== third interface board: === */ -#define CDROM_PORT 0x630 /* <-----------<< port address */ -#define SBPRO 1 /* <-----------<< interface type */ -#define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x240 /* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE-4) /* ==================== fourth interface board: === */ -#define CDROM_PORT 0x634 /* <-----------<< port address */ -#define SBPRO 0 /* <-----------<< interface type */ -#define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0 */ -#endif - -/* - * some more or less user dependent definitions - service them! - */ - -/* Set this to 0 once you have configured your interface definitions right. */ -#define DISTRIBUTION 1 - -/* - * Time to wait after giving a message. - * This gets important if you enable non-standard DBG_xxx flags. - * You will see what happens if you omit the pause or make it - * too short. Be warned! - */ -#define KLOGD_PAUSE 1 - -/* tray control: eject tray if no disk is in */ -#if DISTRIBUTION -#define JUKEBOX 0 -#else -#define JUKEBOX 1 -#endif DISTRIBUTION - -/* tray control: eject tray after last use */ -#if DISTRIBUTION -#define EJECT 0 -#else -#define EJECT 1 -#endif DISTRIBUTION - -/* max. number of audio frames to read with one */ -/* request (allocates n* 2352 bytes kernel memory!) */ -/* may be freely adjusted, f.e. 75 (= 1 sec.), at */ -/* runtime by use of the CDROMAUDIOBUFSIZ ioctl. */ -#define READ_AUDIO 0 - -/* Optimizations for the Teac CD-55A drive read performance. - * SBP_TEAC_SPEED can be changed here, or one can set the - * variable "teac" when loading as a module. - * Valid settings are: - * 0 - very slow - the recommended "DISTRIBUTION 1" setup. - * 1 - 2x performance with little overhead. No busy waiting. - * 2 - 4x performance with 5ms overhead per read. Busy wait. - * - * Setting SBP_TEAC_SPEED or the variable 'teac' to anything - * other than 0 may cause problems. If you run into them, first - * change SBP_TEAC_SPEED back to 0 and see if your drive responds - * normally. If yes, you are "allowed" to report your case - to help - * me with the driver, not to solve your hassle. Don´t mail if you - * simply are stuck into your own "tuning" experiments, you know? - */ -#define SBP_TEAC_SPEED 1 - -/*==========================================================================*/ -/*==========================================================================*/ -/* - * nothing to change below here if you are not fully aware what you're doing - */ -#ifndef _LINUX_SBPCD_H - -#define _LINUX_SBPCD_H -/*==========================================================================*/ -/*==========================================================================*/ -/* - * driver's own read_ahead, data mode - */ -#define SBP_BUFFER_FRAMES 8 - -#define LONG_TIMING 0 /* test against timeouts with "gold" CDs on CR-521 */ -#undef FUTURE -#undef SAFE_MIXED - -#define TEST_UPC 0 -#define SPEA_TEST 0 -#define TEST_STI 0 -#define OLD_BUSY 0 -#undef PATH_CHECK -#ifndef SOUND_BASE -#define SOUND_BASE 0 -#endif -#if DISTRIBUTION -#undef SBP_TEAC_SPEED -#define SBP_TEAC_SPEED 0 -#endif -/*==========================================================================*/ -/* - * DDI interface definitions - * "invented" by Fred N. van Kempen.. - */ -#define DDIOCSDBG 0x9000 - -/*==========================================================================*/ -/* - * "private" IOCTL functions - */ -#define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */ - -/*==========================================================================*/ -/* - * Debug output levels - */ -#define DBG_INF 1 /* necessary information */ -#define DBG_BSZ 2 /* BLOCK_SIZE trace */ -#define DBG_REA 3 /* READ status trace */ -#define DBG_CHK 4 /* MEDIA CHECK trace */ -#define DBG_TIM 5 /* datarate timer test */ -#define DBG_INI 6 /* initialization trace */ -#define DBG_TOC 7 /* tell TocEntry values */ -#define DBG_IOC 8 /* ioctl trace */ -#define DBG_STA 9 /* ResponseStatus() trace */ -#define DBG_ERR 10 /* cc_ReadError() trace */ -#define DBG_CMD 11 /* cmd_out() trace */ -#define DBG_WRN 12 /* give explanation before auto-probing */ -#define DBG_MUL 13 /* multi session code test */ -#define DBG_IDX 14 /* test code for drive_id !=0 */ -#define DBG_IOX 15 /* some special information */ -#define DBG_DID 16 /* drive ID test */ -#define DBG_RES 17 /* drive reset info */ -#define DBG_SPI 18 /* SpinUp test */ -#define DBG_IOS 19 /* ioctl trace: subchannel functions */ -#define DBG_IO2 20 /* ioctl trace: general */ -#define DBG_UPC 21 /* show UPC information */ -#define DBG_XA1 22 /* XA mode debugging */ -#define DBG_LCK 23 /* door (un)lock info */ -#define DBG_SQ1 24 /* dump SubQ frame */ -#define DBG_AUD 25 /* READ AUDIO debugging */ -#define DBG_SEQ 26 /* Sequoia interface configuration trace */ -#define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */ -#define DBG_CD2 28 /* MKE/Funai CD200 debugging trace */ -#define DBG_TEA 29 /* TEAC CD-55A debugging trace */ -#define DBG_ECS 30 /* ECS-AT (Vertos 100) debugging trace */ -#define DBG_000 31 /* unnecessary information */ - -/*==========================================================================*/ -/*==========================================================================*/ - -/* - * bits of flags_cmd_out: - */ -#define f_respo3 0x100 -#define f_putcmd 0x80 -#define f_respo2 0x40 -#define f_lopsta 0x20 -#define f_getsta 0x10 -#define f_ResponseStatus 0x08 -#define f_obey_p_check 0x04 -#define f_bit1 0x02 -#define f_wait_if_busy 0x01 - -/* - * diskstate_flags: - */ -#define x80_bit 0x80 -#define upc_bit 0x40 -#define volume_bit 0x20 -#define toc_bit 0x10 -#define multisession_bit 0x08 -#define cd_size_bit 0x04 -#define subq_bit 0x02 -#define frame_size_bit 0x01 - -/* - * disk states (bits of diskstate_flags): - */ -#define upc_valid (D_S[d].diskstate_flags&upc_bit) -#define volume_valid (D_S[d].diskstate_flags&volume_bit) -#define toc_valid (D_S[d].diskstate_flags&toc_bit) -#define cd_size_valid (D_S[d].diskstate_flags&cd_size_bit) -#define subq_valid (D_S[d].diskstate_flags&subq_bit) -#define frame_size_valid (D_S[d].diskstate_flags&frame_size_bit) - -/* - * the status_bits variable - */ -#define p_success 0x100 -#define p_door_closed 0x80 -#define p_caddy_in 0x40 -#define p_spinning 0x20 -#define p_check 0x10 -#define p_busy_new 0x08 -#define p_door_locked 0x04 -#define p_disk_ok 0x01 - -/* - * LCS-7260 special status result bits: - */ -#define p_lcs_door_locked 0x02 -#define p_lcs_door_closed 0x01 /* probably disk_in */ - -/* - * CR-52x special status result bits: - */ -#define p_caddin_old 0x40 -#define p_success_old 0x08 -#define p_busy_old 0x04 -#define p_bit_1 0x02 /* hopefully unused now */ - -/* - * "generation specific" defs of the status result bits: - */ -#define p0_door_closed 0x80 -#define p0_caddy_in 0x40 -#define p0_spinning 0x20 -#define p0_check 0x10 -#define p0_success 0x08 /* unused */ -#define p0_busy 0x04 -#define p0_bit_1 0x02 /* unused */ -#define p0_disk_ok 0x01 - -#define pL_disk_in 0x40 -#define pL_spinning 0x20 -#define pL_check 0x10 -#define pL_success 0x08 /* unused ?? */ -#define pL_busy 0x04 -#define pL_door_locked 0x02 -#define pL_door_closed 0x01 - -#define pV_door_closed 0x40 -#define pV_spinning 0x20 -#define pV_check 0x10 -#define pV_success 0x08 -#define pV_busy 0x04 -#define pV_door_locked 0x02 -#define pV_disk_ok 0x01 - -#define p1_door_closed 0x80 -#define p1_disk_in 0x40 -#define p1_spinning 0x20 -#define p1_check 0x10 -#define p1_busy 0x08 -#define p1_door_locked 0x04 -#define p1_bit_1 0x02 /* unused */ -#define p1_disk_ok 0x01 - -#define p2_disk_ok 0x80 -#define p2_door_locked 0x40 -#define p2_spinning 0x20 -#define p2_busy2 0x10 -#define p2_busy1 0x08 -#define p2_door_closed 0x04 -#define p2_disk_in 0x02 -#define p2_check 0x01 - -/* - * used drive states: - */ -#define st_door_closed (D_S[d].status_bits&p_door_closed) -#define st_caddy_in (D_S[d].status_bits&p_caddy_in) -#define st_spinning (D_S[d].status_bits&p_spinning) -#define st_check (D_S[d].status_bits&p_check) -#define st_busy (D_S[d].status_bits&p_busy_new) -#define st_door_locked (D_S[d].status_bits&p_door_locked) -#define st_diskok (D_S[d].status_bits&p_disk_ok) - -/* - * bits of the CDi_status register: - */ -#define s_not_result_ready 0x04 /* 0: "result ready" */ -#define s_not_data_ready 0x02 /* 0: "data ready" */ -#define s_attention 0x01 /* 1: "attention required" */ -/* - * usable as: - */ -#define DRV_ATTN ((inb(CDi_status)&s_attention)!=0) -#define DATA_READY ((inb(CDi_status)&s_not_data_ready)==0) -#define RESULT_READY ((inb(CDi_status)&s_not_result_ready)==0) - -/* - * drive families and types (firmware versions): - */ -#define drv_fam0 0x0100 /* CR-52x family */ -#define drv_199 (drv_fam0+0x01) /* <200 */ -#define drv_200 (drv_fam0+0x02) /* <201 */ -#define drv_201 (drv_fam0+0x03) /* <210 */ -#define drv_210 (drv_fam0+0x04) /* <211 */ -#define drv_211 (drv_fam0+0x05) /* <300 */ -#define drv_300 (drv_fam0+0x06) /* >=300 */ - -#define drv_fam1 0x0200 /* CR-56x family */ -#define drv_099 (drv_fam1+0x01) /* <100 */ -#define drv_100 (drv_fam1+0x02) /* >=100, only 1.02 and 5.00 known */ - -#define drv_fam2 0x0400 /* CD200 family */ - -#define drv_famT 0x0800 /* TEAC CD-55A */ - -#define drv_famL 0x1000 /* Longshine family */ -#define drv_260 (drv_famL+0x01) /* LCS-7260 */ -#define drv_e1 (drv_famL+0x01) /* LCS-7260, firmware "A E1" */ -#define drv_f4 (drv_famL+0x02) /* LCS-7260, firmware "A4F4" */ - -#define drv_famV 0x2000 /* ECS-AT (vertos-100) family */ -#define drv_at (drv_famV+0x01) /* ECS-AT, firmware "1.00" */ - -#define fam0_drive (D_S[d].drv_type&drv_fam0) -#define famL_drive (D_S[d].drv_type&drv_famL) -#define famV_drive (D_S[d].drv_type&drv_famV) -#define fam1_drive (D_S[d].drv_type&drv_fam1) -#define fam2_drive (D_S[d].drv_type&drv_fam2) -#define famT_drive (D_S[d].drv_type&drv_famT) -#define fam0L_drive (D_S[d].drv_type&(drv_fam0|drv_famL)) -#define fam0V_drive (D_S[d].drv_type&(drv_fam0|drv_famV)) -#define famLV_drive (D_S[d].drv_type&(drv_famL|drv_famV)) -#define fam0LV_drive (D_S[d].drv_type&(drv_fam0|drv_famL|drv_famV)) -#define fam1L_drive (D_S[d].drv_type&(drv_fam1|drv_famL)) -#define fam1V_drive (D_S[d].drv_type&(drv_fam1|drv_famV)) -#define fam1LV_drive (D_S[d].drv_type&(drv_fam1|drv_famL|drv_famV)) -#define fam01_drive (D_S[d].drv_type&(drv_fam0|drv_fam1)) -#define fam12_drive (D_S[d].drv_type&(drv_fam1|drv_fam2)) -#define fam2T_drive (D_S[d].drv_type&(drv_fam2|drv_famT)) - -/* - * audio states: - */ -#define audio_playing 2 -#define audio_pausing 1 - -/* - * drv_pattern, drv_options: - */ -#define speed_auto 0x80 -#define speed_300 0x40 -#define speed_150 0x20 -#define audio_mono 0x04 - -/* - * values of cmd_type (0 else): - */ -#define READ_M1 0x01 /* "data mode 1": 2048 bytes per frame */ -#define READ_M2 0x02 /* "data mode 2": 12+2048+280 bytes per frame */ -#define READ_SC 0x04 /* "subchannel info": 96 bytes per frame */ -#define READ_AU 0x08 /* "audio frame": 2352 bytes per frame */ - -/* - * sense_byte: - * - * values: 00 - * 01 - * 81 - * 82 "raw audio" mode - * xx from infobuf[0] after 85 00 00 00 00 00 00 - */ - -/* audio status (bin) */ -#define aud_00 0x00 /* Audio status byte not supported or not valid */ -#define audx11 0x0b /* Audio play operation in progress */ -#define audx12 0x0c /* Audio play operation paused */ -#define audx13 0x0d /* Audio play operation successfully completed */ -#define audx14 0x0e /* Audio play operation stopped due to error */ -#define audx15 0x0f /* No current audio status to return */ -/* audio status (bcd) */ -#define aud_11 0x11 /* Audio play operation in progress */ -#define aud_12 0x12 /* Audio play operation paused */ -#define aud_13 0x13 /* Audio play operation successfully completed */ -#define aud_14 0x14 /* Audio play operation stopped due to error */ -#define aud_15 0x15 /* No current audio status to return */ - -/* - * highest allowed drive number (MINOR+1) - */ -#define NR_SBPCD 4 - -/* - * we try to never disable interrupts - seems to work - */ -#define SBPCD_DIS_IRQ 0 - -/* - * "write byte to port" - */ -#define OUT(x,y) outb(y,x) - -/*==========================================================================*/ - -#define MIXER_addr SOUND_BASE+4 /* sound card's address register */ -#define MIXER_data SOUND_BASE+5 /* sound card's data register */ -#define MIXER_CD_Volume 0x28 /* internal SB Pro register address */ - -/*==========================================================================*/ - -#define MAX_TRACKS 99 - -#define ERR_DISKCHANGE 615 - -/*==========================================================================*/ -/* - * To make conversions easier (machine dependent!) - */ -typedef union _msf -{ - u_int n; - u_char c[4]; -} MSF; - -typedef union _blk -{ - u_int n; - u_char c[4]; -} BLK; - -/*==========================================================================*/ - -/*============================================================================ -============================================================================== - -COMMAND SET of "old" drives like CR-521, CR-522 - (the CR-562 family is different): - -No. Command Code --------------------------------------------- - -Drive Commands: - 1 Seek 01 - 2 Read Data 02 - 3 Read XA-Data 03 - 4 Read Header 04 - 5 Spin Up 05 - 6 Spin Down 06 - 7 Diagnostic 07 - 8 Read UPC 08 - 9 Read ISRC 09 -10 Play Audio 0A -11 Play Audio MSF 0B -12 Play Audio Track/Index 0C - -Status Commands: -13 Read Status 81 -14 Read Error 82 -15 Read Drive Version 83 -16 Mode Select 84 -17 Mode Sense 85 -18 Set XA Parameter 86 -19 Read XA Parameter 87 -20 Read Capacity 88 -21 Read SUB_Q 89 -22 Read Disc Code 8A -23 Read Disc Information 8B -24 Read TOC 8C -25 Pause/Resume 8D -26 Read Packet 8E -27 Read Path Check 00 - - -all numbers (lba, msf-bin, msf-bcd, counts) to transfer high byte first - -mnemo 7-byte command #bytes response (r0...rn) -________ ____________________ ____ - -Read Status: -status: 81. (1) one-byte command, gives the main - status byte -Read Error: -check1: 82 00 00 00 00 00 00. (6) r1: audio status - -Read Packet: -check2: 8e xx 00 00 00 00 00. (xx) gets xx bytes response, relating - to commands 01 04 05 07 08 09 - -Play Audio: -play: 0a ll-bb-aa nn-nn-nn. (0) play audio, ll-bb-aa: starting block (lba), - nn-nn-nn: #blocks -Play Audio MSF: - 0b mm-ss-ff mm-ss-ff (0) play audio from/to - -Play Audio Track/Index: - 0c ... - -Pause/Resume: -pause: 8d pr 00 00 00 00 00. (0) pause (pr=00) - resume (pr=80) audio playing - -Mode Select: - 84 00 nn-nn ??-?? 00 (0) nn-nn: 2048 or 2340 - possibly defines transfer size - -set_vol: 84 83 00 00 sw le 00. (0) sw(itch): lrxxxxxx (off=1) - le(vel): min=0, max=FF, else half - (firmware 2.11) - -Mode Sense: -get_vol: 85 03 00 00 00 00 00. (2) tell current audio volume setting - -Read Disc Information: -tocdesc: 8b 00 00 00 00 00 00. (6) read the toc descriptor ("msf-bin"-format) - -Read TOC: -tocent: 8c fl nn 00 00 00 00. (8) read toc entry #nn - (fl=0:"lba"-, =2:"msf-bin"-format) - -Read Capacity: -capacit: 88 00 00 00 00 00 00. (5) "read CD-ROM capacity" - - -Read Path Check: -ping: 00 00 00 00 00 00 00. (2) r0=AA, r1=55 - ("ping" if the drive is connected) - -Read Drive Version: -ident: 83 00 00 00 00 00 00. (12) gives "MATSHITAn.nn" - (n.nn = 2.01, 2.11., 3.00, ...) - -Seek: -seek: 01 00 ll-bb-aa 00 00. (0) -seek: 01 02 mm-ss-ff 00 00. (0) - -Read Data: -read: 02 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2048 bytes, - starting at block xx-xx-xx - fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx - -Read XA-Data: -read: 03 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2340 bytes, - starting at block xx-xx-xx - fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx - -Read SUB_Q: - 89 fl 00 00 00 00 00. (13) r0: audio status, r4-r7: lba/msf, - fl=0: "lba", fl=2: "msf" - -Read Disc Code: - 8a 00 00 00 00 00 00. (14) possibly extended "check condition"-info - -Read Header: - 04 00 ll-bb-aa 00 00. (0) 4 bytes response with "check2" - 04 02 mm-ss-ff 00 00. (0) 4 bytes response with "check2" - -Spin Up: - 05 00 ll-bb-aa 00 00. (0) possibly implies a "seek" - -Spin Down: - 06 ... - -Diagnostic: - 07 00 ll-bb-aa 00 00. (2) 2 bytes response with "check2" - 07 02 mm-ss-ff 00 00. (2) 2 bytes response with "check2" - -Read UPC: - 08 00 ll-bb-aa 00 00. (16) - 08 02 mm-ss-ff 00 00. (16) - -Read ISRC: - 09 00 ll-bb-aa 00 00. (15) 15 bytes response with "check2" - 09 02 mm-ss-ff 00 00. (15) 15 bytes response with "check2" - -Set XA Parameter: - 86 ... - -Read XA Parameter: - 87 ... - -============================================================================== -============================================================================*/ - -/* - * commands - * - * CR-52x: CMD0_ - * CR-56x: CMD1_ - * CD200: CMD2_ - * LCS-7260: CMDL_ - * TEAC CD-55A: CMDT_ - * ECS-AT: CMDV_ - */ -#define CMD1_RESET 0x0a -#define CMD2_RESET 0x01 -#define CMDT_RESET 0xc0 - -#define CMD1_LOCK_CTL 0x0c -#define CMD2_LOCK_CTL 0x1e -#define CMDT_LOCK_CTL CMD2_LOCK_CTL -#define CMDL_LOCK_CTL 0x0e -#define CMDV_LOCK_CTL CMDL_LOCK_CTL - -#define CMD1_TRAY_CTL 0x07 -#define CMD2_TRAY_CTL 0x1b -#define CMDT_TRAY_CTL CMD2_TRAY_CTL -#define CMDL_TRAY_CTL 0x0d -#define CMDV_TRAY_CTL CMDL_TRAY_CTL - -#define CMD1_MULTISESS 0x8d -#define CMDL_MULTISESS 0x8c -#define CMDV_MULTISESS CMDL_MULTISESS - -#define CMD1_SUBCHANINF 0x11 -#define CMD2_SUBCHANINF 0x?? - -#define CMD1_ABORT 0x08 -#define CMD2_ABORT 0x08 -#define CMDT_ABORT 0x08 - -#define CMD2_x02 0x02 - -#define CMD2_SETSPEED 0xda - -#define CMD0_PATH_CHECK 0x00 -#define CMD1_PATH_CHECK 0x??? -#define CMD2_PATH_CHECK 0x??? -#define CMDT_PATH_CHECK 0x??? -#define CMDL_PATH_CHECK CMD0_PATH_CHECK -#define CMDV_PATH_CHECK CMD0_PATH_CHECK - -#define CMD0_SEEK 0x01 -#define CMD1_SEEK CMD0_SEEK -#define CMD2_SEEK 0x2b -#define CMDT_SEEK CMD2_SEEK -#define CMDL_SEEK CMD0_SEEK -#define CMDV_SEEK CMD0_SEEK - -#define CMD0_READ 0x02 -#define CMD1_READ 0x10 -#define CMD2_READ 0x28 -#define CMDT_READ CMD2_READ -#define CMDL_READ CMD0_READ -#define CMDV_READ CMD0_READ - -#define CMD0_READ_XA 0x03 -#define CMD2_READ_XA 0xd4 -#define CMD2_READ_XA2 0xd5 -#define CMDL_READ_XA CMD0_READ_XA /* really ?? */ -#define CMDV_READ_XA CMD0_READ_XA - -#define CMD0_READ_HEAD 0x04 - -#define CMD0_SPINUP 0x05 -#define CMD1_SPINUP 0x02 -#define CMD2_SPINUP CMD2_TRAY_CTL -#define CMDL_SPINUP CMD0_SPINUP -#define CMDV_SPINUP CMD0_SPINUP - -#define CMD0_SPINDOWN 0x06 /* really??? */ -#define CMD1_SPINDOWN 0x06 -#define CMD2_SPINDOWN CMD2_TRAY_CTL -#define CMDL_SPINDOWN 0x0d -#define CMDV_SPINDOWN CMD0_SPINDOWN - -#define CMD0_DIAG 0x07 - -#define CMD0_READ_UPC 0x08 -#define CMD1_READ_UPC 0x88 -#define CMD2_READ_UPC 0x??? -#define CMDL_READ_UPC CMD0_READ_UPC -#define CMDV_READ_UPC 0x8f - -#define CMD0_READ_ISRC 0x09 - -#define CMD0_PLAY 0x0a -#define CMD1_PLAY 0x??? -#define CMD2_PLAY 0x??? -#define CMDL_PLAY CMD0_PLAY -#define CMDV_PLAY CMD0_PLAY - -#define CMD0_PLAY_MSF 0x0b -#define CMD1_PLAY_MSF 0x0e -#define CMD2_PLAY_MSF 0x47 -#define CMDT_PLAY_MSF CMD2_PLAY_MSF -#define CMDL_PLAY_MSF 0x??? - -#define CMD0_PLAY_TI 0x0c -#define CMD1_PLAY_TI 0x0f - -#define CMD0_STATUS 0x81 -#define CMD1_STATUS 0x05 -#define CMD2_STATUS 0x00 -#define CMDT_STATUS CMD2_STATUS -#define CMDL_STATUS CMD0_STATUS -#define CMDV_STATUS CMD0_STATUS -#define CMD2_SEEK_LEADIN 0x00 - -#define CMD0_READ_ERR 0x82 -#define CMD1_READ_ERR CMD0_READ_ERR -#define CMD2_READ_ERR 0x03 -#define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */ -#define CMDL_READ_ERR CMD0_READ_ERR -#define CMDV_READ_ERR CMD0_READ_ERR - -#define CMD0_READ_VER 0x83 -#define CMD1_READ_VER CMD0_READ_VER -#define CMD2_READ_VER 0x12 -#define CMDT_READ_VER CMD2_READ_VER /* really ?? */ -#define CMDL_READ_VER CMD0_READ_VER -#define CMDV_READ_VER CMD0_READ_VER - -#define CMD0_SETMODE 0x84 -#define CMD1_SETMODE 0x09 -#define CMD2_SETMODE 0x55 -#define CMDT_SETMODE CMD2_SETMODE -#define CMDL_SETMODE CMD0_SETMODE - -#define CMD0_GETMODE 0x85 -#define CMD1_GETMODE 0x84 -#define CMD2_GETMODE 0x5a -#define CMDT_GETMODE CMD2_GETMODE -#define CMDL_GETMODE CMD0_GETMODE - -#define CMD0_SET_XA 0x86 - -#define CMD0_GET_XA 0x87 - -#define CMD0_CAPACITY 0x88 -#define CMD1_CAPACITY 0x85 -#define CMD2_CAPACITY 0x25 -#define CMDL_CAPACITY CMD0_CAPACITY /* missing in some firmware versions */ - -#define CMD0_READSUBQ 0x89 -#define CMD1_READSUBQ 0x87 -#define CMD2_READSUBQ 0x42 -#define CMDT_READSUBQ CMD2_READSUBQ -#define CMDL_READSUBQ CMD0_READSUBQ -#define CMDV_READSUBQ CMD0_READSUBQ - -#define CMD0_DISKCODE 0x8a - -#define CMD0_DISKINFO 0x8b -#define CMD1_DISKINFO CMD0_DISKINFO -#define CMD2_DISKINFO 0x43 -#define CMDT_DISKINFO CMD2_DISKINFO -#define CMDL_DISKINFO CMD0_DISKINFO -#define CMDV_DISKINFO CMD0_DISKINFO - -#define CMD0_READTOC 0x8c -#define CMD1_READTOC CMD0_READTOC -#define CMD2_READTOC 0x??? -#define CMDL_READTOC CMD0_READTOC -#define CMDV_READTOC CMD0_READTOC - -#define CMD0_PAU_RES 0x8d -#define CMD1_PAU_RES 0x0d -#define CMD2_PAU_RES 0x4b -#define CMDT_PAUSE CMD2_PAU_RES -#define CMDL_PAU_RES CMD0_PAU_RES -#define CMDV_PAUSE CMD0_PAU_RES - -#define CMD0_PACKET 0x8e -#define CMD1_PACKET CMD0_PACKET -#define CMD2_PACKET 0x??? -#define CMDL_PACKET CMD0_PACKET -#define CMDV_PACKET 0x??? - -/*==========================================================================*/ -/*==========================================================================*/ -#endif _LINUX_SBPCD_H -/*==========================================================================*/ -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-indent-level: 8 - * c-brace-imaginary-offset: 0 - * c-brace-offset: -8 - * c-argdecl-indent: 8 - * c-label-offset: -8 - * c-continued-statement-offset: 8 - * c-continued-brace-offset: 0 - * End: - */ diff --git a/include/linux/scc.h b/include/linux/scc.h index 275cbbb77..c8a440538 100644 --- a/include/linux/scc.h +++ b/include/linux/scc.h @@ -3,6 +3,8 @@ #ifndef _SCC_H #define _SCC_H +#include <linux/config.h> + /* selection of hardware types */ #define PA0HZP 0x00 /* hardware type for PA0HZP SCC card and compatible */ @@ -184,7 +186,7 @@ enum {TX_OFF, TX_ON}; /* command for scc_key_trx() */ #define RXINT 0x04 #define SPINT 0x06 -#ifdef SCC_DELAY +#ifdef CONFIG_SCC_DELAY #define Inb(port) inb_p(port) #define Outb(port, val) outb_p(val, port) #else diff --git a/include/linux/sched.h b/include/linux/sched.h index 71411900b..3afeaa33c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -19,6 +19,7 @@ extern unsigned long event; #include <linux/smp.h> #include <linux/tty.h> #include <linux/sem.h> +#include <linux/signal.h> /* * cloning flags: @@ -165,14 +166,14 @@ struct mm_struct { struct signal_struct { atomic_t count; - struct sigaction action[32]; + struct k_sigaction action[_NSIG]; spinlock_t siglock; }; #define INIT_SIGNALS { \ ATOMIC_INIT(1), \ - { {0,}, }, \ + { {{0,}}, }, \ SPIN_LOCK_UNLOCKED } struct task_struct { @@ -180,10 +181,8 @@ struct task_struct { volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ long counter; long priority; - unsigned long signal; - unsigned long blocked; /* bitmap of masked signals */ unsigned long flags; /* per process flags, defined below */ - int errno; + int sigpending; long debugreg[8]; /* Hardware debugging registers */ struct exec_domain *exec_domain; /* various fields */ @@ -196,11 +195,10 @@ struct task_struct { unsigned long personality; int dumpable:1; int did_exec:1; - /* shouldn't this be pid_t? */ - int pid; - int pgrp; - int tty_old_pgrp; - int session; + pid_t pid; + pid_t pgrp; + pid_t tty_old_pgrp; + pid_t session; /* boolean value for session group leader */ int leader; int ngroups; @@ -220,8 +218,8 @@ struct task_struct { struct task_struct **tarray_ptr; struct wait_queue *wait_chldexit; /* for wait4() */ - unsigned short uid,euid,suid,fsuid; - unsigned short gid,egid,sgid,fsgid; + uid_t uid,euid,suid,fsuid; + gid_t gid,egid,sgid,fsgid; unsigned long timeout, policy, rt_priority; unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_incr, it_prof_incr, it_virt_incr; @@ -257,6 +255,8 @@ struct task_struct { struct mm_struct *mm; /* signal handlers */ struct signal_struct *sig; + sigset_t signal, blocked; + struct signal_queue *sigqueue, **sigqueue_tail; /* SMP state */ int has_cpu; int processor; @@ -271,17 +271,16 @@ struct task_struct { */ #define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ /* Not implemented yet, only for 486*/ -#define PF_PTRACED 0x00000010 /* set if ptrace (0) has been called. */ +#define PF_STARTING 0x00000002 /* being created */ +#define PF_EXITING 0x00000004 /* getting shut down */ +#define PF_PTRACED 0x00000010 /* set if ptrace (0) has been called */ #define PF_TRACESYS 0x00000020 /* tracing system calls */ #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ #define PF_DUMPCORE 0x00000200 /* dumped core */ #define PF_SIGNALED 0x00000400 /* killed by a signal */ -#define PF_STARTING 0x00000002 /* being created */ -#define PF_EXITING 0x00000004 /* getting shut down */ - -#define PF_USEDFPU 0x00100000 /* Process used the FPU this quantum (SMP only) */ +#define PF_USEDFPU 0x00100000 /* task used FPU this quantum (SMP) */ #define PF_DTRACE 0x00200000 /* delayed trace (used on m68k) */ #define PF_ONSIGSTK 0x00400000 /* works on signal stack (m68k only) */ @@ -308,7 +307,7 @@ struct task_struct { * your own risk!. Base=0, limit=0x1fffff (=2MB) */ #define INIT_TASK \ -/* state etc */ { 0,DEF_PRIORITY,DEF_PRIORITY,0,0,0,0, \ +/* state etc */ { 0,DEF_PRIORITY,DEF_PRIORITY,0,0, \ /* debugregs */ { 0, }, \ /* exec domain */&default_exec_domain, \ /* binfmt */ NULL, \ @@ -336,7 +335,7 @@ struct task_struct { /* fs */ &init_fs, \ /* files */ &init_files, \ /* mm */ &init_mm, \ -/* signals */ &init_signals, \ +/* signals */ &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, \ /* SMP */ 0,0,0,0, \ /* locks */ INIT_LOCKS \ } @@ -445,15 +444,61 @@ extern void FASTCALL(wake_up(struct wait_queue ** p)); extern void FASTCALL(wake_up_interruptible(struct wait_queue ** p)); extern void FASTCALL(wake_up_process(struct task_struct * tsk)); -extern void notify_parent(struct task_struct * tsk, int signal); extern void release(struct task_struct * p); -extern void force_sig(unsigned long sig,struct task_struct * p); -extern int send_sig(unsigned long sig,struct task_struct * p,int priv); extern int in_group_p(gid_t grp); +extern void flush_signals(struct task_struct *); +extern void flush_signal_handlers(struct task_struct *); +extern int dequeue_signal(sigset_t *block, siginfo_t *); +extern int send_sig_info(int, struct siginfo *info, struct task_struct *); +extern int force_sig_info(int, struct siginfo *info, struct task_struct *); +extern int kill_pg_info(int, struct siginfo *info, pid_t); +extern int kill_sl_info(int, struct siginfo *info, pid_t); +extern int kill_proc_info(int, struct siginfo *info, pid_t); +extern int kill_something_info(int, struct siginfo *info, int); +extern void notify_parent(struct task_struct * tsk, int); +extern void force_sig(int sig, struct task_struct * p); +extern int send_sig(int sig, struct task_struct * p, int priv); +extern int kill_pg(pid_t, int, int); +extern int kill_sl(pid_t, int, int); +extern int kill_proc(pid_t, int, int); +extern int do_sigaction(int sig, const struct k_sigaction *act, + struct k_sigaction *oact); + extern inline int signal_pending(struct task_struct *p) { - return (p->signal &~ p->blocked) != 0; + return (p->sigpending != 0); +} + +/* Reevaluate whether the task has signals pending delivery. + This is required every time the blocked sigset_t changes. + All callers should have t->sigmask_lock. */ + +static inline void recalc_sigpending(struct task_struct *t) +{ + unsigned long ready; + long i; + + switch (_NSIG_WORDS) { + default: + for (i = _NSIG_WORDS, ready = 0; --i >= 0 ;) + ready |= t->signal.sig[i] &~ t->blocked.sig[i]; + break; + + case 4: ready = t->signal.sig[3] &~ t->blocked.sig[3]; + ready |= t->signal.sig[2] &~ t->blocked.sig[2]; + ready |= t->signal.sig[1] &~ t->blocked.sig[1]; + ready |= t->signal.sig[0] &~ t->blocked.sig[0]; + break; + + case 2: ready = t->signal.sig[1] &~ t->blocked.sig[1]; + ready |= t->signal.sig[0] &~ t->blocked.sig[0]; + break; + + case 1: ready = t->signal.sig[0] &~ t->blocked.sig[0]; + } + + t->sigpending = (ready != 0); } extern int request_irq(unsigned int irq, @@ -556,22 +601,6 @@ extern inline void remove_wait_queue(struct wait_queue ** p, struct wait_queue * write_unlock_irqrestore(&waitqueue_lock, flags); } -extern inline void poll_wait(struct wait_queue ** wait_address, poll_table * p) -{ - struct poll_table_entry * entry; - - if (!p || !wait_address) - return; - if (p->nr >= __MAX_POLL_TABLE_ENTRIES) - return; - entry = p->entry + p->nr; - entry->wait_address = wait_address; - entry->wait.task = current; - entry->wait.next = NULL; - add_wait_queue(wait_address,&entry->wait); - p->nr++; -} - #define REMOVE_LINKS(p) do { unsigned long flags; \ write_lock_irqsave(&tasklist_lock, flags); \ (p)->next_task->prev_task = (p)->prev_task; \ diff --git a/include/linux/signal.h b/include/linux/signal.h index 9d1afa91c..0dd75b886 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -2,5 +2,204 @@ #define _LINUX_SIGNAL_H #include <asm/signal.h> +#include <asm/siginfo.h> -#endif +#ifdef __KERNEL__ +/* + * Real Time signals may be queued. + */ + +struct signal_queue +{ + struct signal_queue *next; + siginfo_t info; +}; + +/* + * Define some primitives to manipulate sigset_t. + */ + +#ifndef __HAVE_ARCH_SIG_BITOPS +#include <asm/bitops.h> + +/* We don't use <asm/bitops.h> for these because there is no need to + be atomic. */ +extern inline void sigaddset(sigset_t *set, int _sig) +{ + unsigned long sig = _sig - 1; + if (_NSIG_WORDS == 1) + set->sig[0] |= 1UL << sig; + else + set->sig[sig / _NSIG_BPW] |= 1UL << (sig % _NSIG_BPW); +} + +extern inline void sigdelset(sigset_t *set, int _sig) +{ + unsigned long sig = _sig - 1; + if (_NSIG_WORDS == 1) + set->sig[0] &= ~(1UL << sig); + else + set->sig[sig / _NSIG_BPW] &= ~(1UL << (sig % _NSIG_BPW)); +} + +extern inline int sigismember(sigset_t *set, int _sig) +{ + unsigned long sig = _sig - 1; + if (_NSIG_WORDS == 1) + return 1 & (set->sig[0] >> sig); + else + return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW)); +} + +extern inline int sigfindinword(unsigned long word) +{ + return ffz(~word); +} + +#define sigmask(sig) (1UL << ((sig) - 1)) + +#endif /* __HAVE_ARCH_SIG_BITOPS */ + +#ifndef __HAVE_ARCH_SIG_SETOPS +#include <linux/string.h> + +#define _SIG_SET_BINOP(name, op) \ +extern inline void name(sigset_t *r, const sigset_t *a, const sigset_t *b) \ +{ \ + unsigned long a0, a1, a2, a3, b0, b1, b2, b3; \ + unsigned long i; \ + \ + for (i = 0; i < _NSIG_WORDS/4; ++i) { \ + a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; \ + a2 = a->sig[4*i+2]; a3 = a->sig[4*i+3]; \ + b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; \ + b2 = b->sig[4*i+2]; b3 = b->sig[4*i+3]; \ + r->sig[4*i+0] = op(a0, b0); \ + r->sig[4*i+1] = op(a1, b1); \ + r->sig[4*i+2] = op(a2, b2); \ + r->sig[4*i+3] = op(a3, b3); \ + } \ + switch (_NSIG_WORDS % 4) { \ + case 3: \ + a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; a2 = a->sig[4*i+2]; \ + b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; b2 = b->sig[4*i+2]; \ + r->sig[4*i+0] = op(a0, b0); \ + r->sig[4*i+1] = op(a1, b1); \ + r->sig[4*i+2] = op(a2, b2); \ + break; \ + case 2: \ + a0 = a->sig[4*i+0]; a1 = a->sig[4*i+1]; \ + b0 = b->sig[4*i+0]; b1 = b->sig[4*i+1]; \ + r->sig[4*i+0] = op(a0, b0); \ + r->sig[4*i+1] = op(a1, b1); \ + break; \ + case 1: \ + a0 = a->sig[4*i+0]; b0 = b->sig[4*i+0]; \ + r->sig[4*i+0] = op(a0, b0); \ + break; \ + } \ +} + +#define _sig_or(x,y) ((x) | (y)) +_SIG_SET_BINOP(sigorsets, _sig_or) + +#define _sig_and(x,y) ((x) & (y)) +_SIG_SET_BINOP(sigandsets, _sig_and) + +#define _sig_nand(x,y) ((x) & ~(y)) +_SIG_SET_BINOP(signandsets, _sig_nand) + +#undef _SIG_SET_BINOP +#undef _sig_or +#undef _sig_and +#undef _sig_nand + +#define _SIG_SET_OP(name, op) \ +extern inline void name(sigset_t *set) \ +{ \ + unsigned long i; \ + \ + for (i = 0; i < _NSIG_WORDS/4; ++i) { \ + set->sig[4*i+0] = op(set->sig[4*i+0]); \ + set->sig[4*i+1] = op(set->sig[4*i+1]); \ + set->sig[4*i+2] = op(set->sig[4*i+2]); \ + set->sig[4*i+3] = op(set->sig[4*i+3]); \ + } \ + switch (_NSIG_WORDS % 4) { \ + case 3: set->sig[4*i+2] = op(set->sig[4*i+2]); \ + case 2: set->sig[4*i+1] = op(set->sig[4*i+1]); \ + case 1: set->sig[4*i+0] = op(set->sig[4*i+0]); \ + } \ +} + +#define _sig_not(x) (~(x)) +_SIG_SET_OP(signotset, _sig_not) + +#undef _SIG_SET_OP +#undef _sig_not + +extern inline void sigemptyset(sigset_t *set) +{ + switch (_NSIG_WORDS) { + default: + memset(set, 0, sizeof(sigset_t)); + break; + case 2: set->sig[1] = 0; + case 1: set->sig[0] = 0; + break; + } +} + +extern inline void sigfillset(sigset_t *set) +{ + switch (_NSIG_WORDS) { + default: + memset(set, -1, sizeof(sigset_t)); + break; + case 2: set->sig[1] = -1; + case 1: set->sig[0] = -1; + break; + } +} + +/* Some extensions for manipulating the low 32 signals in particular. */ + +extern inline void sigaddsetmask(sigset_t *set, unsigned long mask) +{ + set->sig[0] |= mask; +} + +extern inline void sigdelsetmask(sigset_t *set, unsigned long mask) +{ + set->sig[0] &= ~mask; +} + +extern inline void siginitset(sigset_t *set, unsigned long mask) +{ + set->sig[0] = mask; + switch (_NSIG_WORDS) { + default: + memset(&set->sig[1], 0, sizeof(long)*(_NSIG_WORDS-1)); + break; + case 2: set->sig[1] = 0; + case 1: + } +} + +extern inline void siginitsetinv(sigset_t *set, unsigned long mask) +{ + set->sig[0] = ~mask; + switch (_NSIG_WORDS) { + default: + memset(&set->sig[1], -1, sizeof(long)*(_NSIG_WORDS-1)); + break; + case 2: set->sig[1] = -1; + case 1: + } +} + +#endif /* __HAVE_ARCH_SIG_SETOPS */ + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_SIGNAL_H */ diff --git a/include/linux/sjcd.h b/include/linux/sjcd.h index 0aa5e7146..e69de29bb 100644 --- a/include/linux/sjcd.h +++ b/include/linux/sjcd.h @@ -1,181 +0,0 @@ -/* - * Definitions for a Sanyo CD-ROM interface. - * - * Copyright (C) 1995 Vadim V. Model - * model@cecmow.enet.dec.com - * vadim@rbrf.msk.su - * vadim@ipsun.ras.ru - * Eric van der Maarel - * H.T.M.v.d.Maarel@marin.nl - * - * This information is based on mcd.c from M. Harriss and sjcd102.lst from - * E. Moenkeberg. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __SJCD_H__ -#define __SJCD_H__ - -/* - * Change this to set the I/O port address as default. More flexibility - * come with setup implementation. - */ -#define SJCD_BASE_ADDR 0x340 - -/* - * Change this to set the irq as default. Really SANYO do not use interrupts - * at all. - */ -#define SJCD_INTR_NR 0 - -/* - * Change this to set the dma as default value. really SANYO does not use - * direct memory access at all. - */ -#define SJCD_DMA_NR 0 - -/* - * Macros which allow us to find out the status of the drive. - */ -#define SJCD_STATUS_AVAILABLE( x ) (((x)&0x02)==0) -#define SJCD_DATA_AVAILABLE( x ) (((x)&0x01)==0) - -/* - * Port access macro. Three ports are available: S-data port (command port), - * status port (read only) and D-data port (read only). - */ -#define SJCDPORT( x ) ( sjcd_base + ( x ) ) -#define SJCD_STATUS_PORT SJCDPORT( 1 ) -#define SJCD_S_DATA_PORT SJCDPORT( 0 ) -#define SJCD_COMMAND_PORT SJCDPORT( 0 ) -#define SJCD_D_DATA_PORT SJCDPORT( 2 ) - -/* - * Drive info bits. Drive info available as first (mandatory) byte of - * command completion status. - */ -#define SST_NOT_READY 0x10 /* no disk in the drive (???) */ -#define SST_MEDIA_CHANGED 0x20 /* disk is changed */ -#define SST_DOOR_OPENED 0x40 /* door is open */ - -/* commands */ - -#define SCMD_EJECT_TRAY 0xD0 /* eject tray if not locked */ -#define SCMD_LOCK_TRAY 0xD2 /* lock tray when in */ -#define SCMD_UNLOCK_TRAY 0xD4 /* unlock tray when in */ -#define SCMD_CLOSE_TRAY 0xD6 /* load tray in */ - -#define SCMD_RESET 0xFA /* soft reset */ -#define SCMD_GET_STATUS 0x80 -#define SCMD_GET_VERSION 0xCC - -#define SCMD_DATA_READ 0xA0 /* are the same, depend on mode&args */ -#define SCMD_SEEK 0xA0 -#define SCMD_PLAY 0xA0 - -#define SCMD_GET_QINFO 0xA8 - -#define SCMD_SET_MODE 0xC4 -#define SCMD_MODE_PLAY 0xE0 -#define SCMD_MODE_COOKED (0xF8 & ~0x20) -#define SCMD_MODE_RAW 0xF9 -#define SCMD_MODE_x20_BIT 0x20 /* What is it for ? */ - -#define SCMD_SET_VOLUME 0xAE -#define SCMD_PAUSE 0xE0 -#define SCMD_STOP 0xE0 - -#define SCMD_GET_DISK_INFO 0xAA - -/* - * Some standard arguments for SCMD_GET_DISK_INFO. - */ -#define SCMD_GET_1_TRACK 0xA0 /* get the first track information */ -#define SCMD_GET_L_TRACK 0xA1 /* get the last track information */ -#define SCMD_GET_D_SIZE 0xA2 /* get the whole disk information */ - -/* - * Borrowed from hd.c. Allows to optimize multiple port read commands. - */ -#define S_READ_DATA( port, buf, nr ) insb( port, buf, nr ) - -/* - * We assume that there are no audio disks with TOC length more than this - * number (I personally have never seen disks with more than 20 fragments). - */ -#define SJCD_MAX_TRACKS 100 - -struct msf { - unsigned char min; - unsigned char sec; - unsigned char frame; -}; - -struct sjcd_hw_disk_info { - unsigned char track_control; - unsigned char track_no; - unsigned char x, y, z; - union { - unsigned char track_no; - struct msf track_msf; - } un; -}; - -struct sjcd_hw_qinfo { - unsigned char track_control; - unsigned char track_no; - unsigned char x; - struct msf rel; - struct msf abs; -}; - -struct sjcd_play_msf { - struct msf start; - struct msf end; -}; - -struct sjcd_disk_info { - unsigned char first; - unsigned char last; - struct msf disk_length; - struct msf first_track; -}; - -struct sjcd_toc { - unsigned char ctrl_addr; - unsigned char track; - unsigned char point_index; - struct msf track_time; - struct msf disk_time; -}; - -#if defined( SJCD_GATHER_STAT ) - -struct sjcd_stat { - int ticks; - int tticks[ 8 ]; - int idle_ticks; - int start_ticks; - int mode_ticks; - int read_ticks; - int data_ticks; - int stop_ticks; - int stopping_ticks; -}; - -#endif - -#endif diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a2617b15c..3668712d8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -90,15 +90,10 @@ struct sk_buff arp; /* Has IP/ARP resolution finished */ unsigned char tries, /* Times tried */ inclone, /* Inline clone */ - priority, pkt_type, /* Packet class */ pkt_bridged, /* Tracker for bridging */ ip_summed; /* Driver fed us an IP checksum */ -#define PACKET_HOST 0 /* To us */ -#define PACKET_BROADCAST 1 /* To all */ -#define PACKET_MULTICAST 2 /* To group */ -#define PACKET_OTHERHOST 3 /* To someone else */ -#define PACKET_NDISC 17 /* Outgoing NDISC packet */ + __u32 priority; atomic_t users; /* User count - see datagram.c,tcp.c */ unsigned short protocol; /* Packet protocol from driver. */ unsigned short security; /* Security level of packet */ @@ -447,13 +442,17 @@ here: ; return skb->data; } -extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len) +extern __inline__ char *__skb_pull(struct sk_buff *skb, unsigned int len) { + skb->len-=len; + return skb->data+=len; +} + +extern __inline__ unsigned char * skb_pull(struct sk_buff *skb, unsigned int len) +{ if (len > skb->len) return NULL; - skb->data+=len; - skb->len-=len; - return skb->data; + return __skb_pull(skb,len); } extern __inline__ int skb_headroom(struct sk_buff *skb) @@ -472,11 +471,16 @@ extern __inline__ void skb_reserve(struct sk_buff *skb, unsigned int len) skb->tail+=len; } +extern __inline__ void __skb_trim(struct sk_buff *skb, unsigned int len) +{ + skb->len = len; + skb->tail = skb->data+len; +} + extern __inline__ void skb_trim(struct sk_buff *skb, unsigned int len) { if (skb->len > len) { - skb->len = len; - skb->tail = skb->data+len; + __skb_trim(skb, len); } } @@ -515,8 +519,15 @@ extern __inline__ void skb_orphan(struct sk_buff *skb) skb->sk = NULL; } +extern __inline__ void skb_queue_purge(struct sk_buff_head *list) +{ + struct sk_buff *skb; + while ((skb=skb_dequeue(list))!=NULL) + kfree_skb(skb,0); +} + extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err); -extern unsigned int datagram_poll(struct socket *sock, poll_table *wait); +extern unsigned int datagram_poll(struct socket *sock, struct poll_table_struct *wait); extern int skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size); extern int skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size); extern void skb_free_datagram(struct sock * sk, struct sk_buff *skb); diff --git a/include/linux/socket.h b/include/linux/socket.h index 96ec54d1d..86d2b5665 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -12,8 +12,7 @@ typedef unsigned short sa_family_t; * 1003.1g requires sa_family_t and that sa_data is char. */ -struct sockaddr -{ +struct sockaddr { sa_family_t sa_family; /* address family, AF_xxx */ char sa_data[14]; /* 14 bytes of protocol address */ }; @@ -29,8 +28,7 @@ struct linger { * belong in an obscure libc emulation or the bin. */ -struct msghdr -{ +struct msghdr { void * msg_name; /* Socket name */ int msg_namelen; /* Length of name */ struct iovec * msg_iov; /* Data blocks */ @@ -57,7 +55,8 @@ struct cmsghdr { * Table 5-14 of POSIX 1003.1g */ -#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr(mhdr, cmsg) +#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg)) +#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg)) #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) @@ -65,18 +64,19 @@ struct cmsghdr { #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) -#define CMSG_FIRSTHDR(msg) ((msg)->msg_controllen >= sizeof(struct cmsghdr) ? \ - (struct cmsghdr *)(msg)->msg_control : \ - (struct cmsghdr *)NULL) +#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \ + (struct cmsghdr *)(ctl) : \ + (struct cmsghdr *)NULL) +#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen) /* * This mess will go away with glibc */ #ifdef __KERNEL__ -#define KINLINE extern __inline__ +#define __KINLINE extern __inline__ #else -#define KINLINE static +#define __KINLINE static #endif @@ -84,20 +84,23 @@ struct cmsghdr { * Get the next cmsg header */ -KINLINE struct cmsghdr * cmsg_nxthdr(struct msghdr *mhdr, - struct cmsghdr *cmsg) +__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size, + struct cmsghdr *__cmsg) { - unsigned char * ptr; + unsigned char * __ptr; - if (cmsg->cmsg_len < sizeof(struct cmsghdr)) - { + if (__cmsg->cmsg_len < sizeof(struct cmsghdr)) return NULL; - } - ptr = ((unsigned char *) cmsg) + CMSG_ALIGN(cmsg->cmsg_len); - if (ptr >= (unsigned char *) mhdr->msg_control + mhdr->msg_controllen) + __ptr = ((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len); + if (__ptr >= (unsigned char *) __ctl + __size) return NULL; - return (struct cmsghdr *) ptr; + return (struct cmsghdr *) __ptr; +} + +__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg) +{ + return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg); } /* "Socket"-level control message types: */ @@ -106,8 +109,7 @@ KINLINE struct cmsghdr * cmsg_nxthdr(struct msghdr *mhdr, #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ #define SCM_CONNECT 0x03 /* rw: struct scm_connect */ -struct ucred -{ +struct ucred { __kernel_pid_t pid; __kernel_uid_t uid; __kernel_gid_t gid; @@ -132,6 +134,9 @@ struct ucred #define AF_NETBEUI 13 /* Reserved for 802.2LLC project*/ #define AF_SECURITY 14 /* Security callback pseudo AF */ #define pseudo_AF_KEY 15 /* PF_KEY key management API */ +#define AF_NETLINK 16 +#define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */ +#define AF_PACKET 17 /* Packet family */ #define AF_MAX 32 /* For now.. */ /* Protocol families, same as address families. */ @@ -152,6 +157,9 @@ struct ucred #define PF_NETBEUI AF_NETBEUI #define PF_SECURITY AF_SECURITY #define PF_KEY pseudo_AF_KEY +#define PF_NETLINK AF_NETLINK +#define PF_ROUTE AF_ROUTE +#define PF_PACKET AF_PACKET #define PF_MAX AF_MAX @@ -184,6 +192,9 @@ struct ucred /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */ #define SOL_IP 0 +/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */ +#define SOL_TCP 6 +#define SOL_UDP 17 #define SOL_IPV6 41 #define SOL_ICMPV6 58 #define SOL_RAW 255 @@ -194,8 +205,7 @@ struct ucred #define SOL_ROSE 260 #define SOL_DECNET 261 #define SOL_X25 262 -#define SOL_TCP 6 -#define SOL_UDP 17 +#define SOL_PACKET 263 /* IPX options */ #define IPX_TYPE 1 @@ -204,24 +214,19 @@ struct ucred #define TCP_NODELAY 1 #define TCP_MAXSEG 2 -/* The various priorities. */ -#define SOPRI_INTERACTIVE 0 -#define SOPRI_NORMAL 1 -#define SOPRI_BACKGROUND 2 - #ifdef __KERNEL__ extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, int len); -extern unsigned int csum_partial_copy_fromiovecend(unsigned char *kdata, - struct iovec *iov, - int offset, - int len, int csum); +extern int csum_partial_copy_fromiovecend(unsigned char *kdata, + struct iovec *iov, + int offset, + int len, int *csump); extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen); extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr); -extern void put_cmsg(struct msghdr*, int level, int type, int len, void *data); +extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); #endif #endif /* _LINUX_SOCKET_H */ diff --git a/include/linux/sockios.h b/include/linux/sockios.h index 5147dd23c..5465bc6b8 100644 --- a/include/linux/sockios.h +++ b/include/linux/sockios.h @@ -53,18 +53,19 @@ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 -#define SIOGIFINDEX 0x8933 /* name -> if_index mapping */ -#define SIOGIFNAME 0x8934 /* if_index -> name mapping */ -#define SIOCGIFCOUNT 0x8935 /* get number of interfaces */ +#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ +#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ +#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ +#define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ +#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ +#define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ /* ARP cache control calls. */ -#define OLD_SIOCDARP 0x8950 /* old delete ARP table entry */ -#define OLD_SIOCGARP 0x8951 /* old get ARP table entry */ -#define OLD_SIOCSARP 0x8952 /* old set ARP table entry */ + /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ diff --git a/include/linux/sonycd535.h b/include/linux/sonycd535.h index 5dea1ef16..e69de29bb 100644 --- a/include/linux/sonycd535.h +++ b/include/linux/sonycd535.h @@ -1,183 +0,0 @@ -#ifndef SONYCD535_H -#define SONYCD535_H - -/* - * define all the commands recognized by the CDU-531/5 - */ -#define SONY535_REQUEST_DRIVE_STATUS_1 (0x80) -#define SONY535_REQUEST_SENSE (0x82) -#define SONY535_REQUEST_DRIVE_STATUS_2 (0x84) -#define SONY535_REQUEST_ERROR_STATUS (0x86) -#define SONY535_REQUEST_AUDIO_STATUS (0x88) -#define SONY535_INQUIRY (0x8a) - -#define SONY535_SET_INACTIVITY_TIME (0x90) - -#define SONY535_SEEK_AND_READ_N_BLOCKS_1 (0xa0) -#define SONY535_SEEK_AND_READ_N_BLOCKS_2 (0xa4) -#define SONY535_PLAY_AUDIO (0xa6) - -#define SONY535_REQUEST_DISC_CAPACITY (0xb0) -#define SONY535_REQUEST_TOC_DATA (0xb2) -#define SONY535_REQUEST_SUB_Q_DATA (0xb4) -#define SONY535_REQUEST_ISRC (0xb6) -#define SONY535_REQUEST_UPC_EAN (0xb8) - -#define SONY535_SET_DRIVE_MODE (0xc0) -#define SONY535_REQUEST_DRIVE_MODE (0xc2) -#define SONY535_SET_RETRY_COUNT (0xc4) - -#define SONY535_DIAGNOSTIC_1 (0xc6) -#define SONY535_DIAGNOSTIC_4 (0xcc) -#define SONY535_DIAGNOSTIC_5 (0xce) - -#define SONY535_EJECT_CADDY (0xd0) -#define SONY535_DISABLE_EJECT_BUTTON (0xd2) -#define SONY535_ENABLE_EJECT_BUTTON (0xd4) - -#define SONY535_HOLD (0xe0) -#define SONY535_AUDIO_PAUSE_ON_OFF (0xe2) -#define SONY535_SET_VOLUME (0xe8) - -#define SONY535_STOP (0xf0) -#define SONY535_SPIN_UP (0xf2) -#define SONY535_SPIN_DOWN (0xf4) - -#define SONY535_CLEAR_PARAMETERS (0xf6) -#define SONY535_CLEAR_ENDING_ADDRESS (0xf8) - -/* - * define some masks - */ -#define SONY535_DATA_NOT_READY_BIT (0x1) -#define SONY535_RESULT_NOT_READY_BIT (0x2) - -/* - * drive status 1 - */ -#define SONY535_STATUS1_COMMAND_ERROR (0x1) -#define SONY535_STATUS1_DATA_ERROR (0x2) -#define SONY535_STATUS1_SEEK_ERROR (0x4) -#define SONY535_STATUS1_DISC_TYPE_ERROR (0x8) -#define SONY535_STATUS1_NOT_SPINNING (0x10) -#define SONY535_STATUS1_EJECT_BUTTON_PRESSED (0x20) -#define SONY535_STATUS1_CADDY_NOT_INSERTED (0x40) -#define SONY535_STATUS1_BYTE_TWO_FOLLOWS (0x80) - -/* - * drive status 2 - */ -#define SONY535_CDD_LOADING_ERROR (0x7) -#define SONY535_CDD_NO_DISC (0x8) -#define SONY535_CDD_UNLOADING_ERROR (0x9) -#define SONY535_CDD_CADDY_NOT_INSERTED (0xd) -#define SONY535_ATN_RESET_OCCURRED (0x2) -#define SONY535_ATN_DISC_CHANGED (0x4) -#define SONY535_ATN_RESET_AND_DISC_CHANGED (0x6) -#define SONY535_ATN_EJECT_IN_PROGRESS (0xe) -#define SONY535_ATN_BUSY (0xf) - -/* - * define some parameters - */ -#define SONY535_AUDIO_DRIVE_MODE (0) -#define SONY535_CDROM_DRIVE_MODE (0xe0) - -#define SONY535_PLAY_OP_PLAYBACK (0) -#define SONY535_PLAY_OP_ENTER_HOLD (1) -#define SONY535_PLAY_OP_SET_AUDIO_ENDING_ADDR (2) -#define SONY535_PLAY_OP_SCAN_FORWARD (3) -#define SONY535_PLAY_OP_SCAN_BACKWARD (4) - -/* - * convert from msf format to block number - */ -#define SONY_BLOCK_NUMBER(m,s,f) (((m)*60L+(s))*75L+(f)) -#define SONY_BLOCK_NUMBER_MSF(x) (((x)[0]*60L+(x)[1])*75L+(x)[2]) - -/* - * error return values from the doSonyCmd() routines - */ -#define TIME_OUT (-1) -#define NO_CDROM (-2) -#define BAD_STATUS (-3) -#define CD_BUSY (-4) -#define NOT_DATA_CD (-5) -#define NO_ROOM (-6) - -#define LOG_START_OFFSET 150 /* Offset of first logical sector */ - -#define SONY_JIFFIES_TIMEOUT (5*HZ) /* Maximum time - the drive will wait/try for an - operation */ -#define SONY_READY_RETRIES (50000) /* How many times to retry a - spin waiting for a register - to come ready */ -#define SONY535_FAST_POLLS (10000) /* how many times recheck - status waiting for a data - to become ready */ - -typedef unsigned char Byte; - -/* - * This is the complete status returned from the drive configuration request - * command. - */ -struct s535_sony_drive_config -{ - char vendor_id[8]; - char product_id[16]; - char product_rev_level[4]; -}; - -/* The following is returned from the request sub-q data command */ -struct s535_sony_subcode -{ - unsigned char address :4; - unsigned char control :4; - unsigned char track_num; - unsigned char index_num; - unsigned char rel_msf[3]; - unsigned char abs_msf[3]; -}; - -struct s535_sony_disc_capacity -{ - Byte mFirstTrack, sFirstTrack, fFirstTrack; - Byte mLeadOut, sLeadOut, fLeadOut; -}; - -/* - * The following is returned from the request TOC (Table Of Contents) command. - * (last_track_num-first_track_num+1) values are valid in tracks. - */ -struct s535_sony_toc -{ - unsigned char reserved0 :4; - unsigned char control0 :4; - unsigned char point0; - unsigned char first_track_num; - unsigned char reserved0a; - unsigned char reserved0b; - unsigned char reserved1 :4; - unsigned char control1 :4; - unsigned char point1; - unsigned char last_track_num; - unsigned char dummy1; - unsigned char dummy2; - unsigned char reserved2 :4; - unsigned char control2 :4; - unsigned char point2; - unsigned char lead_out_start_msf[3]; - struct - { - unsigned char reserved :4; - unsigned char control :4; - unsigned char track; - unsigned char track_start_msf[3]; - } tracks[100]; - - unsigned int lead_out_start_lba; -}; - -#endif /* SONYCD535_H */ diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h index bfd28359e..e48c0b079 100644 --- a/include/linux/soundcard.h +++ b/include/linux/soundcard.h @@ -599,6 +599,7 @@ typedef struct buffmem_desc { #define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21) #define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22) +#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int) /* * Application's profile defines the way how playback underrun situations should be handled. diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 587aaa847..1f9ab2bf8 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -150,14 +150,15 @@ enum NET_IPV4_RFC1812_FILTER, NET_IPV4_LOG_MARTIANS, NET_IPV4_SOURCE_ROUTE, - NET_IPV4_ADDRMASK_AGENT, - NET_IPV4_BOOTP_AGENT, + NET_IPV4_SEND_REDIRECTS, + NET_IPV4_AUTOCONFIG, NET_IPV4_BOOTP_RELAY, - NET_IPV4_FIB_MODEL, + NET_IPV4_PROXY_ARP, NET_IPV4_NO_PMTU_DISC, NET_IPV4_ACCEPT_REDIRECTS, NET_IPV4_SECURE_REDIRECTS, NET_IPV4_RFC1620_REDIRECTS, + NET_IPV4_RTCACHE_FLUSH, NET_IPV4_TCP_SYN_RETRIES, NET_IPV4_IPFRAG_HIGH_THRESH, NET_IPV4_IPFRAG_LOW_THRESH, @@ -176,6 +177,14 @@ enum NET_TCP_STDURG, NET_TCP_SYN_TAILDROP, NET_TCP_MAX_SYN_BACKLOG, + NET_IPV4_LOCAL_PORT_RANGE, + NET_IPV4_ICMP_ECHO_IGNORE_ALL, + NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, + NET_IPV4_ICMP_SOURCEQUENCH_RATE, + NET_IPV4_ICMP_DESTUNREACH_RATE, + NET_IPV4_ICMP_TIMEEXCEED_RATE, + NET_IPV4_ICMP_PARAMPROB_RATE, + NET_IPV4_ICMP_ECHOREPLY_RATE }; @@ -198,6 +207,8 @@ enum { NET_IPV6_RTR_SOLICITS, NET_IPV6_RTR_SOLICIT_INTERVAL, NET_IPV6_RTR_SOLICIT_DELAY, + + NET_IPV6_ICMPV6_TIME, }; /* /proc/sys/net/ipx */ @@ -291,6 +302,14 @@ enum { /* CTL_DEBUG names: */ /* CTL_DEV names: */ +enum { + DEV_CDROM = 1, +}; + +/* /proc/sys/dev/cdrom */ +enum { + DEV_CDROM_INFO = 1, +}; #ifdef __KERNEL__ diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index eb443b269..7c5167fa8 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -361,17 +361,14 @@ sv_bread (struct super_block *sb, kdev_t dev, unsigned int block) * Function prototypes */ -extern int sysv_lookup(struct inode * dir,const char * name, int len, - struct inode ** result); -extern int sysv_create(struct inode * dir,const char * name, int len, int mode, - struct inode ** result); -extern int sysv_mkdir(struct inode * dir, const char * name, int len, int mode); -extern int sysv_rmdir(struct inode * dir, const char * name, int len); -extern int sysv_unlink(struct inode * dir, const char * name, int len); -extern int sysv_symlink(struct inode * inode, const char * name, int len, - const char * symname); -extern int sysv_link(struct inode * oldinode, struct inode * dir, const char * name, int len); -extern int sysv_mknod(struct inode * dir, const char * name, int len, int mode, int rdev); +extern int sysv_lookup(struct inode * dir, struct dentry * dentry); +extern int sysv_create(struct inode * dir, struct dentry * dentry, int mode); +extern int sysv_mkdir(struct inode * dir, struct dentry * dentry, int mode); +extern int sysv_rmdir(struct inode * dir, struct dentry * dentry); +extern int sysv_unlink(struct inode * dir, struct dentry * dentry); +extern int sysv_symlink(struct inode * inode, struct dentry * dentry, const char * symname); +extern int sysv_link(struct inode * oldinode, struct inode * dir, struct dentry * dentry); +extern int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev); extern int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, struct inode * new_dir, struct dentry * new_dentry); extern struct inode * sysv_new_inode(const struct inode * dir); diff --git a/include/linux/tcp.h b/include/linux/tcp.h index ae6a063e3..594b3108a 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -68,4 +68,18 @@ enum { TCP_CLOSING /* now a valid state */ }; +enum { + TCPF_ESTABLISHED = (1 << 1), + TCPF_SYN_SENT = (1 << 2), + TCPF_SYN_RECV = (1 << 3), + TCPF_FIN_WAIT1 = (1 << 4), + TCPF_FIN_WAIT2 = (1 << 5), + TCPF_TIME_WAIT = (1 << 6), + TCPF_CLOSE = (1 << 7), + TCPF_CLOSE_WAIT = (1 << 8), + TCPF_LAST_ACK = (1 << 9), + TCPF_LISTEN = (1 << 10), + TCPF_CLOSING = (1 << 11) +}; + #endif /* _LINUX_TCP_H */ diff --git a/include/linux/time.h b/include/linux/time.h index 0ecf7bbba..d60d8c776 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -1,19 +1,44 @@ #ifndef _LINUX_TIME_H #define _LINUX_TIME_H +#include <asm/param.h> +#include <linux/types.h> + #ifndef _STRUCT_TIMESPEC #define _STRUCT_TIMESPEC -#ifdef __KERNEL__ struct timespec { - long tv_sec; /* seconds */ + time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; -#endif /* (__KERNEL__) */ #endif /* _STRUCT_TIMESPEC */ +/* + * change timeval to jiffies, trying to avoid the + * most obvious overflows.. + */ +static __inline__ unsigned long +timespec_to_jiffies(struct timespec *value) +{ + unsigned long sec = value->tv_sec; + long nsec = value->tv_nsec; + + if (sec > ((long)(~0UL >> 1) / HZ)) + return ~0UL >> 1; + nsec += 1000000000L / HZ - 1; + nsec /= 1000000000L / HZ; + return HZ * sec + nsec; +} + +static __inline__ void +jiffies_to_timespec(unsigned long jiffies, struct timespec *value) +{ + value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ); + value->tv_sec = jiffies / HZ; +} + struct timeval { - int tv_sec; /* seconds */ - int tv_usec; /* microseconds */ + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* microseconds */ }; struct timezone { diff --git a/include/linux/tty.h b/include/linux/tty.h index 78a59c0a5..a00d759f9 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -230,7 +230,7 @@ struct tty_struct { int count; struct winsize winsize; unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; - unsigned char low_latency:1; + unsigned char low_latency:1, warned:1; unsigned char ctrl_status; struct tty_struct *link; @@ -313,6 +313,7 @@ extern int cy_init(void); extern int stl_init(void); extern int stli_init(void); extern int riscom8_init(void); +extern int specialix_init(void); extern int espserial_init(void); extern int tty_paranoia_check(struct tty_struct *tty, kdev_t device, diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 65853d701..1e8bf261c 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -207,10 +207,12 @@ struct tty_driver { #define TTY_DRIVER_TYPE_SERIAL 0x0003 #define TTY_DRIVER_TYPE_PTY 0x0004 #define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */ +#define TTY_DRIVER_TYPE_SYSCONS 0x0006 /* system subtypes (magic, used by tty_io.c) */ #define SYSTEM_TYPE_TTY 0x0001 #define SYSTEM_TYPE_CONSOLE 0x0002 +#define SYSTEM_TYPE_SYSCONS 0x0003 /* pty subtypes (magic, used by tty_io.c) */ #define PTY_TYPE_MASTER 0x0001 diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index f5f329607..501ea0765 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -119,7 +119,8 @@ struct tty_ldisc { int (*ioctl)(struct tty_struct * tty, struct file * file, unsigned int cmd, unsigned long arg); void (*set_termios)(struct tty_struct *tty, struct termios * old); - unsigned int (*poll)(struct tty_struct *, struct file *, poll_table *); + unsigned int (*poll)(struct tty_struct *, struct file *, + struct poll_table_struct *); /* * The following routines are called from below. diff --git a/include/linux/types.h b/include/linux/types.h index 7f98711a4..a990773af 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -17,6 +17,7 @@ typedef __kernel_uid_t uid_t; typedef __kernel_gid_t gid_t; typedef __kernel_daddr_t daddr_t; typedef __kernel_key_t key_t; +typedef __kernel_suseconds_t suseconds_t; #if defined(__GNUC__) && !defined(__STRICT_ANSI__) typedef __kernel_loff_t loff_t; diff --git a/include/linux/ucdrom.h b/include/linux/ucdrom.h index 6cf5c05b3..e69de29bb 100644 --- a/include/linux/ucdrom.h +++ b/include/linux/ucdrom.h @@ -1,114 +0,0 @@ -/* ucdrom.h. Uniform cdrom data structures for cdrom.c. -*- linux-c -*- - Copyright (c) 1996 David van Leeuwen. - */ - -#ifndef LINUX_UCDROM_H -#define LINUX_UCDROM_H - -#ifdef __KERNEL__ -struct cdrom_device_info { - struct cdrom_device_ops *ops; /* link to device_ops */ - struct cdrom_device_info *next; /* next device_info for this major */ - void *handle; /* driver-dependent data */ -/* specifications */ - kdev_t dev; /* device number */ - int mask; /* mask of capability: disables them */ - int speed; /* maximum speed for reading data */ - int capacity; /* number of discs in jukebox */ -/* device-related storage */ - int options : 30; /* options flags */ - unsigned mc_flags : 2; /* media change buffer flags */ - int use_count; /* number of times device opened */ -}; - -struct cdrom_device_ops { -/* routines */ - int (*open) (struct cdrom_device_info *, int); - void (*release) (struct cdrom_device_info *); - int (*drive_status) (struct cdrom_device_info *, int); - int (*disc_status) (struct cdrom_device_info *); - int (*media_changed) (struct cdrom_device_info *, int); - int (*tray_move) (struct cdrom_device_info *, int); - int (*lock_door) (struct cdrom_device_info *, int); - int (*select_speed) (struct cdrom_device_info *, int); - int (*select_disc) (struct cdrom_device_info *, int); - int (*get_last_session) (struct cdrom_device_info *, - struct cdrom_multisession *); - int (*get_mcn) (struct cdrom_device_info *, - struct cdrom_mcn *); - /* hard reset device */ - int (*reset) (struct cdrom_device_info *); - /* play stuff */ - int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); - /* dev-specific */ - int (*dev_ioctl) (struct cdrom_device_info *, - unsigned int, unsigned long); -/* driver specifications */ - const int capability; /* capability flags */ - int n_minors; /* number of active minor devices */ -}; -#endif - -/* capability flags */ -#define CDC_CLOSE_TRAY 0x1 /* caddy systems _can't_ close */ -#define CDC_OPEN_TRAY 0x2 /* but _can_ eject. */ -#define CDC_LOCK 0x4 /* disable manual eject */ -#define CDC_SELECT_SPEED 0x8 /* programmable speed */ -#define CDC_SELECT_DISC 0x10 /* select disc from juke-box */ -#define CDC_MULTI_SESSION 0x20 /* read sessions>1 */ -#define CDC_MCN 0x40 /* Medium Catalog Number */ -#define CDC_MEDIA_CHANGED 0x80 /* media changed */ -#define CDC_PLAY_AUDIO 0x100 /* audio functions */ - -/* drive status possibilities */ -#define CDS_NO_INFO 0 /* if not implemented */ -#define CDS_NO_DISC 1 -#define CDS_TRAY_OPEN 2 -#define CDS_DRIVE_NOT_READY 3 -#define CDS_DISC_OK 4 - -/* disc status possibilities, other than CDS_NO_DISC */ -#define CDS_AUDIO 100 -#define CDS_DATA_1 101 -#define CDS_DATA_2 102 -#define CDS_XA_2_1 103 -#define CDS_XA_2_2 104 - -/* User-configurable behavior options */ -#define CDO_AUTO_CLOSE 0x1 /* close tray on first open() */ -#define CDO_AUTO_EJECT 0x2 /* open tray on last release() */ -#define CDO_USE_FFLAGS 0x4 /* use O_NONBLOCK information on open */ -#define CDO_LOCK 0x8 /* lock tray on open files */ -#define CDO_CHECK_TYPE 0x10 /* check type on open for data */ - -/* Special codes for specifying changer slots. */ -#define CDSL_NONE ((int) (~0U>>1)-1) -#define CDSL_CURRENT ((int) (~0U>>1)) - -/* Some more ioctls to control these options */ -#define CDROM_SET_OPTIONS 0x5320 -#define CDROM_CLEAR_OPTIONS 0x5321 -#define CDROM_SELECT_SPEED 0x5322 /* head-speed */ -#define CDROM_SELECT_DISC 0x5323 /* for juke-boxes */ -#define CDROM_MEDIA_CHANGED 0x5325 -#define CDROM_DRIVE_STATUS 0x5326 /* tray position, etc. */ -#define CDROM_DISC_STATUS 0x5327 /* disc type etc. */ -#define CDROM_CHANGER_NSLOTS 0x5328 - -/* Rename an old ioctl */ -#define CDROM_GET_MCN CDROM_GET_UPC /* medium catalog number */ - -#ifdef __KERNEL__ -/* the general file operations structure: */ -extern struct file_operations cdrom_fops; - -extern int register_cdrom(struct cdrom_device_info *cdi, char *name); -extern int unregister_cdrom(struct cdrom_device_info *cdi); -#endif - -#endif /* LINUX_UCDROM_H */ -/* - * Local variables: - * comment-column: 40 - * End: - */ diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index eb2f6ec0d..25420e1b1 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -6,13 +6,17 @@ * Laboratory for Computer Science Research Computing Facility * Rutgers, The State University of New Jersey * - * $Id: ufs_fs.h,v 1.8 1997/07/17 02:17:54 davem Exp $ - * + * Clean swab support by Fare <rideau@ens.fr> + * just hope no one is using NNUUXXI on __?64 structure elements */ #ifndef __LINUX_UFS_FS_H #define __LINUX_UFS_FS_H +#undef UFS_HEAVY_DEBUG +/*#define UFS_HEAVY_DEBUG 1*/ +/* Uncomment the line above when hacking ufs code */ + #include <linux/types.h> #include <linux/kernel.h> #include <linux/time.h> @@ -24,6 +28,7 @@ #define UFS_SBSIZE 8192 #define UFS_MAGIC 0x00011954 +#define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */ #define UFS_FSIZE 1024 #define UFS_BSIZE 8192 @@ -51,6 +56,17 @@ #define UFS_DEBUG_NAMEI 0x00000004 #define UFS_DEBUG_LINKS 0x00000008 +#ifdef UFS_HEAVY_DEBUG +# define UFS_DEBUG_INITIAL UFS_DEBUG +#else +# define UFS_DEBUG_INITIAL 0 +#endif + +/* (!) HERE WE ASSUME EITHER BIG OR LITTLE ENDIAN UFSes */ +#define UFS_LITTLE_ENDIAN 0x00000000 /* 0x00010000 */ +#define UFS_BIG_ENDIAN 0x00010000 /* 0x00020000 */ +#define UFS_BYTESEX 0x00010000 /* 0x00030000 */ + #define UFS_ADDR_PER_BLOCK(sb) ((sb)->u.ufs_sb.s_bsize >> 2) #define UFS_ADDR_PER_BLOCK_BITS(sb) ((sb)->u.ufs_sb.s_bshift - 2) @@ -93,10 +109,6 @@ struct ufs_csum { __u32 cs_nffree; /* number of free frags */ }; -typedef struct _ufsquad { - __u32 val[2]; -} ufsquad; - /* * This is the actual superblock, as it is laid out on the disk. */ @@ -109,7 +121,7 @@ struct ufs_superblock { __u32 fs_dblkno; /* offset of first data after cg */ __u32 fs_cgoffset; /* cylinder group offset in cylinder */ __u32 fs_cgmask; /* used to calc mod fs_ntrak */ - time_t fs_time; /* last time written */ + __u32 fs_time; /* last time written -- time_t */ __u32 fs_size; /* number of blocks in fs */ __u32 fs_dsize; /* number of data blocks in fs */ __u32 fs_ncg; /* number of cylinder groups */ @@ -177,15 +189,14 @@ struct ufs_superblock { __u16 fs_opostbl[16][8]; /* old rotation block list head */ __s32 fs_sparecon[55]; /* reserved for future constants */ __s32 fs_state; /* file system state time stamp */ - ufsquad fs_qbmask; /* ~usb_bmask - for use with __s64 size */ - ufsquad fs_qfmask; /* ~usb_fmask - for use with __s64 size */ + __s64 fs_qbmask; /* ~usb_bmask */ + __s64 fs_qfmask; /* ~usb_fmask */ __s32 fs_postblformat; /* format of positional layout tables */ __s32 fs_nrpos; /* number of rotational positions */ __s32 fs_postbloff; /* (__s16) rotation block list head */ __s32 fs_rotbloff; /* (__u8) blocks for each rotation */ __s32 fs_magic; /* magic number */ __u8 fs_space[1]; /* list of blocks for each rotation */ - }; /* @@ -196,13 +207,13 @@ struct ufs_inode { __u16 ui_nlink; /* 0x2 */ __u16 ui_suid; /* 0x4 */ __u16 ui_sgid; /* 0x6 */ - ufsquad ui_size; /* 0x8 */ /* XXX - should be __u64 */ - struct timeval ui_atime; /* 0x10 */ - struct timeval ui_mtime; /* 0x18 */ - struct timeval ui_ctime; /* 0x20 */ - __u32 ui_db[UFS_NDADDR]; /* 0x28 data blocks */ - __u32 ui_ib[UFS_NINDIR]; /* 0x58 indirect blocks */ - __u32 ui_flags; /* 0x64 unused */ + __u64 ui_size; /* 0x8 */ + struct timeval ui_atime; /* 0x10 access */ + struct timeval ui_mtime; /* 0x18 modification */ + struct timeval ui_ctime; /* 0x20 creation */ + __u32 ui_db[UFS_NDADDR]; /* 0x28 data blocks */ + __u32 ui_ib[UFS_NINDIR]; /* 0x58 indirect blocks */ + __u32 ui_flags; /* 0x64 unused -- "status flags (chflags)" ??? */ __u32 ui_blocks; /* 0x68 blocks in use */ __u32 ui_gen; /* 0x6c generation number XXX - what is this? */ __u32 ui_shadow; /* 0x70 shadow inode XXX - what is this?*/ @@ -225,7 +236,7 @@ extern void ufs_put_inode(struct inode * inode); extern void ufs_print_inode (struct inode *); /* ufs_namei.c */ -extern int ufs_lookup (struct inode *, struct qstr *, struct inode **); +extern int ufs_lookup (struct inode *, struct dentry *); /* ufs_super.c */ extern void ufs_warning (struct super_block *, const char *, const char *, ...) @@ -248,23 +259,6 @@ extern struct file_operations ufs_file_operations; extern struct inode_operations ufs_symlink_inode_operations; extern struct file_operations ufs_symlink_operations; -/* Byte swapping 32/16-bit quantities into little endian format. */ -extern int ufs_need_swab; - -extern __inline__ __u32 ufs_swab32(__u32 value) -{ - return (ufs_need_swab ? ((value >> 24) | - ((value >> 8) & 0xff00) | - ((value << 8) & 0xff0000) | - (value << 24)) : value); -} - -extern __inline__ __u16 ufs_swab16(__u16 value) -{ - return (ufs_need_swab ? ((value >> 8) | - (value << 8)) : value); -} - #endif /* __KERNEL__ */ #endif /* __LINUX_UFS_FS_H */ diff --git a/include/linux/wait.h b/include/linux/wait.h index 0a0d11fc9..6514693c2 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -28,18 +28,6 @@ static inline int waitqueue_active(struct wait_queue **q) return head && head != WAIT_QUEUE_HEAD(q); } -struct poll_table_entry { - struct wait_queue wait; - struct wait_queue ** wait_address; -}; - -typedef struct poll_table_struct { - unsigned int nr; - struct poll_table_entry * entry; -} poll_table; - -#define __MAX_POLL_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct poll_table_entry)) - #endif /* __KERNEL__ */ #endif |