diff options
Diffstat (limited to 'include/linux')
49 files changed, 1766 insertions, 474 deletions
diff --git a/include/linux/b1lli.h b/include/linux/b1lli.h index 401933c3f..f564ae898 100644 --- a/include/linux/b1lli.h +++ b/include/linux/b1lli.h @@ -1,11 +1,25 @@ /* - * $Id: b1lli.h,v 1.1 1997/03/04 21:27:32 calle Exp $ + * $Id: b1lli.h,v 1.3 1998/01/31 10:54:37 calle Exp $ * * ISDN lowlevel-module for AVM B1-card. * * Copyright 1996 by Carsten Paeth (calle@calle.in-berlin.de) * * $Log: b1lli.h,v $ + * Revision 1.3 1998/01/31 10:54:37 calle + * include changes for PCMCIA cards from 2.0 version + * + * Revision 1.2 1997/12/10 19:38:42 calle + * get changes from 2.0 tree + * + * Revision 1.1.2.2 1997/11/26 16:57:26 calle + * more changes for B1/M1/T1. + * + * Revision 1.1.2.1 1997/11/26 10:47:01 calle + * prepared for M1 (Mobile) and T1 (PMX) cards. + * prepared to set configuration after load to support other D-channel + * protocols, point-to-point and leased lines. + * * Revision 1.1 1997/03/04 21:27:32 calle * First version in isdn4linux * @@ -32,10 +46,22 @@ typedef struct avmb1_loaddef { avmb1_t4file t4file; } avmb1_loaddef; +typedef struct avmb1_loadandconfigdef { + int contr; + avmb1_t4file t4file; + avmb1_t4file t4config; +} avmb1_loadandconfigdef; + typedef struct avmb1_resetdef { int contr; } avmb1_resetdef; +typedef struct avmb1_getdef { + int contr; + int cardtype; + int cardstate; +} avmb1_getdef; + /* * struct for adding new cards */ @@ -44,25 +70,39 @@ typedef struct avmb1_carddef { int irq; } avmb1_carddef; -#define AVMB1_LOAD 0 /* load image to card */ -#define AVMB1_ADDCARD 1 /* add a new card */ -#define AVMB1_RESETCARD 2 /* reset a card */ +#define AVM_CARDTYPE_B1 0 +#define AVM_CARDTYPE_T1 1 +#define AVM_CARDTYPE_M1 2 +#define AVM_CARDTYPE_M2 3 +typedef struct avmb1_extcarddef { + int port; + int irq; + int cardtype; +} avmb1_extcarddef; + +#define AVMB1_LOAD 0 /* load image to card */ +#define AVMB1_ADDCARD 1 /* add a new card */ +#define AVMB1_RESETCARD 2 /* reset a card */ +#define AVMB1_LOAD_AND_CONFIG 3 /* load image and config to card */ +#define AVMB1_ADDCARD_WITH_TYPE 4 /* add a new card, with cardtype */ +#define AVMB1_GET_CARDINFO 5 /* get cardtype */ -#ifdef __KERNEL__ /* * card states for startup */ -#define CARD_NONE 0 +#define CARD_FREE 0 #define CARD_DETECTED 1 #define CARD_LOADING 2 #define CARD_INITSTATE 4 #define CARD_RUNNING 5 #define CARD_ACTIVE 6 +#ifdef __KERNEL__ + #define AVMB1_PORTLEN 0x1f #define AVM_MAXVERSION 8 @@ -81,6 +121,7 @@ typedef struct avmb1_card { int cnr; unsigned short port; unsigned irq; + int cardtype; volatile unsigned short cardstate; int interrupt; int blocked; @@ -108,14 +149,15 @@ typedef struct avmb1_card { /* b1lli.c */ -int B1_detect(unsigned short base); +int B1_detect(unsigned short base, int cardtype); void B1_reset(unsigned short base); int B1_load_t4file(unsigned short base, avmb1_t4file * t4file); +int B1_load_config(unsigned short base, avmb1_t4file * config); int B1_loaded(unsigned short base); -unsigned char B1_assign_irq(unsigned short base, unsigned irq); +unsigned char B1_assign_irq(unsigned short base, unsigned irq, int cardtype); unsigned char B1_enable_irq(unsigned short base); unsigned char B1_disable_irq(unsigned short base); -int B1_valid_irq(unsigned irq); +int B1_valid_irq(unsigned irq, int cardtype); void B1_handle_interrupt(avmb1_card * card); void B1_send_init(unsigned short port, unsigned int napps, unsigned int nncci, unsigned int cardnr); @@ -133,8 +175,17 @@ void avmb1_handle_free_ncci(avmb1_card * card, void avmb1_handle_capimsg(avmb1_card * card, __u16 appl, struct sk_buff *skb); void avmb1_card_ready(avmb1_card * card); -int avmb1_addcard(int port, int irq); -int avmb1_probecard(int port, int irq); +/* standard calls, with check and allocation of resources */ +int avmb1_addcard(int port, int irq, int cardtype); +int avmb1_probecard(int port, int irq, int cardtype); + + +int avmb1_resetcard(int cardnr); + +/* calls for pcmcia driver */ +int avmb1_detectcard(int port, int irq, int cardtype); +int avmb1_registercard(int port, int irq, int cardtype, int allocio); +int avmb1_unregistercard(int cnr, int freeio); #endif /* __KERNEL__ */ diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 1174fc07d..0d34d35ba 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h @@ -2,6 +2,7 @@ #define _LINUX_BINFMTS_H #include <linux/ptrace.h> +#include <linux/capability.h> /* * MAX_ARG_PAGES defines the number of pages allocated for arguments @@ -10,6 +11,8 @@ */ #define MAX_ARG_PAGES 32 +#ifdef __KERNEL__ + /* * This structure is used to hold the arguments that are used when loading binaries. */ @@ -21,6 +24,7 @@ struct linux_binprm{ int java; /* Java binary, prevent recursive invocation */ struct dentry * dentry; int e_uid, e_gid; + kernel_cap_t cap_inheritable, cap_permitted, cap_effective; int argc, envc; char * filename; /* Name of binary */ unsigned long loader, exec; @@ -64,7 +68,10 @@ extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page, unsigned long p, int from_kmem); +extern void compute_creds(struct linux_binprm *binprm); + /* this eventually goes away */ #define change_ldt(a,b) setup_arg_pages(a,b) -#endif +#endif /* __KERNEL__ */ +#endif /* _LINUX_BINFMTS_H */ diff --git a/include/linux/bios32.h b/include/linux/bios32.h index 7944a53fe..2f2c14b7c 100644 --- a/include/linux/bios32.h +++ b/include/linux/bios32.h @@ -1,61 +1,34 @@ /* - * BIOS32, PCI BIOS functions and defines - * Copyright 1994, Drew Eckhardt - * - * For more information, please consult - * - * PCI BIOS Specification Revision - * PCI Local Bus Specification - * PCI System Design Guide - * - * PCI Special Interest Group - * P.O. Box 14070 - * Portland, OR 97214 - * U. S. A. - * Phone: 800-433-5177 / +1-503-797-4207 - * Fax: +1-503-234-6762 - * - * Manuals are $25 each or $50 for all three, plus $7 shipping - * within the United States, $35 abroad. + * This is only a stub file to make drivers not yet converted to the new + * PCI probing mechanism work. [mj] */ #ifndef BIOS32_H #define BIOS32_H -/* - * Error values that may be returned by the PCI bios. Use - * pcibios_strerror() to convert to a printable string. - */ -#define PCIBIOS_SUCCESSFUL 0x00 -#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81 -#define PCIBIOS_BAD_VENDOR_ID 0x83 -#define PCIBIOS_DEVICE_NOT_FOUND 0x86 -#define PCIBIOS_BAD_REGISTER_NUMBER 0x87 -#define PCIBIOS_SET_FAILED 0x88 -#define PCIBIOS_BUFFER_TOO_SMALL 0x89 +#include <linux/pci.h> + +#warning This driver uses the old PCI interface, please fix it (see Documentation/pci.txt) + +extern inline int __pcibios_read_irq(unsigned char bus, unsigned char dev_fn, unsigned char *to) +{ + struct pci_dev *pdev = pci_find_slot(bus, dev_fn); + if (!pdev) { + *to = 0; + return PCIBIOS_DEVICE_NOT_FOUND; + } else { + *to = pdev->irq; + return PCIBIOS_SUCCESSFUL; + } +} + +extern inline int __pcibios_read_config_byte(unsigned char bus, + unsigned char dev_fn, unsigned char where, unsigned char *to) +{ + return pcibios_read_config_byte(bus, dev_fn, where, to); +} -extern int pcibios_present (void); -extern unsigned long pcibios_init (unsigned long memory_start, - unsigned long memory_end); -extern unsigned long pcibios_fixup (unsigned long memory_start, - unsigned long memory_end); -extern int pcibios_find_class (unsigned int class_code, unsigned short index, - unsigned char *bus, unsigned char *dev_fn); -extern int pcibios_find_device (unsigned short vendor, unsigned short dev_id, - unsigned short index, unsigned char *bus, - unsigned char *dev_fn); -extern int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned char *val); -extern int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned short *val); -extern int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned int *val); -extern int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned char val); -extern int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned short val); -extern int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, - unsigned char where, unsigned int val); -extern const char *pcibios_strerror (int error); +#define pcibios_read_config_byte(b,d,w,p) \ + (((w) == PCI_INTERRUPT_LINE) ? __pcibios_read_irq(b,d,p) : __pcibios_read_config_byte(b,d,w,p)) -#endif /* BIOS32_H */ +#endif diff --git a/include/linux/blk.h b/include/linux/blk.h index ec19b0cdd..5101379f4 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -45,75 +45,33 @@ extern spinlock_t io_request_lock; #endif /* IDE_DRIVER */ #define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0) -#ifdef CONFIG_CDROM -extern int cdrom_init(void); -#endif CONFIG_CDROM -#ifdef CONFIG_ISP16_CDI + +/* + * Initialization functions. + */ extern int isp16_init(void); -#endif CONFIG_ISP16_CDI -#ifdef CONFIG_CDU31A extern int cdu31a_init(void); -#endif CONFIG_CDU31A -#ifdef CONFIG_ATARI_ACSI extern int acsi_init(void); -#endif CONFIG_ATARI_ACSI -#ifdef CONFIG_MCD extern int mcd_init(void); -#endif CONFIG_MCD -#ifdef CONFIG_MCDX extern int mcdx_init(void); -#endif CONFIG_MCDX -#ifdef CONFIG_SBPCD extern int sbpcd_init(void); -#endif CONFIG_SBPCD -#ifdef CONFIG_AZTCD extern int aztcd_init(void); -#endif CONFIG_AZTCD -#ifdef CONFIG_CDU535 extern int sony535_init(void); -#endif CONFIG_CDU535 -#ifdef CONFIG_GSCD extern int gscd_init(void); -#endif CONFIG_GSCD -#ifdef CONFIG_CM206 extern int cm206_init(void); -#endif CONFIG_CM206 -#ifdef CONFIG_OPTCD extern int optcd_init(void); -#endif CONFIG_OPTCD -#ifdef CONFIG_SJCD extern int sjcd_init(void); -#endif CONFIG_SJCD -#ifdef CONFIG_CDI_INIT extern int cdi_init(void); -#endif CONFIG_CDI_INIT -#ifdef CONFIG_BLK_DEV_HD extern int hd_init(void); -#endif -#ifdef CONFIG_BLK_DEV_IDE extern int ide_init(void); -#endif -#ifdef CONFIG_BLK_DEV_XD extern int xd_init(void); -#endif -#ifdef CONFIG_BLK_DEV_LOOP extern int loop_init(void); -#endif -#ifdef CONFIG_BLK_DEV_MD extern int md_init(void); -#endif CONFIG_BLK_DEV_MD -#ifdef CONFIG_APBLOCK extern int ap_init(void); -#endif -#ifdef CONFIG_DDV extern int ddv_init(void); -#endif -#ifdef CONFIG_AMIGA_Z2RAM extern int z2_init(void); -#endif -#ifdef CONFIG_MAC_FLOPPY extern int swim3_init(void); -#endif +extern int ps2esdi_init(void); extern void set_device_ro(kdev_t dev,int flag); void add_blkdev_randomness(int major); @@ -135,9 +93,6 @@ extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < m void initrd_init(void); #endif -#ifdef CONFIG_BLK_DEV_PS2 -extern int ps2esdi_init(void); -#endif #define RO_IOCTLS(dev,where) \ case BLKROSET: { int __val; if (!suser()) return -EACCES; \ diff --git a/include/linux/capability.h b/include/linux/capability.h new file mode 100644 index 000000000..db737e55f --- /dev/null +++ b/include/linux/capability.h @@ -0,0 +1,206 @@ +/* + * This is <linux/capability.h> + * + * Andrew G. Morgan <morgan@transmeta.com> + * Alexander Kjeldaas <astor@guardian.no> + * with help from Aleph1, Roland Buresund and Andrew Main. + */ + +#ifndef _LINUX_CAPABILITY_H +#define _LINUX_CAPABILITY_H + +#include <linux/types.h> +#include <linux/fs.h> + +/* User-level do most of the mapping between kernel and user + capabilities based on the version tag given by the kernel. The + kernel might be somewhat backwards compatible, but don't bet on + it. */ + +#define _LINUX_CAPABILITY_VERSION 0x19980330 + +typedef struct _user_cap_struct { + __u32 version; + __u32 size; + __u8 cap[1]; +} *cap_t; + +#ifdef __KERNEL__ + +typedef struct kernel_cap_struct { + int cap; +} kernel_cap_t; + +#endif + + +/** + ** POSIX-draft defined capabilities. + **/ + +/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this + overrides the restriction of changing file ownership and group + ownership. */ + +#define CAP_CHOWN 0 + +/* Override all DAC access, including ACL execute access if + [_POSIX_ACL] is defined. Excluding DAC access covered by + CAP_LINUX_IMMUTABLE */ + +#define CAP_DAC_OVERRIDE 1 + +/* Overrides all DAC restrictions regarding read and search on files + and directories, including ACL restrictions if [_POSIX_ACL] is + defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE */ + +#define CAP_DAC_READ_SEARCH 2 + +/* Overrides all restrictions about allowed operations on files, where + file owner ID must be equal to the user ID, except where CAP_FSETID + is applicable. It doesn't override MAC and DAC restrictions. */ + +#define CAP_FOWNER 3 + +/* Overrides the following restrictions that the effective user ID + shall match the file owner ID when setting the S_ISUID and S_ISGID + bits on that file; that the effective group ID (or one of the + supplementary group IDs shall match the file owner ID when setting + the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are + cleared on successful return from chown(2). */ + +#define CAP_FSETID 4 + +/* Used to decide between falling back on the old suser() or fsuser(). */ + +#define CAP_FS_MASK 0x1f + +/* Overrides the restriction that the real or effective user ID of a + process sending a signal must match the real or effective user ID + of the process receiving the signal. */ + +#define CAP_KILL 5 + +/* Allows setgid(2) manipulation */ + +#define CAP_SETGID 6 + +/* Allows setuid(2) manipulation */ + +#define CAP_SETUID 7 + + +/** + ** Linux-specific capabilities + **/ + +/* Transfer any capability in your permitted set to any pid, + remove any capability in your permitted set from any pid */ + +#define CAP_SETPCAP 8 + +/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */ + +#define CAP_LINUX_IMMUTABLE 9 + +/* Allows binding to TCP/UDP sockets below 1024 */ + +#define CAP_NET_BIND_SERVICE 10 + +/* Allow broadcasting, listen to multicast */ + +#define CAP_NET_BROADCAST 11 + +/* Allow interface configuration */ +/* Allow configuring of firewall stuff */ +/* Allow setting debug option on sockets */ +/* Allow modification of routing tables */ + +#define CAP_NET_ADMIN 12 + +/* Allow use of RAW sockets */ +/* Allow use of PACKET sockets */ + +#define CAP_NET_RAW 13 + +/* Allow locking of segments in memory */ + +#define CAP_IPC_LOCK 14 + +/* Override IPC ownership checks */ + +#define CAP_IPC_OWNER 15 + +/* Insert and remove kernel modules */ + +#define CAP_SYS_MODULE 16 + +/* Allow ioperm/iopl access */ + +#define CAP_SYS_RAWIO 17 + +/* Allow use of chroot() */ + +#define CAP_SYS_CHROOT 18 + +/* Allow ptrace() of any process */ + +#define CAP_SYS_PTRACE 19 + +/* Allow configuration of process accounting */ + +#define CAP_SYS_PACCT 20 + +/* Allow configuration of the secure attention key */ +/* Allow administration of the random device */ +/* Allow device administration */ +/* Allow examination and configuration of disk quotas */ +/* System Admin functions: mount et al */ + +#define CAP_SYS_ADMIN 21 + +/* Allow use of reboot() */ + +#define CAP_SYS_BOOT 22 + +/* Allow use of renice() on others, and raising of priority */ + +#define CAP_SYS_NICE 23 + +/* Override resource limits */ + +#define CAP_SYS_RESOURCE 24 + +/* Allow manipulation of system clock */ + +#define CAP_SYS_TIME 25 + +/* Allow configuration of tty devices */ + +#define CAP_SYS_TTY_CONFIG 26 + +#ifdef __KERNEL__ + +/* + * Internal kernel functions only + */ + +#define CAP_EMPTY_SET { 0 } +#define CAP_FULL_SET { ~0 } + +#define CAP_TO_MASK(x) (1 << (x)) +#define cap_raise(c, flag) (c.cap |= CAP_TO_MASK(flag)) +#define cap_lower(c, flag) (c.cap &= ~CAP_TO_MASK(flag)) +#define cap_raised(c, flag) (c.cap & CAP_TO_MASK(flag)) + +#define cap_isclear(c) (!c.cap) + +#define cap_copy(dest,src) do { (dest).cap = (src).cap; } while(0) +#define cap_clear(c) do { c.cap = 0; } while(0) +#define cap_set_full(c) do { c.cap = ~0; } while(0) + +#define cap_is_fs_cap(c) ((c) & CAP_FS_MASK) + +#endif /* __KERNEL__ */ + +#endif /* !_LINUX_CAPABILITY_H */ diff --git a/include/linux/concap.h b/include/linux/concap.h new file mode 100644 index 000000000..05f74d820 --- /dev/null +++ b/include/linux/concap.h @@ -0,0 +1,113 @@ +/* $Id: concap.h,v 1.1 1998/02/01 00:15:11 keil Exp $ +*/ +#ifndef _LINUX_CONCAP_H +#define _LINUX_CONCAP_H +#ifdef __KERNEL__ +#include <linux/skbuff.h> +#include <linux/netdevice.h> + +/* Stuff to support encapsulation protocols genericly. The encapsulation + protocol is processed at the uppermost layer of the network interface. + + (c) 1997 by Henner Eisen <eis@baty.hanse.de> + This software is subject to the GNU General Public License. + + Based on a ideas developed in a 'synchronous device' thread in the + linux-x25 mailing list contributed by Alan Cox, Thomasz Motylewski + and Jonathan Naylor. + + For more documetation on this refer to Documentation/isdn/README.concap + */ + +struct concap_proto_ops; +struct concap_device_ops; + +/* this manages all data needed by the encapsulation protocol + */ +struct concap_proto{ + struct device *net_dev; /* net device using our service */ + struct concap_device_ops *dops; /* callbacks provided by device */ + struct concap_proto_ops *pops; /* callbacks provided by us */ + int flags; + void *proto_data; /* protocol specific private data, to + be accessed via *pops methods only*/ + /* + : + whatever + : + */ +}; + +/* Operations to be supported by the net device. Called by the encapsulation + * protocol entity. No receive method is offered because the encapsulation + * protocol directly calls netif_rx(). + */ +struct concap_device_ops{ + + /* to request data is submitted by device*/ + int (*data_req)(struct concap_proto *, struct sk_buff *); + + /* Control methods must be set to NULL by devices which do not + support connection control.*/ + /* to request a connection is set up */ + int (*connect_req)(struct concap_proto *); + + /* to request a connection is released */ + int (*disconn_req)(struct concap_proto *); +}; + +/* Operations to be supported by the encapsulation protocol. Called by + * device driver. + */ +struct concap_proto_ops{ + + /* create a new encapsulation protocol instance of same type */ + struct concap_proto * (*proto_new) (void); + + /* delete encapsulation protocol instance and free all its resources. + cprot may no loger be referenced after calling this */ + void (*proto_del)(struct concap_proto *cprot); + + /* initialize the protocol's data. To be called at interface startup + or when the device driver resets the interface. All services of the + encapsulation protocol may be used after this*/ + int (*restart)(struct concap_proto *cprot, + struct device *ndev, + struct concap_device_ops *dops); + + /* inactivate an encapsulation protocol instance. The encapsulation + protocol may not call any *dops methods after this. */ + int (*close)(struct concap_proto *cprot); + + /* process a frame handed down to us by upper layer */ + int (*encap_and_xmit)(struct concap_proto *cprot, struct sk_buff *skb); + + /* to be called for each data entity received from lower layer*/ + int (*data_ind)(struct concap_proto *cprot, struct sk_buff *skb); + + /* to be called when a connection was set up/down. + Protocols that don't process these primitives might fill in + dummy methods here */ + int (*connect_ind)(struct concap_proto *cprot); + int (*disconn_ind)(struct concap_proto *cprot); + /* + Some network device support functions, like net_header(), rebuild_header(), + and others, that depend solely on the encapsulation protocol, might + be provided here, too. The net device would just fill them in its + corresponding fields when it is opened. + */ +}; + +/* dummy restart/close/connect/reset/disconn methods + */ +extern int concap_nop(struct concap_proto *cprot); + +/* dummy submit method + */ +extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb); +#endif +#endif + + + + diff --git a/include/linux/console.h b/include/linux/console.h index 8c0854b0b..e287e64d5 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -80,7 +80,7 @@ extern struct console_cmdline console_list[MAX_CMDLINECONSOLES]; */ #define CON_PRINTBUFFER (1) -#define CON_FIRST (2) +#define CON_CONSDEV (2) /* Last on the command line */ #define CON_ENABLED (4) struct console diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h index bddb67067..f5ef3f250 100644 --- a/include/linux/cyclades.h +++ b/include/linux/cyclades.h @@ -1,11 +1,21 @@ -/* $Revision: 2.1 $$Date: 1997/10/24 16:03:00 $ +/* $Revision: 2.3 $$Date: 1998/03/16 18:01:12 $ * linux/include/linux/cyclades.h * - * This file is maintained by Marcio Saito <marcio@cyclades.com> and + * This file is maintained by Ivan Passos <ivan@cyclades.com>, + * Marcio Saito <marcio@cyclades.com> and * Randolph Bentson <bentson@grieg.seaslug.org>. * * This file contains the general definitions for the cyclades.c driver *$Log: cyclades.h,v $ + *Revision 2.3 1998/03/16 18:01:12 ivan + *changes in the cyclades_port structure to get it closer to the + *standard serial port structure; + *added constants for new ioctls; + *Revision 2.2 1998/02/17 16:50:00 ivan + *changes in the cyclades_port structure (addition of shutdown_wait and + *chip_rev variables); + *added constants for new ioctls and for CD1400 rev. numbers. + * *Revision 2.1 1997/10/24 16:03:00 ivan *added rflow (which allows enabling the CD1400 special flow control *feature) and rtsdtr_inv (which allows DTR/RTS pin inversion) to @@ -58,10 +68,14 @@ struct cyclades_monitor { #define CYGETDEFTIMEOUT 0x435908 #define CYSETDEFTIMEOUT 0x435909 #define CYSETRFLOW 0x43590a -#define CYRESETRFLOW 0x43590b +#define CYGETRFLOW 0x43590b #define CYSETRTSDTR_INV 0x43590c -#define CYRESETRTSDTR_INV 0x43590d +#define CYGETRTSDTR_INV 0x43590d #define CYZPOLLCYCLE 0x43590e +#define CYGETCD1400VER 0x43590f +#define CYGETCARDINFO 0x435910 +#define CYSETWAIT 0x435911 +#define CYGETWAIT 0x435912 /*************** CYCLOM-Z ADDITIONS ***************/ @@ -78,6 +92,8 @@ struct cyclades_monitor { #define MAX_PORT 128 /* Max number of ports per board */ #define MAX_DEV 256 /* Max number of ports total */ +#define CYZ_FIFO_SIZE 16 + #define CYZ_BOOT_NWORDS 0x100 struct CYZ_BOOT_CTRL { unsigned short nboard; @@ -473,12 +489,13 @@ struct cyclades_chip { struct cyclades_port { int magic; - int type; int card; int line; int flags; /* defined in tty.h */ + int type; /* UART type */ struct tty_struct *tty; int read_status_mask; + int ignore_status_mask; int timeout; int xmit_fifo_size; int cor1,cor2,cor3,cor4,cor5; @@ -486,13 +503,15 @@ struct cyclades_port { int baud; int rflow; int rtsdtr_inv; - int ignore_status_mask; + int chip_rev; + int custom_divisor; + int x_char; /* to be pushed out ASAP */ int close_delay; - int IER; /* Interrupt Enable Register */ - int event; + unsigned short closing_wait; + unsigned short closing_wait2; + unsigned long event; unsigned long last_active; int count; /* # of fd on device */ - int x_char; /* to be pushed out ASAP */ int x_break; int blocked_open; /* # of blocked opens */ long session; /* Session of opening process */ @@ -508,6 +527,7 @@ struct cyclades_port { struct termios callout_termios; struct wait_queue *open_wait; struct wait_queue *close_wait; + struct wait_queue *shutdown_wait; struct cyclades_monitor mon; unsigned long jiffies[3]; unsigned long rflush_count; @@ -517,13 +537,14 @@ struct cyclades_port { * Events are used to schedule things to happen at timer-interrupt * time, instead of at cy interrupt time. */ -#define Cy_EVENT_READ_PROCESS 0 -#define Cy_EVENT_WRITE_WAKEUP 1 -#define Cy_EVENT_HANGUP 2 -#define Cy_EVENT_BREAK 3 -#define Cy_EVENT_OPEN_WAKEUP 4 - +#define Cy_EVENT_READ_PROCESS 0 +#define Cy_EVENT_WRITE_WAKEUP 1 +#define Cy_EVENT_HANGUP 2 +#define Cy_EVENT_BREAK 3 +#define Cy_EVENT_OPEN_WAKEUP 4 +#define Cy_EVENT_SHUTDOWN_WAKEUP 5 +#define CLOSING_WAIT_DELAY 30 #define CyMAX_CHIPS_PER_CARD 8 #define CyMAX_CHAR_FIFO 12 @@ -538,10 +559,13 @@ struct cyclades_port { /**** CD1400 registers ****/ -#define CyRegSize 0x0400 -#define Cy_HwReset 0x1400 -#define Cy_ClrIntr 0x1800 -#define Cy_EpldRev 0x1e00 +#define CD1400_REV_G 0x46 +#define CD1400_REV_J 0x48 + +#define CyRegSize 0x0400 +#define Cy_HwReset 0x1400 +#define Cy_ClrIntr 0x1800 +#define Cy_EpldRev 0x1e00 /* Global Registers */ diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h new file mode 100644 index 000000000..9f07c969a --- /dev/null +++ b/include/linux/devpts_fs.h @@ -0,0 +1,69 @@ +/* -*- linux-c -*- --------------------------------------------------------- * + * + * linux/include/linux/devpts_fs.h + * + * Copyright 1998 H. Peter Anvin -- All Rights Reserved + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + * + * ------------------------------------------------------------------------- */ + +/* + * Prototypes for the pty driver <-> devpts filesystem interface. Most + * of this is really just a hack so we can exclude it or build it as a + * module, and probably should go away eventually. + */ + +#ifndef _LINUX_DEVPTS_FS_H +#define _LINUX_DEVPTS_FS_H 1 + +#include <linux/config.h> +#include <linux/kdev_t.h> + +#ifdef CONFIG_DEVPTS_FS + +void devpts_pty_new(int, kdev_t); +void devpts_pty_kill(int); + +#elif defined(CONFIG_DEVPTS_FS_MODULE) + +#ifdef BUILDING_PTY_C +void (*devpts_upcall_new)(int,kdev_t) = NULL; +void (*devpts_upcall_kill)(int) = NULL; + +EXPORT_SYMBOL(devpts_upcall_new); +EXPORT_SYMBOL(devpts_upcall_kill); +#else +extern void (*devpts_upcall_new)(int,kdev_t); +extern void (*devpts_upcall_kill)(int); +#endif + +#ifndef BUILDING_DEVPTS +extern inline void +devpts_pty_new(int line, kdev_t device) +{ + if ( devpts_upcall_new ) + return devpts_upcall_new(line,device); +} + +extern inline void +devpts_pty_kill(int line) +{ + if ( devpts_upcall_kill ) + return devpts_upcall_kill(line); +} +#endif + +#else /* No /dev/pts filesystem at all */ + +extern inline void +devpts_pty_new(int line, kdev_t device) { } + +extern inline void +devpts_pty_kill(int line) { } + +#endif + +#endif /* _LINUX_DEVPTS_FS_H */ diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 49cdbe2f5..6d4205c97 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -31,6 +31,7 @@ * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files */ #define EXT2_PREALLOCATE +#define EXT2_DEFAULT_PREALLOC_BLOCKS 8 /* * The second extended file system version @@ -190,8 +191,18 @@ struct ext2_group_desc #define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ #define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ #define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ +/* Reserved for compression usage... */ +#define EXT2_DIRTY_FL 0x00000100 +#define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ +#define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ +#define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ +/* End compression flags --- maybe not all used */ +#define EXT2_BTREE_FL 0x00001000 /* btree format dir */ #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ - + +#define EXT2_FL_USER_VISIBLE 0x00001FFF /* User visible flags */ +#define EXT2_FL_USER_MODIFIABLE 0x000000FF /* User modifiable flags */ + /* * ioctl commands */ @@ -255,6 +266,8 @@ struct ext2_inode { } osd2; /* OS dependent 2 */ }; +#define i_size_high i_dir_acl + #if defined(__KERNEL__) || defined(__linux__) #define i_reserved1 osd1.linux1.l_i_reserved1 #define i_frag osd2.linux2.l_i_frag @@ -367,9 +380,26 @@ struct ext2_super_block { __u8 s_uuid[16]; /* 128-bit uuid for volume */ char s_volume_name[16]; /* volume name */ char s_last_mounted[64]; /* directory where last mounted */ - __u32 s_reserved[206]; /* Padding to the end of the block */ + __u32 s_algorithm_usage_bitmap; /* For compression */ + /* + * Performance hints. Directory preallocation should only + * happen if the EXT2_COMPAT_PREALLOC flag is on. + */ + __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ + __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ + __u16 s_padding1; + __u32 s_reserved[204]; /* Padding to the end of the block */ }; +#ifdef __KERNEL__ +#define EXT2_SB(sb) (&((sb)->u.ext2_sb)) +#else +/* Assume that user mode programs are passing in an ext2fs superblock, not + * a kernel struct super_block. This will allow us to call the feature-test + * macros from user land. */ +#define EXT2_SB(sb) (sb) +#endif + /* * Codes for operating systems */ @@ -394,11 +424,27 @@ struct ext2_super_block { * Feature set definitions */ +#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_feature_compat & (mask) ) +#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_feature_ro_compat & (mask) ) +#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ + ( EXT2_SB(sb)->s_feature_incompat & (mask) ) + +#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 + #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 +#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 + +#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 +#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 #define EXT2_FEATURE_COMPAT_SUPP 0 -#define EXT2_FEATURE_INCOMPAT_SUPP 0 -#define EXT2_FEATURE_RO_COMPAT_SUPP EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER +#define EXT2_FEATURE_INCOMPAT_SUPP EXT2_FEATURE_INCOMPAT_FILETYPE +#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \ + EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \ + EXT2_FEATURE_RO_COMPAT_BTREE_DIR) /* * Default values for user and/or group using reserved blocks @@ -419,6 +465,35 @@ struct ext2_dir_entry { }; /* + * The new version of the directory entry. Since EXT2 structures are + * stored in intel byte order, and the name_len field could never be + * bigger than 255 chars, it's safe to reclaim the extra byte for the + * file_type field. + */ +struct ext2_dir_entry_2 { + __u32 inode; /* Inode number */ + __u16 rec_len; /* Directory entry length */ + __u8 name_len; /* Name length */ + __u8 file_type; + char name[EXT2_NAME_LEN]; /* File name */ +}; + +/* + * Ext2 directory file types. Only the low 3 bits are used. The + * other bits are reserved for now. + */ +#define EXT2_FT_UNKNOWN 0 +#define EXT2_FT_REG_FILE 1 +#define EXT2_FT_DIR 2 +#define EXT2_FT_CHRDEV 3 +#define EXT2_FT_BLKDEV 4 +#define EXT2_FT_FIFO 5 +#define EXT2_FT_SOCK 6 +#define EXT2_FT_SYMLINK 7 + +#define EXT2_FT_MAX 8 + +/* * EXT2_DIR_PAD defines the directory entries boundaries * * NOTE: It must be a multiple of 4 @@ -451,13 +526,16 @@ extern void ext2_free_blocks (const struct inode *, unsigned long, unsigned long); extern unsigned long ext2_count_free_blocks (struct super_block *); extern void ext2_check_blocks_bitmap (struct super_block *); +extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb, + unsigned int block_group, + struct buffer_head ** bh); /* bitmap.c */ extern unsigned long ext2_count_free (struct buffer_head *, unsigned); /* dir.c */ extern int ext2_check_dir_entry (const char *, struct inode *, - struct ext2_dir_entry *, struct buffer_head *, + struct ext2_dir_entry_2 *, struct buffer_head *, unsigned long); /* file.c */ diff --git a/include/linux/ext2_fs_i.h b/include/linux/ext2_fs_i.h index 7df902135..8f01f8ad9 100644 --- a/include/linux/ext2_fs_i.h +++ b/include/linux/ext2_fs_i.h @@ -35,6 +35,7 @@ struct ext2_inode_info { __u32 i_next_alloc_goal; __u32 i_prealloc_block; __u32 i_prealloc_count; + __u32 i_high_size; int i_new_inode:1; /* Is a freshly allocated inode */ }; diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 8183b8e94..31bab91a4 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h @@ -64,6 +64,7 @@ #define ARPHRD_PIMREG 779 /* PIMSM register interface */ #define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */ #define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */ +#define ARPHRD_ECONET 782 /* Acorn Econet */ /* ARP protocol opcodes. */ #define ARPOP_REQUEST 1 /* ARP request */ diff --git a/include/linux/if_ec.h b/include/linux/if_ec.h new file mode 100644 index 000000000..4883f16a7 --- /dev/null +++ b/include/linux/if_ec.h @@ -0,0 +1,47 @@ +/* Definitions for Econet sockets. */ + +#ifndef __LINUX_IF_EC +#define __LINUX_IF_EC + +/* User visible stuff. Glibc provides its own but libc5 folk will use these */ + +struct ec_addr +{ + unsigned char station; /* Station number. */ + unsigned char net; /* Network number. */ +}; + +struct sockaddr_ec +{ + unsigned short sec_family; + unsigned char port; /* Port number. */ + unsigned char cb; /* Control/flag byte. */ + unsigned char type; /* Type of message. */ + struct ec_addr addr; + unsigned long cookie; +}; + +#define ECTYPE_PACKET_RECEIVED 0 /* Packet received */ +#define ECTYPE_TRANSMIT_STATUS 0x10 /* Transmit completed, + low nibble holds status */ + +#define ECTYPE_TRANSMIT_OK 1 +#define ECTYPE_TRANSMIT_NOT_LISTENING 2 +#define ECTYPE_TRANSMIT_NET_ERROR 3 +#define ECTYPE_TRANSMIT_NO_CLOCK 4 +#define ECTYPE_TRANSMIT_LINE_JAMMED 5 +#define ECTYPE_TRANSMIT_NOT_PRESENT 6 + +#ifdef __KERNEL__ + +struct econet_opt +{ + unsigned char cb; + unsigned char port; + unsigned char station; + unsigned char net; +}; + +#endif + +#endif diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h index 5811992db..35eb83fa2 100644 --- a/include/linux/if_ppp.h +++ b/include/linux/if_ppp.h @@ -73,12 +73,9 @@ #define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */ #define SC_LOG_RAWIN 0x00080000 /* log all chars received */ #define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ -#define SC_MASK 0x0fE0ffff /* bits that user can change */ +#define SC_MASK 0x0f0000ff /* bits that user can change */ /* state bits */ -#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */ -#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */ -#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */ #define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */ #define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */ #define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */ diff --git a/include/linux/isdn.h b/include/linux/isdn.h index f7b4747d3..e061cabaa 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,10 @@ -/* $Id: isdn.h,v 1.29 1997/05/27 15:18:02 fritz Exp $ +/* Changes for X.25 support: + Added ISDN_NET_ENCAP_X25IFACE macro. + Additional field in isdn_net_dev_s and isdn_net_local to support + generic encapsulation protocols. +*/ + +/* $Id: isdn.h,v 1.37 1998/02/22 19:45:24 fritz Exp $ * * Main header for the Linux ISDN subsystem (linklevel). * @@ -21,6 +27,37 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn.h,v $ + * Revision 1.37 1998/02/22 19:45:24 fritz + * Some changes regarding V.110 + * + * Revision 1.36 1998/02/20 17:35:55 fritz + * Added V.110 stuff. + * + * Revision 1.35 1998/01/31 22:14:14 keil + * changes for 2.1.82 + * + * Revision 1.34 1997/10/09 21:28:11 fritz + * New HL<->LL interface: + * New BSENT callback with nr. of bytes included. + * Sending without ACK. + * New L1 error status (not yet in use). + * Cleaned up obsolete structures. + * Implemented Cisco-SLARP. + * Changed local net-interface data to be dynamically allocated. + * Removed old 2.0 compatibility stuff. + * + * Revision 1.33 1997/08/21 14:44:22 fritz + * Moved triggercps to end of struct for backwards-compatibility. + * + * Revision 1.32 1997/08/21 09:49:46 fritz + * Increased NET_DV + * + * Revision 1.31 1997/06/22 11:57:07 fritz + * Added ability to adjust slave triggerlevel. + * + * Revision 1.30 1997/06/17 13:07:23 hipp + * compression changes , MP changes + * * Revision 1.29 1997/05/27 15:18:02 fritz * Added changes for recent 2.1.x kernels: * changed return type of isdn_close @@ -181,13 +218,15 @@ #define IIOCDRVCTL _IO('I',128) /* Packet encapsulations for net-interfaces */ -#define ISDN_NET_ENCAP_ETHER 0 -#define ISDN_NET_ENCAP_RAWIP 1 -#define ISDN_NET_ENCAP_IPTYP 2 -#define ISDN_NET_ENCAP_CISCOHDLC 3 -#define ISDN_NET_ENCAP_SYNCPPP 4 -#define ISDN_NET_ENCAP_UIHDLC 5 - +#define ISDN_NET_ENCAP_ETHER 0 +#define ISDN_NET_ENCAP_RAWIP 1 +#define ISDN_NET_ENCAP_IPTYP 2 +#define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */ +#define ISDN_NET_ENCAP_SYNCPPP 4 +#define ISDN_NET_ENCAP_UIHDLC 5 +#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */ +#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/ +#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE /* Facility which currently uses an ISDN-channel */ #define ISDN_USAGE_NONE 0 #define ISDN_USAGE_RAW 1 @@ -219,7 +258,7 @@ typedef struct { int outgoing; } isdn_net_ioctl_phone; -#define NET_DV 0x02 /* Data version for net_cfg */ +#define NET_DV 0x04 /* Data version for net_cfg */ #define TTY_DV 0x04 /* Data version for iprofd etc. */ typedef struct { @@ -244,6 +283,7 @@ typedef struct { int cbhup; /* Flag: Reject Call before Callback */ int pppbind; /* ippp device for bindings */ int chargeint; /* Use fixed charge interval length */ + int triggercps; /* BogoCPS needed for triggering slave */ } isdn_net_ioctl_cfg; #ifdef __KERNEL__ @@ -287,6 +327,10 @@ typedef struct { #include <linux/isdn_ppp.h> #endif +#ifdef CONFIG_ISDN_X25 +# include <linux/concap.h> +#endif + #include <linux/isdnif.h> #define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */ @@ -317,21 +361,23 @@ typedef struct { ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE) ) /* Timer-delays and scheduling-flags */ -#define ISDN_TIMER_RES 3 /* Main Timer-Resolution */ -#define ISDN_TIMER_02SEC (HZ/(ISDN_TIMER_RES+1)/5) /* Slow-Timer1 .2 sec */ -#define ISDN_TIMER_1SEC (HZ/(ISDN_TIMER_RES+1)) /* Slow-Timer2 1 sec */ -#define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */ -#define ISDN_TIMER_MODEMREAD 1 -#define ISDN_TIMER_MODEMPLUS 2 -#define ISDN_TIMER_MODEMRING 4 -#define ISDN_TIMER_MODEMXMIT 8 -#define ISDN_TIMER_NETDIAL 16 -#define ISDN_TIMER_NETHANGUP 32 -#define ISDN_TIMER_IPPP 64 +#define ISDN_TIMER_RES 3 /* Main Timer-Resolution */ +#define ISDN_TIMER_02SEC (HZ/(ISDN_TIMER_RES+1)/5) /* Slow-Timer1 .2 sec */ +#define ISDN_TIMER_1SEC (HZ/(ISDN_TIMER_RES+1)) /* Slow-Timer2 1 sec */ +#define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */ +#define ISDN_TIMER_KEEPINT 10 /* Cisco-Keepalive = ISDN_TIMER_1SEC * this factor */ +#define ISDN_TIMER_MODEMREAD 1 +#define ISDN_TIMER_MODEMPLUS 2 +#define ISDN_TIMER_MODEMRING 4 +#define ISDN_TIMER_MODEMXMIT 8 +#define ISDN_TIMER_NETDIAL 16 +#define ISDN_TIMER_NETHANGUP 32 +#define ISDN_TIMER_IPPP 64 +#define ISDN_TIMER_KEEPALIVE 128 /* Cisco-Keepalive */ #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \ ISDN_TIMER_MODEMXMIT) #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \ - ISDN_TIMER_NETDIAL) + ISDN_TIMER_NETDIAL | ISDN_TIMER_KEEPALIVE) /* Timeout-Values for isdn_net_dial() */ #define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1))) @@ -362,6 +408,15 @@ typedef struct { char num[ISDN_MSNLEN]; } isdn_net_phone; +/* + Principles when extending structures for generic encapsulation protocol + ("concap") support: + - Stuff which is hardware specific (here i4l-specific) goes in + the netdev -> local structure (here: isdn_net_local) + - Stuff which is encapsulation protocol specific goes in the structure + which holds the linux device structure (here: isdn_net_device) +*/ + /* Local interface-data */ typedef struct isdn_net_local_s { ulong magic; @@ -413,6 +468,7 @@ typedef struct isdn_net_local_s { int sqfull; /* Flag: netdev-queue overloaded */ ulong sqfull_stamp; /* Start-Time of overload */ ulong slavedelay; /* Dynamic bundling delaytime */ + int triggercps; /* BogoCPS needed for trigger slave */ struct device *srobin; /* Ptr to Master device for slaves */ isdn_net_phone *phone[2]; /* List of remote-phonenumbers */ /* phone[0] = Incoming Numbers */ @@ -425,16 +481,21 @@ typedef struct isdn_net_local_s { struct isdn_net_dev_s *netdev; /* Ptr to netdev */ struct sk_buff *first_skb; /* Ptr to skb that triggers dialing */ struct sk_buff *sav_skb; /* Ptr to skb, rejected by LL-driver*/ - /* Ptr to orig. hard_header_cache */ - int (*org_hhc)(struct neighbour *neigh, + int (*org_hhc)( + struct neighbour *neigh, struct hh_cache *hh); - /* Ptr to orig. header_cache_update */ void (*org_hcu)(struct hh_cache *, struct device *, unsigned char *); int pppbind; /* ippp device for bindings */ +#ifdef CONFIG_ISDN_X25 + struct concap_device_ops *dops; /* callbacks used by encapsulator */ +#endif + int cisco_loop; /* Loop counter for Cisco-SLARP */ + ulong cisco_myseq; /* Local keepalive seq. for Cisco */ + ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */ } isdn_net_local; #ifdef CONFIG_ISDN_PPP @@ -451,14 +512,18 @@ struct ippp_bundle { /* the interface itself */ typedef struct isdn_net_dev_s { - isdn_net_local local; + isdn_net_local *local; isdn_net_local *queue; void *next; /* Pointer to next isdn-interface */ - struct device dev; /* interface to upper levels */ + struct device dev; /* interface to upper levels */ #ifdef CONFIG_ISDN_PPP struct mpqueue *mp_last; struct ippp_bundle ib; #endif +#ifdef CONFIG_ISDN_X25 + struct concap_proto *cprot; /* connection oriented encapsulation protocol */ +#endif + } isdn_net_dev; /*===================== End of ip-over-ISDN stuff ===========================*/ @@ -477,7 +542,8 @@ typedef struct isdn_net_dev_s { #define ISDN_ASYNC_PGRP_LOCKOUT 0x0200 /* Lock cua opens on pgrp */ #define ISDN_ASYNC_CALLOUT_NOHUP 0x0400 /* No hangup for cui */ #define ISDN_ASYNC_SPLIT_TERMIOS 0x0008 /* Sep. termios for dialin/out */ -#define ISDN_SERIAL_XMIT_SIZE 4000 /* Maximum bufsize for write */ +#define ISDN_SERIAL_XMIT_SIZE 1024 /* Default bufsize for write */ +#define ISDN_SERIAL_XMIT_MAX 4000 /* Maximum bufsize for write */ #define ISDN_SERIAL_TYPE_NORMAL 1 #define ISDN_SERIAL_TYPE_CALLOUT 2 @@ -499,18 +565,19 @@ typedef struct isdn_audio_skb { /* Private data of AT-command-interpreter */ typedef struct atemu { - u_char profile[ISDN_MODEM_ANZREG]; /* Modem-Regs. Profile 0 */ - u_char mdmreg[ISDN_MODEM_ANZREG]; /* Modem-Registers */ - char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */ - char msn[ISDN_MSNLEN];/* EAZ/MSN */ + u_char profile[ISDN_MODEM_ANZREG]; /* Modem-Regs. Profile 0 */ + u_char mdmreg[ISDN_MODEM_ANZREG]; /* Modem-Registers */ + char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */ + char msn[ISDN_MSNLEN]; /* EAZ/MSN */ #ifdef CONFIG_ISDN_AUDIO - u_char vpar[10]; /* Voice-parameters */ - int lastDLE; /* Flag for voice-coding: DLE seen */ + u_char vpar[10]; /* Voice-parameters */ + int lastDLE; /* Flag for voice-coding: DLE seen */ #endif - int mdmcmdl; /* Length of Modem-Commandbuffer */ - int pluscount; /* Counter for +++ sequence */ - int lastplus; /* Timestamp of last + */ - char mdmcmd[255]; /* Modem-Commandbuffer */ + int mdmcmdl; /* Length of Modem-Commandbuffer */ + int pluscount; /* Counter for +++ sequence */ + int lastplus; /* Timestamp of last + */ + char mdmcmd[255]; /* Modem-Commandbuffer */ + unsigned int charge; /* Charge units of current connection */ } atemu; /* Private data (similar to async_struct in <linux/serial.h>) */ @@ -590,8 +657,8 @@ typedef struct { struct sqqueue { struct sqqueue *next; - int sqno_start; - int sqno_end; + long sqno_start; + long sqno_end; struct sk_buff *skb; long timer; }; @@ -599,7 +666,7 @@ struct sqqueue { struct mpqueue { struct mpqueue *next; struct mpqueue *last; - int sqno; + long sqno; struct sk_buff *skb; int BEbyte; unsigned long time; @@ -638,18 +705,44 @@ struct ippp_struct { struct slcompress *slcomp; #endif unsigned long debug; - struct isdn_ppp_compressor *compressor; + struct isdn_ppp_compressor *compressor,*link_compressor; + void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat; }; #endif /*======================== End of sync-ppp stuff ===========================*/ +/*======================== Start of V.110 stuff ============================*/ +#define V110_BUFSIZE 1024 + +typedef struct { + int nbytes; /* 1 Matrixbyte -> nbytes in stream */ + int nbits; /* Number of used bits in streambyte */ + unsigned char key; /* Bitmask in stream eg. 11 (nbits=2) */ + int decodelen; /* Amount of data in decodebuf */ + int SyncInit; /* Number of sync frames to send */ + unsigned char *OnlineFrame; /* Precalculated V110 idle frame */ + unsigned char *OfflineFrame; /* Precalculated V110 sync Frame */ + int framelen; /* Length of frames */ + int skbuser; /* Number of unacked userdata skbs */ + int skbidle; /* Number of unacked idle/sync skbs */ + int introducer; /* Local vars for decoder */ + int dbit; + unsigned char b; + int skbres; /* space to reserve in outgoing skb */ + int maxsize; /* maxbufsize of lowlevel driver */ + unsigned char *encodebuf; /* temporary buffer for encoding */ + unsigned char decodebuf[V110_BUFSIZE]; /* incomplete V110 matrices */ +} isdn_v110_stream; + +/*========================= End of V.110 stuff =============================*/ + /*======================= Start of general stuff ===========================*/ typedef struct { - char *next; - char *private; + char *next; + char *private; } infostruct; /* Description of hardware-level-driver */ @@ -704,6 +797,9 @@ typedef struct isdn_devt { isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */ ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */ ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */ + int v110emu[ISDN_MAX_CHANNELS];/* V.110 emulator-mode 0=none */ + atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */ + isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ } isdn_dev; extern isdn_dev *dev; diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 71bbc557a..177646520 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h @@ -1,23 +1,8 @@ #ifndef _LINUX_ISDN_PPP_H #define _LINUX_ISDN_PPP_H -struct isdn_ppp_compressor -{ - struct isdn_ppp_compressor *next,*prev; - int num; /* proto num */ - void *priv; /* private data for compressor */ - int (*open)(struct isdn_ppp_compressor *); - int (*close)(struct isdn_ppp_compressor *); - int (*reset)(struct isdn_ppp_compressor *,int type); - int (*config)(struct isdn_ppp_compressor *,void *data,int data_len); - struct sk_buff *(*compress)(struct isdn_ppp_compressor *,struct sk_buff *); - struct sk_buff *(*uncompress)(struct isdn_ppp_compressor *,struct sk_buff *); -}; - extern int isdn_ppp_dial_slave(char *); extern int isdn_ppp_hangup_slave(char *); -extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *); -extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *); #define CALLTYPE_INCOMING 0x1 #define CALLTYPE_OUTGOING 0x2 @@ -31,18 +16,17 @@ struct pppcallinfo int charge_units; }; - #define PPPIOCGCALLINFO _IOWR('t',128,struct pppcallinfo) #define PPPIOCBUNDLE _IOW('t',129,int) #define PPPIOCGMPFLAGS _IOR('t',130,int) #define PPPIOCSMPFLAGS _IOW('t',131,int) #define PPPIOCSMPMTU _IOW('t',132,int) #define PPPIOCSMPMRU _IOW('t',133,int) +#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long) +#define PPPIOCSCOMPRESSOR _IOW('t',135,int) -#define PPPIOCGCOMPRESSORS _IOR('t',134,unsigned long) -#define PPPIOCSCOMPRESSOR _IOW('t',135,int) - -#define PPP_MP 0x003d +#define PPP_MP 0x003d +#define PPP_LINK_COMP 0x00fb #define SC_MP_PROT 0x00000200 #define SC_REJ_MP_PROT 0x00000400 @@ -52,4 +36,36 @@ struct pppcallinfo #define MP_END_FRAG 0x40 #define MP_BEGIN_FRAG 0x80 -#endif +#ifdef __KERNEL__ +/* + * this is an 'old friend' from ppp-comp.h under a new name + * check the original include for more information + */ +struct isdn_ppp_compressor { + struct isdn_ppp_compressor *next,*prev; + int num; /* CCP compression protocol number */ + void *(*comp_alloc) (unsigned char *options, int opt_len); + void (*comp_free) (void *state); + int (*comp_init) (void *state, unsigned char *options, int opt_len, + int unit, int opthdr, int debug); + void (*comp_reset) (void *state); + int (*compress) (void *state,struct sk_buff *in, struct sk_buff *skb_out, + int proto); + void (*comp_stat) (void *state, struct compstat *stats); + void *(*decomp_alloc) (unsigned char *options, int opt_len); + void (*decomp_free) (void *state); + int (*decomp_init) (void *state, unsigned char *options, + int opt_len, int unit, int opthdr, int mru, int debug); + void (*decomp_reset) (void *state); + int (*decompress) (void *state, unsigned char *ibuf, int isize, unsigned char *obuf, int osize); + void (*incomp) (void *state, unsigned char *ibuf, int icnt); + void (*decomp_stat) (void *state, struct compstat *stats); +}; + +extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *); +extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *); + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_ISDN_PPP_H */ + diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h index a3f6773a4..e7a7f247c 100644 --- a/include/linux/isdnif.h +++ b/include/linux/isdnif.h @@ -1,4 +1,8 @@ -/* $Id: isdnif.h,v 1.20 1997/05/27 15:18:06 fritz Exp $ +/* X25 changes: + Added constants ISDN_PROTO_L2_X25DTE/DCE and corresponding ISDN_FEATURE_.. + */ + +/* $Id: isdnif.h,v 1.23 1998/02/20 17:36:52 fritz Exp $ * * Linux ISDN subsystem * @@ -22,6 +26,22 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdnif.h,v $ + * Revision 1.23 1998/02/20 17:36:52 fritz + * Added L2-protocols for V.110, changed FEATURE-Flag-constants. + * + * Revision 1.22 1998/01/31 22:14:12 keil + * changes for 2.1.82 + * + * Revision 1.21 1997/10/09 21:28:13 fritz + * New HL<->LL interface: + * New BSENT callback with nr. of bytes included. + * Sending without ACK. + * New L1 error status (not yet in use). + * Cleaned up obsolete structures. + * Implemented Cisco-SLARP. + * Changed local net-interface data to be dynamically allocated. + * Removed old 2.0 compatibility stuff. + * * Revision 1.20 1997/05/27 15:18:06 fritz * Added changes for recent 2.1.x kernels: * changed return type of isdn_close @@ -104,20 +124,28 @@ #define ISDN_PTYPE_EURO 2 /* EDSS1-protocol */ #define ISDN_PTYPE_LEASED 3 /* for leased lines */ #define ISDN_PTYPE_NI1 4 /* US NI-1 protocol */ +#define ISDN_PTYPE_MAX 7 /* Max. 8 Protocols */ /* * Values for Layer-2-protocol-selection */ -#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */ -#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */ -#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */ -#define ISDN_PROTO_L2_HDLC 3 /* HDLC */ -#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */ +#define ISDN_PROTO_L2_X75I 0 /* X75/LAPB with I-Frames */ +#define ISDN_PROTO_L2_X75UI 1 /* X75/LAPB with UI-Frames */ +#define ISDN_PROTO_L2_X75BUI 2 /* X75/LAPB with UI-Frames */ +#define ISDN_PROTO_L2_HDLC 3 /* HDLC */ +#define ISDN_PROTO_L2_TRANS 4 /* Transparent (Voice) */ +#define ISDN_PROTO_L2_X25DTE 5 /* X25/LAPB DTE mode */ +#define ISDN_PROTO_L2_X25DCE 6 /* X25/LAPB DCE mode */ +#define ISDN_PROTO_L2_V11096 7 /* V.110 bitrate adaption 9600 Baud */ +#define ISDN_PROTO_L2_V11019 8 /* V.110 bitrate adaption 19200 Baud */ +#define ISDN_PROTO_L2_V11038 9 /* V.110 bitrate adaption 38400 Baud */ +#define ISDN_PROTO_L2_MAX 15 /* Max. 16 Protocols */ /* * Values for Layer-3-protocol-selection */ #define ISDN_PROTO_L3_TRANS 0 /* Transparent */ +#define ISDN_PROTO_L3_MAX 7 /* Max. 8 Protocols */ #ifdef __KERNEL__ @@ -127,7 +155,7 @@ * Commands from linklevel to lowlevel * */ -#define ISDN_CMD_IOCTL 0 /* Perform ioctl */ +#define ISDN_CMD_IOCTL 0 /* Perform ioctl */ #define ISDN_CMD_DIAL 1 /* Dial out */ #define ISDN_CMD_ACCEPTD 2 /* Accept an incoming call on D-Chan. */ #define ISDN_CMD_ACCEPTB 3 /* Request B-Channel connect. */ @@ -166,6 +194,13 @@ #define ISDN_STAT_NODCH 268 /* Signal no D-Channel */ #define ISDN_STAT_ADDCH 269 /* Add more Channels */ #define ISDN_STAT_CAUSE 270 /* Cause-Message */ +#define ISDN_STAT_L1ERR 271 /* Signal Layer-1 Error */ + +/* + * Values for errcode field + */ +#define ISDN_STAT_L1ERR_SEND 1 +#define ISDN_STAT_L1ERR_RECV 2 /* * Values for feature-field of interface-struct. @@ -176,15 +211,29 @@ #define ISDN_FEATURE_L2_X75BUI (0x0001 << ISDN_PROTO_L2_X75BUI) #define ISDN_FEATURE_L2_HDLC (0x0001 << ISDN_PROTO_L2_HDLC) #define ISDN_FEATURE_L2_TRANS (0x0001 << ISDN_PROTO_L2_TRANS) +#define ISDN_FEATURE_L2_X25DTE (0x0001 << ISDN_PROTO_L2_X25DTE) +#define ISDN_FEATURE_L2_X25DCE (0x0001 << ISDN_PROTO_L2_X25DCE) +#define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096) +#define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019) +#define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038) + +#define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */ +#define ISDN_FEATURE_L2_SHIFT (0) /* Layer 3 */ -#define ISDN_FEATURE_L3_TRANS (0x0100 << ISDN_PROTO_L3_TRANS) +#define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS) + +#define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */ +#define ISDN_FEATURE_L3_SHIFT (16) /* Signaling */ -#define ISDN_FEATURE_P_UNKNOWN (0x1000 << ISDN_PTYPE_UNKNOWN) -#define ISDN_FEATURE_P_1TR6 (0x1000 << ISDN_PTYPE_1TR6) -#define ISDN_FEATURE_P_EURO (0x1000 << ISDN_PTYPE_EURO) -#define ISDN_FEATURE_P_NI1 (0x1000 << ISDN_PTYPE_NI1) +#define ISDN_FEATURE_P_UNKNOWN (0x1000000 << ISDN_PTYPE_UNKNOWN) +#define ISDN_FEATURE_P_1TR6 (0x1000000 << ISDN_PTYPE_1TR6) +#define ISDN_FEATURE_P_EURO (0x1000000 << ISDN_PTYPE_EURO) +#define ISDN_FEATURE_P_NI1 (0x1000000 << ISDN_PTYPE_NI1) + +#define ISDN_FEATURE_P_MASK (0x0FF000000) /* Max. 8 Protocols */ +#define ISDN_FEATURE_P_SHIFT (24) typedef struct setup_parm { char phone[32]; /* Remote Phone-Number */ @@ -204,6 +253,8 @@ typedef struct { int command; /* Command or Status (see above) */ ulong arg; /* Additional Data */ union { + ulong errcode; /* Type of error with STAT_L1ERR */ + int length; /* Amount of bytes sent with STAT_BSENT */ char num[50]; /* Additional Data */ setup_parm setup; } parm; @@ -238,19 +289,6 @@ typedef struct { */ unsigned short hl_hdrlen; - /* Receive-Callback - * Parameters: - * int Driver-ID - * int local channel-number (0 ...) - * u_char pointer to received data (in Kernel-Space, volatile) - * int length of data - * - * NOTE: This callback is obsolete, and will be removed when all - * current LL-drivers support rcvcall_skb. Do NOT use for new - * drivers. - */ - void (*rcvcallb)(int, int, u_char*, int); - /* * Receive-Callback using sk_buff's * Parameters: @@ -269,6 +307,7 @@ typedef struct { * num = depending on status-type. */ int (*statcallb)(isdn_ctrl*); + /* Send command * Parameters: * isdn_ctrl* @@ -278,31 +317,16 @@ typedef struct { * num = depending on command. */ int (*command)(isdn_ctrl*); - /* Send Data - * Parameters: - * int driverId - * int local channel-number (0 ...) - * u_char pointer to data - * int length of data - * int Flag: 0 = Call form Kernel-Space (use memcpy, - * no schedule allowed) - * 1 = Data is in User-Space (use memcpy_fromfs, - * may schedule) - * - * NOTE: This call is obsolete, and will be removed when all - * current LL-drivers support writebuf_skb. Do NOT use for new - * drivers. - */ - int (*writebuf)(int, int, const u_char*, int, int); /* * Send data using sk_buff's * Parameters: * int driverId * int local channel-number (0...) + * int Flag: Need ACK for this packet. * struct sk_buff *skb Data to send */ - int (*writebuf_skb) (int, int, struct sk_buff *); + int (*writebuf_skb) (int, int, int, struct sk_buff *); /* Send raw D-Channel-Commands * Parameters: @@ -316,6 +340,7 @@ typedef struct { * int local channel-number (0 ...) */ int (*writecmd)(const u_char*, int, int, int, int); + /* Read raw Status replies * u_char pointer data (volatile) * int length of buffer @@ -327,6 +352,7 @@ typedef struct { * int local channel-number (0 ...) */ int (*readstat)(u_char*, int, int, int, int); + char id[20]; } isdn_if; @@ -339,8 +365,7 @@ typedef struct { * supporting sk_buff's should set this to 0. * command Address of Command-Handler. * features Bitwise coded Features of this driver. (use ISDN_FEATURE_...) - * writebuf Address of Send-Command-Handler. OBSOLETE do NOT use anymore. - * writebuf_skb Address of Skbuff-Send-Handler. (NULL if not supported) + * writebuf_skb Address of Skbuff-Send-Handler. * writecmd " " D-Channel " which accepts raw D-Ch-Commands. * readstat " " D-Channel " which delivers raw Status-Data. * @@ -348,72 +373,16 @@ typedef struct { * * channels Driver-ID assigned to this driver. (Must be used on all * subsequent callbacks. - * rcvcallb Address of handler for received data. OBSOLETE, do NOT use anymore. - * rcvcallb_skb Address of handler for received Skbuff's. (NULL if not supp.) + * rcvcallb_skb Address of handler for received Skbuff's. * statcallb " " " for status-changes. * */ extern int register_isdn(isdn_if*); -/* Compatibility Linux-2.0.X <-> Linux-2.1.X */ - #ifndef LINUX_VERSION_CODE #include <linux/version.h> #endif -#if (LINUX_VERSION_CODE < 0x020100) -#include <linux/mm.h> - -static inline unsigned long copy_from_user(void *to, const void *from, unsigned long n) -{ - int i; - if ((i = verify_area(VERIFY_READ, from, n)) != 0) - return i; - memcpy_fromfs(to, from, n); - return 0; -} - -static inline unsigned long copy_to_user(void *to, const void *from, unsigned long n) -{ - int i; - if ((i = verify_area(VERIFY_WRITE, to, n)) != 0) - return i; - memcpy_tofs(to, from, n); - return 0; -} - -#define GET_USER(x, addr) ( x = get_user(addr) ) -#define RWTYPE int -#define LSTYPE int -#define RWARG int -#define LSARG off_t -#else #include <asm/uaccess.h> -#define GET_USER get_user -#define PUT_USER put_user -#define RWTYPE ssize_t -#define LSTYPE long long -#define RWARG size_t -#define LSARG long long -#endif - -#if (LINUX_VERSION_CODE < 0x02010F) -#define SET_SKB_FREE(x) ( x->free = 1 ) -#else -#define SET_SKB_FREE(x) -#endif - -#if (LINUX_VERSION_CODE < 0x02011F) -#define CLOSETYPE void -#define CLOSEVAL -#else -#define CLOSETYPE int -#define CLOSEVAL (0) -#endif - -#if (LINUX_VERSION_CODE < 0x020125) -#define test_and_clear_bit clear_bit -#define test_and_set_bit set_bit -#endif #endif /* __KERNEL__ */ #endif /* isdnif_h */ diff --git a/include/linux/joystick.h b/include/linux/joystick.h index 05d0bbab8..2a3f1f8ba 100644 --- a/include/linux/joystick.h +++ b/include/linux/joystick.h @@ -2,19 +2,18 @@ #define _LINUX_JOYSTICK_H /* - * $Id: joystick.h,v 1.2 1997/10/31 19:11:57 mj Exp $ + * $Id: joystick.h,v 1.3 1998/03/30 11:10:40 mj Exp $ * - * Copyright (C) 1997 Vojtech Pavlik + * Copyright (C) 1997, 1998 Vojtech Pavlik */ -#include <linux/ioctl.h> #include <asm/types.h> /* * Version */ -#define JS_VERSION 0x00010006L /* 1.0.6 BCD */ +#define JS_VERSION 0x00010007L /* 1.0.7 BCD */ /* * IOCTL commands for joystick driver diff --git a/include/linux/kernel.h b/include/linux/kernel.h index a5e6544f6..20fe4fa68 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -69,10 +69,10 @@ asmlinkage int printk(const char * fmt, ...) */ #define NIPQUAD(addr) \ - (((addr) >> 0) & 0xff), \ - (((addr) >> 8) & 0xff), \ - (((addr) >> 16) & 0xff), \ - (((addr) >> 24) & 0xff) + (int)(((addr) >> 0) & 0xff), \ + (int)(((addr) >> 8) & 0xff), \ + (int)(((addr) >> 16) & 0xff), \ + (int)(((addr) >> 24) & 0xff) #endif /* __KERNEL__ */ diff --git a/include/linux/lists.h b/include/linux/lists.h index 04f905aaf..6a2240a20 100644 --- a/include/linux/lists.h +++ b/include/linux/lists.h @@ -13,7 +13,7 @@ #define DLIST_INIT(listnam) \ (listnam).dl_prev = &(listnam); \ - (listnam).dl_last = &(listnam); + (listnam).dl_next = &(listnam); #define DLIST_NEXT(listnam) listnam.dl_next #define DLIST_PREV(listnam) listnam.dl_prev @@ -38,3 +38,25 @@ node->listnam.dl_next->listnam.dl_prev = \ node->listnam.dl_prev; \ } while (0) + +/* + * queue-style operations, which have a head and tail + */ + +#define QUEUE_INIT(head, listnam, ptype) \ + (head)->listnam.dl_prev = (head)->listnam.dl_next = (ptype)(head); + +#define QUEUE_FIRST(head, listnam) (head)->DLIST_NEXT(listnam) +#define QUEUE_LAST(head, listnam) (head)->DLIST_PREV(listnam) +#define QUEUE_EMPTY(head, listnam) \ + ((QUEUE_FIRST(head, listnam) == QUEUE_LAST(head, listnam)) && \ + ((u_long)QUEUE_FIRST(head, listnam) == (u_long)head)) + +#define QUEUE_ENTER(head, new, listnam, ptype) do { \ + (new)->listnam.dl_prev = (ptype)(head); \ + (new)->listnam.dl_next = (head)->listnam.dl_next; \ + (head)->listnam.dl_next->listnam.dl_prev = (new); \ + (head)->listnam.dl_next = (new); \ + } while (0) + +#define QUEUE_REMOVE(head, node, listnam) DLIST_DELETE(node, listnam) diff --git a/include/linux/major.h b/include/linux/major.h index 6dee4de76..8a59c1fb6 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 IDE4_MAJOR 56 +#define IDE5_MAJOR 57 + #define SPECIALIX_NORMAL_MAJOR 75 #define SPECIALIX_CALLOUT_MAJOR 76 diff --git a/include/linux/mm.h b/include/linux/mm.h index 2140eac53..8114875ae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -133,7 +133,7 @@ typedef struct page { #define PG_uptodate 3 #define PG_free_after 4 #define PG_decr_after 5 -/* Unused 6 */ +#define PG_swap_unlock_after 6 #define PG_DMA 7 #define PG_Slab 8 #define PG_swap_cache 9 @@ -146,6 +146,7 @@ typedef struct page { #define PageUptodate(page) (test_bit(PG_uptodate, &(page)->flags)) #define PageFreeAfter(page) (test_bit(PG_free_after, &(page)->flags)) #define PageDecrAfter(page) (test_bit(PG_decr_after, &(page)->flags)) +#define PageSwapUnlockAfter(page) (test_bit(PG_swap_unlock_after, &(page)->flags)) #define PageDMA(page) (test_bit(PG_DMA, &(page)->flags)) #define PageSlab(page) (test_bit(PG_Slab, &(page)->flags)) #define PageSwapCache(page) (test_bit(PG_swap_cache, &(page)->flags)) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e795ccb49..aa9568e83 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -256,6 +256,7 @@ struct device struct Qdisc *qdisc; struct Qdisc *qdisc_sleeping; + struct Qdisc *qdisc_list; unsigned long tx_queue_len; /* Max frames per queue allowed */ /* Pointers to interface service routines. */ diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 83d9fae1b..bd4f9dd9b 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -161,7 +161,7 @@ __nlmsg_put(struct sk_buff *skb, pid_t pid, u32 seq, int type, int len) } #define NLMSG_PUT(skb, pid, seq, type, len) \ -({ if (skb_tailroom(skb) < NLMSG_SPACE(len)) goto nlmsg_failure; \ +({ if (skb_tailroom(skb) < (int)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, diff --git a/include/linux/parport.h b/include/linux/parport.h index 35b7fbb5a..d03aca79f 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -14,6 +14,7 @@ #define PARPORT_IRQ_AUTO -2 #define PARPORT_DMA_AUTO -2 #define PARPORT_DISABLE -2 +#define PARPORT_IRQ_PROBEONLY -3 #define PARPORT_CONTROL_STROBE 0x1 #define PARPORT_CONTROL_AUTOFD 0x2 @@ -291,6 +292,7 @@ extern __inline__ unsigned int parport_yield_blocking(struct pardevice *dev) #define PARPORT_FLAG_COMA 1 +extern void parport_parse_irqs(int, const char *[], int irqval[]); extern int parport_ieee1284_nibble_mode_ok(struct parport *, unsigned char); extern int parport_wait_peripheral(struct parport *, unsigned char, unsigned char); diff --git a/include/linux/pci.h b/include/linux/pci.h index 138710213..77acd8c0f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1,25 +1,25 @@ /* - * $Id: pci.h,v 1.51 1997/12/27 13:55:23 mj Exp $ + * $Id: pci.h,v 1.67 1998/04/16 20:48:33 mj Exp $ * - * PCI defines and function prototypes - * Copyright 1994, Drew Eckhardt - * Copyright 1997, Martin Mares <mj@atrey.karlin.mff.cuni.cz> + * PCI defines and function prototypes + * Copyright 1994, Drew Eckhardt + * Copyright 1997, Martin Mares <mj@atrey.karlin.mff.cuni.cz> * - * For more information, please consult + * For more information, please consult * - * PCI BIOS Specification Revision - * PCI Local Bus Specification - * PCI System Design Guide + * PCI BIOS Specification Revision + * PCI Local Bus Specification + * PCI System Design Guide * - * PCI Special Interest Group - * M/S HF3-15A - * 5200 N.E. Elam Young Parkway - * Hillsboro, Oregon 97124-6497 - * +1 (503) 696-2000 - * +1 (800) 433-5177 + * PCI Special Interest Group + * M/S HF3-15A + * 5200 N.E. Elam Young Parkway + * Hillsboro, Oregon 97124-6497 + * +1 (503) 696-2000 + * +1 (800) 433-5177 * - * Manuals are $25 each or $50 for all three, plus $7 shipping - * within the United States, $35 abroad. + * Manuals are $25 each or $50 for all three, plus $7 shipping + * within the United States, $35 abroad. */ #ifndef LINUX_PCI_H @@ -68,6 +68,10 @@ #define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ #define PCI_LATENCY_TIMER 0x0d /* 8 bits */ #define PCI_HEADER_TYPE 0x0e /* 8 bits */ +#define PCI_HEADER_TYPE_NORMAL 0 +#define PCI_HEADER_TYPE_BRIDGE 1 +#define PCI_HEADER_TYPE_CARDBUS 2 + #define PCI_BIST 0x0f /* 8 bits */ #define PCI_BIST_CODE_MASK 0x0f /* Return result */ #define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ @@ -93,18 +97,18 @@ #define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M */ #define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ #define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ -#define PCI_BASE_ADDRESS_MEM_MASK (~0x0f) -#define PCI_BASE_ADDRESS_IO_MASK (~0x03) +#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL) +#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL) /* bit 1 is reserved if address_space = 1 */ /* Header type 0 (normal devices) */ #define PCI_CARDBUS_CIS 0x28 -#define PCI_SUBSYSTEM_ID 0x2c -#define PCI_SUBSYSTEM_VENDOR_ID 0x2e -#define PCI_ROM_ADDRESS 0x30 /* 32 bits */ -#define PCI_ROM_ADDRESS_ENABLE 0x01 /* Write 1 to enable ROM, - bits 31..11 are address, - 10..2 are reserved */ +#define PCI_SUBSYSTEM_VENDOR_ID 0x2c +#define PCI_SUBSYSTEM_ID 0x2e +#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ +#define PCI_ROM_ADDRESS_ENABLE 0x01 +#define PCI_ROM_ADDRESS_MASK (~0x7ffUL) + /* 0x34-0x3b are reserved */ #define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ #define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ @@ -149,6 +153,36 @@ #define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ #define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ +/* Header type 2 (CardBus bridges) -- detailed info welcome */ +#define PCI_CB_CARDBUS_BASE 0x10 /* CardBus Socket/ExCa base address */ +#define PCI_CB_CARDBUS_BASE_TYPE_MASK 0xfff +#define PCI_CB_CARDBUS_BASE_MASK ~0xfff +#define PCI_CB_CAPABILITIES 0x14 /* Offset of list of capabilities in cfg space */ +/* 0x15 reserved */ +#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ +#define PCI_CB_BUS_NUMBER 0x18 /* PCI bus number */ +#define PCI_CB_CARDBUS_NUMBER 0x19 /* CardBus bus number */ +#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ +#define PCI_CB_CARDBUS_LATENCY 0x1b /* CardBus latency timer */ +#define PCI_CB_MEMORY_BASE_0 0x1c +#define PCI_CB_MEMORY_LIMIT_0 0x20 +#define PCI_CB_MEMORY_BASE_1 0x24 +#define PCI_CB_MEMORY_LIMIT_1 0x28 +#define PCI_CB_IO_BASE_0 0x2c +#define PCI_CB_IO_BASE_0_HI 0x2e +#define PCI_CB_IO_LIMIT_0 0x30 +#define PCI_CB_IO_LIMIT_0_HI 0x32 +#define PCI_CB_IO_BASE_1 0x34 +#define PCI_CB_IO_BASE_1_HI 0x36 +#define PCI_CB_IO_LIMIT_1 0x38 +#define PCI_CB_IO_LIMIT_1_HI 0x3a +/* 0x3c-0x3d are same as for htype 0 */ +/* 0x3e-0x3f are same as for htype 1 */ +#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 +#define PCI_CB_SUBSYSTEM_ID 0x42 +#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ +/* 0x48-0x7f reserved */ + /* Device classes and subclasses */ #define PCI_CLASS_NOT_DEFINED 0x0000 @@ -236,7 +270,8 @@ /* * Vendor and card ID's: sort these numerically according to vendor - * (and according to card ID within vendor) + * (and according to card ID within vendor). Send all updates to + * <linux-pcisupport@cck.uni-kl.de>. */ #define PCI_VENDOR_ID_COMPAQ 0x0e11 #define PCI_DEVICE_ID_COMPAQ_1280 0x3033 @@ -503,7 +538,7 @@ #define PCI_VENDOR_ID_CONTAQ 0x1080 #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 -/* ??? Alpha SX164 has reference to device nr 0xc693 as a CYPRESS bridge. */ +#define PCI_DEVICE_ID_CONTAQ_82C693 0xC693 #define PCI_VENDOR_ID_FOREX 0x1083 @@ -518,7 +553,9 @@ #define PCI_VENDOR_ID_SUN 0x108e #define PCI_DEVICE_ID_SUN_EBUS 0x1000 #define PCI_DEVICE_ID_SUN_HAPPYMEAL 0x1001 +#define PCI_DEVICE_ID_SUN_SIMBA 0x5000 #define PCI_DEVICE_ID_SUN_PBM 0x8000 +#define PCI_DEVICE_ID_SUN_SABRE 0xa000 #define PCI_VENDOR_ID_CMD 0x1095 #define PCI_DEVICE_ID_CMD_640 0x0640 @@ -601,6 +638,8 @@ #define PCI_VENDOR_ID_CERN 0x10dc #define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001 #define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002 +#define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021 +#define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022 #define PCI_VENDOR_ID_NVIDIA 0x10de @@ -786,6 +825,9 @@ #define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200 #define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201 +#define PCI_VENDOR_ID_ESSENTIAL 0x120f +#define PCI_DEVICE_ID_ROADRUNNER 0x0001 + #define PCI_VENDOR_ID_O2 0x1217 #define PCI_DEVICE_ID_O2_6832 0x6832 @@ -896,6 +938,7 @@ #define PCI_DEVICE_ID_KTI_ET32P2 0x3000 #define PCI_VENDOR_ID_ADAPTEC 0x9004 +#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 #define PCI_DEVICE_ID_ADAPTEC_5800 0x5800 @@ -937,6 +980,44 @@ #define PCI_FUNC(devfn) ((devfn) & 0x07) #ifdef __KERNEL__ + +/* + * Error values that may be returned by the PCI bios. + */ +#define PCIBIOS_SUCCESSFUL 0x00 +#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81 +#define PCIBIOS_BAD_VENDOR_ID 0x83 +#define PCIBIOS_DEVICE_NOT_FOUND 0x86 +#define PCIBIOS_BAD_REGISTER_NUMBER 0x87 +#define PCIBIOS_SET_FAILED 0x88 +#define PCIBIOS_BUFFER_TOO_SMALL 0x89 + +/* Direct configuration space access */ + +int pcibios_present (void); +void pcibios_init(void); +void pcibios_fixup(void); +char *pcibios_setup (char *str); +int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned char *val); +int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned short *val); +int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned int *val); +int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned char val); +int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned short val); +int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned int val); + +/* Don't use these in new code, use pci_find_... instead */ + +int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn); +int pcibios_find_device (unsigned short vendor, unsigned short dev_id, + unsigned short index, unsigned char *bus, + unsigned char *dev_fn); + /* * There is one pci_dev structure for each slot-number/function-number * combination: @@ -952,6 +1033,7 @@ struct pci_dev { unsigned short vendor; unsigned short device; unsigned int class; /* 3 bytes: (base,sub,prog-if) */ + unsigned int hdr_type; /* PCI header type */ unsigned int master : 1; /* set if device is master capable */ /* * In theory, the irq level can be read from configuration @@ -970,6 +1052,7 @@ struct pci_dev { * pcibios_fixup() as necessary. */ unsigned long base_address[6]; + unsigned long rom_address; }; struct pci_bus { @@ -991,13 +1074,26 @@ struct pci_bus { extern struct pci_bus pci_root; /* root bus */ extern struct pci_dev *pci_devices; /* list of all devices */ -extern unsigned long pci_init (unsigned long mem_start, unsigned long mem_end); - -extern unsigned int pci_scan_bus (struct pci_bus *bus, unsigned long *mem_startp); - -extern int get_pci_list (char *buf); - -extern void pci_quirks_init (void); +void pci_init(void); +void pci_setup(char *str, int *ints); +void pci_quirks_init(void); +unsigned int pci_scan_bus(struct pci_bus *bus); +void pci_proc_init(void); +void proc_old_pci_init(void); +int get_pci_list(char *buf); + +struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, struct pci_dev *from); +struct pci_dev *pci_find_class (unsigned int class, struct pci_dev *from); +struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); + +#define pci_present pcibios_present +#define pci_read_config_byte(dev, where, val) pcibios_read_config_byte(dev->bus->number, dev->devfn, where, val) +#define pci_read_config_word(dev, where, val) pcibios_read_config_word(dev->bus->number, dev->devfn, where, val) +#define pci_read_config_dword(dev, where, val) pcibios_read_config_dword(dev->bus->number, dev->devfn, where, val) +#define pci_write_config_byte(dev, where, val) pcibios_write_config_byte(dev->bus->number, dev->devfn, where, val) +#define pci_write_config_word(dev, where, val) pcibios_write_config_word(dev->bus->number, dev->devfn, where, val) +#define pci_write_config_dword(dev, where, val) pcibios_write_config_dword(dev->bus->number, dev->devfn, where, val) +void pci_set_master(struct pci_dev *); #endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */ diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h new file mode 100644 index 000000000..0c38cac86 --- /dev/null +++ b/include/linux/pkt_cls.h @@ -0,0 +1,117 @@ +#ifndef __LINUX_PKT_CLS_H +#define __LINUX_PKT_CLS_H + +struct tc_police +{ + __u32 index; + int action; +#define TC_POLICE_UNSPEC (-1) +#define TC_POLICE_OK 0 +#define TC_POLICE_RECLASSIFY 1 +#define TC_POLICE_SHOT 2 + + __u32 limit; + __u32 burst; + __u32 mtu; + struct tc_ratespec rate; + struct tc_ratespec peakrate; +}; + +enum +{ + TCA_POLICE_UNSPEC, + TCA_POLICE_TBF, + TCA_POLICE_RATE, + TCA_POLICE_PEAKRATE, +}; + +#define TCA_POLICE_MAX TCA_POLICE_PEAKRATE + +/* U32 filters */ + +#define TC_U32_HTID(h) ((h)&0xFFF00000) +#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20) +#define TC_U32_HASH(h) (((h)>>12)&0xFF) +#define TC_U32_NODE(h) ((h)&0xFFF) +#define TC_U32_KEY(h) ((h)&0xFFFFF) +#define TC_U32_UNSPEC 0 +#define TC_U32_ROOT (0xFFF00000) + +enum +{ + TCA_U32_UNSPEC, + TCA_U32_CLASSID, + TCA_U32_HASH, + TCA_U32_LINK, + TCA_U32_DIVISOR, + TCA_U32_SEL, + TCA_U32_POLICE, +}; + +#define TCA_U32_MAX TCA_U32_POLICE + +struct tc_u32_key +{ + __u32 mask; + __u32 val; + int off; + int offmask; +}; + +struct tc_u32_sel +{ + unsigned char flags; + unsigned char offshift; + unsigned char nkeys; + + __u16 offmask; + __u16 off; + short offoff; + + short hoff; + __u32 hmask; + + struct tc_u32_key keys[0]; +}; + +/* Flags */ + +#define TC_U32_TERMINAL 1 +#define TC_U32_OFFSET 2 +#define TC_U32_VAROFFSET 4 +#define TC_U32_EAT 8 + +#define TC_U32_MAXDEPTH 8 + + +/* RSVP filter */ + +enum +{ + TCA_RSVP_UNSPEC, + TCA_RSVP_CLASSID, + TCA_RSVP_DST, + TCA_RSVP_SRC, + TCA_RSVP_PINFO, + TCA_RSVP_POLICE, +}; + +#define TCA_RSVP_MAX TCA_RSVP_POLICE + +struct tc_rsvp_gpi +{ + __u32 key; + __u32 mask; + int offset; +}; + +struct tc_rsvp_pinfo +{ + struct tc_rsvp_gpi dpi; + struct tc_rsvp_gpi spi; + __u8 protocol; + __u8 tunnelid; + __u8 tunnelhdr; +}; + +#endif diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index b72ca41c1..4ec170dbd 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h @@ -1,15 +1,17 @@ #ifndef __LINUX_PKT_SCHED_H #define __LINUX_PKT_SCHED_H -#define PSCHED_TC_INIT 1 -#define PSCHED_TC_DESTROY 2 -#define PSCHED_TC_ATTACH 3 -#define PSCHED_TC_DETACH 4 +/* Logical priority bands not depending on specific packet scheduler. + Every scheduler will map them to real traffic classes, if it has + no more precise mechanism to classify packets. + These numbers have no special meaning, though their coincidence + with obsolete IPv6 values is not occasional :-). New IPv6 drafts + preferred full anarchy inspired by diffserv group. -/* "Logical" priority bands, not depending of concrete packet scheduler. - Every scheduler will map them to real traffic classes, if it have - no more precise machanism. + Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy + class, actually, as rule it will be handled with more care than + filler or even bulk. */ #define TC_PRIO_BESTEFFORT 0 @@ -19,75 +21,257 @@ #define TC_PRIO_INTERACTIVE 6 #define TC_PRIO_CONTROL 7 +#define TC_PRIO_MAX 15 -struct pschedctl +/* Generic queue statistics, available for all the elements. + Particular schedulers may have also their private records. + */ + +struct tc_stats { - int command; - int handle; - int child; - int ifindex; - char id[IFNAMSIZ]; - int arglen; - char args[0]; + __u64 bytes; /* NUmber of enqueues bytes */ + __u32 packets; /* Number of enqueued packets */ + __u32 drops; /* Packets dropped because of lack of resources */ + __u32 overlimits; /* Number of throttle events when this + * flow goes out of allocated bandwidth */ + __u32 bps; /* Current flow byte rate */ + __u32 pps; /* Current flow packet rate */ + __u32 qlen; + __u32 backlog; }; -/* CBQ section */ +struct tc_estimator +{ + char interval; + unsigned char ewma_log; +}; + +/* "Handles" + --------- + + All the traffic control objects have 32bit identifiers, or "handles". + + They can be considered as opaque numbers from user API viewpoint, + but actually they always consist of two fields: major and + minor numbers, which are interpreted by kernel specially, + that may be used by applications, though not recommended. + + F.e. qdisc handles always have minor number equal to zero, + classes (or flows) have major equal to parent qdisc major, and + minor uniquely identifying class inside qdisc. + + Macros to manipulate handles: + */ + +#define TC_H_MAJ_MASK (0xFFFF0000U) +#define TC_H_MIN_MASK (0x0000FFFFU) +#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK) +#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK) +#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK)) + +#define TC_H_UNSPEC (0U) +#define TC_H_ROOT (0xFFFFFFFFU) + +struct tc_ratespec +{ + unsigned char cell_log; + unsigned char __reserved; + unsigned short feature; + short addend; + unsigned short mpu; + __u32 rate; +}; -#define CBQ_MAXPRIO 8 -#define CBQ_MAXLEVEL 8 +/* FIFO section */ + +struct tc_fifo_qopt +{ + __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ +}; + +/* PRIO section */ + +#define TCQ_PRIO_BANDS 16 + +struct tc_prio_qopt +{ + int bands; /* Number of bands */ + __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ +}; /* CSZ section */ -struct cszctl +struct tc_csz_qopt { - int flow_id; - int handle; - unsigned long rate; - unsigned long max_bytes; - unsigned long depth; - unsigned long L_tab[256]; + int flows; /* Maximal number of guaranteed flows */ + unsigned char R_log; /* Fixed point position for round number */ + unsigned char delta_log; /* Log of maximal managed time interval */ + __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> CSZ band */ }; -struct cszinitctl +struct tc_csz_copt { - int flows; - unsigned cell_log; + struct tc_ratespec slice; + struct tc_ratespec rate; + struct tc_ratespec peakrate; + __u32 limit; + __u32 buffer; + __u32 mtu; +}; + +enum +{ + TCA_CSZ_UNSPEC, + TCA_CSZ_PARMS, + TCA_CSZ_RTAB, + TCA_CSZ_PTAB, }; /* TBF section */ -struct tbfctl +struct tc_tbf_qopt { - unsigned cell_log; - unsigned long bytes; - unsigned long depth; - unsigned long L_tab[256]; + struct tc_ratespec rate; + struct tc_ratespec peakrate; + __u32 limit; + __u32 buffer; + __u32 mtu; }; +enum +{ + TCA_TBF_UNSPEC, + TCA_TBF_PARMS, + TCA_TBF_RTAB, + TCA_TBF_PTAB, +}; + + +/* TEQL section */ + +/* TEQL does not require any parameters */ + /* SFQ section */ -struct sfqctl +struct tc_sfq_qopt { - unsigned quantum; - unsigned depth; - unsigned divisor; - unsigned flows; + unsigned quantum; /* Bytes per round allocated to flow */ + int perturb_period; /* Period of hash perturbation */ + __u32 limit; /* Maximal packets in queue */ + unsigned divisor; /* Hash divisor */ + unsigned flows; /* Maximal number of flows */ }; +/* + * NOTE: limit, divisor and flows are hardwired to code at the moment. + * + * limit=flows=128, divisor=1024; + * + * The only reason for this is efficiency, it is possible + * to change these parameters in compile time. + */ + /* RED section */ -struct redctl +enum +{ + TCA_RED_UNSPEC, + TCA_RED_PARMS, + TCA_RED_STAB, +}; + +struct tc_red_qopt +{ + __u32 limit; /* HARD maximal queue length (bytes) */ + __u32 qth_min; /* Min average length threshold (bytes) */ + __u32 qth_max; /* Max average length threshold (bytes) */ + unsigned char Wlog; /* log(W) */ + unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ + unsigned char Scell_log; /* cell size for idle damping */ +}; + +/* CBQ section */ + +#define TC_CBQ_MAXPRIO 8 +#define TC_CBQ_MAXLEVEL 8 +#define TC_CBQ_DEF_EWMA 5 + +struct tc_cbq_lssopt +{ + unsigned char change; + unsigned char flags; +#define TCF_CBQ_LSS_BOUNDED 1 +#define TCF_CBQ_LSS_ISOLATED 2 + unsigned char ewma_log; + unsigned char level; +#define TCF_CBQ_LSS_FLAGS 1 +#define TCF_CBQ_LSS_EWMA 2 +#define TCF_CBQ_LSS_MAXIDLE 4 +#define TCF_CBQ_LSS_MINIDLE 8 +#define TCF_CBQ_LSS_OFFTIME 0x10 +#define TCF_CBQ_LSS_AVPKT 0x20 + __u32 maxidle; + __u32 minidle; + __u32 offtime; + __u32 avpkt; +}; + +struct tc_cbq_wrropt +{ + unsigned char flags; + unsigned char priority; + unsigned char cpriority; + unsigned char __reserved; + __u32 allot; + __u32 weight; +}; + +struct tc_cbq_ovl +{ + unsigned char strategy; +#define TC_CBQ_OVL_CLASSIC 0 +#define TC_CBQ_OVL_DELAY 1 +#define TC_CBQ_OVL_LOWPRIO 2 +#define TC_CBQ_OVL_DROP 3 +#define TC_CBQ_OVL_RCLASSIC 4 + unsigned char priority2; + __u32 penalty; +}; + +struct tc_cbq_police +{ + unsigned char police; + unsigned char __res1; + unsigned short __res2; +}; + +struct tc_cbq_fopt +{ + __u32 split; + __u32 defmap; + __u32 defchange; +}; + +struct tc_cbq_xstats +{ + __u32 borrows; + __u32 overactions; + __s32 avgidle; + __s32 undertime; +}; + +enum { - unsigned qmaxbytes; /* HARD maximal queue length */ - unsigned qth_min; /* Min average length threshold: A scaled */ - unsigned qth_max; /* Max average length threshold: A scaled */ - char Alog; /* Point position in average lengths */ - char Wlog; /* log(W) */ - char Rlog; /* random number bits */ - char C1log; /* log(1/C1) */ - char Slog; - char Stab[256]; + TCA_CBQ_UNSPEC, + TCA_CBQ_LSSOPT, + TCA_CBQ_WRROPT, + TCA_CBQ_FOPT, + TCA_CBQ_OVL_STRATEGY, + TCA_CBQ_RATE, + TCA_CBQ_RTAB, + TCA_CBQ_POLICE, }; +#define TCA_CBQ_MAX TCA_CBQ_POLICE #endif diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h index 2cdc35715..3a5d58651 100644 --- a/include/linux/ppp-comp.h +++ b/include/linux/ppp-comp.h @@ -24,11 +24,11 @@ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. * - * $Id: ppp-comp.h,v 1.7 1995/05/01 01:43:37 paulus Exp $ + * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $ */ /* - * ==FILEVERSION 971024== + * ==FILEVERSION 980319== * * NOTE TO MAINTAINERS: * If you modify this file at all, please set the above date. @@ -173,7 +173,8 @@ struct compressor { * Definitions for Deflate. */ -#define CI_DEFLATE 24 /* config option for Deflate */ +#define CI_DEFLATE 26 /* config option for Deflate */ +#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */ #define CILEN_DEFLATE 4 /* length of its config option */ #define DEFLATE_MIN_SIZE 8 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 5fd4821e2..a333cd278 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -49,7 +49,8 @@ enum root_directory_inos { PROC_SLABINFO, PROC_PARPORT, PROC_PPC_HTAB, - PROC_SOUND + PROC_SOUND, + PROC_MTRR, /* whether enabled or not */ }; enum pid_directory_inos { @@ -134,6 +135,7 @@ enum net_directory_inos { PROC_NET_DN_L1, PROC_NET_DN_L2, PROC_NET_DN_SKT, + PROC_NET_NETSTAT, PROC_NET_LAST }; @@ -182,6 +184,7 @@ enum scsi_directory_inos { PROC_SCSI_SGIWD93, PROC_SCSI_MESH, PROC_SCSI_53C94, + PROC_SCSI_PLUTO, PROC_SCSI_SCSI_DEBUG, PROC_SCSI_NOT_PRESENT, PROC_SCSI_FILE, /* I'm assuming here that we */ @@ -275,7 +278,6 @@ extern struct inode_operations proc_scsi_inode_operations; extern void proc_root_init(void); extern void proc_base_init(void); -extern void proc_bus_pci_init(void); extern int proc_register(struct proc_dir_entry *, struct proc_dir_entry *); extern int proc_unregister(struct proc_dir_entry *, int); @@ -328,6 +330,7 @@ extern struct inode * proc_get_inode(struct super_block *, int, struct proc_dir_ extern int proc_statfs(struct super_block *, struct statfs *, int); extern void proc_read_inode(struct inode *); extern void proc_write_inode(struct inode *); +extern int proc_permission(struct inode *, int); extern int proc_match(int, const char *,struct proc_dir_entry *); @@ -350,7 +353,7 @@ struct openpromfs_dev { char name[32]; }; extern struct inode_operations * -proc_openprom_register(int (*readdir)(struct inode *, struct file *, void *, filldir_t), +proc_openprom_register(int (*readdir)(struct file *, void *, filldir_t), int (*lookup)(struct inode *, struct dentry *), void (*use)(struct inode *, int), struct openpromfs_dev ***); diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 7dd531688..463350f5c 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -8,6 +8,7 @@ #define LINUX_REBOOT_MAGIC1 0xfee1dead #define LINUX_REBOOT_MAGIC2 672274793 #define LINUX_REBOOT_MAGIC2A 85072278 +#define LINUX_REBOOT_MAGIC2B 369367448 /* diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 7b6b3af7e..b0efb81a9 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -37,12 +37,12 @@ #define RTM_GETRULE (RTM_BASE+18) #define RTM_NEWQDISC (RTM_BASE+20) -#define RTM_DELQDSIC (RTM_BASE+21) +#define RTM_DELQDISC (RTM_BASE+21) #define RTM_GETQDISC (RTM_BASE+22) -#define RTM_NEWTFLOW (RTM_BASE+24) -#define RTM_DELTFLOW (RTM_BASE+25) -#define RTM_GETTFLOW (RTM_BASE+26) +#define RTM_NEWTCLASS (RTM_BASE+24) +#define RTM_DELTCLASS (RTM_BASE+25) +#define RTM_GETTCLASS (RTM_BASE+26) #define RTM_NEWTFILTER (RTM_BASE+28) #define RTM_DELTFILTER (RTM_BASE+29) @@ -533,10 +533,11 @@ enum TCA_KIND, TCA_OPTIONS, TCA_STATS, - TCA_XSTATS + TCA_XSTATS, + TCA_RATE, }; -#define TCA_MAX TCA_XSTATS +#define TCA_MAX TCA_RATE #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) @@ -551,6 +552,7 @@ enum #define RTMGRP_LINK 1 #define RTMGRP_NOTIFY 2 #define RTMGRP_NEIGH 4 +#define RTMGRP_TC 8 #define RTMGRP_IPV4_IFADDR 0x10 #define RTMGRP_IPV4_MROUTE 0x20 @@ -567,6 +569,14 @@ enum extern atomic_t rtnl_rlockct; extern struct wait_queue *rtnl_wait; +extern __inline__ int rtattr_strcmp(struct rtattr *rta, char *str) +{ + int len = strlen(str) + 1; + return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); +} + +extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); + #ifdef CONFIG_RTNETLINK extern struct sock *rtnl; @@ -578,12 +588,12 @@ struct rtnetlink_link extern struct rtnetlink_link * rtnetlink_links[NPROTO]; extern int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb); - +extern int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo); extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); #define RTA_PUT(skb, attrtype, attrlen, data) \ -({ if (skb_tailroom(skb) < RTA_SPACE(attrlen)) goto rtattr_failure; \ +({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) extern unsigned long rtnl_wlockct; diff --git a/include/linux/sched.h b/include/linux/sched.h index 7eae346a5..eabe924df 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -20,6 +20,8 @@ extern unsigned long event; #include <linux/tty.h> #include <linux/sem.h> #include <linux/signal.h> +#include <linux/capability.h> +#include <linux/securebits.h> /* * cloning flags: @@ -166,6 +168,11 @@ struct mm_struct { unsigned long rss, total_vm, locked_vm; unsigned long def_flags; unsigned long cpu_vm_mask; + /* + * This is an architecture-specific pointer: the portable + * part of Linux does not know about any segments. + */ + void * segments; }; #define INIT_MM { \ @@ -176,7 +183,7 @@ struct mm_struct { 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, \ - 0, 0 } + 0, 0, NULL } struct signal_struct { atomic_t count; @@ -220,8 +227,6 @@ struct task_struct { pid_t session; /* boolean value for session group leader */ int leader; - int ngroups; - gid_t groups[NGROUPS]; /* * pointers to (original) parent process, youngest child, younger sibling, * older sibling, respectively. (p->father can be replaced with @@ -237,8 +242,6 @@ struct task_struct { struct task_struct **tarray_ptr; struct wait_queue *wait_chldexit; /* for wait4() */ - 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; @@ -253,6 +256,12 @@ struct task_struct { unsigned long old_maj_flt; /* old value of maj_flt */ unsigned long dec_flt; /* page fault count of the last time */ unsigned long swap_cnt; /* number of pages to swap on next pass */ +/* process credentials */ + uid_t uid,euid,suid,fsuid; + gid_t gid,egid,sgid,fsgid; + int ngroups; + gid_t groups[NGROUPS]; + kernel_cap_t cap_effective, cap_inheritable, cap_permitted; /* limits */ struct rlimit rlim[RLIM_NLIMITS]; unsigned short used_math; @@ -263,8 +272,6 @@ struct task_struct { /* ipc stuff */ struct sem_undo *semundo; struct sem_queue *semsleeping; -/* ldt for this task - used by Wine. If NULL, default_ldt is used */ - struct desc_struct *ldt; /* tss for this task */ struct thread_struct tss; /* filesystem information */ @@ -334,24 +341,25 @@ struct task_struct { /* schedlink */ &init_task,&init_task, &init_task, &init_task, \ /* ec,brk... */ 0,0,0,0,0,0, \ /* pid etc.. */ 0,0,0,0,0, \ -/* suppl grps*/ 0, {0,}, \ /* proc links*/ &init_task,&init_task,NULL,NULL,NULL, \ /* pidhash */ NULL, NULL, \ /* tarray */ &task[0], \ /* chld wait */ NULL, \ -/* uid etc */ 0,0,0,0,0,0,0,0, \ /* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \ /* timer */ { NULL, NULL, 0, 0, it_real_fn }, \ /* utime */ {0,0,0,0},0, \ /* per cpu times */ {0, }, {0, }, \ /* flt */ 0,0,0,0,0,0, \ /* swp */ 0,0,0,0,0, \ +/* process credentials */ \ +/* uid etc */ 0,0,0,0,0,0,0,0, \ +/* suppl grps*/ 0, {0,}, \ +/* caps */ CAP_FULL_SET, CAP_FULL_SET, CAP_FULL_SET, \ /* rlimits */ INIT_RLIMITS, \ /* math */ 0, \ /* comm */ "swapper", \ /* fs info */ 0,NULL, \ /* ipc */ NULL, NULL, \ -/* ldt */ NULL, \ /* tss */ INIT_TSS, \ /* fs */ &init_fs, \ /* files */ &init_files, \ @@ -444,8 +452,6 @@ extern unsigned int * prof_buffer; extern unsigned long prof_len; extern unsigned long prof_shift; -extern int securelevel; /* system security level */ - #define CURRENT_TIME (xtime.tv_sec) extern void FASTCALL(__wake_up(struct wait_queue ** p, unsigned int mode)); @@ -530,10 +536,13 @@ extern void free_irq(unsigned int irq, void *dev_id); * For correctness, the above considerations need to be extended to * fsuser(). This is done, along with moving fsuser() checks to be * last. + * + * These will be removed, but in the mean time, when the SECURE_NOROOT + * flag is set, uids don't grant privilege. */ extern inline int suser(void) { - if (current->euid == 0) { + if (!issecure(SECURE_NOROOT) && current->euid == 0) { current->flags |= PF_SUPERPRIV; return 1; } @@ -542,7 +551,27 @@ extern inline int suser(void) extern inline int fsuser(void) { - if (current->fsuid == 0) { + if (!issecure(SECURE_NOROOT) && current->fsuid == 0) { + current->flags |= PF_SUPERPRIV; + return 1; + } + return 0; +} + +/* + * capable() checks for a particular capability. + * New privilege checks should use this interface, rather than suser() or + * fsuser(). See include/linux/capability.h for defined capabilities. + */ + +extern inline int capable(int cap) +{ +#if 0 /* not yet */ + if (cap_raised(current->cap_effective, cap)) +#else + if (cap_is_fs_cap(cap) ? current->fsuid == 0 : current->euid == 0) +#endif + { current->flags |= PF_SUPERPRIV; return 1; } diff --git a/include/linux/securebits.h b/include/linux/securebits.h new file mode 100644 index 000000000..1e10badcb --- /dev/null +++ b/include/linux/securebits.h @@ -0,0 +1,30 @@ +#ifndef _LINUX_SECUREBITS_H +#define _LINUX_SECUREBITS_H 1 + +#define SECUREBITS_DEFAULT 0x00000000 + +extern unsigned securebits; + +/* When set UID 0 has no special privileges. When unset, we support + inheritance of root-permissions and suid-root executablew under + compatibility mode. We raise the effective and inheritable bitmasks + *of the executable file* if the effective uid of the new process is + 0. If the real uid is 0, we raise the inheritable bitmask of the + executable file. */ +#define SECURE_NOROOT 0 + +/* When set, setuid to/from uid 0 does not trigger capability-"fixes" + to be compatible with old programs relying on set*uid to loose + privileges. When unset, setuid doesn't change privileges. */ +#define SECURE_NO_SETUID_FIXUP 2 + +/* Each securesetting is implemented using two bits. One bit specify + whether the setting is on or off. The other bit specify whether the + setting is fixed or not. A setting which is fixed cannot be changed + from user-level. */ + +#define issecure(X) ( (1 << (X+1)) & SECUREBITS_DEFAULT ? \ + (1 << (X)) & SECUREBITS_DEFAULT : \ + (1 << (X)) & securebits ) + +#endif /* !_LINUX_SECUREBITS_H */ diff --git a/include/linux/serial.h b/include/linux/serial.h index e2d8b76f3..91cd5eca3 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -85,8 +85,10 @@ struct serial_uart_config { #define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */ #define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */ -#define ASYNC_FLAGS 0x1FFF /* Possible legal async flags */ -#define ASYNC_USR_MASK 0x1430 /* Legal flags that non-privileged +#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */ + +#define ASYNC_FLAGS 0x2FFF /* Possible legal async flags */ +#define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged * users can set or reset */ /* Internal flags used only by kernel/chr_drv/serial.c */ diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d94b40bcc..9e9b338b6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -29,21 +29,18 @@ #define CHECKSUM_HW 1 #define CHECKSUM_UNNECESSARY 2 -struct sk_buff_head -{ +struct sk_buff_head { struct sk_buff * next; struct sk_buff * prev; __u32 qlen; /* Must be same length as a pointer for using debugging */ }; -struct sk_buff -{ +struct sk_buff { struct sk_buff * next; /* Next buffer in list */ struct sk_buff * prev; /* Previous buffer in list */ struct sk_buff_head * list; /* List we are on */ struct sock *sk; /* Socket we are owned by */ - unsigned long when; /* used to compute rtt's */ struct timeval stamp; /* Time we arrived */ struct device *dev; /* Device we arrived on/are leaving by */ @@ -78,16 +75,8 @@ struct sk_buff struct dst_entry *dst; -#if (defined(__alpha__) || defined(__sparc64__)) && (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) - char cb[48]; /* sorry. 64bit pointers have a price */ -#else - char cb[32]; -#endif + char cb[48]; - __u32 seq; /* TCP sequence number */ - __u32 end_seq; /* seq [+ fin] [+ syn] + datalen */ - __u32 ack_seq; /* TCP ack sequence number */ - unsigned int len; /* Length of actual data */ unsigned int csum; /* Checksum */ volatile char used; /* Data moved to user and not MSG_PEEK */ @@ -102,10 +91,6 @@ struct sk_buff unsigned short security; /* Security level of packet */ unsigned int truesize; /* Buffer size */ -#ifndef SLAB_SKB - atomic_t count; /* reference count */ - struct sk_buff *data_skb; /* Link to the actual data skb */ -#endif unsigned char *head; /* Head of buffer */ unsigned char *data; /* Data head pointer */ unsigned char *tail; /* Tail pointer */ @@ -381,12 +366,17 @@ extern __inline__ void skb_insert(struct sk_buff *old, struct sk_buff *newsk) * Place a packet after a given packet in a list. */ +extern __inline__ void __skb_append(struct sk_buff *old, struct sk_buff *newsk) +{ + __skb_insert(newsk, old, old->next, old->list); +} + extern __inline__ void skb_append(struct sk_buff *old, struct sk_buff *newsk) { unsigned long flags; spin_lock_irqsave(&skb_queue_lock, flags); - __skb_insert(newsk, old, old->next, old->list); + __skb_append(old, newsk); spin_unlock_irqrestore(&skb_queue_lock, flags); } @@ -461,12 +451,7 @@ extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len) if(skb->tail>skb->end) { __label__ here; -#if 1 - printk(KERN_DEBUG "skbput: over: %p:tail=%p:end=%p:len=%u\n", - &&here, skb->tail, skb->end, len); -#else panic(skb_put_errstr,&&here,len); -#endif here: ; } return tmp; diff --git a/include/linux/smp.h b/include/linux/smp.h index 1a8d71f58..ed3e0d31d 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -47,7 +47,8 @@ extern volatile int smp_msg_id; #define MSG_STOP_CPU 0x0002 /* Sent to shut down slave CPU's * when rebooting */ -#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU */ +#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/ +#define MSG_MTRR_CHANGE 0x0004 /* Change MTRR */ #else diff --git a/include/linux/socket.h b/include/linux/socket.h index eccaa2f57..8bc5acacd 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -60,7 +60,7 @@ struct cmsghdr { #define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) -#define CMSG_DATA(cmsg) ((void *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))) +#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr)))) #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) @@ -75,6 +75,10 @@ struct cmsghdr { #ifdef __KERNEL__ #define __KINLINE extern __inline__ +#elif defined(__GNUC__) +#define __KINLINE static __inline__ +#elif defined(__cplusplus) +#define __KINLINE static inline #else #define __KINLINE static #endif @@ -126,7 +130,7 @@ struct ucred { #define AF_APPLETALK 5 /* Appletalk DDP */ #define AF_NETROM 6 /* Amateur Radio NET/ROM */ #define AF_BRIDGE 7 /* Multiprotocol bridge */ -#define AF_AAL5 8 /* Reserved for Werner's ATM */ +#define AF_ATMPVC 8 /* ATM PVCs */ #define AF_X25 9 /* Reserved for X.25 project */ #define AF_INET6 10 /* IP version 6 */ #define AF_ROSE 11 /* Amateur Radio X.25 PLP */ @@ -138,6 +142,8 @@ struct ucred { #define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */ #define AF_PACKET 17 /* Packet family */ #define AF_ASH 18 /* Ash */ +#define AF_ECONET 19 /* Acorn Econet */ +#define AF_ATMSVC 20 /* ATM SVCs */ #define AF_MAX 32 /* For now.. */ /* Protocol families, same as address families. */ @@ -150,7 +156,7 @@ struct ucred { #define PF_APPLETALK AF_APPLETALK #define PF_NETROM AF_NETROM #define PF_BRIDGE AF_BRIDGE -#define PF_AAL5 AF_AAL5 +#define PF_ATMPVC AF_ATMPVC #define PF_X25 AF_X25 #define PF_INET6 AF_INET6 #define PF_ROSE AF_ROSE @@ -162,6 +168,7 @@ struct ucred { #define PF_ROUTE AF_ROUTE #define PF_PACKET AF_PACKET #define PF_ASH AF_ASH +#define PF_ATMSVC AF_ATMSVC #define PF_MAX AF_MAX @@ -210,6 +217,8 @@ struct ucred { #define SOL_DECNET 261 #define SOL_X25 262 #define SOL_PACKET 263 +#define SOL_ATM 264 /* ATM layer (cell level) */ +#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */ /* IPX options */ #define IPX_TYPE 1 diff --git a/include/linux/swap.h b/include/linux/swap.h index 48a0ca02c..c407d7428 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -23,6 +23,7 @@ struct swap_info_struct { kdev_t swap_device; struct dentry * swap_file; unsigned char * swap_map; + unsigned char * swap_lockmap; unsigned int lowest_bit; unsigned int highest_bit; unsigned int cluster_next; @@ -64,6 +65,7 @@ extern void swap_in(struct task_struct *, struct vm_area_struct *, extern void show_swap_cache_info(void); extern int add_to_swap_cache(struct page *, unsigned long); extern void swap_duplicate(unsigned long); +extern void swap_after_unlock_page (unsigned long entry); extern struct page * read_swap_cache_async(unsigned long, int); #define read_swap_cache(entry) read_swap_cache_async(entry, 1); diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3a8f31e77..69d785df1 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -72,7 +72,6 @@ enum KERN_STATINODE, KERN_DENTRY, /* dentry statistics */ KERN_MODPROBE, - KERN_KMOD_UNLOAD_DELAY }; @@ -153,7 +152,7 @@ enum NET_IPV4_TCP_TIMESTAMPS, NET_IPV4_TCP_WINDOW_SCALING, NET_IPV4_TCP_SACK, - NET_IPV4_TCP_VEGAS_CONG_AVOID, + NET_IPV4_TCP_RETRANS_COLLAPSE, NET_IPV4_DEFAULT_TTL, NET_IPV4_AUTOCONFIG, NET_IPV4_NO_PMTU_DISC, @@ -166,7 +165,6 @@ enum NET_IPV4_TCP_KEEPALIVE_PROBES, NET_IPV4_TCP_RETRIES1, NET_IPV4_TCP_RETRIES2, - NET_IPV4_TCP_MAX_DELAY_ACKS, NET_IPV4_TCP_FIN_TIMEOUT, NET_IPV4_IP_MASQ_DEBUG, NET_TCP_SYNCOOKIES, diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 594b3108a..eae70d918 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -65,9 +65,14 @@ enum { TCP_CLOSE_WAIT, TCP_LAST_ACK, TCP_LISTEN, - TCP_CLOSING /* now a valid state */ + TCP_CLOSING, /* now a valid state */ + + TCP_MAX_STATES /* Leave at the end! */ }; +#define TCP_STATE_MASK 0xF +#define TCP_ACTION_FIN 1 << 7 + enum { TCPF_ESTABLISHED = (1 << 1), TCPF_SYN_SENT = (1 << 2), diff --git a/include/linux/types.h b/include/linux/types.h index a990773af..a53a4ccc1 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -69,6 +69,28 @@ typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; +#ifndef __BIT_TYPES_DEFINED__ +#define __BIT_TYPES_DEFINED__ + +typedef __u8 u_int8_t; +typedef __s8 int8_t; +typedef __u16 u_int16_t; +typedef __s16 int16_t; +typedef __u32 u_int32_t; +typedef __s32 int32_t; + +#endif /* !(__BIT_TYPES_DEFINED__) */ + +typedef __u8 uint8_t; +typedef __u16 uint16_t; +typedef __u32 uint32_t; + +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +typedef __u64 uint64_t; +typedef __u64 u_int64_t; +typedef __s64 int64_t; +#endif + #endif /* __KERNEL_STRICT_NAMES */ /* diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 78b336416..74cb98295 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -260,7 +260,7 @@ struct ufs_superblock { __u32 fs_qfmask[2]; /* ~usb_fmask */ __s32 fs_state; /* file system state time stamp */ } fs_44; - } fs_u; + } fs_u __attribute__ ((packed)); __s32 fs_postblformat; /* format of positional layout tables */ __s32 fs_nrpos; /* number of rotational positions */ __s32 fs_postbloff; /* (__s16) rotation block list head */ diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h index 730517cef..b5f6b38c7 100644 --- a/include/linux/umsdos_fs.h +++ b/include/linux/umsdos_fs.h @@ -141,6 +141,7 @@ extern struct inode_operations umsdos_dir_inode_operations; extern struct file_operations umsdos_file_operations; extern struct inode_operations umsdos_file_inode_operations; extern struct inode_operations umsdos_file_inode_operations_no_bmap; +extern struct inode_operations umsdos_file_inode_operations_readpage; extern struct inode_operations umsdos_symlink_inode_operations; extern int init_umsdos_fs(void); diff --git a/include/linux/umsdos_fs.p b/include/linux/umsdos_fs.p index 7c0e64ec3..586f168fe 100644 --- a/include/linux/umsdos_fs.p +++ b/include/linux/umsdos_fs.p @@ -31,7 +31,8 @@ void fill_new_filp (struct file *filp, struct dentry *dentry); void kill_dentry (struct dentry *dentry); struct dentry *creat_dentry (const char *name, const int len, - struct inode *inode); + struct inode *inode, + struct dentry *parent); ssize_t umsdos_file_write_kmem_real (struct file *filp, const char *buf, size_t count, diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 064ee9d06..960ffad9a 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -17,14 +17,20 @@ struct video_device int (*ioctl)(struct video_device *, unsigned int , void *); int (*mmap)(struct video_device *, const char *, unsigned long); int (*initialize)(struct video_device *); - void *private; + void *priv; /* Used to be 'private' but that upsets C++ */ int busy; int minor; }; extern int videodev_init(void); #define VIDEO_MAJOR 81 -extern int video_register_device(struct video_device *); +extern int video_register_device(struct video_device *, int type); + +#define VFL_TYPE_GRABBER 0 +#define VFL_TYPE_VBI 1 +#define VFL_TYPE_RADIO 2 +#define VFL_TYPE_VTX 3 + extern void video_unregister_device(struct video_device *); #endif @@ -39,10 +45,9 @@ extern void video_unregister_device(struct video_device *); #define VID_TYPE_SCALES 128 /* Scalable */ #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ - struct video_capability { - char name[32]; + char name[32]; int type; int channels; /* Num channels */ int audios; /* Num audio devices */ @@ -111,6 +116,11 @@ struct video_audio #define VIDEO_AUDIO_BASS 8 #define VIDEO_AUDIO_TREBLE 16 char name[16]; +#define VIDEO_SOUND_MONO 1 +#define VIDEO_SOUND_STEREO 2 +#define VIDEO_SOUND_LANG1 3 +#define VIDEO_SOUND_LANG2 4 + __u16 mode; }; struct video_clip @@ -139,6 +149,12 @@ struct video_buffer int bytesperline; }; +struct video_mmap +{ + unsigned int frame; /* Frame (0 or 1) for double buffer */ + int height,width; + unsigned int format; +}; struct video_key { @@ -163,6 +179,8 @@ struct video_key #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define VIDIOCSYNC _IO('v',18) /* Sync with mmap grabbing */ +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ @@ -172,6 +190,8 @@ struct video_key #define VID_HARDWARE_QCAM_BW 2 #define VID_HARDWARE_PMS 3 #define VID_HARDWARE_QCAM_C 4 +#define VID_HARDWARE_PSEUDO 5 +#define VID_HARDWARE_SAA5249 6 /* * Initialiser list diff --git a/include/linux/videotext.h b/include/linux/videotext.h new file mode 100644 index 000000000..bd427fb31 --- /dev/null +++ b/include/linux/videotext.h @@ -0,0 +1,144 @@ +#ifndef _VTX_H +#define _VTX_H + +/* $Id: videotext.h,v 1.1 1998/03/30 22:26:39 alan Exp $ + * + * Copyright (c) 1994-97 Martin Buck <martin-2.buck@student.uni-ulm.de> + * Read COPYING for more information + * + */ + + +/* + * Videotext ioctls + */ +#define VTXIOCGETINFO 0x7101 /* get version of driver & capabilities of vtx-chipset */ +#define VTXIOCCLRPAGE 0x7102 /* clear page-buffer */ +#define VTXIOCCLRFOUND 0x7103 /* clear bits indicating that page was found */ +#define VTXIOCPAGEREQ 0x7104 /* search for page */ +#define VTXIOCGETSTAT 0x7105 /* get status of page-buffer */ +#define VTXIOCGETPAGE 0x7106 /* get contents of page-buffer */ +#define VTXIOCSTOPDAU 0x7107 /* stop data acquisition unit */ +#define VTXIOCPUTPAGE 0x7108 /* display page on TV-screen */ +#define VTXIOCSETDISP 0x7109 /* set TV-mode */ +#define VTXIOCPUTSTAT 0x710a /* set status of TV-output-buffer */ +#define VTXIOCCLRCACHE 0x710b /* clear cache on VTX-interface (if avail.) */ +#define VTXIOCSETVIRT 0x710c /* turn on virtual mode (this disables TV-display) */ + + +/* + * Definitions for VTXIOCGETINFO + */ + +#define SAA5243 0 +#define SAA5246 1 +#define SAA5249 2 +#define SAA5248 3 +#define XSTV5346 4 + +typedef struct { + int version_major, version_minor; /* version of driver; if version_major changes, driver */ + /* is not backward compatible!!! CHECK THIS!!! */ + int numpages; /* number of page-buffers of vtx-chipset */ + int cct_type; /* type of vtx-chipset (SAA5243, SAA5246, SAA5248 or + * SAA5249) */ +} +vtx_info_t; + + +/* + * Definitions for VTXIOC{CLRPAGE,CLRFOUND,PAGEREQ,GETSTAT,GETPAGE,STOPDAU,PUTPAGE,SETDISP} + */ + +#define MIN_UNIT (1<<0) +#define MIN_TEN (1<<1) +#define HR_UNIT (1<<2) +#define HR_TEN (1<<3) +#define PG_UNIT (1<<4) +#define PG_TEN (1<<5) +#define PG_HUND (1<<6) +#define PGMASK_MAX (1<<7) +#define PGMASK_PAGE (PG_HUND | PG_TEN | PG_UNIT) +#define PGMASK_HOUR (HR_TEN | HR_UNIT) +#define PGMASK_MINUTE (MIN_TEN | MIN_UNIT) + +typedef struct +{ + int page; /* number of requested page (hexadecimal) */ + int hour; /* requested hour (hexadecimal) */ + int minute; /* requested minute (hexadecimal) */ + int pagemask; /* mask defining which values of the above are set */ + int pgbuf; /* buffer where page will be stored */ + int start; /* start of requested part of page */ + int end; /* end of requested part of page */ + void *buffer; /* pointer to beginning of destination buffer */ +} +vtx_pagereq_t; + + +/* + * Definitions for VTXIOC{GETSTAT,PUTSTAT} + */ + +#define VTX_PAGESIZE (40 * 24) +#define VTX_VIRTUALSIZE (40 * 49) + +typedef struct +{ + int pagenum; /* number of page (hexadecimal) */ + int hour; /* hour (hexadecimal) */ + int minute; /* minute (hexadecimal) */ + int charset; /* national charset */ + unsigned delete : 1; /* delete page (C4) */ + unsigned headline : 1; /* insert headline (C5) */ + unsigned subtitle : 1; /* insert subtitle (C6) */ + unsigned supp_header : 1; /* suppress header (C7) */ + unsigned update : 1; /* update page (C8) */ + unsigned inter_seq : 1; /* interrupted sequence (C9) */ + unsigned dis_disp : 1; /* disable/suppress display (C10) */ + unsigned serial : 1; /* serial mode (C11) */ + unsigned notfound : 1; /* /FOUND */ + unsigned pblf : 1; /* PBLF */ + unsigned hamming : 1; /* hamming-error occured */ +} +vtx_pageinfo_t; + + +/* + * Definitions for VTXIOCSETDISP + */ + +typedef enum { + DISPOFF, DISPNORM, DISPTRANS, DISPINS, INTERLACE_OFFSET +} vtxdisp_t; + + + +/* + * Tuner ioctls + */ + +#define TUNIOCGETINFO 0x7201 /* get version of driver & capabilities of tuner */ +#define TUNIOCRESET 0x7202 /* reset tuner */ +#define TUNIOCSETFREQ 0x7203 /* set tuning frequency (unit: kHz) */ +#define TUNIOCGETFREQ 0x7204 /* get tuning frequency (unit: kHz) */ +#define TUNIOCSETCHAN 0x7205 /* set tuning channel */ +#define TUNIOCGETCHAN 0x7206 /* get tuning channel */ + + +typedef struct +{ + int version_major, version_minor; /* version of driver; if version_major changes, driver */ + /* is not backward compatible!!! CHECK THIS!!! */ + unsigned freq : 1; /* tuner can be set to given frequency */ + unsigned chan : 1; /* tuner stores several channels */ + unsigned scan : 1; /* tuner supports scanning */ + unsigned autoscan : 1; /* tuner supports scanning with automatic stop */ + unsigned afc : 1; /* tuner supports AFC */ + unsigned dummy1, dummy2, dummy3, dummy4, dummy5, dummy6, dummy7, dummy8, dummy9, dummy10, + dummy11 : 1; + int dummy12, dummy13, dummy14, dummy15, dummy16, dummy17, dummy18, dummy19; +} tuner_info_t; + + +#endif /* _VTX_H */ diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 68e74d2ed..cac9992bf 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -20,7 +20,7 @@ void * vmalloc_uncached(unsigned long size); extern void * vmalloc(unsigned long size); -int vread(char *buf, char *addr, int count); +long vread(char *buf, char *addr, unsigned long count); void vmfree_area_pages(unsigned long address, unsigned long size); int vmalloc_area_pages(unsigned long address, unsigned long size, pgprot_t prot); diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h index 8bdba9cad..ed38830ce 100644 --- a/include/linux/wanrouter.h +++ b/include/linux/wanrouter.h @@ -359,10 +359,10 @@ typedef struct wan_device } wan_device_t; /* Public functions available for device drivers */ -extern int register_wandev (wan_device_t* wandev); -extern int unregister_wandev (char* name); -unsigned short wan_type_trans (struct sk_buff* skb, struct device* dev); -int wan_encapsulate (struct sk_buff* skb, struct device* dev); +extern int register_wan_device(wan_device_t* wandev); +extern int unregister_wan_device(char* name); +unsigned short wanrouter_type_trans(struct sk_buff* skb, struct device* dev); +int wanrouter_encapsulate(struct sk_buff* skb, struct device* dev); /* Proc interface functions. These must not be called by the drivers! */ extern int wanrouter_proc_init (void); |