From a0f3dc932a2a48a9ee4f6f65f162e49c4ac0bb7d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:11:04 -0500 Subject: [PATCH] Import pre2.0.11 --- CREDITS | 2 +- Documentation/isdn/README.audio | 6 +- MAINTAINERS | 4 +- Makefile | 2 +- arch/i386/defconfig | 1 + arch/i386/kernel/time.c | 2 +- arch/ppc/kernel/raw_printf.c | 1200 ------------------------------- drivers/block/ide-cd.c | 26 +- drivers/isdn/isdn_tty.c | 2 +- drivers/isdn/teles/isdnl3.c | 2 +- drivers/net/Space.c | 10 +- drivers/net/new_tunnel.c | 1 + drivers/scsi/Config.in | 18 +- drivers/scsi/atari_scsi.c | 1 + drivers/scsi/scsi.c | 12 +- drivers/scsi/scsi_ioctl.c | 22 +- drivers/scsi/sd.c | 2 + drivers/scsi/sr.c | 1 + drivers/sound/Config.in | 267 ++++++- drivers/sound/sequencer.c | 3 + fs/Config.in | 6 +- fs/buffer.c | 22 +- fs/ext2/ioctl.c | 9 +- fs/locks.c | 8 +- fs/ncpfs/dir.c | 10 + fs/ncpfs/file.c | 9 +- fs/ncpfs/inode.c | 3 + include/asm-i386/posix_types.h | 4 + include/asm-i386/statfs.h | 12 +- include/asm-m68k/posix_types.h | 4 + include/asm-m68k/statfs.h | 12 +- include/asm-ppc/statfs.h | 12 +- include/asm-sparc/posix_types.h | 4 + include/asm-sparc/statfs.h | 12 +- include/linux/interrupt.h | 1 + include/linux/sched.h | 1 - include/linux/swap.h | 4 +- include/linux/sysctl.h | 26 +- include/net/ip_masq.h | 1 + ipc/msg.c | 1 + kernel/exit.c | 1 + mm/kmalloc.c | 2 + mm/page_alloc.c | 1 + mm/page_io.c | 2 +- mm/swap.c | 2 +- net/bridge/Makefile | 2 +- net/bridge/sysctl_net_bridge.c | 13 + net/core/datagram.c | 18 +- net/ipv4/arp.c | 75 +- net/ipv4/icmp.c | 84 ++- net/ipv4/ip_forward.c | 27 +- net/ipv4/ip_masq.c | 111 ++- net/ipv4/sysctl_net_ipv4.c | 25 + net/ipv4/tcp_input.c | 4 +- net/ipv4/tcp_timer.c | 2 +- net/netlink.c | 17 +- net/netsyms.c | 10 + net/sysctl_net.c | 14 + scripts/Menuconfig | 57 +- 59 files changed, 839 insertions(+), 1373 deletions(-) delete mode 100644 arch/ppc/kernel/raw_printf.c create mode 100644 net/bridge/sysctl_net_bridge.c diff --git a/CREDITS b/CREDITS index 8ac2266b3184..745cbda672d2 100644 --- a/CREDITS +++ b/CREDITS @@ -735,7 +735,7 @@ D: Author of the dialog utility, foundation D: for Menuconfig's lxdialog. N: Volker Lendecke -E: lendecke@namu01.gwdg.de +E: lendecke@namu01.Num.Math.Uni-Goettingen.de D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.) D: NCP filesystem support (to mount NetWare volumes) S: Innersteweg 11 diff --git a/Documentation/isdn/README.audio b/Documentation/isdn/README.audio index 07b107d8d783..bb8a427be718 100644 --- a/Documentation/isdn/README.audio +++ b/Documentation/isdn/README.audio @@ -32,7 +32,7 @@ All audio mode commands have the one of the following form: where xx is a two-character code and v are alphanumerical parameters. The following commands are supported: - AT+VNH=x Auto hangup settting. NO EFFECT, supported + AT+VNH=x Auto hangup setting. NO EFFECT, supported for compatibility only. AT+VNH? Always reporting "1" AT+VNH=? Always reporting "1" @@ -100,7 +100,7 @@ General behavior and description of data formats/protocol. c FAX calling tone received. b busy tone received. q quiet. Silence detected after non-silence. - s silence. Silence dectected from the + s silence. Silence detected from the start of recording. Any character sent by the application, except XON (0x11) or XOFF (0x13) @@ -109,7 +109,7 @@ General behavior and description of data formats/protocol. Audio playback. When sending audio data, upon AT+VTX command, emulator responds with - CONNECT, and starts transfering data from application to the phone line. + CONNECT, and starts transferring data from application to the phone line. The same DLE sequences apply to this mode. diff --git a/MAINTAINERS b/MAINTAINERS index f2fc78ac16bb..2c9197a74b93 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -217,7 +217,7 @@ S: Maintained NCP FILESYSTEM: P: Volker Lendecke -M: lendecke@namu01.gwdg.de +M: lendecke@namu01.Num.Math.Uni-Goettingen.de L: linware@sh.cvut.cz S: Maintained @@ -253,7 +253,7 @@ S: Maintained SMB FILESYSTEM: P: Volker Lendecke -M: lendecke@namu01.gwdg.de +M: lendecke@namu01.Num.Math.Uni-Goettingen.de L: samba@listproc.anu.edu.au S: Odd Fixes diff --git a/Makefile b/Makefile index 9620429bb671..964b144e851b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 99 -SUBLEVEL = 10 +SUBLEVEL = 11 ARCH = i386 diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 622b5e4c7bdf..b64e0a678c38 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -142,6 +142,7 @@ CONFIG_NFS_FS=y CONFIG_ISO9660_FS=y # CONFIG_HPFS_FS is not set # CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set # # Character devices diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index b71e529f3d1f..9c4abc2641d0 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -122,7 +122,7 @@ static unsigned long do_fast_gettimeoffset(void) /* * Due to rounding errors (and jiffies inconsistencies), * we need to check the result so that we'll get a timer - * that is monotonous. + * that is monotonic. */ if (edx >= 997670/HZ) edx = 997670/HZ-1; diff --git a/arch/ppc/kernel/raw_printf.c b/arch/ppc/kernel/raw_printf.c deleted file mode 100644 index c2c34a12aec0..000000000000 --- a/arch/ppc/kernel/raw_printf.c +++ /dev/null @@ -1,1200 +0,0 @@ -#define FALSE 0 -#define TRUE 1 -#include - -extern int isBeBox[]; - -extern void cnputc(char c); - -static char *_sprintk_ptr; - -static _sputc(char c) -{ - *_sprintk_ptr++ = c; - *_sprintk_ptr = '\0'; -} - -_sprintk(char *buf, char const *fmt, ...) -{ - int ret; - va_list ap; - - va_start(ap, fmt); - _sprintk_ptr = buf; - ret = _vprintk(_sputc, fmt, ap); - va_end(ap); - return (ret); -} - -_vsprintk(char *buf, char const *fmt, va_list ap) -{ - int ret; - - _sprintk_ptr = buf; - ret = _vprintk(_sputc, fmt, ap); - return (ret); -} - -_printk(char const *fmt, ...) -{ - int ret; - va_list ap; - - va_start(ap, fmt); - ret = _vprintk(cnputc, fmt, ap); - va_end(ap); - return (ret); -} - -#define is_digit(c) ((c >= '0') && (c <= '9')) - -int -_vprintk(putc, fmt0, ap) - int (*putc)(); - const char *fmt0; - va_list ap; -{ - char c, sign, *cp; - int left_prec, right_prec, zero_fill, length, pad, pad_on_right; - char buf[32]; - long val; - while (c = *fmt0++) - { - if (c == '%') - { - c = *fmt0++; - left_prec = right_prec = pad_on_right = 0; - if (c == '-') - { - c = *fmt0++; - pad_on_right++; - } - if (c == '0') - { - zero_fill = TRUE; - c = *fmt0++; - } else - { - zero_fill = FALSE; - } - while (is_digit(c)) - { - left_prec = (left_prec * 10) + (c - '0'); - c = *fmt0++; - } - if (c == '.') - { - c = *fmt0++; - zero_fill++; - while (is_digit(c)) - { - right_prec = (right_prec * 10) + (c - '0'); - c = *fmt0++; - } - } else - { - right_prec = left_prec; - } - sign = '\0'; - switch (c) - { - case 'd': - case 'x': - case 'X': - val = va_arg(ap, long); - switch (c) - { - case 'd': - if (val < 0) - { - sign = '-'; - val = -val; - } - length = _cvt(val, buf, 10, "0123456789"); - break; - case 'x': - length = _cvt(val, buf, 16, "0123456789abcdef"); - break; - case 'X': - length = _cvt(val, buf, 16, "0123456789ABCDEF"); - break; - } - cp = buf; - break; - case 's': - cp = va_arg(ap, char *); - length = strlen(cp); - break; - case 'c': - c = va_arg(ap, long /*char*/); - (*putc)(c); - continue; - default: - (*putc)('?'); - } - pad = left_prec - length; - if (sign != '\0') - { - pad--; - } - if (zero_fill) - { - c = '0'; - if (sign != '\0') - { - (*putc)(sign); - sign = '\0'; - } - } else - { - c = ' '; - } - if (!pad_on_right) - { - while (pad-- > 0) - { - (*putc)(c); - } - } - if (sign != '\0') - { - (*putc)(sign); - } - while (length-- > 0) - { - (*putc)(c = *cp++); - if (c == '\n') - { - (*putc)('\r'); - } - } - if (pad_on_right) - { - while (pad-- > 0) - { - (*putc)(c); - } - } - } else - { - (*putc)(c); - if (c == '\n') - { - (*putc)('\r'); - } - } - } -} - -static _cvt(unsigned long val, char *buf, long radix, char *digits) -{ - char temp[80]; - char *cp = temp; - int length = 0; - if (val == 0) - { /* Special case */ - *cp++ = '0'; - } else - while (val) - { - *cp++ = digits[val % radix]; - val /= radix; - } - while (cp != temp) - { - *buf++ = *--cp; - length++; - } - *buf = '\0'; - return (length); -} - -/* - * Console I/O interface - */ - -typedef const (*proc)(); -typedef int dev_t; - -#define FALSE 0 -#define TRUE 1 - -#define CRT_PORT 0x3D4 /* Pick one */ - -static int init = FALSE; -static int is_crt = 0; -static int port = 0; -static int line_num = 0; -#define MAX_LINES 24 - -char -cngetc() -{ - int s = _disable_interrupts(); - char c = '\0'; - if (port == CRT_PORT) - { - c = CRT_getc(port); - } else - if (port) - { - c = NS16550_getc(port); - } - _enable_interrupts(s); - return (c); -} - -cntstc() -{ - return (0); -} - -char _cn_trace[1024]; -char *_cnp = _cn_trace; - -/* - * Console kernel output character routine. - */ -void -cnputc(char c) -{ - *_cnp++ = c; - if (_cnp == &_cn_trace[sizeof(_cn_trace)]) - { - _cnp = _cn_trace; - } - if (!init) - { - if (is_crt = CRT_init()) - { - port = CRT_PORT; - } else - { - port = NS16550_init(0); - } - init = TRUE; - } - if (port == CRT_PORT) - { - CRT_putc(port, c); - } else - if (port) - { - NS16550_putc(port, c); - } - if (c == '\n') - { - if (line_num >= 0) line_num++; - } - if (c == '\r') - { - if (line_num >= MAX_LINES) - { - line_num = 0; - _cnpause(); - } - } -} - -_cnpause() -{ - int c; - int s = _disable_interrupts(); - _printk("-- More? "); - while ((c = cngetc()) == 0); - _printk("\r \r"); /* Erase prompt */ - if (c == ' ') - { - line_num = 0; - } else - if (c == 'n') - { - line_num = -1; /* Turn off pause */ - } else - if ((c == '\r') || (c == '\n')) - { - line_num = MAX_LINES-1; - } else - if (c == 0x03) /* ^C */ - { - abort(); - } else - { - line_num = MAX_LINES - (MAX_LINES/3); - } - _enable_interrupts(s); -} - -cnpause() -{ - int c; - int s = _disable_interrupts(); - flush_data_cache(); - printk("-- More? "); - while ((c = cngetc()) == 0); - printk("\r \r"); /* Erase prompt */ - _enable_interrupts(s); -} - -/* - * COM1 NS16550 support - */ - -struct NS16550 - { - unsigned char rbr; /* 0 */ - unsigned char ier; /* 1 */ - unsigned char fcr; /* 2 */ - unsigned char lcr; /* 3 */ - unsigned char mcr; /* 4 */ - unsigned char lsr; /* 5 */ - unsigned char msr; /* 6 */ - unsigned char scr; /* 7 */ - }; - -#define thr rbr -#define iir fcr -#define dll rbr -#define dlm ier - -#define LSR_DR 0x01 /* Data ready */ -#define LSR_OE 0x02 /* Overrun */ -#define LSR_PE 0x04 /* Parity error */ -#define LSR_FE 0x08 /* Framing error */ -#define LSR_BI 0x10 /* Break */ -#define LSR_THRE 0x20 /* Xmit holding register empty */ -#define LSR_TEMT 0x40 /* Xmitter empty */ -#define LSR_ERR 0x80 /* Error */ - -#define COM1 0x800003F8 -#define COM2 0x800002F8 - -typedef struct NS16550 *NS16550_t; - -const NS16550_t COM_PORTS[] = { COM1, COM2}; - -volatile struct NS16550 * -NS16550_init(int chan) -{ - volatile struct NS16550 *com_port; - volatile unsigned char xx; - com_port = (struct NS16550 *) COM_PORTS[chan]; - /* See if port is present */ - com_port->lcr = 0x00; - com_port->ier = 0xFF; -#if 0 - if (com_port->ier != 0x0F) return ((struct NS16550 *)0); -#endif - com_port->ier = 0x00; - com_port->lcr = 0x80; /* Access baud rate */ - com_port->dll = 12; /* 9600 baud */ - com_port->dlm = 12 >> 8; - com_port->lcr = 0x03; /* 8 data, 1 stop, no parity */ - com_port->mcr = 0x03; /* RTS/DTR */ - com_port->fcr = 0x07; /* Clear & enable FIFOs */ - return (com_port); -} - - -NS16550_putc(volatile struct NS16550 *com_port, unsigned char c) -{ - volatile int i; - while ((com_port->lsr & LSR_THRE) == 0) ; - com_port->thr = c; -} - -unsigned char NS16550_getc(volatile struct NS16550 *com_port) -{ - while ((com_port->lsr & LSR_DR) == 0) ; - return (com_port->rbr); -} - -NS16550_test(volatile struct NS16550 *com_port) -{ - return ((com_port->lsr & LSR_DR) != 0); -} - -typedef unsigned short u_short; -typedef unsigned char u_char; - -#define COL 80 -#define ROW 25 -#define CHR 2 -#define MONO_BASE 0x3B4 -#define MONO_BUF 0xB0000 -#define CGA_BASE 0x3D4 -#define CGA_BUF 0xB8000 -#define ISA_mem ((unsigned char *)0xC0000000) -#define ISA_io ((unsigned char *)0x80000000) - -unsigned char background = 0; -unsigned char foreground = 6; - -unsigned int addr_6845; -unsigned short *Crtat; -int lastpos; -int scroll; - -static void -outb(int port, unsigned char c) -{ - ISA_io[port] = c; -} - -static unsigned char -inb(int port) -{ - return (ISA_io[port]); -} - -/* - * The current state of virtual displays - */ -struct screen { - u_short *cp; /* the current character address */ - enum state { - NORMAL, /* no pending escape */ - ESC, /* saw ESC */ - EBRAC, /* saw ESC[ */ - EBRACEQ /* saw ESC[= */ - } state; /* command parser state */ - int cx; /* the first escape seq argument */ - int cy; /* the second escape seq argument */ - int *accp; /* pointer to the current processed argument */ - int row; /* current column */ - int so; /* standout mode */ - u_short color; /* normal character color */ - u_short color_so; /* standout color */ - u_short save_color; /* saved normal color */ - u_short save_color_so; /* saved standout color */ -} screen; - -/* - * Color and attributes for normal, standout and kernel output - * are stored in the least-significant byte of a u_short - * so they don't have to be shifted for use. - * This is all byte-order dependent. - */ -#define CATTR(x) (x) /* store color/attributes un-shifted */ -#define ATTR_ADDR(which) (((u_char *)&(which))+1) /* address of attributes */ - -unsigned short pccolor; /* color/attributes for tty output */ -unsigned short pccolor_so; /* color/attributes, standout mode */ - -/* - * cursor() sets an offset (0-1999) into the 80x25 text area - */ -static void -cursor() -{ - int pos = screen.cp - Crtat; - - if (lastpos != pos) { - outb(addr_6845, 14); - outb(addr_6845+1, pos >> 8); - outb(addr_6845, 15); - outb(addr_6845+1, pos); - lastpos = pos; - } -} - -static void -initscreen() -{ - struct screen *d = &screen; - - pccolor = CATTR((background<<4)|foreground); - pccolor_so = CATTR((foreground<<4)|background); - d->color = pccolor; - d->save_color = pccolor; - d->color_so = pccolor_so; - d->save_color_so = pccolor_so; -} - - -#define wrtchar(c, d) { \ - *(d->cp) = c; \ - d->cp++; \ - d->row++; \ -} - -fillw(unsigned short val, unsigned short *buf, int num) -{ - /* Need to byte swap value */ - unsigned short tmp; - tmp = val; - while (num-- > 0) - { - *buf++ = tmp; - } -} - -/* - * CRT_putc (nee sput) has support for emulation of the 'ibmpc' termcap entry. - * This is a bare-bones implementation of a bare-bones entry - * One modification: Change li#24 to li#25 to reflect 25 lines - * "ca" is the color/attributes value (left-shifted by 8) - * or 0 if the current regular color for that screen is to be used. - */ -void -CRT_putc(int port, u_char c) -{ - struct screen *d = &screen; - u_short *base; - int i, j; - u_short *pp; - - base = Crtat; - - switch (d->state) { - case NORMAL: - switch (c) { - case 0x0: /* Ignore pad characters */ - return; - - case 0x1B: - d->state = ESC; - break; - - case '\t': - do { - wrtchar(d->color | ' ', d); - } while (d->row % 8); - break; - - case '\b': /* non-destructive backspace */ - if (d->cp > base) { - d->cp--; - d->row--; - if (d->row < 0) - d->row += COL; /* prev column */ - } - break; - - case '\r': - d->cp -= d->row; - d->row = 0; - break; - - case '\n': - d->cp += COL; - break; - - case '\007': - break; - - default: - if (d->so) { - wrtchar(d->color_so|(c<<8), d); - } else { - wrtchar(d->color | (c<<8), d); - } - if (d->row >= COL) - d->row = 0; - break; - } - break; - - case EBRAC: - /* - * In this state, the action at the end of the switch - * on the character type is to go to NORMAL state, - * and intermediate states do a return rather than break. - */ - switch (c) { - case 'm': - d->so = d->cx; - break; - - case 'A': /* back one row */ - if (d->cp >= base + COL) - d->cp -= COL; - break; - - case 'B': /* down one row */ - d->cp += COL; - break; - - case 'C': /* right cursor */ - d->cp++; - d->row++; - break; - - case 'D': /* left cursor */ - if (d->cp > base) { - d->cp--; - d->row--; - if (d->row < 0) - d->row += COL; /* prev column ??? */ - } - break; - - case 'J': /* Clear to end of display */ - fillw(d->color|(' '<<8), d->cp, base + COL * ROW - d->cp); - break; - - case 'K': /* Clear to EOL */ - fillw(d->color|(' '<<8), d->cp, COL - (d->cp - base) % COL); - break; - - case 'H': /* Cursor move */ - if (d->cx > ROW) - d->cx = ROW; - if (d->cy > COL) - d->cy = COL; - if (d->cx == 0 || d->cy == 0) { - d->cp = base; - d->row = 0; - } else { - d->cp = base + (d->cx - 1) * COL + d->cy - 1; - d->row = d->cy - 1; - } - break; - - case '_': /* set cursor */ - if (d->cx) - d->cx = 1; /* block */ - else - d->cx = 12; /* underline */ - outb(addr_6845, 10); - outb(addr_6845+1, d->cx); - outb(addr_6845, 11); - outb(addr_6845+1, 13); - break; - - case ';': /* Switch params in cursor def */ - d->accp = &d->cy; - return; - - case '=': /* ESC[= color change */ - d->state = EBRACEQ; - return; - - case 'L': /* Insert line */ - i = (d->cp - base) / COL; - /* avoid deficiency of bcopy implementation */ - pp = base + COL * (ROW-2); - for (j = ROW - 1 - i; j--; pp -= COL) - bcopy(pp, pp + COL, COL * CHR); - fillw(d->color|(' '<<8), base + i * COL, COL); - break; - - case 'M': /* Delete line */ - i = (d->cp - base) / COL; - pp = base + i * COL; - bcopy(pp + COL, pp, (ROW-1 - i)*COL*CHR); - fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL); - break; - - default: /* Only numbers valid here */ - if ((c >= '0') && (c <= '9')) { - *(d->accp) *= 10; - *(d->accp) += c - '0'; - return; - } else - break; - } - d->state = NORMAL; - break; - - case EBRACEQ: { - /* - * In this state, the action at the end of the switch - * on the character type is to go to NORMAL state, - * and intermediate states do a return rather than break. - */ - u_char *colp; - - /* - * Set foreground/background color - * for normal mode, standout mode - * or kernel output. - * Based on code from kentp@svmp03. - */ - switch (c) { - case 'F': - colp = ATTR_ADDR(d->color); - do_fg: - *colp = (*colp & 0xf0) | (d->cx); - break; - - case 'G': - colp = ATTR_ADDR(d->color); - do_bg: - *colp = (*colp & 0xf) | (d->cx << 4); - break; - - case 'H': - colp = ATTR_ADDR(d->color_so); - goto do_fg; - - case 'I': - colp = ATTR_ADDR(d->color_so); - goto do_bg; - - case 'S': - d->save_color = d->color; - d->save_color_so = d->color_so; - break; - - case 'R': - d->color = d->save_color; - d->color_so = d->save_color_so; - break; - - default: /* Only numbers valid here */ - if ((c >= '0') && (c <= '9')) { - d->cx *= 10; - d->cx += c - '0'; - return; - } else - break; - } - d->state = NORMAL; - } - break; - - case ESC: - switch (c) { - case 'c': /* Clear screen & home */ - fillw(d->color|(' '<<8), base, COL * ROW); - d->cp = base; - d->row = 0; - d->state = NORMAL; - break; - case '[': /* Start ESC [ sequence */ - d->state = EBRAC; - d->cx = 0; - d->cy = 0; - d->accp = &d->cx; - break; - default: /* Invalid, clear state */ - d->state = NORMAL; - break; - } - break; - } - if (d->cp >= base + (COL * ROW)) { /* scroll check */ - bcopy(base + COL, base, COL * (ROW - 1) * CHR); - fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL); - d->cp -= COL; - } - cursor(); -} - -video_on() -{ /* Enable video */ - outb(0x3C4, 0x01); - outb(0x3C5, inb(0x3C5)&~20); -} - -CRT_init() -{ - unsigned long *PCI_base = (unsigned long *)0x80808010; /* Magic */ - struct screen *d = &screen; - if (!isBeBox[0] && *PCI_base) - { /* No CRT configured */ - return (0); - } - /* Assume BeBox uses only VGA */ - video_on(); - d->cp = Crtat = (u_short *)&ISA_mem[0x0B8000]; - addr_6845 = CGA_BASE; - initscreen(); - fillw(pccolor|(' '<<8), d->cp, COL * ROW); - return (1); -} - -/* Keyboard handler */ - -#define L 0x0001 /* locking function */ -#define SHF 0x0002 /* keyboard shift */ -#define ALT 0x0004 /* alternate shift -- alternate chars */ -#define NUM 0x0008 /* numeric shift cursors vs. numeric */ -#define CTL 0x0010 /* control shift -- allows ctl function */ -#define CPS 0x0020 /* caps shift -- swaps case of letter */ -#define ASCII 0x0040 /* ascii code for this key */ -#define STP 0x0080 /* stop output */ -#define FUNC 0x0100 /* function key */ -#define SCROLL 0x0200 /* scroll lock key */ - -/* #include "pcconstab.US" */ -/* BSDI $Id: pcconstab.US,v 1.1.1.1 1994/03/31 13:29:09 gary Exp $ */ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz and Don Ahn. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from @(#)pccons.c 5.11 (Berkeley) 5/21/91 - */ - -/* - * US Keyboard mapping tables - */ - -const unsigned short action[] = { - 0, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 0- 7 */ - ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 8-15 */ - ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 16-23 */ - ASCII, ASCII, ASCII, ASCII, ASCII, CTL, ASCII, ASCII, /* scan 24-31 */ - ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 32-39 */ - ASCII, ASCII, SHF, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 40-47 */ - ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, SHF, ASCII, /* scan 48-55 */ - ALT, ASCII, CPS, FUNC, FUNC, FUNC, FUNC, FUNC, /* scan 56-63 */ - FUNC, FUNC, FUNC, FUNC, FUNC, NUM,SCROLL, ASCII, /* scan 64-71 */ - ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, /* scan 72-79 */ - ASCII, ASCII, ASCII, ASCII, 0, 0, 0, 0, /* scan 80-87 */ - 0,0,0,0,0,0,0,0, /* scan 88-95 */ - 0,0,0,0,0,0,0,0, /* scan 96-103 */ - 0,0,0,0,0,0,0,0, /* scan 104-111 */ - 0,0,0,0,0,0,0,0, /* scan 112-119 */ - 0,0,0,0,0,0,0,0, /* scan 120-127 */ -}; - -const unsigned char unshift[] = { /* no shift */ - 0, 033, '1', '2', '3', '4', '5', '6', /* scan 0- 7 */ - '7', '8', '9', '0', '-', '=', 010, '\t', /* scan 8-15 */ - 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', /* scan 16-23 */ - 'o', 'p', '[', ']', '\r', CTL, 'a', 's', /* scan 24-31 */ - 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* scan 32-39 */ - '\'', '`', SHF, '\\', 'z', 'x', 'c', 'v', /* scan 40-47 */ - 'b', 'n', 'm', ',', '.', '/', SHF, '*', /* scan 48-55 */ - ALT, ' ', CPS, 1, 2, 3, 4, 5, /* scan 56-63 */ - 6, 7, 8, 9, 10, NUM, STP, '7', /* scan 64-71 */ - '8', '9', '-', '4', '5', '6', '+', '1', /* scan 72-79 */ - '2', '3', '0', 0177, 0, 0, 0, 0, /* scan 80-87 */ - 0,0,0,0,0,0,0,0, /* scan 88-95 */ - 0,0,0,0,0,0,0,0, /* scan 96-103 */ - 0,0,0,0,0,0,0,0, /* scan 104-111 */ - 0,0,0,0,0,0,0,0, /* scan 112-119 */ - 0,0,0,0,0,0,0,0, /* scan 120-127 */ -}; - -const unsigned char shift[] = { /* shift shift */ - 0, 033, '!', '@', '#', '$', '%', '^', /* scan 0- 7 */ - '&', '*', '(', ')', '_', '+', 010, '\t', /* scan 8-15 */ - 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', /* scan 16-23 */ - 'O', 'P', '{', '}', '\r', CTL, 'A', 'S', /* scan 24-31 */ - 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* scan 32-39 */ - '"', '~', SHF, '|', 'Z', 'X', 'C', 'V', /* scan 40-47 */ - 'B', 'N', 'M', '<', '>', '?', SHF, '*', /* scan 48-55 */ - ALT, ' ', CPS, 0, 0, ' ', 0, 0, /* scan 56-63 */ - 0, 0, 0, 0, 0, NUM, STP, '7', /* scan 64-71 */ - '8', '9', '-', '4', '5', '6', '+', '1', /* scan 72-79 */ - '2', '3', '0', 0177, 0, 0, 0, 0, /* scan 80-87 */ - 0,0,0,0,0,0,0,0, /* scan 88-95 */ - 0,0,0,0,0,0,0,0, /* scan 96-103 */ - 0,0,0,0,0,0,0,0, /* scan 104-111 */ - 0,0,0,0,0,0,0,0, /* scan 112-119 */ - 0,0,0,0,0,0,0,0, /* scan 120-127 */ -}; - -const unsigned char ctl[] = { /* CTL shift */ - 0, 033, '!', 000, '#', '$', '%', 036, /* scan 0- 7 */ - '&', '*', '(', ')', 037, '+', 034,'\177', /* scan 8-15 */ - 021, 027, 005, 022, 024, 031, 025, 011, /* scan 16-23 */ - 017, 020, 033, 035, '\r', CTL, 001, 023, /* scan 24-31 */ - 004, 006, 007, 010, 012, 013, 014, ';', /* scan 32-39 */ - '\'', '`', SHF, 034, 032, 030, 003, 026, /* scan 40-47 */ - 002, 016, 015, '<', '>', '?', SHF, '*', /* scan 48-55 */ - ALT, ' ', CPS, 0, 0, ' ', 0, 0, /* scan 56-63 */ - CPS, 0, 0, 0, 0, 0, 0, 0, /* scan 64-71 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* scan 72-79 */ - 0, 0, 0, 0177, 0, 0, 0, 0, /* scan 80-87 */ - 0, 0, 033, '7', '4', '1', 0, NUM, /* scan 88-95 */ - '8', '5', '2', 0, STP, '9', '6', '3', /* scan 96-103*/ - '.', 0, '*', '-', '+', 0, 0, 0, /*scan 104-111*/ - 0,0,0,0,0,0,0,0, /* scan 112-119 */ - 0,0,0,0,0,0,0,0, /* scan 120-127 */ -}; - - -unsigned char shfts, ctls, alts, caps, num, stp; - -#define KBDATAP 0x60 /* kbd data port */ -#define KBSTATUSPORT 0x61 /* kbd status */ -#define KBSTATP 0x64 /* kbd status port */ -#define KBINRDY 0x01 -#define KBOUTRDY 0x02 - -#define _x__ 0x00 /* Unknown / unmapped */ - -const unsigned char keycode[] = { - _x__, 0x43, 0x41, 0x3F, 0x3D, 0x3B, 0x3C, _x__, /* 0x00-0x07 */ - _x__, 0x44, 0x42, 0x40, 0x3E, 0x0F, 0x29, _x__, /* 0x08-0x0F */ - _x__, 0x38, 0x2A, _x__, 0x1D, 0x10, 0x02, _x__, /* 0x10-0x17 */ - _x__, _x__, 0x2C, 0x1F, 0x1E, 0x11, 0x03, _x__, /* 0x18-0x1F */ - _x__, 0x2E, 0x2D, 0x20, 0x12, 0x05, 0x04, _x__, /* 0x20-0x27 */ - _x__, 0x39, 0x2F, 0x21, 0x14, 0x13, 0x06, _x__, /* 0x28-0x2F */ - _x__, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, _x__, /* 0x30-0x37 */ - _x__, _x__, 0x32, 0x24, 0x16, 0x08, 0x09, _x__, /* 0x38-0x3F */ - _x__, 0x33, 0x25, 0x17, 0x18, 0x0B, 0x0A, _x__, /* 0x40-0x47 */ - _x__, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0C, _x__, /* 0x48-0x4F */ - _x__, _x__, 0x28, _x__, 0x1A, 0x0D, _x__, _x__, /* 0x50-0x57 */ - 0x3A, 0x36, 0x1C, 0x1B, _x__, 0x2B, _x__, _x__, /* 0x58-0x5F */ - _x__, _x__, _x__, _x__, _x__, _x__, 0x0E, _x__, /* 0x60-0x67 */ - _x__, 0x4F, _x__, 0x4B, 0x47, _x__, _x__, _x__, /* 0x68-0x6F */ - 0x52, 0x53, 0x50, 0x4C, 0x4D, 0x48, 0x01, 0x45, /* 0x70-0x77 */ - _x__, 0x4E, 0x51, 0x4A, _x__, 0x49, 0x46, 0x54, /* 0x78-0x7F */ -}; - -int -kbd(noblock) - int noblock; -{ - unsigned char dt, brk, act; - int first = 1; -loop: - if (noblock) { - if ((inb(KBSTATP) & KBINRDY) == 0) - return (-1); - } else while((inb(KBSTATP) & KBINRDY) == 0) - ; - dt = inb(KBDATAP); - - brk = dt & 0x80; /* brk == 1 on key release */ - dt = dt & 0x7f; /* keycode */ - - act = action[dt]; - if (act&SHF) - shfts = brk ? 0 : 1; - if (act&ALT) - alts = brk ? 0 : 1; - if (act&NUM) - if (act&L) { - /* NUM lock */ - if(!brk) - num = !num; - } else - num = brk ? 0 : 1; - if (act&CTL) - ctls = brk ? 0 : 1; - if (act&CPS) - if (act&L) { - /* CAPS lock */ - if(!brk) - caps = !caps; - } else - caps = brk ? 0 : 1; - if (act&STP) - if (act&L) { - if(!brk) - stp = !stp; - } else - stp = brk ? 0 : 1; - - if ((act&ASCII) && !brk) { - unsigned char chr; - - if (shfts) - chr = shift[dt]; - else if (ctls) - chr = ctl[dt]; - else - chr = unshift[dt]; - - if (alts) - chr |= 0x80; - - if (caps && (chr >= 'a' && chr <= 'z')) - chr -= 'a' - 'A' ; -#define CTRL(s) (s & 0x1F) - if ((chr == '\r') || (chr == '\n') || (chr == CTRL('A')) || (chr == CTRL('S'))) - { - /* Wait for key up */ - while (1) - { - while((inb(KBSTATP) & KBINRDY) == 0) ; - dt = inb(KBDATAP); - if (dt & 0x80) /* key up */ break; - } - } - return (chr); - } - if (first && brk) return (0); /* Ignore initial 'key up' codes */ - goto loop; -} - -scankbd() { - return (kbd(1) != -1); -} - -kbdreset() -{ - unsigned char c; - - /* Enable interrupts and keyboard controller */ - while (inb(KBSTATP) & KBOUTRDY) - ; - outb(KBSTATP,0x60); - while (inb(KBSTATP) & KBOUTRDY) - ; - outb(KBDATAP,0x4D); - - /* Start keyboard stuff RESET */ - while (inb(KBSTATP) & KBOUTRDY) - ; /* wait input ready */ - outb(KBDATAP,0xFF); /* RESET */ - - while ((c = inb(KBDATAP)) != 0xFA) - ; -} - -CRT_getc() -{ - int c; - while ((c = kbd(0)) == 0) ; - return(c); -} - -CRT_test() -{ - return ((inb(KBSTATP) & KBINRDY) != 0); -} - - -_dump_buf_with_offset(unsigned char *p, int s, unsigned char *base) -{ - int i, c; - if ((unsigned int)s > (unsigned int)p) - { - s = (unsigned int)s - (unsigned int)p; - } - while (s > 0) - { - if (base) - { - _printk("%06X: ", (int)p - (int)base); - } else - { - _printk("%06X: ", p); - } - for (i = 0; i < 16; i++) - { - if (i < s) - { - _printk("%02X", p[i] & 0xFF); - } else - { - _printk(" "); - } - if ((i % 2) == 1) _printk(" "); - if ((i % 8) == 7) _printk(" "); - } - _printk(" |"); - for (i = 0; i < 16; i++) - { - if (i < s) - { - c = p[i] & 0xFF; - if ((c < 0x20) || (c >= 0x7F)) c = '.'; - } else - { - c = ' '; - } - _printk("%c", c); - } - _printk("|\n"); - s -= 16; - p += 16; - } -} - -_dump_buf(unsigned char *p, int s) -{ - _dump_buf_with_offset(p, s, 0); -} - - -dump_buf_with_offset(unsigned char *p, int s, unsigned char *base) -{ - int i, c; - if ((unsigned int)s > (unsigned int)p) - { - s = (unsigned int)s - (unsigned int)p; - } - while (s > 0) - { - if (base) - { - printk("%06X: ", (int)p - (int)base); - } else - { - printk("%06X: ", p); - } - for (i = 0; i < 16; i++) - { - if (i < s) - { - printk("%02X", p[i] & 0xFF); - } else - { - printk(" "); - } - if ((i % 2) == 1) printk(" "); - if ((i % 8) == 7) printk(" "); - } - printk(" |"); - for (i = 0; i < 16; i++) - { - if (i < s) - { - c = p[i] & 0xFF; - if ((c < 0x20) || (c >= 0x7F)) c = '.'; - } else - { - c = ' '; - } - printk("%c", c); - } - printk("|\n"); - s -= 16; - p += 16; - } -} - -dump_buf(unsigned char *p, int s) -{ - dump_buf_with_offset(p, s, 0); -} - - -do_cnpause() -{ - static int line = 0; - if (++line > MAX_LINES) - { - cnpause(); - line = 0; - } -} diff --git a/drivers/block/ide-cd.c b/drivers/block/ide-cd.c index 9088f75eee6f..c4972f3248ed 100644 --- a/drivers/block/ide-cd.c +++ b/drivers/block/ide-cd.c @@ -98,6 +98,8 @@ * from Gerhard Zuber . * Let open succeed even if there's no loaded disc. * 3.13 May 19, 1996 -- Fixes for changer code. + * 3.14 May 29, 1996 -- Add work-around for Vertos 600. + * (From Hennus Bergman .) * * NOTE: Direct audio reads will only work on some types of drive. * So far, i've received reports of success for Sony and Toshiba drives. @@ -2597,6 +2599,13 @@ void ide_cdrom_setup (ide_drive_t *drive) CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1; } + else if (strcmp (drive->id->model, "V006E0DS") == 0 && + drive->id->fw_rev[4] == '1' && + drive->id->fw_rev[6] <= '2') { + /* Vertos 600 ESD. */ + CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 1; + } + else if (strcmp (drive->id->model, "NEC CD-ROM DRIVE:260") == 0 && strcmp (drive->id->fw_rev, "1.01") == 0) { @@ -2624,14 +2633,15 @@ void ide_cdrom_setup (ide_drive_t *drive) /* - * TODO: - * CDROMRESET - * Lock the door when a read request completes successfully and the - * door is not already locked. Also try to reorganize to reduce - * duplicated functionality between read and ioctl paths? - * Establish interfaces for an IDE port driver, and break out the cdrom - * code into a loadable module. - * Support changers better. + * TODO (for 2.1?): + * Avoid printing error messages for expected errors from the drive. + * Integrate with generic cdrom driver. + * Query the drive to find what features are available + * before trying to use them. + * Integrate spindown time adjustment patch. + * Modularize. + * CDROMRESET ioctl. + * Better support for changers. */ diff --git a/drivers/isdn/isdn_tty.c b/drivers/isdn/isdn_tty.c index 0d5cb12dc335..0e070a0ec2b3 100644 --- a/drivers/isdn/isdn_tty.c +++ b/drivers/isdn/isdn_tty.c @@ -1103,7 +1103,7 @@ static int isdn_tty_ioctl(struct tty_struct *tty, struct file *file, return isdn_tty_set_modem_info(info, cmd, (uint *) arg); case TIOCSERGETLSR: /* Get line status register */ #ifdef ISDN_DEBUG_MODEM_IOCTL - printk(KERN_DEBUG "ttyI%d ioctl TIOSERGETLSR\n", info->line); + printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line); #endif error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint)); if (error) diff --git a/drivers/isdn/teles/isdnl3.c b/drivers/isdn/teles/isdnl3.c index 6b829ed957c6..fa7ae88aef86 100644 --- a/drivers/isdn/teles/isdnl3.c +++ b/drivers/isdn/teles/isdnl3.c @@ -2,7 +2,7 @@ * * $Log: isdnl3.c,v $ * Revision 1.6 1996/05/21 11:33:50 keil - * Adding SETUP_ACKNOWLEGDE as answer of a SETUP message. + * Adding SETUP_ACKNOWLEDGE as answer of a SETUP message. * * Revision 1.5 1996/05/18 01:37:16 fritz * Added spelling corrections and some minor changes diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 275e07005e77..c28bec6c034b 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c @@ -263,8 +263,16 @@ static struct device atp_dev = { which means "don't probe". These entries exist to only to provide empty slots which may be enabled at boot-time. */ +static struct device eth7_dev = { + "eth7", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe }; +static struct device eth6_dev = { + "eth6", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð7_dev, ethif_probe }; +static struct device eth5_dev = { + "eth5", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð6_dev, ethif_probe }; +static struct device eth4_dev = { + "eth4", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð5_dev, ethif_probe }; static struct device eth3_dev = { - "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe }; + "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð4_dev, ethif_probe }; static struct device eth2_dev = { "eth2", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð3_dev, ethif_probe }; static struct device eth1_dev = { diff --git a/drivers/net/new_tunnel.c b/drivers/net/new_tunnel.c index 2a642bae9839..c9592de30a32 100644 --- a/drivers/net/new_tunnel.c +++ b/drivers/net/new_tunnel.c @@ -261,6 +261,7 @@ printk("Required room: %d, Tunnel hlen: %d\n", max_headroom, TUNL_HLEN); * and new_skb->ip_hdr is the IP header of the old packet. */ new_skb->ip_hdr = (struct iphdr *) skb_put(new_skb, skb->len); + new_skb->dev = skb->dev; memcpy(new_skb->ip_hdr, skb->data, skb->len); memset(new_skb->proto_priv, 0, sizeof(skb->proto_priv)); diff --git a/drivers/scsi/Config.in b/drivers/scsi/Config.in index a8ef97990c4f..650b20b4a80b 100644 --- a/drivers/scsi/Config.in +++ b/drivers/scsi/Config.in @@ -14,16 +14,21 @@ bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS mainmenu_option next_comment comment 'SCSI low-level drivers' -dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI +dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI dep_tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X $CONFIG_SCSI dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI dep_tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI +dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI +dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI +if [ "$CONFIG_PCI" = "y" ]; then + bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 +fi dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI +dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI dep_tristate 'EATA-DMA (DPT, NEC, AT&T, SNI, AST, Olivetti, Alphatronix) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI -dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI dep_tristate 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN $CONFIG_SCSI dep_tristate 'Generic NCR5380/53c400 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 $CONFIG_SCSI if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then @@ -32,6 +37,7 @@ if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then "Port CONFIG_SCSI_G_NCR5380_PORT \ Memory CONFIG_SCSI_G_NCR5380_MEM" Port fi +dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI if [ "$CONFIG_PCI" = "y" ]; then dep_tristate 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then @@ -40,7 +46,7 @@ if [ "$CONFIG_PCI" = "y" ]; then bool ' allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT fi fi -dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI +dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI dep_tristate 'PAS16 SCSI support' CONFIG_SCSI_PAS16 $CONFIG_SCSI dep_tristate 'Qlogic FAS SCSI support' CONFIG_SCSI_QLOGIC_FAS $CONFIG_SCSI if [ "$CONFIG_PCI" = "y" ]; then @@ -50,11 +56,7 @@ if [ "$CONFIG_PCI" = "y" ]; then fi dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI dep_tristate 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 $CONFIG_SCSI +dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI -dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI -dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI -dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI -dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI -bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974 #dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI endmenu diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c index 36f56857af5c..13feac634f28 100644 --- a/drivers/scsi/atari_scsi.c +++ b/drivers/scsi/atari_scsi.c @@ -87,6 +87,7 @@ #include #include #include +#include #include #include diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index c5a1bf7abd7e..3a3eb0dc1164 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -38,18 +38,20 @@ #include #include -#include #include #include #include #include -#include -#include #include #include -#include - +#include #include +#include + +#include +#include +#include + #include "scsi.h" #include "hosts.h" #include "constants.h" diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 20a5fe289a1d..9d165f9635dc 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -171,7 +171,7 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) unsigned char opcode; int inlen, outlen, cmdlen; int needed, buf_needed; - int result; + int timeout, retries, result; if (!buffer) return -EINVAL; @@ -239,6 +239,22 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) */ cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5); + switch (opcode) + { + case FORMAT_UNIT: + timeout = 2 * 60 * 60 * HZ; /* 2 Hours */ + retries = 1; + break; + case START_STOP: + timeout = 60 * HZ; /* 60 seconds */ + retries = 1; + break; + default: + timeout = MAX_TIMEOUT; + retries = MAX_RETRIES; + break; + } + #ifndef DEBUG_NO_CMD SCpnt = allocate_device(NULL, dev, 1); @@ -246,8 +262,8 @@ static int ioctl_command(Scsi_Device *dev, void *buffer) { struct semaphore sem = MUTEX_LOCKED; SCpnt->request.sem = &sem; - scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done, MAX_TIMEOUT, - MAX_RETRIES); + scsi_do_cmd(SCpnt, cmd, buf, needed, scsi_ioctl_done, + timeout, retries); down(&sem); } diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3bca2934e71f..c51e2192de77 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -34,6 +34,8 @@ #include #include #include +#include + #include #define MAJOR_NR SCSI_DISK_MAJOR diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 03565bea9b87..76fa76e97bae 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #define MAJOR_NR SCSI_CDROM_MAJOR diff --git a/drivers/sound/Config.in b/drivers/sound/Config.in index 105eedf4f3f2..8fa935b905b9 100644 --- a/drivers/sound/Config.in +++ b/drivers/sound/Config.in @@ -1,12 +1,257 @@ -# -# Sound driver configuration -# -#-------- -# There is another config script which is compatible with rest of -# the kernel. It can be activated by running 'make mkscript' in this -# directory. Please note that this is an _experimental_ feature which -# doesn't work with all cards (PSS, SM Wave, AudioTriX Pro). -#-------- -# -$MAKE -C drivers/sound config || exit 1 +bool 'ProAudioSpectrum 16 support' CONFIG_PAS +bool 'SoundBlaster (SB, SBPro, SB16, clones) support' CONFIG_SB +bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB +bool 'Gravis Ultrasound support' CONFIG_GUS +bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401 +bool '6850 UART Midi support' CONFIG_UART6850 +bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS +bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16 +bool 'GUS MAX support' CONFIG_GUSMAX +bool 'Microsoft Sound System support' CONFIG_MSS +bool 'Ensoniq Soundscape support' CONFIG_SSCAPE +bool 'MediaTriX AudioTriX Pro support' CONFIG_TRIX +bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16 +bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232 +bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI +bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO +bool 'MIDI interface support' CONFIG_MIDI +bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812 +bool 'Support for SM Wave' CONFIG_SMWAVE + +if [ "$CONFIG_AEDSP16" = "y" ]; then +hex 'I/O base for Audio Excel DSP 16 220 or 240' AEDSP16_BASE 220 +fi + +if [ "$CONFIG_SB" = "y" ]; then +hex 'I/O base for SB Check from manual of the card' SBC_BASE 220 +fi + +if [ "$CONFIG_SB" = "y" ]; then +int 'SoundBlaster IRQ Check from manual of the card' SBC_IRQ 7 +fi + +if [ "$CONFIG_SB" = "y" ]; then +int 'SoundBlaster DMA 0, 1 or 3' SBC_DMA 1 +fi + +if [ "$CONFIG_SB" = "y" ]; then +int 'SoundBlaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7' SB_DMA2 5 +fi + +if [ "$CONFIG_SB" = "y" ]; then +hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0 +fi + +if [ "$CONFIG_SB" = "y" ]; then +int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Check from manual of the card' SB_MPU_IRQ -1 +fi + +if [ "$CONFIG_PAS" = "y" ]; then +int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10 +fi + +if [ "$CONFIG_PAS" = "y" ]; then +int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3 +fi + +if [ "$CONFIG_GUS" = "y" ]; then +hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220 +fi + +if [ "$CONFIG_GUS" = "y" ]; then +int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15 +fi + +if [ "$CONFIG_GUS" = "y" ]; then +int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6 +fi + +if [ "$CONFIG_GUS" = "y" ]; then +int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1 +fi + +if [ "$CONFIG_GUS16" = "y" ]; then +hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530 +fi + +if [ "$CONFIG_GUS16" = "y" ]; then +int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7 +fi + +if [ "$CONFIG_GUS16" = "y" ]; then +int 'GUS DMA 0, 1 or 3' GUS16_DMA 3 +fi + +if [ "$CONFIG_MPU401" = "y" ]; then +hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330 +fi + +if [ "$CONFIG_MPU401" = "y" ]; then +int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9 +fi + +if [ "$CONFIG_MAUI" = "y" ]; then +hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330 +fi + +if [ "$CONFIG_MAUI" = "y" ]; then +int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9 +fi + +if [ "$CONFIG_UART6850" = "y" ]; then +hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0 +fi + +if [ "$CONFIG_UART6850" = "y" ]; then +int 'UART6850 IRQ (Unknown)' U6850_IRQ -1 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +hex 'PSS I/O base 220 or 240' PSS_BASE 220 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330 +fi + +if [ "$CONFIG_PSS" = "y" ]; then +int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9 +fi +if [ "$CONFIG_MSS" = "y" ]; then +hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530 +fi + +if [ "$CONFIG_MSS" = "y" ]; then +int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11 +fi + +if [ "$CONFIG_MSS" = "y" ]; then +int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +hex 'Soundscape MIDI I/O base ' SSCAPE_BASE 330 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +int 'Soundscape MIDI IRQ ' SSCAPE_IRQ 9 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +int 'Soundscape initialization DMA 0, 1 or 3' SSCAPE_DMA 3 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +hex 'Soundscape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +int 'Soundscape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11 +fi + +if [ "$CONFIG_SSCAPE" = "y" ]; then +int 'Soundscape audio DMA 0, 1 or 3' SSCAPE_MSS_DMA 0 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +hex 'AudioTriX audio I/O base 530, 604, E80 or F40' TRIX_BASE 530 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX audio DMA 0, 1 or 3' TRIX_DMA 0 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +hex 'AudioTriX MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +hex 'AudioTriX SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7 +fi + +if [ "$CONFIG_TRIX" = "y" ]; then +int 'AudioTriX SB DMA 1 or 3' TRIX_SB_DMA 1 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330 +fi + +if [ "$CONFIG_CS4232" = "y" ]; then +int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330 +fi + +if [ "$CONFIG_MAD16" = "y" ]; then +int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9 +fi + +if [ "$CONFIG_AUDIO" = "y" ]; then +int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536 +fi +# +$MAKE -C drivers/sound kernelconfig || exit 1 diff --git a/drivers/sound/sequencer.c b/drivers/sound/sequencer.c index ace39c50985a..d0d93f4b6d84 100644 --- a/drivers/sound/sequencer.c +++ b/drivers/sound/sequencer.c @@ -926,6 +926,9 @@ play_event (unsigned char *q) dev = q[2]; + if (dev < 0 || dev >= num_midis) + break; + if (!midi_devs[dev]->putc (dev, q[1])) { /* diff --git a/fs/Config.in b/fs/Config.in index ffb18033625d..770b002c6176 100644 --- a/fs/Config.in +++ b/fs/Config.in @@ -35,7 +35,7 @@ fi tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS -if [ "$CONFIG_EXPERIMENTAL = "y" ]; then +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then tristate 'Amiga FFS filesystem support (EXPERIMENTAL)' CONFIG_AFFS_FS if [ "$CONFIG_AFFS_FS" != "n" ]; then define_bool CONFIG_AMIGA_PARTITION y @@ -43,7 +43,7 @@ if [ "$CONFIG_EXPERIMENTAL = "y" ]; then fi tristate 'UFS filesystem support (read only)' CONFIG_UFS_FS if [ "$CONFIG_UFS_FS" != "n" ]; then - bool "BSD disklabel (FreeBSD partition tables) support" CONFIG_BSD_DISKLABEL - bool "SMD disklabel (Sun partition tables) support" CONFIG_SMD_DISKLABEL + bool 'BSD disklabel (FreeBSD partition tables) support' CONFIG_BSD_DISKLABEL + bool 'SMD disklabel (Sun partition tables) support' CONFIG_SMD_DISKLABEL fi endmenu diff --git a/fs/buffer.c b/fs/buffer.c index c4925e66a86d..278237d4e25e 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1099,7 +1099,7 @@ no_grow: static inline void after_unlock_page (struct page * page) { if (clear_bit(PG_decr_after, &page->flags)) - nr_async_pages--; + atomic_dec(&nr_async_pages); if (clear_bit(PG_free_after, &page->flags)) free_page(page_address(page)); if (clear_bit(PG_swap_unlock_after, &page->flags)) @@ -1250,11 +1250,12 @@ void unlock_buffer(struct buffer_head * bh) struct buffer_head *tmp; struct page *page; - clear_bit(BH_Lock, &bh->b_state); - wake_up(&bh->b_wait); - - if (!test_bit(BH_FreeOnIO, &bh->b_state)) + if (!test_bit(BH_FreeOnIO, &bh->b_state)) { + /* This is a normal buffer. */ + clear_bit(BH_Lock, &bh->b_state); + wake_up(&bh->b_wait); return; + } /* This is a temporary buffer used for page I/O. */ page = mem_map + MAP_NR(bh->b_data); if (!PageLocked(page)) { @@ -1268,17 +1269,18 @@ void unlock_buffer(struct buffer_head * bh) } /* Async buffer_heads are here only as labels for IO, and get thrown away once the IO for this page is complete. IO is - deemed complete once all buffers have been visited - (b_count==0) and are now unlocked. */ - bh->b_count--; + deemed complete once all buffers have been unlocked. */ if (!test_bit(BH_Uptodate, &bh->b_state)) set_bit(PG_error, &page->flags); + clear_bit(BH_Lock, &bh->b_state); + wake_up(&bh->b_wait); for (tmp = bh; tmp=tmp->b_this_page, tmp!=bh; ) { - if (test_bit(BH_Lock, &tmp->b_state) || tmp->b_count) + if (test_bit(BH_Lock, &tmp->b_state)) return; } /* OK, the async IO on this page is complete. */ - clear_bit(PG_locked, &page->flags); + if (!clear_bit(PG_locked, &page->flags)) + return; wake_up(&page->wait); free_async_buffers(bh); after_unlock_page(page); diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 770b84c92be5..2dba71d8e7c1 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c @@ -37,11 +37,12 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, return err; flags = get_user((int *) arg); /* - * The IMMUTABLE flag can only be changed by the super user - * when the security level is zero. + * The IMMUTABLE and APPEND_ONLY flags can only be changed by + * the super user when the security level is zero. */ - if ((flags & EXT2_IMMUTABLE_FL) ^ - (inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)) { + if ((flags & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) ^ + (inode->u.ext2_i.i_flags & + (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) { /* This test looks nicer. Thanks to Pauline Middelink */ if (!fsuser() || securelevel > 0) return -EPERM; diff --git a/fs/locks.c b/fs/locks.c index 35a4934152bf..d9c72ead4ee9 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -82,6 +82,9 @@ * be compiled with different options than the kernel itself. * Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996. * + * Added a couple of missing wake_up() calls. + * Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996. + * * TODO: Do not honour mandatory locks on remote file systems. This matches * the SVR4 semantics and neatly sidesteps a pile of awkward issues that * would otherwise have to be addressed. @@ -882,9 +885,12 @@ repeat: locks_insert_lock(before, left); } right->fl_start = caller->fl_end + 1; + wake_up(&right->fl_wait); } - if (left) + if (left) { left->fl_end = caller->fl_start - 1; + wake_up(&left->fl_wait); + } return (0); } diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index e280541ee608..73119f510fe9 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "ncplib_kernel.h" struct ncp_dirent { @@ -807,6 +808,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, memcpy(name, __name, len); name[len] = 0; + lock_super(dir->i_sb); result_info = ncp_find_dir_inode(dir, name); if (result_info != 0) @@ -820,6 +822,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, inode number */ *result = iget(dir->i_sb, ncp_info_ino(server, result_info)); + unlock_super(dir->i_sb); iput(dir); if (*result == NULL) @@ -881,6 +884,7 @@ ncp_lookup(struct inode *dir, const char *__name, int len, } if (res != 0) { + unlock_super(dir->i_sb); iput(dir); return -ENOENT; } @@ -891,10 +895,12 @@ ncp_lookup(struct inode *dir, const char *__name, int len, if (!(*result = ncp_iget(dir, &finfo))) { + unlock_super(dir->i_sb); iput(dir); return -EACCES; } + unlock_super(dir->i_sb); iput(dir); return 0; } @@ -924,6 +930,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, _name[len] = '\0'; str_upper(_name); + lock_super(dir->i_sb); if (ncp_open_create_file_or_subdir(NCP_SERVER(dir), NCP_ISTRUCT(dir), _name, OC_MODE_CREATE|OC_MODE_OPEN| @@ -931,6 +938,7 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, 0, AR_READ|AR_WRITE, &finfo) != 0) { + unlock_super(dir->i_sb); iput(dir); return -EACCES; } @@ -943,10 +951,12 @@ ncp_create(struct inode *dir, const char *name, int len, int mode, if (!(*result = ncp_iget(dir, &finfo)) < 0) { ncp_close_file(NCP_SERVER(dir), finfo.file_handle); + unlock_super(dir->i_sb); iput(dir); return -EINVAL; } + unlock_super(dir->i_sb); iput(dir); return 0; } diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 0a54daf5f5f2..c5b99edba848 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ncplib_kernel.h" #include @@ -44,8 +45,10 @@ ncp_make_open(struct inode *i, int right) DPRINTK("ncp_make_open: dirent->opened = %d\n", finfo->opened); + lock_super(i->i_sb); if (finfo->opened == 0) { + finfo->access = -1; /* tries max. rights */ if (ncp_open_create_file_or_subdir(NCP_SERVER(i), NULL, NULL, @@ -63,12 +66,10 @@ ncp_make_open(struct inode *i, int right) { finfo->access = O_RDONLY; } - else - { - return -EACCES; - } } + unlock_super(i->i_sb); + if ( ((right == O_RDONLY) && ( (finfo->access == O_RDONLY) || (finfo->access == O_RDWR))) || ((right == O_WRONLY) && ( (finfo->access == O_WRONLY) diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 289d17454279..b7e6825c2227 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -129,7 +129,9 @@ static void ncp_put_inode(struct inode *inode) { struct nw_file_info *finfo = NCP_FINFO(inode); + struct super_block *sb = inode->i_sb; + lock_super(sb); if (finfo->opened != 0) { if (ncp_close_file(NCP_SERVER(inode), finfo->file_handle)!=0) @@ -152,6 +154,7 @@ ncp_put_inode(struct inode *inode) } clear_inode(inode); + unlock_super(sb); } struct super_block * diff --git a/include/asm-i386/posix_types.h b/include/asm-i386/posix_types.h index a6e2d7ffc1e8..3ff41051c22e 100644 --- a/include/asm-i386/posix_types.h +++ b/include/asm-i386/posix_types.h @@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t; typedef long long __kernel_loff_t; #endif +typedef struct { + int val[2]; +} __kernel_fsid_t; + #undef __FD_SET #define __FD_SET(fd,fdsetp) \ __asm__ __volatile__("btsl %1,%0": \ diff --git a/include/asm-i386/statfs.h b/include/asm-i386/statfs.h index 6efb741135cf..113d5d428aa0 100644 --- a/include/asm-i386/statfs.h +++ b/include/asm-i386/statfs.h @@ -1,9 +1,13 @@ #ifndef _I386_STATFS_H #define _I386_STATFS_H -typedef struct { - long val[2]; -} fsid_t; +#ifndef __KERNEL_STRICT_NAMES + +#include + +typedef __kernel_fsid_t fsid_t; + +#endif struct statfs { long f_type; @@ -13,7 +17,7 @@ struct statfs { long f_bavail; long f_files; long f_ffree; - fsid_t f_fsid; + __kernel_fsid_t f_fsid; long f_namelen; long f_spare[6]; }; diff --git a/include/asm-m68k/posix_types.h b/include/asm-m68k/posix_types.h index e434633902ed..ae79964b8f1c 100644 --- a/include/asm-m68k/posix_types.h +++ b/include/asm-m68k/posix_types.h @@ -27,6 +27,10 @@ typedef char * __kernel_caddr_t; typedef long long __kernel_loff_t; #endif +typedef struct { + int val[2]; +} __kernel_fsid_t; + #undef __FD_SET #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) diff --git a/include/asm-m68k/statfs.h b/include/asm-m68k/statfs.h index 7967ef697e71..1ee08965d53b 100644 --- a/include/asm-m68k/statfs.h +++ b/include/asm-m68k/statfs.h @@ -1,9 +1,13 @@ #ifndef _M68K_STATFS_H #define _M68K_STATFS_H -typedef struct { - long val[2]; -} fsid_t; +#ifndef __KERNEL_STRICT_NAMES + +#include + +typedef __kernel_fsid_t fsid_t; + +#endif struct statfs { long f_type; @@ -13,7 +17,7 @@ struct statfs { long f_bavail; long f_files; long f_ffree; - fsid_t f_fsid; + __kernel_fsid_t f_fsid; long f_namelen; long f_spare[6]; }; diff --git a/include/asm-ppc/statfs.h b/include/asm-ppc/statfs.h index c2b67a7e9d18..b2fd73564310 100644 --- a/include/asm-ppc/statfs.h +++ b/include/asm-ppc/statfs.h @@ -1,9 +1,13 @@ #ifndef _PPC_STATFS_H #define _PPC_STATFS_H -typedef struct { - long val[2]; -} fsid_t; +#ifndef __KERNEL_STRICT_NAMES + +#include + +typedef __kernel_fsid_t fsid_t; + +#endif struct statfs { long f_type; @@ -13,7 +17,7 @@ struct statfs { long f_bavail; long f_files; long f_ffree; - fsid_t f_fsid; + __kernel_fsid_t f_fsid; long f_namelen; long f_spare[6]; }; diff --git a/include/asm-sparc/posix_types.h b/include/asm-sparc/posix_types.h index 417a0d46415a..ff6807a3fbdf 100644 --- a/include/asm-sparc/posix_types.h +++ b/include/asm-sparc/posix_types.h @@ -34,6 +34,10 @@ typedef char * __kernel_caddr_t; typedef long long __kernel_loff_t; #endif +typedef struct { + int val[2]; +} __kernel_fsid_t; + #undef __FD_SET static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) { diff --git a/include/asm-sparc/statfs.h b/include/asm-sparc/statfs.h index 97e4093a6c87..ca9fee8819a8 100644 --- a/include/asm-sparc/statfs.h +++ b/include/asm-sparc/statfs.h @@ -2,9 +2,13 @@ #ifndef _SPARC_STATFS_H #define _SPARC_STATFS_H -typedef struct { - long val[2]; -} fsid_t; +#ifndef __KERNEL_STRICT_NAMES + +#include + +typedef __kernel_fsid_t fsid_t; + +#endif struct statfs { long f_type; @@ -14,7 +18,7 @@ struct statfs { long f_bavail; long f_files; long f_ffree; - fsid_t f_fsid; + __kernel_fsid_t f_fsid; long f_namelen; /* SunOS ignores this field. */ long f_spare[6]; }; diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 628a60d5988d..77cd07c8f672 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -14,6 +14,7 @@ struct irqaction { struct irqaction *next; }; +extern unsigned long intr_count; extern int bh_mask_count[32]; extern unsigned long bh_active; diff --git a/include/linux/sched.h b/include/linux/sched.h index 211c6b3264a9..14a44945d4aa 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -11,7 +11,6 @@ #include /* for HZ */ -extern unsigned long intr_count; extern unsigned long event; #include diff --git a/include/linux/swap.h b/include/linux/swap.h index 62d3754f61fd..6cfb7df0bb9d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -9,6 +9,8 @@ #ifdef __KERNEL__ +#include + #define SWP_USED 1 #define SWP_WRITEOK 3 @@ -32,7 +34,7 @@ struct swap_info_struct { extern int nr_swap_pages; extern int nr_free_pages; -extern int nr_async_pages; +extern atomic_t nr_async_pages; extern int min_free_pages; extern int free_pages_low; extern int free_pages_high; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index d819661be4b8..70b8093c08bc 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -70,33 +70,41 @@ struct __sysctl_args { #define VM_MAXID 5 /* CTL_NET names: */ +#define NET_CORE 1 +#define NET_ETHER 2 +#define NET_802 3 +#define NET_UNIX 4 +#define NET_IPV4 5 +#define NET_IPX 6 +#define NET_ATALK 7 +#define NET_NETROM 8 +#define NET_AX25 9 +#define NET_BRIDGE 10 /* /proc/sys/net/core */ -#define NET_CORE 0x01000000 /* /proc/sys/net/ethernet */ -#define NET_ETHER 0x02000000 /* /proc/sys/net/802 */ -#define NET_802 0x03000000 /* /proc/sys/net/unix */ -#define NET_UNIX 0x04000000 /* /proc/sys/net/ipv4 */ -#define NET_IPV4 0x05000000 +#define NET_IPV4_ARP_RES_TIME 1 +#define NET_IPV4_ARP_DEAD_RES_TIME 2 +#define NET_IPV4_ARP_MAX_TRIES 3 +#define NET_IPV4_ARP_TIMEOUT 4 +#define NET_IPV4_ARP_CHECK_INTERVAL 5 +#define NET_IPV4_ARP_CONFIRM_INTERVAL 6 +#define NET_IPV4_ARP_CONFIRM_TIMEOUT 7 /* /proc/sys/net/ipx */ -#define NET_IPX 0x06000000 /* /proc/sys/net/appletalk */ -#define NET_ATALK 0x07000000 /* /proc/sys/net/netrom */ -#define NET_NETROM 0x08000000 /* /proc/sys/net/ax25 */ -#define NET_AX25 0x09000000 /* CTL_PROC names: */ diff --git a/include/net/ip_masq.h b/include/net/ip_masq.h index 397c32603525..f51cc7075f45 100644 --- a/include/net/ip_masq.h +++ b/include/net/ip_masq.h @@ -85,6 +85,7 @@ extern int ip_masq_init(void); * functions called from ip layer */ extern int ip_fw_masquerade(struct sk_buff **, struct device *); +extern int ip_fw_masq_icmp(struct sk_buff **, struct device *); extern int ip_fw_demasquerade(struct sk_buff **, struct device *); /* diff --git a/ipc/msg.c b/ipc/msg.c index b0d9b583725a..3df15e005fd1 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -14,6 +14,7 @@ #include #include #include +#include #include diff --git a/kernel/exit.c b/kernel/exit.c index d483a0b388ce..fe4f9f416ce0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/mm/kmalloc.c b/mm/kmalloc.c index b5d114faed51..0fb14092d6e5 100644 --- a/mm/kmalloc.c +++ b/mm/kmalloc.c @@ -16,6 +16,8 @@ #include #include +#include + #include #include diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e4259fd3a0f4..122a9dcf9fc9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include /* for cli()/sti() */ diff --git a/mm/page_io.c b/mm/page_io.c index 7c65b080622f..acb02d83fd42 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -84,7 +84,7 @@ void rw_swap_page(int rw, unsigned long entry, char * buf, int wait) set_bit(PG_decr_after, &page->flags); set_bit(PG_swap_unlock_after, &page->flags); page->swap_unlock_entry = entry; - nr_async_pages++; + atomic_inc(&nr_async_pages); } ll_rw_page(rw,p->swap_device,offset,buf); /* diff --git a/mm/swap.c b/mm/swap.c index ff0794675002..0edfcdbc8ec1 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -44,7 +44,7 @@ int free_pages_high = 40; /* We track the number of pages currently being asynchronously swapped out, so that we don't try to swap TOO many pages out at once */ -int nr_async_pages = 0; +atomic_t nr_async_pages = 0; /* * Constants for the page aging mechanism: the maximum age (actually, diff --git a/net/bridge/Makefile b/net/bridge/Makefile index 48c07949d00c..981c47dcde12 100644 --- a/net/bridge/Makefile +++ b/net/bridge/Makefile @@ -8,7 +8,7 @@ # Note 2! The CFLAGS definition is now in the main makefile... O_TARGET := bridge.o -O_OBJS := br.o br_tree.o +O_OBJS := br.o br_tree.o sysctl_net_bridge.o M_OBJS := $(O_TARGET) include $(TOPDIR)/Rules.make diff --git a/net/bridge/sysctl_net_bridge.c b/net/bridge/sysctl_net_bridge.c new file mode 100644 index 000000000000..6e2f57d65601 --- /dev/null +++ b/net/bridge/sysctl_net_bridge.c @@ -0,0 +1,13 @@ +/* -*- linux-c -*- + * sysctl_net_bridge.c: sysctl interface to net bridge subsystem. + * + * Begun June 1, 1996, Mike Shaver. + * Added /proc/sys/net/bridge directory entry (empty =) ). [MS] + */ + +#include +#include + +ctl_table bridge_table[] = { + {0} +}; diff --git a/net/core/datagram.c b/net/core/datagram.c index 3d3275fe4fc3..b415571f5002 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -18,6 +18,7 @@ * Darryl Miles : Fixed non-blocking SOCK_SEQPACKET. * Linus Torvalds : BSD semantic fixes. * Alan Cox : Datagram iovec handling + * Darryl Miles : Fixed non-blocking SOCK_STREAM. * */ @@ -47,6 +48,7 @@ * Interrupts off so that no packet arrives before we begin sleeping. * Otherwise we might miss our wake up */ + static inline void wait_for_packet(struct sock * sk) { unsigned long flags; @@ -60,6 +62,16 @@ static inline void wait_for_packet(struct sock * sk) lock_sock(sk); } +/* + * Is a socket 'connection oriented' ? + */ + +static inline int connection_based(struct sock *sk) +{ + if(sk->type==SOCK_SEQPACKET || sk->type==SOCK_STREAM) + return 1; + return 0; +} /* * Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible @@ -92,7 +104,7 @@ restart: /* Sequenced packets can come disconnected. If so we report the problem */ error = -ENOTCONN; - if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED) + if(connection_based(sk) && sk->state!=TCP_ESTABLISHED) goto no_packet; /* User doesn't want to wait */ @@ -186,7 +198,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait) return 1; if (sk->shutdown & RCV_SHUTDOWN) return 1; - if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE) + if (connection_based(sk) && sk->state==TCP_CLOSE) { /* Connection closed: Wake up */ return(1); @@ -203,7 +215,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait) return 1; if (sk->shutdown & SEND_SHUTDOWN) return 1; - if (sk->type==SOCK_SEQPACKET && sk->state==TCP_SYN_SENT) + if (connection_based(sk) && sk->state==TCP_SYN_SENT) { /* Connection still in progress */ break; diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index dc4b400ad8fb..8adcb2b14c2d 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -4,14 +4,15 @@ * * This module implements the Address Resolution Protocol ARP (RFC 826), * which is used to convert IP addresses (or in the future maybe other - * high-level addresses into a low-level hardware address (like an Ethernet + * high-level addresses) into a low-level hardware address (like an Ethernet * address). * * FIXME: * Experiment with better retransmit timers * Clean up the timer deletions - * If you create a proxy entry set your interface address to the address - * and then delete it, proxies may get out of sync with reality - check this + * If you create a proxy entry, set your interface address to the address + * and then delete it, proxies may get out of sync with reality - + * check this. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,11 +20,12 @@ * 2 of the License, or (at your option) any later version. * * Fixes: - * Alan Cox : Removed the ethernet assumptions in Florian's code - * Alan Cox : Fixed some small errors in the ARP logic + * Alan Cox : Removed the ethernet assumptions in + * Florian's code + * Alan Cox : Fixed some small errors in the ARP + * logic * Alan Cox : Allow >4K in /proc * Alan Cox : Make ARP add its own protocol entry - * * Ross Martin : Rewrote arp_rcv() and arp_get_info() * Stephen Henson : Add AX25 support to arp_get_info() * Alan Cox : Drop data when a device is downed. @@ -46,7 +48,8 @@ * during arp_rcv. * Russ Nelson : Tidied up a few bits. * Alexey Kuznetsov: Major changes to caching and behaviour, - * eg intelligent arp probing and generation + * eg intelligent arp probing and + * generation * of host down events. * Alan Cox : Missing unlock in device events. * Eckes : ARP ioctl control errors. @@ -54,12 +57,13 @@ * Manuel Rodriguez: Gratuitous ARP. * Jonathan Layes : Added arpd support through kerneld * message queue (960314) + * Mike Shaver : /proc/sys/net/ipv4/arp_* support */ /* RFC1122 Status: 2.3.2.1 (ARP Cache Validation): MUST provide mechanism to flush stale cache entries (OK) - SHOULD be able to configure cache timeout (NOT YET) + SHOULD be able to configure cache timeout (OK) MUST throttle ARP retransmits (OK) 2.3.2.2 (ARP Packet Queue): SHOULD save at least one packet from each "conversation" with an @@ -121,12 +125,9 @@ * and dynamic routing. */ -#ifndef CONFIG_ARPD -#define ARP_TIMEOUT (600*HZ) -#else #define ARP_TIMEOUT (60*HZ) -#define ARPD_TIMEOUT (600*HZ) -#endif + +int sysctl_arp_timeout = ARP_TIMEOUT; /* * How often is ARP cache checked for expire. @@ -135,11 +136,13 @@ #define ARP_CHECK_INTERVAL (60*HZ) +int sysctl_arp_check_interval = ARP_CHECK_INTERVAL; + /* * Soft limit on ARP cache size. - * Note that this number should be greater, than - * number of simultaneously opened sockets, else - * hardware header cache will be not efficient. + * Note that this number should be greater than + * number of simultaneously opened sockets, or else + * hardware header cache will not be efficient. */ #if RT_CACHE_DEBUG >= 2 @@ -162,6 +165,8 @@ #define ARP_RES_TIME (5*HZ) +int sysctl_arp_res_time = ARP_RES_TIME; + /* * The number of times an broadcast arp request is send, until * the host is considered temporarily unreachable. @@ -169,6 +174,8 @@ #define ARP_MAX_TRIES 3 +int sysctl_arp_max_tries = ARP_MAX_TRIES; + /* * The entry is reconfirmed by sending point-to-point ARP * request after ARP_CONFIRM_INTERVAL. @@ -183,12 +190,16 @@ #define ARP_CONFIRM_INTERVAL (300*HZ) +int sysctl_arp_confirm_interval = ARP_CONFIRM_INTERVAL; + /* * We wait for answer to unicast request for ARP_CONFIRM_TIMEOUT. */ #define ARP_CONFIRM_TIMEOUT ARP_RES_TIME +int sysctl_arp_confirm_timeout = ARP_CONFIRM_TIMEOUT; + /* * The number of times an unicast arp request is retried, until * the cache entry is considered suspicious. @@ -198,6 +209,8 @@ #define ARP_MAX_PINGS 1 +int sysctl_arp_max_pings = ARP_MAX_PINGS; + /* * When a host is dead, but someone tries to connect it, * we do not remove corresponding cache entry (it would @@ -211,6 +224,8 @@ #define ARP_DEAD_RES_TIME (60*HZ) +int sysctl_arp_dead_res_time = ARP_DEAD_RES_TIME; + /* * This structure defines the ARP mapping cache. */ @@ -741,7 +756,7 @@ static int arp_force_expire(void) cli(); users = arp_count_hhs(entry); - if (!users && now - entry->last_used > ARP_TIMEOUT) + if (!users && now - entry->last_used > sysctl_arp_timeout) { *pentry = entry->next; restore_flags(flags); @@ -820,7 +835,7 @@ static void arp_check_expire(unsigned long dummy) } cli(); - if (now - entry->last_used > ARP_TIMEOUT + if (now - entry->last_used > sysctl_arp_timeout && !arp_count_hhs(entry)) { *pentry = entry->next; @@ -833,11 +848,11 @@ static void arp_check_expire(unsigned long dummy) } sti(); if (entry->last_updated - && now - entry->last_updated > ARP_CONFIRM_INTERVAL + && now - entry->last_updated > sysctl_arp_confirm_interval && !(entry->flags & ATF_PERM)) { struct device * dev = entry->dev; - entry->retries = ARP_MAX_TRIES+ARP_MAX_PINGS; + entry->retries = sysctl_arp_max_tries+sysctl_arp_max_pings; del_timer(&entry->timer); entry->timer.expires = jiffies + ARP_CONFIRM_TIMEOUT; add_timer(&entry->timer); @@ -859,7 +874,7 @@ static void arp_check_expire(unsigned long dummy) * Set the timer again. */ - arp_timer.expires = jiffies + ARP_CHECK_INTERVAL; + arp_timer.expires = jiffies + sysctl_arp_check_interval; add_timer(&arp_timer); } @@ -909,7 +924,7 @@ static void arp_expire_request (unsigned long arg) */ if ((entry->flags & ATF_COM) && entry->last_updated - && jiffies - entry->last_updated <= ARP_CONFIRM_INTERVAL) + && jiffies - entry->last_updated <= sysctl_arp_confirm_interval) { restore_flags(flags); arp_unlock(); @@ -926,10 +941,10 @@ static void arp_expire_request (unsigned long arg) printk("arp_expire_request: %08x timed out\n", entry->ip); #endif /* Set new timer. */ - entry->timer.expires = jiffies + ARP_RES_TIME; + entry->timer.expires = jiffies + sysctl_arp_res_time; add_timer(&entry->timer); arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr, - entry->retries > ARP_MAX_TRIES ? entry->ha : NULL, + entry->retries > sysctl_arp_max_tries ? entry->ha : NULL, dev->dev_addr, NULL); arp_unlock(); return; @@ -956,7 +971,7 @@ static void arp_expire_request (unsigned long arg) #if RT_CACHE_DEBUG >= 2 printk("arp_expire_request: %08x is dead\n", entry->ip); #endif - entry->retries = ARP_MAX_TRIES; + entry->retries = sysctl_arp_max_tries; entry->flags &= ~ATF_COM; arp_invalidate_hhs(entry); restore_flags(flags); @@ -967,7 +982,7 @@ static void arp_expire_request (unsigned long arg) entry->last_updated = 0; arpd_update(entry); - entry->timer.expires = jiffies + ARP_DEAD_RES_TIME; + entry->timer.expires = jiffies + sysctl_arp_dead_res_time; add_timer(&entry->timer); arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr, NULL, dev->dev_addr, NULL); @@ -1317,7 +1332,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache atomic_inc(&hh->hh_refcnt); hh->hh_arp = (void*)entry; } - entry->timer.expires = jiffies + ARP_RES_TIME; + entry->timer.expires = jiffies + sysctl_arp_res_time; if (skb != NULL) { @@ -1331,7 +1346,7 @@ struct arp_table * arp_new_entry(u32 paddr, struct device *dev, struct hh_cache entry->next = arp_tables[hash]; arp_tables[hash] = entry; add_timer(&entry->timer); - entry->retries = ARP_MAX_TRIES; + entry->retries = sysctl_arp_max_tries; #ifdef CONFIG_ARPD if (!arpd_not_running) arpd_lookup(paddr, dev); @@ -1573,8 +1588,8 @@ static void arp_run_bh() entry->next = arp_tables[hash]; arp_tables[hash] = entry; restore_flags(flags); - entry->timer.expires = jiffies + ARP_RES_TIME; - entry->retries = ARP_MAX_TRIES; + entry->timer.expires = jiffies + sysctl_arp_res_time; + entry->retries = sysctl_arp_max_tries; entry->last_used = jiffies; if (!(entry->flags & ATF_COM)) { diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index f2ab7b47f564..293ee09f6602 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -16,18 +16,26 @@ * Fixes: * Mike Shaver : RFC1122 checks. * Alan Cox : Multicast ping reply as self. - * Alan Cox : Fix atomicity lockup in ip_build_xmit call - * Alan Cox : Added 216,128 byte paths to the MTU code. + * Alan Cox : Fix atomicity lockup in ip_build_xmit + * call. + * Alan Cox : Added 216,128 byte paths to the MTU + * code. * Martin Mares : RFC1812 checks. - * Martin Mares : Can be configured to follow redirects if acting - * as a router _without_ a routing protocol (RFC 1812). - * Martin Mares : Echo requests may be configured to be ignored (RFC 1812). - * Martin Mares : Limitation of ICMP error message transmit rate (RFC 1812). - * Martin Mares : TOS and Precedence set correctly (RFC 1812). - * Martin Mares : Now copying as much data from the original packet - * as we can without exceeding 576 bytes (RFC 1812). + * Martin Mares : Can be configured to follow redirects + * if acting as a router _without_ a + * routing protocol (RFC 1812). + * Martin Mares : Echo requests may be configured to + * be ignored (RFC 1812). + * Martin Mares : Limitation of ICMP error message + * transmit rate (RFC 1812). + * Martin Mares : TOS and Precedence set correctly + * (RFC 1812). + * Martin Mares : Now copying as much data from the + * original packet as we can without + * exceeding 576 bytes (RFC 1812). * Willy Konynenberg : Transparent proxying support. - * + * Keith Owens : RFC1191 correction for 4.2BSD based + * path MTU bug. * * * RFC1122 (Host Requirements -- Comm. Layer) Status: @@ -81,7 +89,8 @@ * MAY discard broadcast REQUESTs. (OK, but see source for inconsistency) * MUST reply using same source address as the request was sent to. (OK) * MUST reverse source route, as per ECHO (NOT YET) - * MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK) + * MUST pass REPLYs to transport/user layer (requires RAW, just like + * ECHO) (OK) * MUST update clock for timestamp at least 15 times/sec (OK) * MUST be "correct within a few minutes" (OK) * 3.2.2.9 (Address Mask Request/Reply) @@ -108,10 +117,11 @@ * MUST use one of addresses for the interface the orig. packet arrived as * source address (OK) * 4.3.2.5 (TOS and Precedence) - * SHOULD leave TOS set to the same value unless the packet would be discarded - * for that reason (OK) + * SHOULD leave TOS set to the same value unless the packet would be + * discarded for that reason (OK) * MUST use TOS=0 if not possible to leave original value (OK) - * MUST leave IP Precedence for Source Quench messages (OK -- not sent at all) + * MUST leave IP Precedence for Source Quench messages (OK -- not sent + * at all) * SHOULD use IP Precedence = 6 (Internetwork Control) or 7 (Network Control) * for all other error messages (OK, we use 6) * MAY allow configuration of IP Precedence (OK -- not done) @@ -137,7 +147,8 @@ * is enabled on the interface (OK -- ignores) * 4.3.3.3 (Source Quench) * SHOULD NOT originate SQ messages (OK) - * MUST be able to limit SQ rate if originates them (OK as we don't send them) + * MUST be able to limit SQ rate if originates them (OK as we don't + * send them) * MAY ignore SQ messages it receives (OK -- we don't) * 4.3.3.4 (Time Exceeded) * Requirements dealt with at IP (generating TIME_EXCEEDED). @@ -166,16 +177,19 @@ * MUST reply using same source address as the request was sent to. (OK) * MUST use reversed Source Route if possible (NOT YET) * SHOULD update Record Route / Timestamp options (??) - * MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK) + * MUST pass REPLYs to transport/user layer (requires RAW, just like + * ECHO) (OK) * MUST update clock for timestamp at least 16 times/sec (OK) * MUST be "correct within a few minutes" (OK) * 4.3.3.9 (Address Mask Request/Reply) - * MUST have support for receiving AMRq and responding with AMRe (OK, but only as a - * compile-time option) - * SHOULD have option for each interface for AMRe's, MUST default to NO (NOT YET) + * MUST have support for receiving AMRq and responding with AMRe (OK, + * but only as a compile-time option) + * SHOULD have option for each interface for AMRe's, MUST default to + * NO (NOT YET) * MUST NOT reply to AMRq before knows the correct AM (OK) - * MUST NOT respond to AMRq with source address 0.0.0.0 on physical interfaces - * having multiple logical i-faces with different masks (NOT YET) + * MUST NOT respond to AMRq with source address 0.0.0.0 on physical + * interfaces having multiple logical i-faces with different masks + * (NOT YET) * SHOULD examine all AMRe's it receives and check them (NOT YET) * SHOULD log invalid AMRe's (AM+sender) (NOT YET) * MUST NOT use contents of AMRe to determine correct AM (OK) @@ -192,8 +206,8 @@ * SHOULD NOT generate Host Isolated codes (OK) * SHOULD use Communication Administratively Prohibited when administratively * filtering packets (NOT YET -- bug-to-bug compatibility) - * MAY include config option for not generating the above and silently discard - * the packets instead (OK) + * MAY include config option for not generating the above and silently + * discard the packets instead (OK) * MAY include config option for not generating Precedence Violation and * Precedence Cutoff messages (OK as we don't generate them at all) * MUST use Host Unreachable or Dest. Host Unknown codes whenever other hosts @@ -344,7 +358,7 @@ struct socket icmp_socket; /* * Send an ICMP frame. */ - + /* * Initialize the transmit rate limitation mechanism. @@ -370,7 +384,8 @@ static void xrlim_init(void) * Check transmit rate limitation for given message. * * RFC 1812: 4.3.2.8 SHOULD be able to limit error message rate - * SHOULD allow setting of rate limits (we allow in the source) + * SHOULD allow setting of rate limits (we allow + * in the source) */ static int xrlim_allow(int type, __u32 addr) @@ -385,7 +400,8 @@ static int xrlim_allow(int type, __u32 addr) if (!r) return 1; - for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++) /* Cache lookup */ + for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++) + /* Cache lookup */ if (c->daddr == addr) break; @@ -645,6 +661,22 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, struct devi unsigned short old_mtu = ntohs(iph->tot_len); unsigned short new_mtu = ntohs(icmph->un.echo.sequence); + /* + * RFC1191 5. 4.2BSD based router can return incorrect + * Total Length. If current mtu is unknown or old_mtu + * is not less than current mtu, reduce old_mtu by 4 times + * the header length. + */ + + if (skb->sk == NULL /* can this happen? */ + || skb->sk->ip_route_cache == NULL + || skb->sk->ip_route_cache->rt_mtu <= old_mtu) + { + NETDEBUG(printk(KERN_INFO "4.2BSD based fragmenting router between here and %s, mtu corrected from %d", in_ntoa(iph->daddr), old_mtu)); + old_mtu -= 4 * iph->ihl; + NETDEBUG(printk(" to %d\n", old_mtu)); + } + if (new_mtu < 68 || new_mtu >= old_mtu) { /* diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index ae6768c158b1..e025d831fc14 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -8,8 +8,10 @@ * Authors: see ip.c * * Fixes: - * Many : Split from ip.c , see ip_input.c for history. - * Dave Gregorich : NULL ip_rt_put fix for multicast routing. + * Many : Split from ip.c , see ip_input.c for + * history. + * Dave Gregorich : NULL ip_rt_put fix for multicast + * routing. * Jos Vos : Add call_out_firewall before sending, * use output device for accounting. * Jos Vos : Call forward firewall after routing @@ -225,6 +227,23 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, #ifdef CONFIG_FIREWALL if(!(is_frag&IPFWD_MASQUERADED)) { +#ifdef CONFIG_IP_MASQUERADE + /* + * Check that any ICMP packets are not for a + * masqueraded connection. If so rewrite them + * and skip the firewall checks + */ + if (iph->protocol == IPPROTO_ICMP) + { + if ((fw_res = ip_fw_masq_icmp(&skb, dev2)) < 0) + /* Problem - ie bad checksum */ + return -1; + + if (fw_res) + /* ICMP matched - skip firewall */ + goto skip_call_fw_firewall; + } +#endif fw_res=call_fw_firewall(PF_INET, dev2, iph, NULL); switch (fw_res) { case FW_ACCEPT: @@ -236,6 +255,10 @@ int ip_forward(struct sk_buff *skb, struct device *dev, int is_frag, default: return -1; } + +#ifdef CONFIG_IP_MASQUERADE + skip_call_fw_firewall: +#endif } #endif diff --git a/net/ipv4/ip_masq.c b/net/ipv4/ip_masq.c index 79539b64bf95..f730828dfb66 100644 --- a/net/ipv4/ip_masq.c +++ b/net/ipv4/ip_masq.c @@ -568,8 +568,108 @@ int ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev) return 0; } + +/* + * Handle ICMP messages in forward direction. + * Find any that might be relevant, check against existing connections, + * forward to masqueraded host if relevant. + * Currently handles error types - unreachable, quench, ttl exceeded + */ + +int ip_fw_masq_icmp(struct sk_buff **skb_p, struct device *dev) +{ + struct sk_buff *skb = *skb_p; + struct iphdr *iph = skb->h.iph; + struct icmphdr *icmph = (struct icmphdr *)((char *)iph + (iph->ihl<<2)); + struct iphdr *ciph; /* The ip header contained within the ICMP */ + __u16 *pptr; /* port numbers from TCP/UDP contained header */ + struct ip_masq *ms; + unsigned short len = ntohs(iph->tot_len) - (iph->ihl * 4); + +#ifdef DEBUG_CONFIG_IP_MASQUERADE + printk("Incoming forward ICMP (%d) %lX -> %lX\n", + icmph->type, + ntohl(iph->saddr), ntohl(iph->daddr)); +#endif + + /* + * Work through seeing if this is for us. + * These checks are supposed to be in an order that + * means easy things are checked first to speed up + * processing.... however this means that some + * packets will manage to get a long way down this + * stack and then be rejected, but thats life + */ + if ((icmph->type != ICMP_DEST_UNREACH) && + (icmph->type != ICMP_SOURCE_QUENCH) && + (icmph->type != ICMP_TIME_EXCEEDED)) + return 0; + + /* Now find the contained IP header */ + ciph = (struct iphdr *) (icmph + 1); + + /* We are only interested ICMPs generated from TCP or UDP packets */ + if ((ciph->protocol != IPPROTO_UDP) && (ciph->protocol != IPPROTO_TCP)) + return 0; + + /* + * Find the ports involved - this packet was + * incoming so the ports are right way round + * (but reversed relative to outer IP header!) + */ + pptr = (__u16 *)&(((char *)ciph)[ciph->ihl*4]); + if (ntohs(pptr[1]) < PORT_MASQ_BEGIN || + ntohs(pptr[1]) > PORT_MASQ_END) + return 0; + + /* Ensure the checksum is correct */ + if (ip_compute_csum((unsigned char *) icmph, len)) + { + /* Failed checksum! */ + printk(KERN_INFO "MASQ: forward ICMP: failed checksum from %s!\n", + in_ntoa(iph->saddr)); + return(-1); + } + +#ifdef DEBUG_CONFIG_IP_MASQUERADE + printk("Handling forward ICMP for %lX:%X -> %lX:%X\n", + ntohl(ciph->saddr), ntohs(pptr[0]), + ntohl(ciph->daddr), ntohs(pptr[1])); +#endif + + /* This is pretty much what ip_masq_in_get() does */ + ms = ip_masq_in_get_2(ciph->protocol, ciph->saddr, pptr[0], ciph->daddr, pptr[1]); + + if (ms == NULL) + return 0; + + /* Now we do real damage to this packet...! */ + /* First change the source IP address, and recalc checksum */ + iph->saddr = ms->maddr; + ip_send_check(iph); + + /* Now change the *dest* address in the contained IP */ + ciph->daddr = ms->maddr; + ip_send_check(ciph); + + /* the TCP/UDP dest port - cannot redo check */ + pptr[1] = ms->mport; + + /* And finally the ICMP checksum */ + icmph->checksum = 0; + icmph->checksum = ip_compute_csum((unsigned char *) icmph, len); + +#ifdef DEBUG_CONFIG_IP_MASQUERADE + printk("Rewrote forward ICMP to %lX:%X -> %lX:%X\n", + ntohl(ciph->saddr), ntohs(pptr[0]), + ntohl(ciph->daddr), ntohs(pptr[1])); +#endif + + return 1; +} + /* - * Handle ICMP messages. + * Handle ICMP messages in reverse (demasquerade) direction. * Find any that might be relevant, check against existing connections, * forward to masqueraded host if relevant. * Currently handles error types - unreachable, quench, ttl exceeded @@ -586,7 +686,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) unsigned short len = ntohs(iph->tot_len) - (iph->ihl * 4); #ifdef DEBUG_CONFIG_IP_MASQUERADE - printk("Incoming ICMP (%d) %lX -> %lX\n", + printk("Incoming reverse ICMP (%d) %lX -> %lX\n", icmph->type, ntohl(iph->saddr), ntohl(iph->daddr)); #endif @@ -616,12 +716,13 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) if (ip_compute_csum((unsigned char *) icmph, len)) { /* Failed checksum! */ - printk(KERN_INFO "MASQ: ICMP: failed checksum from %s!\n", in_ntoa(iph->saddr)); + printk(KERN_INFO "MASQ: reverse ICMP: failed checksum from %s!\n", + in_ntoa(iph->saddr)); return(-1); } #ifdef DEBUG_CONFIG_IP_MASQUERADE - printk("Handling ICMP for %lX:%X -> %lX:%X\n", + printk("Handling reverse ICMP for %lX:%X -> %lX:%X\n", ntohl(ciph->saddr), ntohs(pptr[0]), ntohl(ciph->daddr), ntohs(pptr[1])); #endif @@ -649,7 +750,7 @@ int ip_fw_demasq_icmp(struct sk_buff **skb_p, struct device *dev) icmph->checksum = ip_compute_csum((unsigned char *) icmph, len); #ifdef DEBUG_CONFIG_IP_MASQUERADE - printk("Rewrote ICMP to %lX:%X -> %lX:%X\n", + printk("Rewrote reverse ICMP to %lX:%X -> %lX:%X\n", ntohl(ciph->saddr), ntohs(pptr[0]), ntohl(ciph->daddr), ntohs(pptr[1])); #endif diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 463c4de17bef..21d7cd3be852 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -8,6 +8,31 @@ #include #include +/* From arp.c */ +extern int sysctl_arp_res_time; +extern int sysctl_arp_dead_res_time; +extern int sysctl_arp_max_tries; +extern int sysctl_arp_timeout; +extern int sysctl_arp_check_interval; +extern int sysctl_arp_confirm_interval; +extern int sysctl_arp_confirm_timeout; + ctl_table ipv4_table[] = { + {NET_IPV4_ARP_RES_TIME, "arp_res_time", + &sysctl_arp_res_time, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ARP_DEAD_RES_TIME, "arp_dead_res_time", + &sysctl_arp_dead_res_time, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ARP_MAX_TRIES, "arp_max_tries", + &sysctl_arp_max_tries, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ARP_TIMEOUT, "arp_timeout", + &sysctl_arp_timeout, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ARP_CHECK_INTERVAL, "arp_check_interval", + &sysctl_arp_check_interval, sizeof(int), 0644, NULL, &proc_dointvec}, + {NET_IPV4_ARP_CONFIRM_INTERVAL, "arp_confirm_interval", + &sysctl_arp_confirm_interval, sizeof(int), 0644, NULL, + &proc_dointvec}, + {NET_IPV4_ARP_CONFIRM_TIMEOUT, "arp_confirm_timeout", + &sysctl_arp_confirm_timeout, sizeof(int), 0644, NULL, + &proc_dointvec}, {0} }; diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d1ed4549955e..ae14060da1ba 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -933,7 +933,7 @@ static int tcp_ack(struct sock *sk, struct tcphdr *th, u32 ack, int len) /* * Maybe we can take some stuff off of the write queue, * and put it onto the xmit queue. - * FIXME: (?) There is bizzare case being tested here, to check if + * FIXME: (?) There is bizarre case being tested here, to check if * the data at the head of the queue ends before the start of * the sequence we already ACKed. This does not appear to be * a case that can actually occur. Why are we testing it? @@ -1679,7 +1679,7 @@ int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, struct sock *sk; int syn_ok=0; #ifdef CONFIG_IP_TRANSPARENT_PROXY - int r; + int r=0; #endif /* diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 680f5060a4d6..35de9fe8a125 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -61,7 +61,7 @@ void tcp_reset_xmit_timer(struct sock *sk, int why, unsigned long when) if (sk->retransmit_timer.expires < jiffies) { /* We can get here if we reset the timer on an event - * that could not fire because the interupts where disabled. + * that could not fire because the interrupts were disabled. * make sure it happens soon. */ sk->retransmit_timer.expires = jiffies+2; diff --git a/net/netlink.c b/net/netlink.c index ac4db4a68fa6..a4fe9ed5c48d 100644 --- a/net/netlink.c +++ b/net/netlink.c @@ -63,6 +63,21 @@ int netlink_donothing(struct sk_buff *skb) return -EINVAL; } +static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_table * wait) +{ + unsigned int minor = MINOR(inode->i_rdev); + switch (sel_type) { + case SEL_IN: + if (skb_peek(&skb_queue_rd[minor])!=NULL) + return 1; + select_wait(&read_space_wait[minor], wait); + break; + case SEL_OUT: + return 1; + } + return 0; +} + /* * Write a message to the kernel side of a communication link */ @@ -161,7 +176,7 @@ static struct file_operations netlink_fops = { netlink_read, netlink_write, NULL, /* netlink_readdir */ - NULL, /* netlink_select */ + netlink_select, netlink_ioctl, NULL, /* netlink_mmap */ netlink_open, diff --git a/net/netsyms.c b/net/netsyms.c index cfb52888cda2..7a86cf280e86 100644 --- a/net/netsyms.c +++ b/net/netsyms.c @@ -31,6 +31,10 @@ #include #endif +#ifdef CONFIG_NETLINK +#include +#endif + #ifdef CONFIG_NET_ALIAS #include #endif @@ -173,6 +177,12 @@ static struct symbol_table net_syms = { X(arp_query), #endif /* CONFIG_INET */ +#ifdef CONFIG_NETLINK + X(netlink_attach), + X(netlink_detach), + X(netlink_post), +#endif /* CONFIG_NETLINK */ + #include }; diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 8d3c39b70998..bb06dab376b2 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c @@ -3,6 +3,13 @@ * * Begun April 1, 1996, Mike Shaver. * Added /proc/sys/net directories for each protocol family. [MS] + * + * $Log: sysctl_net.c,v $ + * Revision 1.2 1996/05/08 20:24:40 shaver + * Added bits for NET_BRIDGE and the NET_IPV4_ARP stuff and + * NET_IPV4_IP_FORWARD. + * + * */ #include @@ -35,6 +42,10 @@ extern ctl_table core_table[], unix_table[]; extern ctl_table ether_table[], e802_table[]; #endif +#ifdef CONFIG_BRIDGE +extern ctl_table bridge_table[]; +#endif + ctl_table net_table[] = { {NET_CORE, "core", NULL, 0, 0555, core_table}, {NET_UNIX, "unix", NULL, 0, 0555, unix_table}, @@ -56,6 +67,9 @@ ctl_table net_table[] = { #endif #ifdef CONFIG_AX25 {NET_AX25, "ax25", NULL, 0, 0555, ax25_table}, +#endif +#ifdef CONFIG_BRIDGE + {NET_BRIDGE, "bridge", NULL, 0, 0555, bridge_table}, #endif {0} }; diff --git a/scripts/Menuconfig b/scripts/Menuconfig index 4bc4b9523fea..d52a50301b08 100644 --- a/scripts/Menuconfig +++ b/scripts/Menuconfig @@ -627,7 +627,7 @@ function parse_config_files () { # for i in MCmenu* do - source $i + source ./$i done rm -f MCmenu* @@ -646,9 +646,30 @@ function activate_menu () { comment_ctr=0 #So comment lines get unique tags $1 "$default" #Create the lxdialog menu & functions - . MCradiolists #Source the menu's functions - . MCmenu 2>MCdialog.out #Activate the lxdialog menu + if [ "$?" != "0" ] + then + clear + cat <. You may also +send a problem report to linux-kernel@vger.rutgers.edu or post a +message to the linux.dev.kernel news group. + +Please indicate the kernel version you are trying to configure and +which menu you were trying to enter when this error occured. + +EOM + cleanup + exit 1 + fi + + . ./MCradiolists #Source the menu's functions + + . ./MCmenu 2>MCdialog.out #Activate the lxdialog menu ret=$? read selection or post a message on the linux.dev.kernel +news group for additional assistance. + +EOM + cleanup + exit 139 + ;; esac done } @@ -719,7 +766,7 @@ last retrieved. Leave blank to abort."\ else echo -ne "\007" $DIALOG --backtitle "$backtitle" \ - --infobox "File does not exit!" 3 38 + --infobox "File does not exist!" 3 38 sleep 2 fi else @@ -815,7 +862,7 @@ function load_config_file () { ! /# .* is not set.*/ { print } ' $1 >.tmpconfig - source .tmpconfig + source ./.tmpconfig rm -f .tmpconfig } -- 2.39.5