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
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"
<DLE>c FAX calling tone received.
<DLE>b busy tone received.
<DLE>q quiet. Silence detected after non-silence.
- <DLE>s silence. Silence dectected from the
+ <DLE>s silence. Silence detected from the
start of recording.
Any character sent by the application, except XON (0x11) or XOFF (0x13)
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.
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
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
VERSION = 1
PATCHLEVEL = 99
-SUBLEVEL = 10
+SUBLEVEL = 11
ARCH = i386
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
#
# Character devices
/*
* 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;
+++ /dev/null
-#define FALSE 0
-#define TRUE 1
-#include <stdarg.h>
-
-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;
- }
-}
* from Gerhard Zuber <zuber@berlin.snafu.de>.
* 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 <hennus@sky.ow.nl>.)
*
* 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.
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) {
/*
- * 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.
*/
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)
*
* $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
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 = {
* 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));
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
"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
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
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
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/blk.h>
+#include <linux/interrupt.h>
#include <asm/bootinfo.h>
#include <asm/atarihw.h>
#include <linux/config.h>
#include <linux/module.h>
-#include <asm/system.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/malloc.h>
-#include <asm/irq.h>
-#include <asm/dma.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
-#include<linux/stat.h>
-
+#include <linux/stat.h>
#include <linux/blk.h>
+#include <linux/interrupt.h>
+
+#include <asm/system.h>
+#include <asm/irq.h>
+#include <asm/dma.h>
+
#include "scsi.h"
#include "hosts.h"
#include "constants.h"
unsigned char opcode;
int inlen, outlen, cmdlen;
int needed, buf_needed;
- int result;
+ int timeout, retries, result;
if (!buffer)
return -EINVAL;
*/
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);
{
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);
}
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
+#include <linux/interrupt.h>
+
#include <asm/system.h>
#define MAJOR_NR SCSI_DISK_MAJOR
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/cdrom.h>
+#include <linux/interrupt.h>
#include <asm/system.h>
#define MAJOR_NR SCSI_CDROM_MAJOR
-#
-# 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
dev = q[2];
+ if (dev < 0 || dev >= num_midis)
+ break;
+
if (!midi_devs[dev]->putc (dev, q[1]))
{
/*
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
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
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))
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)) {
}
/* 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);
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;
* 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.
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);
}
#include <linux/ncp_fs.h>
#include <asm/segment.h>
#include <linux/errno.h>
+#include <linux/locks.h>
#include "ncplib_kernel.h"
struct ncp_dirent {
memcpy(name, __name, len);
name[len] = 0;
+ lock_super(dir->i_sb);
result_info = ncp_find_dir_inode(dir, name);
if (result_info != 0)
inode number */
*result = iget(dir->i_sb, ncp_info_ino(server, result_info));
+ unlock_super(dir->i_sb);
iput(dir);
if (*result == NULL)
}
if (res != 0)
{
+ unlock_super(dir->i_sb);
iput(dir);
return -ENOENT;
}
if (!(*result = ncp_iget(dir, &finfo)))
{
+ unlock_super(dir->i_sb);
iput(dir);
return -EACCES;
}
+ unlock_super(dir->i_sb);
iput(dir);
return 0;
}
_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|
0, AR_READ|AR_WRITE,
&finfo) != 0)
{
+ unlock_super(dir->i_sb);
iput(dir);
return -EACCES;
}
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;
}
#include <linux/stat.h>
#include <linux/mm.h>
#include <linux/ncp_fs.h>
+#include <linux/locks.h>
#include "ncplib_kernel.h"
#include <linux/malloc.h>
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,
{
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)
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)
}
clear_inode(inode);
+ unlock_super(sb);
}
struct super_block *
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": \
#ifndef _I386_STATFS_H
#define _I386_STATFS_H
-typedef struct {
- long val[2];
-} fsid_t;
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
struct statfs {
long f_type;
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];
};
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))
#ifndef _M68K_STATFS_H
#define _M68K_STATFS_H
-typedef struct {
- long val[2];
-} fsid_t;
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
struct statfs {
long f_type;
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];
};
#ifndef _PPC_STATFS_H
#define _PPC_STATFS_H
-typedef struct {
- long val[2];
-} fsid_t;
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
struct statfs {
long f_type;
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];
};
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)
{
#ifndef _SPARC_STATFS_H
#define _SPARC_STATFS_H
-typedef struct {
- long val[2];
-} fsid_t;
+#ifndef __KERNEL_STRICT_NAMES
+
+#include <linux/types.h>
+
+typedef __kernel_fsid_t fsid_t;
+
+#endif
struct statfs {
long f_type;
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];
};
struct irqaction *next;
};
+extern unsigned long intr_count;
extern int bh_mask_count[32];
extern unsigned long bh_active;
#include <asm/param.h> /* for HZ */
-extern unsigned long intr_count;
extern unsigned long event;
#include <linux/binfmts.h>
#ifdef __KERNEL__
+#include <asm/atomic.h>
+
#define SWP_USED 1
#define SWP_WRITEOK 3
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;
#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: */
* 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 *);
/*
#include <linux/stat.h>
#include <linux/malloc.h>
#include <linux/kerneld.h>
+#include <linux/interrupt.h>
#include <asm/segment.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/malloc.h>
+#include <linux/interrupt.h>
#include <asm/segment.h>
#include <asm/pgtable.h>
#include <linux/mm.h>
#include <linux/delay.h>
+#include <linux/interrupt.h>
+
#include <asm/system.h>
#include <asm/dma.h>
#include <linux/swap.h>
#include <linux/fs.h>
#include <linux/swapctl.h>
+#include <linux/interrupt.h>
#include <asm/dma.h>
#include <asm/system.h> /* for cli()/sti() */
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);
/*
/* 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,
# 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
--- /dev/null
+/* -*- 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 <linux/mm.h>
+#include <linux/sysctl.h>
+
+ctl_table bridge_table[] = {
+ {0}
+};
* Darryl Miles : Fixed non-blocking SOCK_SEQPACKET.
* Linus Torvalds : BSD semantic fixes.
* Alan Cox : Datagram iovec handling
+ * Darryl Miles : Fixed non-blocking SOCK_STREAM.
*
*/
* 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;
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
/* 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 */
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);
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;
*
* 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
* 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.
* 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.
* 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
* 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.
#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
#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.
#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.
#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.
#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
#define ARP_DEAD_RES_TIME (60*HZ)
+int sysctl_arp_dead_res_time = ARP_DEAD_RES_TIME;
+
/*
* This structure defines the ARP mapping cache.
*/
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);
}
cli();
- if (now - entry->last_used > ARP_TIMEOUT
+ if (now - entry->last_used > sysctl_arp_timeout
&& !arp_count_hhs(entry))
{
*pentry = entry->next;
}
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);
* Set the timer again.
*/
- arp_timer.expires = jiffies + ARP_CHECK_INTERVAL;
+ arp_timer.expires = jiffies + sysctl_arp_check_interval;
add_timer(&arp_timer);
}
*/
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();
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;
#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);
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);
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)
{
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);
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))
{
* 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:
* 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)
* 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)
* 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).
* 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)
* 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
/*
* Send an ICMP frame.
*/
-
+
/*
* Initialize the transmit rate limitation mechanism.
* 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)
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;
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)
{
/*
* 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
#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:
default:
return -1;
}
+
+#ifdef CONFIG_IP_MASQUERADE
+ skip_call_fw_firewall:
+#endif
}
#endif
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
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
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
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
#include <linux/mm.h>
#include <linux/sysctl.h>
+/* 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}
};
/*
* 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?
struct sock *sk;
int syn_ok=0;
#ifdef CONFIG_IP_TRANSPARENT_PROXY
- int r;
+ int r=0;
#endif
/*
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;
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
*/
netlink_read,
netlink_write,
NULL, /* netlink_readdir */
- NULL, /* netlink_select */
+ netlink_select,
netlink_ioctl,
NULL, /* netlink_mmap */
netlink_open,
#include <linux/net_alias.h>
#endif
+#ifdef CONFIG_NETLINK
+#include <net/netlink.h>
+#endif
+
#ifdef CONFIG_NET_ALIAS
#include <linux/net_alias.h>
#endif
X(arp_query),
#endif /* CONFIG_INET */
+#ifdef CONFIG_NETLINK
+ X(netlink_attach),
+ X(netlink_detach),
+ X(netlink_post),
+#endif /* CONFIG_NETLINK */
+
#include <linux/symtab_end.h>
};
*
* 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 <linux/config.h>
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},
#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}
};
#
for i in MCmenu*
do
- source $i
+ source ./$i
done
rm -f MCmenu*
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 <<EOM
+\a
+Menuconfig has encountered a possible error in one of the kernel's
+configuration files and is unable to continue.
+
+Please report this to the author <roadcapw@cfw.com>. 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 <MCdialog.out
255|1)
break
;;
+ 139)
+ stty sane
+ clear
+ cat <<EOM
+\a
+There seems to be a problem with the lxdialog companion utility which is
+built prior to running Menuconfig. Usually this is an indicator that you
+have upgraded/downgraded your ncurses libraries and did not remove the
+old ncurses header file(s) in /usr/include or /usr/include/ncurses.
+
+It is VERY important that you have only one set of ncurses header files
+and that those files are properly version matched to the ncurses libraries
+installed on your machine.
+
+You may also need to rebuild lxdialog. This can be done by moving to
+the /usr/src/linux/scripts/lxdialog directory and issuing the
+"make clean all" command.
+
+If you have verified that your ncurses install is correct, you may email
+the author <roadcapw@cfw.com> or post a message on the linux.dev.kernel
+news group for additional assistance.
+
+EOM
+ cleanup
+ exit 139
+ ;;
esac
done
}
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
! /# .* is not set.*/ { print }
' $1 >.tmpconfig
- source .tmpconfig
+ source ./.tmpconfig
rm -f .tmpconfig
}