home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac / prep2011.zip / PREP2011.GZ / PREP2011
Text File  |  1996-06-03  |  103KB  |  3,425 lines

  1. diff -u --recursive --new-file pre2.0.10/linux/CREDITS linux/CREDITS
  2. --- pre2.0.10/linux/CREDITS    Sat Jun  1 20:11:29 1996
  3. +++ linux/CREDITS    Sun Jun  2 11:21:10 1996
  4. @@ -735,7 +735,7 @@
  5.  D: for Menuconfig's lxdialog.
  6.  
  7.  N: Volker Lendecke
  8. -E: lendecke@namu01.gwdg.de
  9. +E: lendecke@namu01.Num.Math.Uni-Goettingen.de
  10.  D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.)
  11.  D: NCP filesystem support (to mount NetWare volumes)
  12.  S: Innersteweg 11
  13. diff -u --recursive --new-file pre2.0.10/linux/Documentation/isdn/README.audio linux/Documentation/isdn/README.audio
  14. --- pre2.0.10/linux/Documentation/isdn/README.audio    Sat Jun  1 20:11:29 1996
  15. +++ linux/Documentation/isdn/README.audio    Sun Jun  2 13:23:14 1996
  16. @@ -32,7 +32,7 @@
  17.  where xx is a two-character code and v are alphanumerical parameters.
  18.  The following commands are supported:
  19.  
  20. -        AT+VNH=x         Auto hangup settting. NO EFFECT, supported
  21. +        AT+VNH=x         Auto hangup setting. NO EFFECT, supported
  22.                           for compatibility only.
  23.          AT+VNH?          Always reporting "1"
  24.          AT+VNH=?         Always reporting "1"
  25. @@ -100,7 +100,7 @@
  26.      <DLE>c                  FAX calling tone received.
  27.      <DLE>b                  busy tone received.
  28.      <DLE>q                  quiet. Silence detected after non-silence.
  29. -    <DLE>s                  silence. Silence dectected from the
  30. +    <DLE>s                  silence. Silence detected from the
  31.                              start of recording.
  32.  
  33.      Any character sent by the application, except XON (0x11) or XOFF (0x13)
  34. @@ -109,7 +109,7 @@
  35.    Audio playback.
  36.  
  37.      When sending audio data, upon AT+VTX command, emulator responds with
  38. -    CONNECT, and starts transfering data from application to the phone line.
  39. +    CONNECT, and starts transferring data from application to the phone line.
  40.      The same DLE sequences apply to this mode.
  41.  
  42.  
  43. diff -u --recursive --new-file pre2.0.10/linux/MAINTAINERS linux/MAINTAINERS
  44. --- pre2.0.10/linux/MAINTAINERS    Sat Jun  1 20:11:29 1996
  45. +++ linux/MAINTAINERS    Sun Jun  2 11:21:10 1996
  46. @@ -217,7 +217,7 @@
  47.  
  48.  NCP FILESYSTEM:
  49.  P:    Volker Lendecke
  50. -M:    lendecke@namu01.gwdg.de
  51. +M:    lendecke@namu01.Num.Math.Uni-Goettingen.de
  52.  L:    linware@sh.cvut.cz
  53.  S:    Maintained
  54.  
  55. @@ -253,7 +253,7 @@
  56.  
  57.  SMB FILESYSTEM:
  58.  P:    Volker Lendecke
  59. -M:    lendecke@namu01.gwdg.de
  60. +M:    lendecke@namu01.Num.Math.Uni-Goettingen.de
  61.  L:    samba@listproc.anu.edu.au
  62.  S:    Odd Fixes
  63.  
  64. diff -u --recursive --new-file pre2.0.10/linux/Makefile linux/Makefile
  65. --- pre2.0.10/linux/Makefile    Sat Jun  1 20:11:29 1996
  66. +++ linux/Makefile    Sat Jun  1 20:11:12 1996
  67. @@ -1,6 +1,6 @@
  68.  VERSION = 1
  69.  PATCHLEVEL = 99
  70. -SUBLEVEL = 10
  71. +SUBLEVEL = 11
  72.  
  73.  ARCH = i386
  74.  
  75. diff -u --recursive --new-file pre2.0.10/linux/arch/i386/defconfig linux/arch/i386/defconfig
  76. --- pre2.0.10/linux/arch/i386/defconfig    Sat Jun  1 20:11:30 1996
  77. +++ linux/arch/i386/defconfig    Mon Jun  3 12:13:30 1996
  78. @@ -142,6 +142,7 @@
  79.  CONFIG_ISO9660_FS=y
  80.  # CONFIG_HPFS_FS is not set
  81.  # CONFIG_SYSV_FS is not set
  82. +# CONFIG_UFS_FS is not set
  83.  
  84.  #
  85.  # Character devices
  86. diff -u --recursive --new-file pre2.0.10/linux/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
  87. --- pre2.0.10/linux/arch/i386/kernel/time.c    Sat Jun  1 20:11:30 1996
  88. +++ linux/arch/i386/kernel/time.c    Sun Jun  2 12:37:09 1996
  89. @@ -122,7 +122,7 @@
  90.      /*
  91.        * Due to rounding errors (and jiffies inconsistencies),
  92.       * we need to check the result so that we'll get a timer
  93. -     * that is monotonous.
  94. +     * that is monotonic.
  95.       */
  96.      if (edx >= 997670/HZ)
  97.          edx = 997670/HZ-1;
  98. diff -u --recursive --new-file pre2.0.10/linux/arch/ppc/kernel/raw_printf.c linux/arch/ppc/kernel/raw_printf.c
  99. --- pre2.0.10/linux/arch/ppc/kernel/raw_printf.c    Tue May 28 08:09:55 1996
  100. +++ linux/arch/ppc/kernel/raw_printf.c    Thu Jan  1 02:00:00 1970
  101. @@ -1,1200 +0,0 @@
  102. -#define FALSE 0
  103. -#define TRUE  1
  104. -#include <stdarg.h>
  105. -
  106. -extern int isBeBox[];
  107. -
  108. -extern void cnputc(char c);
  109. -
  110. -static char *_sprintk_ptr;
  111. -
  112. -static _sputc(char c)
  113. -{
  114. -   *_sprintk_ptr++ = c;
  115. -   *_sprintk_ptr = '\0';
  116. -}
  117. -
  118. -_sprintk(char *buf, char const *fmt, ...)
  119. -{
  120. -    int ret;
  121. -    va_list ap;
  122. -
  123. -    va_start(ap, fmt);
  124. -    _sprintk_ptr = buf;
  125. -    ret = _vprintk(_sputc, fmt, ap);
  126. -    va_end(ap);
  127. -    return (ret);
  128. -}
  129. -
  130. -_vsprintk(char *buf, char const *fmt, va_list ap)
  131. -{
  132. -    int ret;
  133. -
  134. -    _sprintk_ptr = buf;
  135. -    ret = _vprintk(_sputc, fmt, ap);
  136. -    return (ret);
  137. -}
  138. -
  139. -_printk(char const *fmt, ...)
  140. -{
  141. -    int ret;
  142. -    va_list ap;
  143. -
  144. -    va_start(ap, fmt);
  145. -    ret = _vprintk(cnputc, fmt, ap);
  146. -    va_end(ap);
  147. -    return (ret);
  148. -}
  149. -
  150. -#define is_digit(c) ((c >= '0') && (c <= '9'))
  151. -
  152. -int
  153. -_vprintk(putc, fmt0, ap)
  154. -   int (*putc)();
  155. -   const char *fmt0;
  156. -   va_list ap;
  157. -{
  158. -   char c, sign, *cp;
  159. -   int left_prec, right_prec, zero_fill, length, pad, pad_on_right;
  160. -   char buf[32];
  161. -   long val;
  162. -   while (c = *fmt0++)
  163. -   {
  164. -      if (c == '%')
  165. -      {
  166. -         c = *fmt0++;
  167. -         left_prec = right_prec = pad_on_right = 0;
  168. -         if (c == '-')
  169. -         {
  170. -            c = *fmt0++;
  171. -            pad_on_right++;
  172. -         }
  173. -         if (c == '0')
  174. -         {
  175. -            zero_fill = TRUE;
  176. -            c = *fmt0++;
  177. -         } else
  178. -         {
  179. -            zero_fill = FALSE;
  180. -         }
  181. -         while (is_digit(c))
  182. -         {
  183. -            left_prec = (left_prec * 10) + (c - '0');
  184. -            c = *fmt0++;
  185. -         }
  186. -         if (c == '.')
  187. -         {
  188. -            c = *fmt0++;
  189. -            zero_fill++;
  190. -            while (is_digit(c))
  191. -            {
  192. -               right_prec = (right_prec * 10) + (c - '0');
  193. -               c = *fmt0++;
  194. -            }
  195. -         } else
  196. -         {
  197. -            right_prec = left_prec;
  198. -         }
  199. -         sign = '\0';
  200. -         switch (c)
  201. -         {
  202. -            case 'd':
  203. -            case 'x':
  204. -            case 'X':
  205. -               val = va_arg(ap, long);
  206. -               switch (c)
  207. -               {
  208. -                  case 'd':
  209. -                     if (val < 0)
  210. -                     {
  211. -                        sign = '-';
  212. -                        val = -val;
  213. -                     }
  214. -                     length = _cvt(val, buf, 10, "0123456789");
  215. -                     break;
  216. -                  case 'x':
  217. -                     length = _cvt(val, buf, 16, "0123456789abcdef");
  218. -                     break;
  219. -                  case 'X':
  220. -                     length = _cvt(val, buf, 16, "0123456789ABCDEF");
  221. -                     break;
  222. -               }
  223. -               cp = buf;
  224. -               break;
  225. -            case 's':
  226. -               cp = va_arg(ap, char *);
  227. -               length = strlen(cp);
  228. -               break;
  229. -            case 'c':
  230. -               c = va_arg(ap, long /*char*/);
  231. -               (*putc)(c);
  232. -               continue;
  233. -            default:
  234. -               (*putc)('?');
  235. -         }
  236. -         pad = left_prec - length;
  237. -         if (sign != '\0')
  238. -         {
  239. -            pad--;
  240. -         }
  241. -         if (zero_fill)
  242. -         {
  243. -            c = '0';
  244. -            if (sign != '\0')
  245. -            {
  246. -               (*putc)(sign);
  247. -               sign = '\0';
  248. -            }
  249. -         } else
  250. -         {
  251. -            c = ' ';
  252. -         }
  253. -         if (!pad_on_right)
  254. -         {
  255. -            while (pad-- > 0)
  256. -            {
  257. -               (*putc)(c);
  258. -            }
  259. -         }
  260. -         if (sign != '\0')
  261. -         {
  262. -            (*putc)(sign);
  263. -         }
  264. -         while (length-- > 0)
  265. -         {
  266. -            (*putc)(c = *cp++);
  267. -            if (c == '\n')
  268. -            {
  269. -               (*putc)('\r');
  270. -            }
  271. -         }
  272. -         if (pad_on_right)
  273. -         {
  274. -            while (pad-- > 0)
  275. -            {
  276. -               (*putc)(c);
  277. -            }
  278. -         }
  279. -      } else
  280. -      {
  281. -         (*putc)(c);
  282. -         if (c == '\n')
  283. -         {
  284. -            (*putc)('\r');
  285. -         }
  286. -      }
  287. -   }
  288. -}
  289. -
  290. -static _cvt(unsigned long val, char *buf, long radix, char *digits)
  291. -{
  292. -   char temp[80];
  293. -   char *cp = temp;
  294. -   int length = 0;
  295. -   if (val == 0)
  296. -   { /* Special case */
  297. -      *cp++ = '0';
  298. -   } else
  299. -   while (val)
  300. -   {
  301. -      *cp++ = digits[val % radix];
  302. -      val /= radix;
  303. -   }
  304. -   while (cp != temp)
  305. -   {
  306. -      *buf++ = *--cp;
  307. -      length++;
  308. -   }
  309. -   *buf = '\0';
  310. -   return (length);
  311. -}
  312. -
  313. -/*
  314. - * Console I/O interface
  315. - */
  316. -
  317. -typedef const (*proc)();
  318. -typedef int dev_t;
  319. -
  320. -#define FALSE 0
  321. -#define TRUE  1
  322. -
  323. -#define CRT_PORT 0x3D4  /* Pick one */
  324. -
  325. -static int init = FALSE;
  326. -static int is_crt = 0;
  327. -static int port = 0;
  328. -static int line_num = 0;
  329. -#define MAX_LINES 24
  330. -
  331. -char
  332. -cngetc()
  333. -{
  334. -   int s = _disable_interrupts();
  335. -   char c = '\0';
  336. -   if (port == CRT_PORT)
  337. -   {
  338. -      c = CRT_getc(port);
  339. -   } else
  340. -   if (port)
  341. -   {
  342. -      c = NS16550_getc(port);
  343. -   }
  344. -   _enable_interrupts(s);
  345. -   return (c);
  346. -}
  347. -
  348. -cntstc()
  349. -{
  350. -   return (0);
  351. -}
  352. -
  353. -char _cn_trace[1024];
  354. -char *_cnp = _cn_trace;
  355. -
  356. -/*
  357. - * Console kernel output character routine.
  358. - */
  359. -void
  360. -cnputc(char c)
  361. -{
  362. -   *_cnp++ = c;
  363. -   if (_cnp == &_cn_trace[sizeof(_cn_trace)])
  364. -   {
  365. -      _cnp = _cn_trace;
  366. -   }
  367. -   if (!init)
  368. -   {
  369. -      if (is_crt = CRT_init())
  370. -      {
  371. -         port = CRT_PORT;
  372. -      } else
  373. -      {
  374. -         port = NS16550_init(0);
  375. -      }
  376. -      init = TRUE;
  377. -   }
  378. -   if (port == CRT_PORT)
  379. -   {
  380. -      CRT_putc(port, c);
  381. -   } else
  382. -   if (port)
  383. -   {
  384. -      NS16550_putc(port, c);
  385. -   }
  386. -   if (c == '\n')
  387. -   {
  388. -      if (line_num >= 0) line_num++;
  389. -   }
  390. -   if (c == '\r')
  391. -   {
  392. -      if (line_num >= MAX_LINES)
  393. -      {
  394. -         line_num = 0;
  395. -         _cnpause();
  396. -      }
  397. -   }
  398. -}
  399. -
  400. -_cnpause()
  401. -{
  402. -   int c;
  403. -   int s = _disable_interrupts();
  404. -   _printk("-- More? ");
  405. -   while ((c = cngetc()) == 0);
  406. -   _printk("\r         \r");  /* Erase prompt */
  407. -   if (c == ' ')
  408. -   {
  409. -      line_num = 0;
  410. -   } else
  411. -   if (c == 'n')
  412. -   {
  413. -      line_num = -1;  /* Turn off pause */
  414. -   } else
  415. -   if ((c == '\r') || (c == '\n'))
  416. -   {
  417. -      line_num = MAX_LINES-1;
  418. -   } else
  419. -   if (c == 0x03) /* ^C */
  420. -   {
  421. -       abort();
  422. -   } else
  423. -   {
  424. -      line_num = MAX_LINES - (MAX_LINES/3);
  425. -   }
  426. -   _enable_interrupts(s);
  427. -}
  428. -
  429. -cnpause()
  430. -{
  431. -   int c;
  432. -   int s = _disable_interrupts();
  433. -   flush_data_cache();
  434. -   printk("-- More? ");
  435. -   while ((c = cngetc()) == 0);
  436. -   printk("\r         \r");  /* Erase prompt */
  437. -   _enable_interrupts(s);
  438. -}
  439. -
  440. -/*
  441. - * COM1 NS16550 support
  442. - */
  443. -
  444. -struct NS16550
  445. -    {
  446. -        unsigned char rbr;  /* 0 */
  447. -        unsigned char ier;  /* 1 */
  448. -        unsigned char fcr;  /* 2 */
  449. -        unsigned char lcr;  /* 3 */
  450. -        unsigned char mcr;  /* 4 */
  451. -        unsigned char lsr;  /* 5 */
  452. -        unsigned char msr;  /* 6 */
  453. -        unsigned char scr;  /* 7 */
  454. -    };
  455. -
  456. -#define thr rbr
  457. -#define iir fcr
  458. -#define dll rbr
  459. -#define dlm ier
  460. -
  461. -#define LSR_DR   0x01  /* Data ready */
  462. -#define LSR_OE   0x02  /* Overrun */
  463. -#define LSR_PE   0x04  /* Parity error */
  464. -#define LSR_FE   0x08  /* Framing error */
  465. -#define LSR_BI   0x10  /* Break */
  466. -#define LSR_THRE 0x20  /* Xmit holding register empty */
  467. -#define LSR_TEMT 0x40  /* Xmitter empty */
  468. -#define LSR_ERR  0x80  /* Error */
  469. -
  470. -#define COM1    0x800003F8
  471. -#define COM2    0x800002F8
  472. -
  473. -typedef struct NS16550 *NS16550_t;
  474. -
  475. -const NS16550_t COM_PORTS[] = { COM1, COM2};
  476. -
  477. -volatile struct NS16550 *
  478. -NS16550_init(int chan)
  479. -{
  480. -    volatile struct NS16550 *com_port;
  481. -    volatile unsigned char xx;
  482. -    com_port = (struct NS16550 *) COM_PORTS[chan];
  483. -    /* See if port is present */
  484. -    com_port->lcr = 0x00;
  485. -    com_port->ier = 0xFF;
  486. -#if 0    
  487. -    if (com_port->ier != 0x0F) return ((struct NS16550 *)0);
  488. -#endif    
  489. -    com_port->ier = 0x00;
  490. -    com_port->lcr = 0x80;  /* Access baud rate */
  491. -    com_port->dll = 12;  /* 9600 baud */
  492. -    com_port->dlm = 12 >> 8;
  493. -    com_port->lcr = 0x03;  /* 8 data, 1 stop, no parity */
  494. -    com_port->mcr = 0x03;  /* RTS/DTR */
  495. -    com_port->fcr = 0x07;  /* Clear & enable FIFOs */
  496. -    return (com_port);
  497. -}
  498. -
  499. -
  500. -NS16550_putc(volatile struct NS16550 *com_port, unsigned char c)
  501. -{
  502. -    volatile int i;
  503. -    while ((com_port->lsr & LSR_THRE) == 0) ;
  504. -    com_port->thr = c;
  505. -}
  506. -
  507. -unsigned char NS16550_getc(volatile struct NS16550 *com_port)
  508. -{
  509. -    while ((com_port->lsr & LSR_DR) == 0) ;
  510. -    return (com_port->rbr);
  511. -}
  512. -
  513. -NS16550_test(volatile struct NS16550 *com_port)
  514. -{
  515. -    return ((com_port->lsr & LSR_DR) != 0);
  516. -}
  517. -
  518. -typedef unsigned short u_short;
  519. -typedef unsigned char  u_char;
  520. -
  521. -#define    COL        80
  522. -#define    ROW        25
  523. -#define    CHR        2
  524. -#define MONO_BASE    0x3B4
  525. -#define MONO_BUF    0xB0000
  526. -#define CGA_BASE    0x3D4
  527. -#define CGA_BUF        0xB8000
  528. -#define ISA_mem        ((unsigned char *)0xC0000000)
  529. -#define ISA_io        ((unsigned char *)0x80000000)
  530. -
  531. -unsigned char background = 0;
  532. -unsigned char foreground = 6;
  533. -
  534. -unsigned int addr_6845;
  535. -unsigned short *Crtat;
  536. -int lastpos;
  537. -int scroll;
  538. -
  539. -static void
  540. -outb(int port, unsigned char c)
  541. -{
  542. -    ISA_io[port] = c;
  543. -}
  544. -
  545. -static unsigned char
  546. -inb(int port)
  547. -{
  548. -    return (ISA_io[port]);
  549. -}
  550. -
  551. -/*
  552. - * The current state of virtual displays
  553. - */
  554. -struct screen {
  555. -    u_short *cp;        /* the current character address */
  556. -    enum state {
  557. -        NORMAL,            /* no pending escape */
  558. -        ESC,            /* saw ESC */
  559. -        EBRAC,            /* saw ESC[ */
  560. -        EBRACEQ            /* saw ESC[= */
  561. -    } state;        /* command parser state */
  562. -    int    cx;        /* the first escape seq argument */
  563. -    int    cy;        /* the second escape seq argument */
  564. -    int    *accp;        /* pointer to the current processed argument */
  565. -    int    row;        /* current column */
  566. -    int    so;        /* standout mode */
  567. -    u_short color;        /* normal character color */
  568. -    u_short color_so;    /* standout color */
  569. -    u_short save_color;    /* saved normal color */
  570. -    u_short save_color_so;    /* saved standout color */
  571. -} screen;
  572. -
  573. -/*
  574. - * Color and attributes for normal, standout and kernel output
  575. - * are stored in the least-significant byte of a u_short
  576. - * so they don't have to be shifted for use.
  577. - * This is all byte-order dependent.
  578. - */
  579. -#define    CATTR(x) (x)        /* store color/attributes un-shifted */
  580. -#define    ATTR_ADDR(which) (((u_char *)&(which))+1) /* address of attributes */
  581. -
  582. -unsigned short    pccolor;        /* color/attributes for tty output */
  583. -unsigned short    pccolor_so;        /* color/attributes, standout mode */
  584. -
  585. -/*
  586. - * cursor() sets an offset (0-1999) into the 80x25 text area   
  587. - */
  588. -static void
  589. -cursor()
  590. -{
  591. -     int pos = screen.cp - Crtat;
  592. -
  593. -    if (lastpos != pos) {
  594. -        outb(addr_6845, 14);
  595. -        outb(addr_6845+1, pos >> 8);
  596. -        outb(addr_6845, 15);
  597. -        outb(addr_6845+1, pos);
  598. -        lastpos = pos;
  599. -    }
  600. -}
  601. -
  602. -static void
  603. -initscreen()
  604. -{
  605. -    struct screen *d = &screen;
  606. -
  607. -    pccolor = CATTR((background<<4)|foreground);
  608. -    pccolor_so = CATTR((foreground<<4)|background);
  609. -    d->color = pccolor;
  610. -    d->save_color = pccolor;
  611. -    d->color_so = pccolor_so;
  612. -    d->save_color_so = pccolor_so;
  613. -}
  614. -
  615. -
  616. -#define    wrtchar(c, d) { \
  617. -    *(d->cp) = c; \
  618. -    d->cp++; \
  619. -    d->row++; \
  620. -}
  621. -
  622. -fillw(unsigned short val, unsigned short *buf, int num)
  623. -{
  624. -    /* Need to byte swap value */
  625. -    unsigned short tmp;
  626. -    tmp = val;
  627. -    while (num-- > 0)
  628. -    {
  629. -        *buf++ = tmp;
  630. -    }
  631. -}
  632. -
  633. -/*
  634. - * CRT_putc (nee sput) has support for emulation of the 'ibmpc' termcap entry.
  635. - * This is a bare-bones implementation of a bare-bones entry
  636. - * One modification: Change li#24 to li#25 to reflect 25 lines
  637. - * "ca" is the color/attributes value (left-shifted by 8)
  638. - * or 0 if the current regular color for that screen is to be used.
  639. - */
  640. -void 
  641. -CRT_putc(int port, u_char c)
  642. -{
  643. -    struct screen *d = &screen;
  644. -    u_short *base;
  645. -    int i, j;
  646. -    u_short *pp;
  647. -
  648. -    base = Crtat;
  649. -
  650. -    switch (d->state) {
  651. -    case NORMAL:
  652. -        switch (c) {
  653. -        case 0x0:        /* Ignore pad characters */
  654. -            return;
  655. -
  656. -        case 0x1B:
  657. -            d->state = ESC;
  658. -            break;
  659. -
  660. -        case '\t':
  661. -            do {
  662. -                wrtchar(d->color | ' ', d);
  663. -            } while (d->row % 8);
  664. -            break;
  665. -
  666. -        case '\b':  /* non-destructive backspace */
  667. -            if (d->cp > base) {
  668. -                d->cp--;
  669. -                d->row--;
  670. -                if (d->row < 0)
  671. -                    d->row += COL;    /* prev column */
  672. -            }
  673. -            break;
  674. -
  675. -        case '\r':
  676. -            d->cp -= d->row;
  677. -            d->row = 0;
  678. -            break;
  679. -
  680. -        case '\n':
  681. -            d->cp += COL;
  682. -            break;
  683. -
  684. -        case '\007':
  685. -            break;
  686. -
  687. -        default:
  688. -            if (d->so) {
  689. -                wrtchar(d->color_so|(c<<8), d); 
  690. -            } else {
  691. -                wrtchar(d->color | (c<<8), d); 
  692. -            }
  693. -            if (d->row >= COL)
  694. -                d->row = 0;
  695. -            break;
  696. -        }
  697. -        break;
  698. -
  699. -    case EBRAC:
  700. -        /*
  701. -         * In this state, the action at the end of the switch
  702. -         * on the character type is to go to NORMAL state,
  703. -         * and intermediate states do a return rather than break.
  704. -         */
  705. -        switch (c) {
  706. -        case 'm':
  707. -            d->so = d->cx;
  708. -            break;
  709. -
  710. -        case 'A': /* back one row */
  711. -            if (d->cp >= base + COL)
  712. -                d->cp -= COL;
  713. -            break;
  714. -
  715. -        case 'B': /* down one row */
  716. -            d->cp += COL;
  717. -            break;
  718. -
  719. -        case 'C': /* right cursor */
  720. -            d->cp++;
  721. -            d->row++;
  722. -            break;
  723. -
  724. -        case 'D': /* left cursor */
  725. -            if (d->cp > base) {
  726. -                d->cp--;
  727. -                d->row--;
  728. -                if (d->row < 0)
  729. -                    d->row += COL;    /* prev column ??? */
  730. -            }
  731. -            break;
  732. -
  733. -        case 'J': /* Clear to end of display */
  734. -            fillw(d->color|(' '<<8), d->cp, base + COL * ROW - d->cp);
  735. -            break;
  736. -
  737. -        case 'K': /* Clear to EOL */
  738. -            fillw(d->color|(' '<<8), d->cp, COL - (d->cp - base) % COL);
  739. -            break;
  740. -
  741. -        case 'H': /* Cursor move */
  742. -            if (d->cx > ROW)
  743. -                d->cx = ROW;
  744. -            if (d->cy > COL)
  745. -                d->cy = COL;
  746. -            if (d->cx == 0 || d->cy == 0) {
  747. -                d->cp = base;
  748. -                d->row = 0;
  749. -            } else {
  750. -                d->cp = base + (d->cx - 1) * COL + d->cy - 1;
  751. -                d->row = d->cy - 1;
  752. -            }
  753. -            break;
  754. -
  755. -        case '_': /* set cursor */
  756. -            if (d->cx)
  757. -                d->cx = 1;        /* block */
  758. -            else
  759. -                d->cx = 12;    /* underline */
  760. -            outb(addr_6845, 10);
  761. -            outb(addr_6845+1, d->cx);
  762. -            outb(addr_6845, 11);
  763. -            outb(addr_6845+1, 13);
  764. -            break;
  765. -
  766. -        case ';': /* Switch params in cursor def */
  767. -            d->accp = &d->cy;
  768. -            return;
  769. -
  770. -        case '=': /* ESC[= color change */
  771. -            d->state = EBRACEQ;
  772. -            return;
  773. -
  774. -        case 'L':    /* Insert line */
  775. -            i = (d->cp - base) / COL;
  776. -            /* avoid deficiency of bcopy implementation */
  777. -            pp = base + COL * (ROW-2);
  778. -            for (j = ROW - 1 - i; j--; pp -= COL)
  779. -                bcopy(pp, pp + COL, COL * CHR);
  780. -            fillw(d->color|(' '<<8), base + i * COL, COL);
  781. -            break;
  782. -            
  783. -        case 'M':    /* Delete line */
  784. -            i = (d->cp - base) / COL;
  785. -            pp = base + i * COL;
  786. -            bcopy(pp + COL, pp, (ROW-1 - i)*COL*CHR);
  787. -            fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL);
  788. -            break;
  789. -
  790. -        default: /* Only numbers valid here */
  791. -            if ((c >= '0') && (c <= '9')) {
  792. -                *(d->accp) *= 10;
  793. -                *(d->accp) += c - '0';
  794. -                return;
  795. -            } else
  796. -                break;
  797. -        }
  798. -        d->state = NORMAL;
  799. -        break;
  800. -
  801. -    case EBRACEQ: {
  802. -        /*
  803. -         * In this state, the action at the end of the switch
  804. -         * on the character type is to go to NORMAL state,
  805. -         * and intermediate states do a return rather than break.
  806. -         */
  807. -        u_char *colp;
  808. -
  809. -        /*
  810. -         * Set foreground/background color
  811. -         * for normal mode, standout mode
  812. -         * or kernel output.
  813. -         * Based on code from kentp@svmp03.
  814. -         */
  815. -        switch (c) {
  816. -        case 'F':
  817. -            colp = ATTR_ADDR(d->color);
  818. -    do_fg:
  819. -            *colp = (*colp & 0xf0) | (d->cx);
  820. -            break;
  821. -
  822. -        case 'G':
  823. -            colp = ATTR_ADDR(d->color);
  824. -    do_bg:
  825. -            *colp = (*colp & 0xf) | (d->cx << 4);
  826. -            break;
  827. -
  828. -        case 'H':
  829. -            colp = ATTR_ADDR(d->color_so);
  830. -            goto do_fg;
  831. -
  832. -        case 'I':
  833. -            colp = ATTR_ADDR(d->color_so);
  834. -            goto do_bg;
  835. -
  836. -        case 'S':
  837. -            d->save_color = d->color;
  838. -            d->save_color_so = d->color_so;
  839. -            break;
  840. -
  841. -        case 'R':
  842. -            d->color = d->save_color;
  843. -            d->color_so = d->save_color_so;
  844. -            break;
  845. -
  846. -        default: /* Only numbers valid here */
  847. -            if ((c >= '0') && (c <= '9')) {
  848. -                d->cx *= 10;
  849. -                d->cx += c - '0';
  850. -                return;
  851. -            } else
  852. -                break;
  853. -        }
  854. -        d->state = NORMAL;
  855. -        }
  856. -        break;
  857. -
  858. -    case ESC:
  859. -        switch (c) {
  860. -        case 'c':    /* Clear screen & home */
  861. -            fillw(d->color|(' '<<8), base, COL * ROW);
  862. -            d->cp = base;
  863. -            d->row = 0;
  864. -            d->state = NORMAL;
  865. -            break;
  866. -        case '[':    /* Start ESC [ sequence */
  867. -            d->state = EBRAC;
  868. -            d->cx = 0;
  869. -            d->cy = 0;
  870. -            d->accp = &d->cx;
  871. -            break;
  872. -        default: /* Invalid, clear state */
  873. -            d->state = NORMAL;
  874. -            break;
  875. -        }
  876. -        break;
  877. -    }
  878. -    if (d->cp >= base + (COL * ROW)) { /* scroll check */
  879. -        bcopy(base + COL, base, COL * (ROW - 1) * CHR);
  880. -        fillw(d->color|(' '<<8), base + COL * (ROW - 1), COL);
  881. -        d->cp -= COL;
  882. -    }    
  883. -    cursor();
  884. -}
  885. -
  886. -video_on()
  887. -{ /* Enable video */
  888. -    outb(0x3C4, 0x01);
  889. -    outb(0x3C5, inb(0x3C5)&~20);
  890. -}
  891. -
  892. -CRT_init()
  893. -{
  894. -    unsigned long *PCI_base = (unsigned long *)0x80808010;  /* Magic */
  895. -    struct screen *d = &screen;
  896. -    if (!isBeBox[0] && *PCI_base)
  897. -    { /* No CRT configured */
  898. -        return (0);
  899. -    }
  900. -    /* Assume BeBox uses only VGA */
  901. -    video_on();
  902. -    d->cp = Crtat = (u_short *)&ISA_mem[0x0B8000];
  903. -    addr_6845 = CGA_BASE;
  904. -    initscreen();
  905. -    fillw(pccolor|(' '<<8), d->cp, COL * ROW);
  906. -    return (1);
  907. -}
  908. -
  909. -/* Keyboard handler */
  910. -
  911. -#define    L        0x0001    /* locking function */
  912. -#define    SHF        0x0002    /* keyboard shift */
  913. -#define    ALT        0x0004    /* alternate shift -- alternate chars */
  914. -#define    NUM        0x0008    /* numeric shift  cursors vs. numeric */
  915. -#define    CTL        0x0010    /* control shift  -- allows ctl function */
  916. -#define    CPS        0x0020    /* caps shift -- swaps case of letter */
  917. -#define    ASCII        0x0040    /* ascii code for this key */
  918. -#define    STP        0x0080    /* stop output */
  919. -#define    FUNC        0x0100    /* function key */
  920. -#define    SCROLL        0x0200    /* scroll lock key */
  921. -
  922. -/* #include "pcconstab.US" */
  923. -/*    BSDI $Id: pcconstab.US,v 1.1.1.1 1994/03/31 13:29:09 gary Exp $    */
  924. -/*-
  925. - * Copyright (c) 1990 The Regents of the University of California.
  926. - * All rights reserved.
  927. - *
  928. - * This code is derived from software contributed to Berkeley by
  929. - * William Jolitz and Don Ahn.
  930. - *
  931. - * Redistribution and use in source and binary forms, with or without
  932. - * modification, are permitted provided that the following conditions
  933. - * are met:
  934. - * 1. Redistributions of source code must retain the above copyright
  935. - *    notice, this list of conditions and the following disclaimer.
  936. - * 2. Redistributions in binary form must reproduce the above copyright
  937. - *    notice, this list of conditions and the following disclaimer in the
  938. - *    documentation and/or other materials provided with the distribution.
  939. - * 3. All advertising materials mentioning features or use of this software
  940. - *    must display the following acknowledgement:
  941. - *    This product includes software developed by the University of
  942. - *    California, Berkeley and its contributors.
  943. - * 4. Neither the name of the University nor the names of its contributors
  944. - *    may be used to endorse or promote products derived from this software
  945. - *    without specific prior written permission.
  946. - *
  947. - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  948. - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  949. - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  950. - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  951. - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  952. - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  953. - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  954. - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  955. - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  956. - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  957. - * SUCH DAMAGE.
  958. - *
  959. - *    from @(#)pccons.c    5.11 (Berkeley) 5/21/91
  960. - */
  961. -
  962. -/*
  963. - *    US Keyboard mapping tables
  964. - */
  965. -
  966. -const unsigned short action[] = {
  967. -    0,     ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan  0- 7 */
  968. -    ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan  8-15 */
  969. -    ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan 16-23 */
  970. -    ASCII, ASCII, ASCII, ASCII, ASCII,   CTL, ASCII, ASCII,    /* scan 24-31 */
  971. -    ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan 32-39 */
  972. -    ASCII, ASCII,   SHF, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan 40-47 */
  973. -    ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,   SHF, ASCII,    /* scan 48-55 */
  974. -      ALT, ASCII,   CPS,  FUNC,  FUNC,  FUNC,  FUNC,  FUNC,    /* scan 56-63 */
  975. -     FUNC,  FUNC,  FUNC,  FUNC,  FUNC,   NUM,SCROLL, ASCII,    /* scan 64-71 */
  976. -    ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,    /* scan 72-79 */
  977. -    ASCII, ASCII, ASCII, ASCII,     0,     0,     0,     0,    /* scan 80-87 */
  978. -    0,0,0,0,0,0,0,0,    /* scan 88-95 */
  979. -    0,0,0,0,0,0,0,0,    /* scan 96-103 */
  980. -    0,0,0,0,0,0,0,0,    /* scan 104-111 */
  981. -    0,0,0,0,0,0,0,0,    /* scan 112-119 */
  982. -    0,0,0,0,0,0,0,0,    /* scan 120-127 */
  983. -};
  984. -
  985. -const unsigned char unshift[] = {    /* no shift */
  986. -      0,   033,   '1',   '2',   '3',   '4',   '5',   '6',    /* scan  0- 7 */
  987. -    '7',   '8',   '9',   '0',   '-',   '=',   010,  '\t',    /* scan  8-15 */
  988. -    'q',   'w',   'e',   'r',   't',   'y',   'u',   'i',    /* scan 16-23 */
  989. -    'o',   'p',   '[',   ']',  '\r',   CTL,   'a',   's',    /* scan 24-31 */
  990. -    'd',   'f',   'g',   'h',   'j',   'k',   'l',   ';',    /* scan 32-39 */
  991. -    '\'',  '`',   SHF,   '\\',  'z',   'x',   'c',   'v',    /* scan 40-47 */
  992. -    'b',   'n',   'm',   ',',   '.',   '/',   SHF,   '*',    /* scan 48-55 */
  993. -    ALT,   ' ',   CPS,     1,     2,     3,     4,     5,    /* scan 56-63 */
  994. -      6,     7,     8,     9,    10,   NUM,   STP,   '7',    /* scan 64-71 */
  995. -    '8',   '9',   '-',   '4',   '5',   '6',   '+',   '1',    /* scan 72-79 */
  996. -    '2',   '3',   '0',   0177,    0,     0,     0,     0,    /* scan 80-87 */
  997. -    0,0,0,0,0,0,0,0,    /* scan 88-95 */
  998. -    0,0,0,0,0,0,0,0,    /* scan 96-103 */
  999. -    0,0,0,0,0,0,0,0,    /* scan 104-111 */
  1000. -    0,0,0,0,0,0,0,0,    /* scan 112-119 */
  1001. -    0,0,0,0,0,0,0,0,    /* scan 120-127 */
  1002. -};
  1003. -
  1004. -const unsigned char shift[] = {    /* shift shift */
  1005. -      0,   033,   '!',   '@',   '#',   '$',   '%',   '^',    /* scan  0- 7 */
  1006. -    '&',   '*',   '(',   ')',   '_',   '+',   010,  '\t',    /* scan  8-15 */
  1007. -    'Q',   'W',   'E',   'R',   'T',   'Y',   'U',   'I',    /* scan 16-23 */
  1008. -    'O',   'P',   '{',   '}',  '\r',   CTL,   'A',   'S',    /* scan 24-31 */
  1009. -    'D',   'F',   'G',   'H',   'J',   'K',   'L',   ':',    /* scan 32-39 */
  1010. -    '"',   '~',   SHF,   '|',   'Z',   'X',   'C',   'V',    /* scan 40-47 */
  1011. -    'B',   'N',   'M',   '<',   '>',   '?',   SHF,   '*',    /* scan 48-55 */
  1012. -    ALT,   ' ',   CPS,     0,     0,   ' ',     0,     0,    /* scan 56-63 */
  1013. -      0,     0,     0,     0,     0,   NUM,   STP,   '7',    /* scan 64-71 */
  1014. -    '8',   '9',   '-',   '4',   '5',   '6',   '+',   '1',    /* scan 72-79 */
  1015. -    '2',   '3',   '0',  0177,     0,     0,     0,     0,    /* scan 80-87 */
  1016. -    0,0,0,0,0,0,0,0,    /* scan 88-95 */
  1017. -    0,0,0,0,0,0,0,0,    /* scan 96-103 */
  1018. -    0,0,0,0,0,0,0,0,    /* scan 104-111 */
  1019. -    0,0,0,0,0,0,0,0,    /* scan 112-119 */
  1020. -    0,0,0,0,0,0,0,0,    /* scan 120-127 */
  1021. -};
  1022. -
  1023. -const unsigned char ctl[] = {    /* CTL shift */
  1024. -      0,   033,   '!',   000,   '#',   '$',   '%',   036,    /* scan  0- 7 */
  1025. -    '&',   '*',   '(',   ')',   037,   '+',   034,'\177',    /* scan  8-15 */
  1026. -    021,   027,   005,   022,   024,   031,   025,   011,    /* scan 16-23 */
  1027. -    017,   020,   033,   035,  '\r',   CTL,   001,   023,    /* scan 24-31 */
  1028. -    004,   006,   007,   010,   012,   013,   014,   ';',    /* scan 32-39 */
  1029. -    '\'',  '`',   SHF,   034,   032,   030,   003,   026,    /* scan 40-47 */
  1030. -    002,   016,   015,   '<',   '>',   '?',   SHF,   '*',    /* scan 48-55 */
  1031. -    ALT,   ' ',   CPS,     0,     0,   ' ',     0,     0,    /* scan 56-63 */
  1032. -    CPS,     0,     0,     0,     0,     0,     0,     0,    /* scan 64-71 */
  1033. -      0,     0,     0,     0,     0,     0,     0,     0,    /* scan 72-79 */
  1034. -      0,     0,     0,  0177,     0,     0,     0,     0,    /* scan 80-87 */
  1035. -      0,     0,   033,   '7',   '4',   '1',     0,   NUM,    /* scan 88-95 */
  1036. -    '8',   '5',   '2',     0,   STP,   '9',   '6',   '3',    /* scan 96-103*/
  1037. -    '.',     0,   '*',   '-',   '+',     0,     0,     0,    /*scan 104-111*/
  1038. -    0,0,0,0,0,0,0,0,    /* scan 112-119 */
  1039. -    0,0,0,0,0,0,0,0,    /* scan 120-127 */
  1040. -};
  1041. -
  1042. -
  1043. -unsigned char shfts, ctls, alts, caps, num, stp;
  1044. -
  1045. -#define    KBDATAP        0x60    /* kbd data port */
  1046. -#define    KBSTATUSPORT    0x61    /* kbd status */
  1047. -#define    KBSTATP        0x64    /* kbd status port */
  1048. -#define    KBINRDY        0x01
  1049. -#define    KBOUTRDY    0x02
  1050. -
  1051. -#define _x__ 0x00  /* Unknown / unmapped */
  1052. -
  1053. -const unsigned char keycode[] = {
  1054. -    _x__, 0x43, 0x41, 0x3F, 0x3D, 0x3B, 0x3C, _x__, /* 0x00-0x07 */
  1055. -    _x__, 0x44, 0x42, 0x40, 0x3E, 0x0F, 0x29, _x__, /* 0x08-0x0F */
  1056. -    _x__, 0x38, 0x2A, _x__, 0x1D, 0x10, 0x02, _x__, /* 0x10-0x17 */
  1057. -    _x__, _x__, 0x2C, 0x1F, 0x1E, 0x11, 0x03, _x__, /* 0x18-0x1F */
  1058. -    _x__, 0x2E, 0x2D, 0x20, 0x12, 0x05, 0x04, _x__, /* 0x20-0x27 */
  1059. -    _x__, 0x39, 0x2F, 0x21, 0x14, 0x13, 0x06, _x__, /* 0x28-0x2F */
  1060. -    _x__, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, _x__, /* 0x30-0x37 */
  1061. -    _x__, _x__, 0x32, 0x24, 0x16, 0x08, 0x09, _x__, /* 0x38-0x3F */
  1062. -    _x__, 0x33, 0x25, 0x17, 0x18, 0x0B, 0x0A, _x__, /* 0x40-0x47 */
  1063. -    _x__, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0C, _x__, /* 0x48-0x4F */
  1064. -    _x__, _x__, 0x28, _x__, 0x1A, 0x0D, _x__, _x__, /* 0x50-0x57 */
  1065. -    0x3A, 0x36, 0x1C, 0x1B, _x__, 0x2B, _x__, _x__, /* 0x58-0x5F */
  1066. -    _x__, _x__, _x__, _x__, _x__, _x__, 0x0E, _x__, /* 0x60-0x67 */
  1067. -    _x__, 0x4F, _x__, 0x4B, 0x47, _x__, _x__, _x__, /* 0x68-0x6F */
  1068. -    0x52, 0x53, 0x50, 0x4C, 0x4D, 0x48, 0x01, 0x45, /* 0x70-0x77 */
  1069. -    _x__, 0x4E, 0x51, 0x4A, _x__, 0x49, 0x46, 0x54, /* 0x78-0x7F */
  1070. -};
  1071. -
  1072. -int
  1073. -kbd(noblock)
  1074. -    int noblock;
  1075. -{
  1076. -    unsigned char dt, brk, act;
  1077. -    int first = 1;    
  1078. -loop:
  1079. -    if (noblock) {
  1080. -        if ((inb(KBSTATP) & KBINRDY) == 0)
  1081. -            return (-1);
  1082. -    } else while((inb(KBSTATP) & KBINRDY) == 0)
  1083. -        ;
  1084. -    dt = inb(KBDATAP);
  1085. -
  1086. -    brk = dt & 0x80;    /* brk == 1 on key release */
  1087. -    dt = dt & 0x7f;        /* keycode */
  1088. -
  1089. -    act = action[dt];
  1090. -    if (act&SHF)
  1091. -        shfts = brk ? 0 : 1;
  1092. -    if (act&ALT)
  1093. -        alts = brk ? 0 : 1;
  1094. -    if (act&NUM)
  1095. -        if (act&L) {
  1096. -            /* NUM lock */
  1097. -            if(!brk)
  1098. -                num = !num;
  1099. -        } else
  1100. -            num = brk ? 0 : 1;
  1101. -    if (act&CTL)
  1102. -        ctls = brk ? 0 : 1;
  1103. -    if (act&CPS)
  1104. -        if (act&L) {
  1105. -            /* CAPS lock */
  1106. -            if(!brk)
  1107. -                caps = !caps;
  1108. -        } else
  1109. -            caps = brk ? 0 : 1;
  1110. -    if (act&STP)
  1111. -        if (act&L) {
  1112. -            if(!brk)
  1113. -                stp = !stp;
  1114. -        } else
  1115. -            stp = brk ? 0 : 1;
  1116. -
  1117. -    if ((act&ASCII) && !brk) {
  1118. -        unsigned char chr;
  1119. -
  1120. -        if (shfts)
  1121. -            chr = shift[dt];
  1122. -        else if (ctls)
  1123. -            chr = ctl[dt];
  1124. -        else
  1125. -            chr = unshift[dt];
  1126. -
  1127. -        if (alts)
  1128. -            chr |= 0x80;
  1129. -
  1130. -        if (caps && (chr >= 'a' && chr <= 'z'))
  1131. -            chr -= 'a' - 'A' ;
  1132. -#define CTRL(s) (s & 0x1F)            
  1133. -        if ((chr == '\r') || (chr == '\n') || (chr == CTRL('A')) || (chr == CTRL('S')))
  1134. -        {
  1135. -            /* Wait for key up */
  1136. -            while (1)
  1137. -            {
  1138. -                while((inb(KBSTATP) & KBINRDY) == 0) ;
  1139. -                dt = inb(KBDATAP);
  1140. -                if (dt & 0x80) /* key up */ break;
  1141. -            }
  1142. -        }
  1143. -        return (chr);
  1144. -    }
  1145. -    if (first && brk) return (0);  /* Ignore initial 'key up' codes */
  1146. -    goto loop;
  1147. -}
  1148. -
  1149. -scankbd() {
  1150. -    return (kbd(1) != -1);
  1151. -}
  1152. -
  1153. -kbdreset()
  1154. -{
  1155. -    unsigned char c;
  1156. -
  1157. -    /* Enable interrupts and keyboard controller */
  1158. -    while (inb(KBSTATP) & KBOUTRDY)
  1159. -        ;
  1160. -    outb(KBSTATP,0x60);
  1161. -    while (inb(KBSTATP) & KBOUTRDY)
  1162. -        ;
  1163. -    outb(KBDATAP,0x4D);
  1164. -
  1165. -    /* Start keyboard stuff RESET */
  1166. -    while (inb(KBSTATP) & KBOUTRDY)
  1167. -        ;    /* wait input ready */
  1168. -    outb(KBDATAP,0xFF);    /* RESET */
  1169. -
  1170. -    while ((c = inb(KBDATAP)) != 0xFA)
  1171. -        ;
  1172. -}
  1173. -
  1174. -CRT_getc()
  1175. -{
  1176. -    int c;
  1177. -    while ((c = kbd(0)) == 0) ;
  1178. -    return(c);
  1179. -}
  1180. -
  1181. -CRT_test()
  1182. -{
  1183. -    return ((inb(KBSTATP) & KBINRDY) != 0);
  1184. -}
  1185. -
  1186. -
  1187. -_dump_buf_with_offset(unsigned char *p, int s, unsigned char *base)
  1188. -{
  1189. -   int i, c;
  1190. -   if ((unsigned int)s > (unsigned int)p)
  1191. -   {
  1192. -       s = (unsigned int)s - (unsigned int)p;
  1193. -   }
  1194. -   while (s > 0)
  1195. -   {
  1196. -      if (base)
  1197. -      {
  1198. -         _printk("%06X: ", (int)p - (int)base);
  1199. -      } else
  1200. -      {
  1201. -         _printk("%06X: ", p);
  1202. -      }
  1203. -      for (i = 0;  i < 16;  i++)
  1204. -      {
  1205. -         if (i < s)
  1206. -         {
  1207. -            _printk("%02X", p[i] & 0xFF);
  1208. -         } else
  1209. -         {
  1210. -            _printk("  ");
  1211. -         }
  1212. -         if ((i % 2) == 1) _printk(" ");
  1213. -         if ((i % 8) == 7) _printk(" ");
  1214. -      }
  1215. -      _printk(" |");
  1216. -      for (i = 0;  i < 16;  i++)
  1217. -      {
  1218. -         if (i < s)
  1219. -         {
  1220. -            c = p[i] & 0xFF;
  1221. -            if ((c < 0x20) || (c >= 0x7F)) c = '.';
  1222. -         } else
  1223. -         {
  1224. -            c = ' ';
  1225. -         }
  1226. -         _printk("%c", c);
  1227. -      }
  1228. -      _printk("|\n");
  1229. -      s -= 16;
  1230. -      p += 16;
  1231. -   }
  1232. -}
  1233. -
  1234. -_dump_buf(unsigned char *p, int s)
  1235. -{
  1236. -   _dump_buf_with_offset(p, s, 0);
  1237. -}
  1238. -
  1239. -
  1240. -dump_buf_with_offset(unsigned char *p, int s, unsigned char *base)
  1241. -{
  1242. -   int i, c;
  1243. -   if ((unsigned int)s > (unsigned int)p)
  1244. -   {
  1245. -       s = (unsigned int)s - (unsigned int)p;
  1246. -   }
  1247. -   while (s > 0)
  1248. -   {
  1249. -      if (base)
  1250. -      {
  1251. -         printk("%06X: ", (int)p - (int)base);
  1252. -      } else
  1253. -      {
  1254. -         printk("%06X: ", p);
  1255. -      }
  1256. -      for (i = 0;  i < 16;  i++)
  1257. -      {
  1258. -         if (i < s)
  1259. -         {
  1260. -            printk("%02X", p[i] & 0xFF);
  1261. -         } else
  1262. -         {
  1263. -            printk("  ");
  1264. -         }
  1265. -         if ((i % 2) == 1) printk(" ");
  1266. -         if ((i % 8) == 7) printk(" ");
  1267. -      }
  1268. -      printk(" |");
  1269. -      for (i = 0;  i < 16;  i++)
  1270. -      {
  1271. -         if (i < s)
  1272. -         {
  1273. -            c = p[i] & 0xFF;
  1274. -            if ((c < 0x20) || (c >= 0x7F)) c = '.';
  1275. -         } else
  1276. -         {
  1277. -            c = ' ';
  1278. -         }
  1279. -         printk("%c", c);
  1280. -      }
  1281. -      printk("|\n");
  1282. -      s -= 16;
  1283. -      p += 16;
  1284. -   }
  1285. -}
  1286. -
  1287. -dump_buf(unsigned char *p, int s)
  1288. -{
  1289. -   dump_buf_with_offset(p, s, 0);
  1290. -}
  1291. -
  1292. -
  1293. -do_cnpause()
  1294. -{
  1295. -    static int line = 0;
  1296. -    if (++line > MAX_LINES)
  1297. -    {
  1298. -        cnpause();
  1299. -        line = 0;
  1300. -    }
  1301. -}
  1302. diff -u --recursive --new-file pre2.0.10/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
  1303. --- pre2.0.10/linux/drivers/block/ide-cd.c    Mon May 20 08:20:58 1996
  1304. +++ linux/drivers/block/ide-cd.c    Mon Jun  3 11:10:11 1996
  1305. @@ -98,6 +98,8 @@
  1306.   *                        from Gerhard Zuber <zuber@berlin.snafu.de>.
  1307.   *                       Let open succeed even if there's no loaded disc.
  1308.   * 3.13  May 19, 1996 -- Fixes for changer code.
  1309. + * 3.14  May 29, 1996 -- Add work-around for Vertos 600.
  1310. + *                        (From Hennus Bergman <hennus@sky.ow.nl>.)
  1311.   *
  1312.   * NOTE: Direct audio reads will only work on some types of drive.
  1313.   * So far, i've received reports of success for Sony and Toshiba drives.
  1314. @@ -2597,6 +2599,13 @@
  1315.              CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1;
  1316.          }
  1317.  
  1318. +        else if (strcmp (drive->id->model, "V006E0DS") == 0 &&
  1319. +            drive->id->fw_rev[4] == '1' &&
  1320. +            drive->id->fw_rev[6] <= '2') {
  1321. +            /* Vertos 600 ESD. */
  1322. +            CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 1;
  1323. +        }
  1324. +
  1325.          else if (strcmp (drive->id->model,
  1326.                   "NEC CD-ROM DRIVE:260") == 0 &&
  1327.               strcmp (drive->id->fw_rev, "1.01") == 0) {
  1328. @@ -2624,14 +2633,15 @@
  1329.  
  1330.  
  1331.  /*
  1332. - * TODO:
  1333. - *  CDROMRESET
  1334. - *  Lock the door when a read request completes successfully and the
  1335. - *   door is not already locked.  Also try to reorganize to reduce
  1336. - *   duplicated functionality between read and ioctl paths?
  1337. - *  Establish interfaces for an IDE port driver, and break out the cdrom
  1338. - *   code into a loadable module.
  1339. - *  Support changers better.
  1340. + * TODO (for 2.1?):
  1341. + *  Avoid printing error messages for expected errors from the drive.
  1342. + *  Integrate with generic cdrom driver.
  1343. + *  Query the drive to find what features are available
  1344. + *   before trying to use them.
  1345. + *  Integrate spindown time adjustment patch.
  1346. + *  Modularize.
  1347. + *  CDROMRESET ioctl.
  1348. + *  Better support for changers.
  1349.   */
  1350.  
  1351.  
  1352. diff -u --recursive --new-file pre2.0.10/linux/drivers/isdn/isdn_tty.c linux/drivers/isdn/isdn_tty.c
  1353. --- pre2.0.10/linux/drivers/isdn/isdn_tty.c    Sat Jun  1 20:11:31 1996
  1354. +++ linux/drivers/isdn/isdn_tty.c    Sun Jun  2 13:23:14 1996
  1355. @@ -1103,7 +1103,7 @@
  1356.                          return isdn_tty_set_modem_info(info, cmd, (uint *) arg);
  1357.                  case TIOCSERGETLSR:    /* Get line status register */
  1358.  #ifdef ISDN_DEBUG_MODEM_IOCTL
  1359. -                        printk(KERN_DEBUG "ttyI%d ioctl TIOSERGETLSR\n", info->line);
  1360. +                        printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line);
  1361.  #endif
  1362.                          error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(uint));
  1363.                          if (error)
  1364. diff -u --recursive --new-file pre2.0.10/linux/drivers/isdn/teles/isdnl3.c linux/drivers/isdn/teles/isdnl3.c
  1365. --- pre2.0.10/linux/drivers/isdn/teles/isdnl3.c    Sat Jun  1 20:11:32 1996
  1366. +++ linux/drivers/isdn/teles/isdnl3.c    Sun Jun  2 13:23:13 1996
  1367. @@ -2,7 +2,7 @@
  1368.   *
  1369.   * $Log: isdnl3.c,v $
  1370.   * Revision 1.6  1996/05/21 11:33:50  keil
  1371. - * Adding SETUP_ACKNOWLEGDE as answer of a SETUP message.
  1372. + * Adding SETUP_ACKNOWLEDGE as answer of a SETUP message.
  1373.   *
  1374.   * Revision 1.5  1996/05/18 01:37:16  fritz
  1375.   * Added spelling corrections and some minor changes
  1376. diff -u --recursive --new-file pre2.0.10/linux/drivers/net/Space.c linux/drivers/net/Space.c
  1377. --- pre2.0.10/linux/drivers/net/Space.c    Wed May 15 11:01:14 1996
  1378. +++ linux/drivers/net/Space.c    Mon Jun  3 12:42:41 1996
  1379. @@ -263,8 +263,16 @@
  1380.     which means "don't probe".  These entries exist to only to provide empty
  1381.     slots which may be enabled at boot-time. */
  1382.  
  1383. +static struct device eth7_dev = {
  1384. +    "eth7", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
  1385. +static struct device eth6_dev = {
  1386. +    "eth6", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð7_dev, ethif_probe };
  1387. +static struct device eth5_dev = {
  1388. +    "eth5", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð6_dev, ethif_probe };
  1389. +static struct device eth4_dev = {
  1390. +    "eth4", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð5_dev, ethif_probe };
  1391.  static struct device eth3_dev = {
  1392. -    "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, NEXT_DEV, ethif_probe };
  1393. +    "eth3", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð4_dev, ethif_probe };
  1394.  static struct device eth2_dev = {
  1395.      "eth2", 0,0,0,0,0xffe0 /* I/O base*/, 0,0,0,0, ð3_dev, ethif_probe };
  1396.  static struct device eth1_dev = {
  1397. diff -u --recursive --new-file pre2.0.10/linux/drivers/net/new_tunnel.c linux/drivers/net/new_tunnel.c
  1398. --- pre2.0.10/linux/drivers/net/new_tunnel.c    Tue May 28 08:09:56 1996
  1399. +++ linux/drivers/net/new_tunnel.c    Mon Jun  3 12:42:41 1996
  1400. @@ -261,6 +261,7 @@
  1401.           * and new_skb->ip_hdr is the IP header of the old packet.
  1402.           */
  1403.          new_skb->ip_hdr = (struct iphdr *) skb_put(new_skb, skb->len);
  1404. +        new_skb->dev = skb->dev;
  1405.          memcpy(new_skb->ip_hdr, skb->data, skb->len);
  1406.          memset(new_skb->proto_priv, 0, sizeof(skb->proto_priv));
  1407.  
  1408. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/Config.in linux/drivers/scsi/Config.in
  1409. --- pre2.0.10/linux/drivers/scsi/Config.in    Mon May 20 08:21:02 1996
  1410. +++ linux/drivers/scsi/Config.in    Sun Jun  2 13:40:39 1996
  1411. @@ -14,16 +14,21 @@
  1412.  mainmenu_option next_comment
  1413.  comment 'SCSI low-level drivers'
  1414.  
  1415. -dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
  1416. +dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI
  1417.  dep_tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X $CONFIG_SCSI
  1418.  dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI
  1419.  dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI
  1420.  dep_tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
  1421. +dep_tristate 'AdvanSys SCSI support' CONFIG_SCSI_ADVANSYS $CONFIG_SCSI
  1422. +dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
  1423. +if [ "$CONFIG_PCI" = "y" ]; then
  1424. +  bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974
  1425. +fi
  1426.  dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI
  1427.  dep_tristate 'DTC3180/3280 SCSI support' CONFIG_SCSI_DTC3280 $CONFIG_SCSI
  1428. +dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI
  1429.  dep_tristate 'EATA-DMA (DPT, NEC, AT&T, SNI, AST, Olivetti, Alphatronix) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI
  1430.  dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI
  1431. -dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
  1432.  dep_tristate 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN $CONFIG_SCSI
  1433.  dep_tristate 'Generic NCR5380/53c400 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 $CONFIG_SCSI
  1434.  if [ "$CONFIG_SCSI_GENERIC_NCR5380" != "n" ]; then
  1435. @@ -32,6 +37,7 @@
  1436.          "Port CONFIG_SCSI_G_NCR5380_PORT \
  1437.          Memory CONFIG_SCSI_G_NCR5380_MEM" Port
  1438.  fi
  1439. +dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
  1440.  if [ "$CONFIG_PCI" = "y" ]; then
  1441.    dep_tristate 'NCR53c7,8xx SCSI support'  CONFIG_SCSI_NCR53C7xx $CONFIG_SCSI
  1442.    if [ "$CONFIG_SCSI_NCR53C7xx" != "n" ]; then
  1443. @@ -40,7 +46,7 @@
  1444.      bool '   allow DISCONNECT' CONFIG_SCSI_NCR53C7xx_DISCONNECT
  1445.    fi
  1446.  fi
  1447. -dep_tristate 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 $CONFIG_SCSI
  1448. +dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI
  1449.  dep_tristate 'PAS16 SCSI support' CONFIG_SCSI_PAS16 $CONFIG_SCSI
  1450.  dep_tristate 'Qlogic FAS SCSI support' CONFIG_SCSI_QLOGIC_FAS $CONFIG_SCSI
  1451.  if [ "$CONFIG_PCI" = "y" ]; then
  1452. @@ -50,11 +56,7 @@
  1453.  fi
  1454.  dep_tristate 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE $CONFIG_SCSI
  1455.  dep_tristate 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 $CONFIG_SCSI
  1456. +dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
  1457.  dep_tristate 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR $CONFIG_SCSI
  1458. -dep_tristate '7000FASST SCSI support' CONFIG_SCSI_7000FASST $CONFIG_SCSI
  1459. -dep_tristate 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA $CONFIG_SCSI
  1460. -dep_tristate 'NCR53c406a SCSI support' CONFIG_SCSI_NCR53C406A $CONFIG_SCSI
  1461. -dep_tristate 'IOMEGA Parallel Port ZIP drive SCSI support' CONFIG_SCSI_PPA $CONFIG_SCSI
  1462. -bool 'AM53/79C974 PCI SCSI support' CONFIG_SCSI_AM53C974
  1463.  #dep_tristate 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG $CONFIG_SCSI
  1464.  endmenu
  1465. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/atari_scsi.c linux/drivers/scsi/atari_scsi.c
  1466. --- pre2.0.10/linux/drivers/scsi/atari_scsi.c    Tue May 21 19:52:36 1996
  1467. +++ linux/drivers/scsi/atari_scsi.c    Mon Jun  3 12:29:12 1996
  1468. @@ -87,6 +87,7 @@
  1469.  #include <linux/delay.h>
  1470.  #include <linux/mm.h>
  1471.  #include <linux/blk.h>
  1472. +#include <linux/interrupt.h>
  1473.  
  1474.  #include <asm/bootinfo.h>
  1475.  #include <asm/atarihw.h>
  1476. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
  1477. --- pre2.0.10/linux/drivers/scsi/scsi.c    Fri May 31 08:02:20 1996
  1478. +++ linux/drivers/scsi/scsi.c    Mon Jun  3 12:29:58 1996
  1479. @@ -38,18 +38,20 @@
  1480.  #include <linux/config.h>
  1481.  #include <linux/module.h>
  1482.  
  1483. -#include <asm/system.h>
  1484.  #include <linux/sched.h>
  1485.  #include <linux/timer.h>
  1486.  #include <linux/string.h>
  1487.  #include <linux/malloc.h>
  1488. -#include <asm/irq.h>
  1489. -#include <asm/dma.h>
  1490.  #include <linux/ioport.h>
  1491.  #include <linux/kernel.h>
  1492. -#include<linux/stat.h>
  1493. -
  1494. +#include <linux/stat.h>
  1495.  #include <linux/blk.h>
  1496. +#include <linux/interrupt.h>
  1497. +
  1498. +#include <asm/system.h>
  1499. +#include <asm/irq.h>
  1500. +#include <asm/dma.h>
  1501. +
  1502.  #include "scsi.h"
  1503.  #include "hosts.h"
  1504.  #include "constants.h"
  1505. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/scsi_ioctl.c linux/drivers/scsi/scsi_ioctl.c
  1506. --- pre2.0.10/linux/drivers/scsi/scsi_ioctl.c    Fri May 31 08:02:20 1996
  1507. +++ linux/drivers/scsi/scsi_ioctl.c    Mon Jun  3 11:00:21 1996
  1508. @@ -171,7 +171,7 @@
  1509.      unsigned char opcode;
  1510.      int inlen, outlen, cmdlen;
  1511.      int needed, buf_needed;
  1512. -    int result;
  1513. +    int timeout, retries, result;
  1514.      
  1515.      if (!buffer)
  1516.      return -EINVAL;
  1517. @@ -239,6 +239,22 @@
  1518.       */
  1519.      cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5);
  1520.      
  1521. +    switch (opcode)
  1522. +      {
  1523. +      case FORMAT_UNIT:
  1524. +    timeout =  2 * 60 * 60 * HZ; /* 2 Hours */
  1525. +    retries = 1;
  1526. +    break;
  1527. +      case START_STOP:
  1528. +    timeout =  60 * HZ;    /* 60 seconds */
  1529. +    retries = 1;
  1530. +    break;
  1531. +      default:
  1532. +    timeout = MAX_TIMEOUT;
  1533. +    retries = MAX_RETRIES;
  1534. +    break;
  1535. +      }
  1536. +
  1537.  #ifndef DEBUG_NO_CMD
  1538.      
  1539.      SCpnt = allocate_device(NULL, dev, 1);
  1540. @@ -246,8 +262,8 @@
  1541.      {
  1542.      struct semaphore sem = MUTEX_LOCKED;
  1543.      SCpnt->request.sem = &sem;
  1544. -    scsi_do_cmd(SCpnt,  cmd,  buf, needed,  scsi_ioctl_done,  MAX_TIMEOUT, 
  1545. -            MAX_RETRIES);
  1546. +    scsi_do_cmd(SCpnt,  cmd,  buf, needed,  scsi_ioctl_done,
  1547. +            timeout, retries);
  1548.      down(&sem);
  1549.      }
  1550.      
  1551. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
  1552. --- pre2.0.10/linux/drivers/scsi/sd.c    Mon May 20 08:21:02 1996
  1553. +++ linux/drivers/scsi/sd.c    Mon Jun  3 12:30:16 1996
  1554. @@ -34,6 +34,8 @@
  1555.  #include <linux/mm.h>
  1556.  #include <linux/string.h>
  1557.  #include <linux/errno.h>
  1558. +#include <linux/interrupt.h>
  1559. +
  1560.  #include <asm/system.h>
  1561.  
  1562.  #define MAJOR_NR SCSI_DISK_MAJOR
  1563. diff -u --recursive --new-file pre2.0.10/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
  1564. --- pre2.0.10/linux/drivers/scsi/sr.c    Tue May  7 16:22:34 1996
  1565. +++ linux/drivers/scsi/sr.c    Mon Jun  3 12:30:43 1996
  1566. @@ -28,6 +28,7 @@
  1567.  #include <linux/string.h>
  1568.  #include <linux/errno.h>
  1569.  #include <linux/cdrom.h>
  1570. +#include <linux/interrupt.h>
  1571.  #include <asm/system.h>
  1572.  
  1573.  #define MAJOR_NR SCSI_CDROM_MAJOR
  1574. diff -u --recursive --new-file pre2.0.10/linux/drivers/sound/Config.in linux/drivers/sound/Config.in
  1575. --- pre2.0.10/linux/drivers/sound/Config.in    Fri Apr 12 15:52:02 1996
  1576. +++ linux/drivers/sound/Config.in    Mon Jun  3 16:19:44 1996
  1577. @@ -1,12 +1,257 @@
  1578. -#
  1579. -# Sound driver configuration
  1580. -#
  1581. -#--------
  1582. -# There is another config script which is compatible with rest of
  1583. -# the kernel. It can be activated by running 'make mkscript' in this
  1584. -# directory. Please note that this is an _experimental_ feature which
  1585. -# doesn't work with all cards (PSS, SM Wave, AudioTriX Pro).
  1586. -#--------
  1587. -#
  1588. -$MAKE -C drivers/sound config || exit 1
  1589. +bool 'ProAudioSpectrum 16 support' CONFIG_PAS
  1590. +bool 'SoundBlaster (SB, SBPro, SB16, clones) support' CONFIG_SB
  1591. +bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB
  1592. +bool 'Gravis Ultrasound support' CONFIG_GUS
  1593. +bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401
  1594. +bool '6850 UART Midi support' CONFIG_UART6850
  1595. +bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS
  1596. +bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16
  1597. +bool 'GUS MAX support' CONFIG_GUSMAX
  1598. +bool 'Microsoft Sound System support' CONFIG_MSS
  1599. +bool 'Ensoniq Soundscape support' CONFIG_SSCAPE
  1600. +bool 'MediaTriX AudioTriX Pro support' CONFIG_TRIX
  1601. +bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16
  1602. +bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232
  1603. +bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI
  1604. +bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO
  1605. +bool 'MIDI interface support' CONFIG_MIDI
  1606. +bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812
  1607. +bool 'Support for SM Wave' CONFIG_SMWAVE
  1608. +
  1609. +if [ "$CONFIG_AEDSP16" = "y" ]; then
  1610. +hex 'I/O base for Audio Excel DSP 16 220 or 240' AEDSP16_BASE 220
  1611. +fi
  1612. +
  1613. +if [ "$CONFIG_SB" = "y" ]; then
  1614. +hex 'I/O base for SB Check from manual of the card' SBC_BASE 220
  1615. +fi
  1616. +
  1617. +if [ "$CONFIG_SB" = "y" ]; then
  1618. +int 'SoundBlaster IRQ Check from manual of the card' SBC_IRQ 7
  1619. +fi
  1620. +
  1621. +if [ "$CONFIG_SB" = "y" ]; then
  1622. +int 'SoundBlaster DMA 0, 1 or 3' SBC_DMA 1
  1623. +fi
  1624. +
  1625. +if [ "$CONFIG_SB" = "y" ]; then
  1626. +int 'SoundBlaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7' SB_DMA2 5
  1627. +fi
  1628. +
  1629. +if [ "$CONFIG_SB" = "y" ]; then
  1630. +hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0
  1631. +fi
  1632. +
  1633. +if [ "$CONFIG_SB" = "y" ]; then
  1634. +int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Check from manual of the card' SB_MPU_IRQ -1
  1635. +fi
  1636. +
  1637. +if [ "$CONFIG_PAS" = "y" ]; then
  1638. +int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10
  1639. +fi
  1640. +
  1641. +if [ "$CONFIG_PAS" = "y" ]; then
  1642. +int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3
  1643. +fi
  1644. +
  1645. +if [ "$CONFIG_GUS" = "y" ]; then
  1646. +hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220
  1647. +fi
  1648. +
  1649. +if [ "$CONFIG_GUS" = "y" ]; then
  1650. +int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15
  1651. +fi
  1652. +
  1653. +if [ "$CONFIG_GUS" = "y" ]; then
  1654. +int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6
  1655. +fi
  1656. +
  1657. +if [ "$CONFIG_GUS" = "y" ]; then
  1658. +int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1
  1659. +fi
  1660. +
  1661. +if [ "$CONFIG_GUS16" = "y" ]; then
  1662. +hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530
  1663. +fi
  1664. +
  1665. +if [ "$CONFIG_GUS16" = "y" ]; then
  1666. +int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7
  1667. +fi
  1668. +
  1669. +if [ "$CONFIG_GUS16" = "y" ]; then
  1670. +int 'GUS DMA 0, 1 or 3' GUS16_DMA 3
  1671. +fi
  1672. +
  1673. +if [ "$CONFIG_MPU401" = "y" ]; then
  1674. +hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330
  1675. +fi
  1676. +
  1677. +if [ "$CONFIG_MPU401" = "y" ]; then
  1678. +int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9
  1679. +fi
  1680. +
  1681. +if [ "$CONFIG_MAUI" = "y" ]; then
  1682. +hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330
  1683. +fi
  1684. +
  1685. +if [ "$CONFIG_MAUI" = "y" ]; then
  1686. +int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9
  1687. +fi
  1688. +
  1689. +if [ "$CONFIG_UART6850" = "y" ]; then
  1690. +hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0
  1691. +fi
  1692. +
  1693. +if [ "$CONFIG_UART6850" = "y" ]; then
  1694. +int 'UART6850 IRQ (Unknown)' U6850_IRQ -1
  1695. +fi
  1696. +
  1697. +if [ "$CONFIG_PSS" = "y" ]; then
  1698. +hex 'PSS I/O base 220 or 240' PSS_BASE 220
  1699. +fi
  1700. +
  1701. +if [ "$CONFIG_PSS" = "y" ]; then
  1702. +hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530
  1703. +fi
  1704. +
  1705. +if [ "$CONFIG_PSS" = "y" ]; then
  1706. +int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11
  1707. +fi
  1708. +
  1709. +if [ "$CONFIG_PSS" = "y" ]; then
  1710. +int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3
  1711. +fi
  1712. +
  1713. +if [ "$CONFIG_PSS" = "y" ]; then
  1714. +hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330
  1715. +fi
  1716. +
  1717. +if [ "$CONFIG_PSS" = "y" ]; then
  1718. +int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9
  1719. +fi
  1720.  
  1721. +if [ "$CONFIG_MSS" = "y" ]; then
  1722. +hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530
  1723. +fi
  1724. +
  1725. +if [ "$CONFIG_MSS" = "y" ]; then
  1726. +int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11
  1727. +fi
  1728. +
  1729. +if [ "$CONFIG_MSS" = "y" ]; then
  1730. +int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3
  1731. +fi
  1732. +
  1733. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1734. +hex 'Soundscape MIDI I/O base ' SSCAPE_BASE 330
  1735. +fi
  1736. +
  1737. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1738. +int 'Soundscape MIDI IRQ ' SSCAPE_IRQ 9
  1739. +fi
  1740. +
  1741. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1742. +int 'Soundscape initialization DMA 0, 1 or 3' SSCAPE_DMA 3
  1743. +fi
  1744. +
  1745. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1746. +hex 'Soundscape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534
  1747. +fi
  1748. +
  1749. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1750. +int 'Soundscape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11
  1751. +fi
  1752. +
  1753. +if [ "$CONFIG_SSCAPE" = "y" ]; then
  1754. +int 'Soundscape audio DMA 0, 1 or 3' SSCAPE_MSS_DMA 0
  1755. +fi
  1756. +
  1757. +if [ "$CONFIG_TRIX" = "y" ]; then
  1758. +hex 'AudioTriX audio I/O base 530, 604, E80 or F40' TRIX_BASE 530
  1759. +fi
  1760. +
  1761. +if [ "$CONFIG_TRIX" = "y" ]; then
  1762. +int 'AudioTriX audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11
  1763. +fi
  1764. +
  1765. +if [ "$CONFIG_TRIX" = "y" ]; then
  1766. +int 'AudioTriX audio DMA 0, 1 or 3' TRIX_DMA 0
  1767. +fi
  1768. +
  1769. +if [ "$CONFIG_TRIX" = "y" ]; then
  1770. +int 'AudioTriX second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3
  1771. +fi
  1772. +
  1773. +if [ "$CONFIG_TRIX" = "y" ]; then
  1774. +hex 'AudioTriX MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330
  1775. +fi
  1776. +
  1777. +if [ "$CONFIG_TRIX" = "y" ]; then
  1778. +int 'AudioTriX MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9
  1779. +fi
  1780. +
  1781. +if [ "$CONFIG_TRIX" = "y" ]; then
  1782. +hex 'AudioTriX SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220
  1783. +fi
  1784. +
  1785. +if [ "$CONFIG_TRIX" = "y" ]; then
  1786. +int 'AudioTriX SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7
  1787. +fi
  1788. +
  1789. +if [ "$CONFIG_TRIX" = "y" ]; then
  1790. +int 'AudioTriX SB DMA 1 or 3' TRIX_SB_DMA 1
  1791. +fi
  1792. +
  1793. +if [ "$CONFIG_CS4232" = "y" ]; then
  1794. +hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530
  1795. +fi
  1796. +
  1797. +if [ "$CONFIG_CS4232" = "y" ]; then
  1798. +int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11
  1799. +fi
  1800. +
  1801. +if [ "$CONFIG_CS4232" = "y" ]; then
  1802. +int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0
  1803. +fi
  1804. +
  1805. +if [ "$CONFIG_CS4232" = "y" ]; then
  1806. +int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3
  1807. +fi
  1808. +
  1809. +if [ "$CONFIG_CS4232" = "y" ]; then
  1810. +hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330
  1811. +fi
  1812. +
  1813. +if [ "$CONFIG_CS4232" = "y" ]; then
  1814. +int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9
  1815. +fi
  1816. +
  1817. +if [ "$CONFIG_MAD16" = "y" ]; then
  1818. +hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530
  1819. +fi
  1820. +
  1821. +if [ "$CONFIG_MAD16" = "y" ]; then
  1822. +int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11
  1823. +fi
  1824. +
  1825. +if [ "$CONFIG_MAD16" = "y" ]; then
  1826. +int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3
  1827. +fi
  1828. +
  1829. +if [ "$CONFIG_MAD16" = "y" ]; then
  1830. +int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0
  1831. +fi
  1832. +
  1833. +if [ "$CONFIG_MAD16" = "y" ]; then
  1834. +hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330
  1835. +fi
  1836. +
  1837. +if [ "$CONFIG_MAD16" = "y" ]; then
  1838. +int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9
  1839. +fi
  1840. +
  1841. +if [ "$CONFIG_AUDIO" = "y" ]; then
  1842. +int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536
  1843. +fi
  1844. +#
  1845. +$MAKE -C drivers/sound kernelconfig || exit 1
  1846. diff -u --recursive --new-file pre2.0.10/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
  1847. --- pre2.0.10/linux/drivers/sound/sequencer.c    Fri Apr 12 15:52:03 1996
  1848. +++ linux/drivers/sound/sequencer.c    Mon Jun  3 12:33:14 1996
  1849. @@ -926,6 +926,9 @@
  1850.  
  1851.        dev = q[2];
  1852.  
  1853. +      if (dev < 0 || dev >= num_midis)
  1854. +         break;
  1855. +
  1856.        if (!midi_devs[dev]->putc (dev, q[1]))
  1857.          {
  1858.            /*
  1859. diff -u --recursive --new-file pre2.0.10/linux/fs/Config.in linux/fs/Config.in
  1860. --- pre2.0.10/linux/fs/Config.in    Sat Jun  1 20:11:33 1996
  1861. +++ linux/fs/Config.in    Sun Jun  2 13:19:46 1996
  1862. @@ -35,7 +35,7 @@
  1863.  tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
  1864.  tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
  1865.  tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
  1866. -if [ "$CONFIG_EXPERIMENTAL = "y" ]; then
  1867. +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  1868.    tristate 'Amiga FFS filesystem support (EXPERIMENTAL)' CONFIG_AFFS_FS
  1869.    if [ "$CONFIG_AFFS_FS" != "n" ]; then
  1870.      define_bool CONFIG_AMIGA_PARTITION y
  1871. @@ -43,7 +43,7 @@
  1872.  fi
  1873.  tristate 'UFS filesystem support (read only)' CONFIG_UFS_FS
  1874.  if [ "$CONFIG_UFS_FS" != "n" ]; then
  1875. -  bool "BSD disklabel (FreeBSD partition tables) support" CONFIG_BSD_DISKLABEL
  1876. -  bool "SMD disklabel (Sun partition tables) support" CONFIG_SMD_DISKLABEL
  1877. +  bool 'BSD disklabel (FreeBSD partition tables) support' CONFIG_BSD_DISKLABEL
  1878. +  bool 'SMD disklabel (Sun partition tables) support' CONFIG_SMD_DISKLABEL
  1879.  fi
  1880.  endmenu
  1881. diff -u --recursive --new-file pre2.0.10/linux/fs/buffer.c linux/fs/buffer.c
  1882. --- pre2.0.10/linux/fs/buffer.c    Sat Jun  1 20:11:33 1996
  1883. +++ linux/fs/buffer.c    Mon Jun  3 15:38:37 1996
  1884. @@ -1099,7 +1099,7 @@
  1885.  static inline void after_unlock_page (struct page * page)
  1886.  {
  1887.      if (clear_bit(PG_decr_after, &page->flags))
  1888. -        nr_async_pages--;
  1889. +        atomic_dec(&nr_async_pages);
  1890.      if (clear_bit(PG_free_after, &page->flags))
  1891.          free_page(page_address(page));
  1892.      if (clear_bit(PG_swap_unlock_after, &page->flags))
  1893. @@ -1250,11 +1250,12 @@
  1894.      struct buffer_head *tmp;
  1895.      struct page *page;
  1896.  
  1897. -    clear_bit(BH_Lock, &bh->b_state);
  1898. -    wake_up(&bh->b_wait);
  1899. -
  1900. -    if (!test_bit(BH_FreeOnIO, &bh->b_state))
  1901. +    if (!test_bit(BH_FreeOnIO, &bh->b_state)) {
  1902. +        /* This is a normal buffer. */
  1903. +        clear_bit(BH_Lock, &bh->b_state);
  1904. +        wake_up(&bh->b_wait);
  1905.          return;
  1906. +    }
  1907.      /* This is a temporary buffer used for page I/O. */
  1908.      page = mem_map + MAP_NR(bh->b_data);
  1909.      if (!PageLocked(page)) {
  1910. @@ -1268,17 +1269,18 @@
  1911.      }
  1912.      /* Async buffer_heads are here only as labels for IO, and get
  1913.             thrown away once the IO for this page is complete.  IO is
  1914. -           deemed complete once all buffers have been visited
  1915. -           (b_count==0) and are now unlocked. */
  1916. -    bh->b_count--;
  1917. +           deemed complete once all buffers have been unlocked. */
  1918.      if (!test_bit(BH_Uptodate, &bh->b_state))
  1919.          set_bit(PG_error, &page->flags);
  1920. +    clear_bit(BH_Lock, &bh->b_state);
  1921. +    wake_up(&bh->b_wait);
  1922.      for (tmp = bh; tmp=tmp->b_this_page, tmp!=bh; ) {
  1923. -        if (test_bit(BH_Lock, &tmp->b_state) || tmp->b_count)
  1924. +        if (test_bit(BH_Lock, &tmp->b_state))
  1925.              return;
  1926.      }
  1927.      /* OK, the async IO on this page is complete. */
  1928. -    clear_bit(PG_locked, &page->flags);
  1929. +    if (!clear_bit(PG_locked, &page->flags))
  1930. +        return;
  1931.      wake_up(&page->wait);
  1932.      free_async_buffers(bh);
  1933.      after_unlock_page(page);
  1934. diff -u --recursive --new-file pre2.0.10/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c
  1935. --- pre2.0.10/linux/fs/ext2/ioctl.c    Mon Apr 29 18:05:19 1996
  1936. +++ linux/fs/ext2/ioctl.c    Sun Jun  2 16:02:50 1996
  1937. @@ -37,11 +37,12 @@
  1938.              return err;
  1939.          flags = get_user((int *) arg);
  1940.          /*
  1941. -         * The IMMUTABLE flag can only be changed by the super user
  1942. -         * when the security level is zero.
  1943. +         * The IMMUTABLE and APPEND_ONLY flags can only be changed by
  1944. +         * the super user when the security level is zero.
  1945.           */
  1946. -        if ((flags & EXT2_IMMUTABLE_FL) ^
  1947. -            (inode->u.ext2_i.i_flags & EXT2_IMMUTABLE_FL)) {
  1948. +        if ((flags & (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL)) ^
  1949. +            (inode->u.ext2_i.i_flags &
  1950. +             (EXT2_APPEND_FL | EXT2_IMMUTABLE_FL))) {
  1951.              /* This test looks nicer. Thanks to Pauline Middelink */
  1952.              if (!fsuser() || securelevel > 0)
  1953.                  return -EPERM;
  1954. diff -u --recursive --new-file pre2.0.10/linux/fs/locks.c linux/fs/locks.c
  1955. --- pre2.0.10/linux/fs/locks.c    Fri May 17 15:32:18 1996
  1956. +++ linux/fs/locks.c    Sat Jun  1 20:11:02 1996
  1957. @@ -82,6 +82,9 @@
  1958.   *  be compiled with different options than the kernel itself.
  1959.   *  Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996.
  1960.   *
  1961. + *  Added a couple of missing wake_up() calls.
  1962. + *  Andy Walker (andy@lysaker.kvaerner.no), May 15, 1996.
  1963. + *
  1964.   *  TODO: Do not honour mandatory locks on remote file systems. This matches
  1965.   *        the SVR4 semantics and neatly sidesteps a pile of awkward issues that
  1966.   *        would otherwise have to be addressed.
  1967. @@ -882,9 +885,12 @@
  1968.              locks_insert_lock(before, left);
  1969.          }
  1970.          right->fl_start = caller->fl_end + 1;
  1971. +        wake_up(&right->fl_wait);
  1972.      }
  1973. -    if (left)
  1974. +    if (left) {
  1975.          left->fl_end = caller->fl_start - 1;
  1976. +        wake_up(&left->fl_wait);
  1977. +    }
  1978.      return (0);
  1979.  }
  1980.  
  1981. diff -u --recursive --new-file pre2.0.10/linux/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c
  1982. --- pre2.0.10/linux/fs/ncpfs/dir.c    Sat Jun  1 20:11:34 1996
  1983. +++ linux/fs/ncpfs/dir.c    Sun Jun  2 11:21:10 1996
  1984. @@ -14,6 +14,7 @@
  1985.  #include <linux/ncp_fs.h>
  1986.  #include <asm/segment.h>
  1987.  #include <linux/errno.h>
  1988. +#include <linux/locks.h>
  1989.  #include "ncplib_kernel.h"
  1990.  
  1991.  struct ncp_dirent {
  1992. @@ -807,6 +808,7 @@
  1993.  
  1994.      memcpy(name, __name, len);
  1995.      name[len] = 0;
  1996. +    lock_super(dir->i_sb);
  1997.      result_info = ncp_find_dir_inode(dir, name);
  1998.  
  1999.          if (result_info != 0)
  2000. @@ -820,6 +822,7 @@
  2001.                     inode number */
  2002.  
  2003.                  *result = iget(dir->i_sb, ncp_info_ino(server, result_info));
  2004. +        unlock_super(dir->i_sb);
  2005.                  iput(dir);
  2006.  
  2007.                  if (*result == NULL)
  2008. @@ -881,6 +884,7 @@
  2009.          }
  2010.          if (res != 0)
  2011.          {
  2012. +            unlock_super(dir->i_sb);
  2013.                          iput(dir);
  2014.                          return -ENOENT;
  2015.                  }
  2016. @@ -891,10 +895,12 @@
  2017.  
  2018.      if (!(*result = ncp_iget(dir, &finfo)))
  2019.      {
  2020. +        unlock_super(dir->i_sb);
  2021.          iput(dir);
  2022.          return -EACCES;
  2023.      }
  2024.  
  2025. +    unlock_super(dir->i_sb);
  2026.      iput(dir);
  2027.      return 0;
  2028.  }
  2029. @@ -924,6 +930,7 @@
  2030.      _name[len] = '\0';
  2031.      str_upper(_name);
  2032.  
  2033. +    lock_super(dir->i_sb);
  2034.      if (ncp_open_create_file_or_subdir(NCP_SERVER(dir),
  2035.                         NCP_ISTRUCT(dir), _name,
  2036.                         OC_MODE_CREATE|OC_MODE_OPEN|
  2037. @@ -931,6 +938,7 @@
  2038.                         0, AR_READ|AR_WRITE,
  2039.                         &finfo) != 0)
  2040.      {
  2041. +        unlock_super(dir->i_sb);
  2042.          iput(dir);
  2043.          return -EACCES;
  2044.      }
  2045. @@ -943,10 +951,12 @@
  2046.      if (!(*result = ncp_iget(dir, &finfo)) < 0)
  2047.      {
  2048.          ncp_close_file(NCP_SERVER(dir), finfo.file_handle);
  2049. +        unlock_super(dir->i_sb);
  2050.          iput(dir);
  2051.          return -EINVAL;
  2052.      }
  2053.  
  2054. +    unlock_super(dir->i_sb);
  2055.      iput(dir);
  2056.      return 0;    
  2057.  }
  2058. diff -u --recursive --new-file pre2.0.10/linux/fs/ncpfs/file.c linux/fs/ncpfs/file.c
  2059. --- pre2.0.10/linux/fs/ncpfs/file.c    Sat Mar  2 13:15:35 1996
  2060. +++ linux/fs/ncpfs/file.c    Sun Jun  2 11:21:10 1996
  2061. @@ -15,6 +15,7 @@
  2062.  #include <linux/stat.h>
  2063.  #include <linux/mm.h>
  2064.  #include <linux/ncp_fs.h>
  2065. +#include <linux/locks.h>
  2066.  #include "ncplib_kernel.h"
  2067.  #include <linux/malloc.h>
  2068.  
  2069. @@ -44,8 +45,10 @@
  2070.  
  2071.          DPRINTK("ncp_make_open: dirent->opened = %d\n", finfo->opened);
  2072.  
  2073. +    lock_super(i->i_sb);
  2074.          if (finfo->opened == 0)
  2075.      {
  2076. +        finfo->access = -1;
  2077.                  /* tries max. rights */
  2078.          if (ncp_open_create_file_or_subdir(NCP_SERVER(i),
  2079.                             NULL, NULL,
  2080. @@ -63,11 +66,9 @@
  2081.          {
  2082.              finfo->access = O_RDONLY;
  2083.          }
  2084. -        else
  2085. -        {
  2086. -            return -EACCES;
  2087. -        }
  2088.          }
  2089. +
  2090. +    unlock_super(i->i_sb);
  2091.  
  2092.          if (   ((right == O_RDONLY) && (   (finfo->access == O_RDONLY)
  2093.                                          || (finfo->access == O_RDWR)))
  2094. diff -u --recursive --new-file pre2.0.10/linux/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c
  2095. --- pre2.0.10/linux/fs/ncpfs/inode.c    Fri Apr 19 10:08:01 1996
  2096. +++ linux/fs/ncpfs/inode.c    Sun Jun  2 11:21:10 1996
  2097. @@ -129,7 +129,9 @@
  2098.  ncp_put_inode(struct inode *inode)
  2099.  {
  2100.          struct nw_file_info *finfo = NCP_FINFO(inode);
  2101. +    struct super_block *sb = inode->i_sb;
  2102.  
  2103. +    lock_super(sb);
  2104.          if (finfo->opened != 0)
  2105.      {
  2106.                  if (ncp_close_file(NCP_SERVER(inode), finfo->file_handle)!=0)
  2107. @@ -152,6 +154,7 @@
  2108.          }                
  2109.  
  2110.      clear_inode(inode);
  2111. +    unlock_super(sb);
  2112.  }
  2113.  
  2114.  struct super_block *
  2115. diff -u --recursive --new-file pre2.0.10/linux/include/asm-i386/posix_types.h linux/include/asm-i386/posix_types.h
  2116. --- pre2.0.10/linux/include/asm-i386/posix_types.h    Wed Mar 27 08:19:29 1996
  2117. +++ linux/include/asm-i386/posix_types.h    Mon Jun  3 10:09:13 1996
  2118. @@ -27,6 +27,10 @@
  2119.  typedef long long    __kernel_loff_t;
  2120.  #endif
  2121.  
  2122. +typedef struct {
  2123. +    int    val[2];
  2124. +} __kernel_fsid_t;
  2125. +
  2126.  #undef    __FD_SET
  2127.  #define __FD_SET(fd,fdsetp) \
  2128.          __asm__ __volatile__("btsl %1,%0": \
  2129. diff -u --recursive --new-file pre2.0.10/linux/include/asm-i386/statfs.h linux/include/asm-i386/statfs.h
  2130. --- pre2.0.10/linux/include/asm-i386/statfs.h    Sat Jun 10 18:35:54 1995
  2131. +++ linux/include/asm-i386/statfs.h    Mon Jun  3 10:09:13 1996
  2132. @@ -1,9 +1,13 @@
  2133.  #ifndef _I386_STATFS_H
  2134.  #define _I386_STATFS_H
  2135.  
  2136. -typedef struct {
  2137. -    long    val[2];
  2138. -} fsid_t;
  2139. +#ifndef __KERNEL_STRICT_NAMES
  2140. +
  2141. +#include <linux/types.h>
  2142. +
  2143. +typedef __kernel_fsid_t    fsid_t;
  2144. +
  2145. +#endif
  2146.  
  2147.  struct statfs {
  2148.      long f_type;
  2149. @@ -13,7 +17,7 @@
  2150.      long f_bavail;
  2151.      long f_files;
  2152.      long f_ffree;
  2153. -    fsid_t f_fsid;
  2154. +    __kernel_fsid_t f_fsid;
  2155.      long f_namelen;
  2156.      long f_spare[6];
  2157.  };
  2158. diff -u --recursive --new-file pre2.0.10/linux/include/asm-m68k/posix_types.h linux/include/asm-m68k/posix_types.h
  2159. --- pre2.0.10/linux/include/asm-m68k/posix_types.h    Tue Apr 23 13:57:12 1996
  2160. +++ linux/include/asm-m68k/posix_types.h    Mon Jun  3 10:09:13 1996
  2161. @@ -27,6 +27,10 @@
  2162.  typedef long long    __kernel_loff_t;
  2163.  #endif
  2164.  
  2165. +typedef struct {
  2166. +    int    val[2];
  2167. +} __kernel_fsid_t;
  2168. +
  2169.  #undef    __FD_SET
  2170.  #define    __FD_SET(d, set)    ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
  2171.  
  2172. diff -u --recursive --new-file pre2.0.10/linux/include/asm-m68k/statfs.h linux/include/asm-m68k/statfs.h
  2173. --- pre2.0.10/linux/include/asm-m68k/statfs.h    Tue Apr 23 13:57:12 1996
  2174. +++ linux/include/asm-m68k/statfs.h    Mon Jun  3 10:09:13 1996
  2175. @@ -1,9 +1,13 @@
  2176.  #ifndef _M68K_STATFS_H
  2177.  #define _M68K_STATFS_H
  2178.  
  2179. -typedef struct {
  2180. -    long    val[2];
  2181. -} fsid_t;
  2182. +#ifndef __KERNEL_STRICT_NAMES
  2183. +
  2184. +#include <linux/types.h>
  2185. +
  2186. +typedef __kernel_fsid_t    fsid_t;
  2187. +
  2188. +#endif
  2189.  
  2190.  struct statfs {
  2191.      long f_type;
  2192. @@ -13,7 +17,7 @@
  2193.      long f_bavail;
  2194.      long f_files;
  2195.      long f_ffree;
  2196. -    fsid_t f_fsid;
  2197. +    __kernel_fsid_t f_fsid;
  2198.      long f_namelen;
  2199.      long f_spare[6];
  2200.  };
  2201. diff -u --recursive --new-file pre2.0.10/linux/include/asm-ppc/statfs.h linux/include/asm-ppc/statfs.h
  2202. --- pre2.0.10/linux/include/asm-ppc/statfs.h    Sat Nov 25 19:49:07 1995
  2203. +++ linux/include/asm-ppc/statfs.h    Mon Jun  3 10:09:13 1996
  2204. @@ -1,9 +1,13 @@
  2205.  #ifndef _PPC_STATFS_H
  2206.  #define _PPC_STATFS_H
  2207.  
  2208. -typedef struct {
  2209. -    long    val[2];
  2210. -} fsid_t;
  2211. +#ifndef __KERNEL_STRICT_NAMES
  2212. +
  2213. +#include <linux/types.h>
  2214. +
  2215. +typedef __kernel_fsid_t    fsid_t;
  2216. +
  2217. +#endif
  2218.  
  2219.  struct statfs {
  2220.      long f_type;
  2221. @@ -13,7 +17,7 @@
  2222.      long f_bavail;
  2223.      long f_files;
  2224.      long f_ffree;
  2225. -    fsid_t f_fsid;
  2226. +    __kernel_fsid_t f_fsid;
  2227.      long f_namelen;
  2228.      long f_spare[6];
  2229.  };
  2230. diff -u --recursive --new-file pre2.0.10/linux/include/asm-sparc/posix_types.h linux/include/asm-sparc/posix_types.h
  2231. --- pre2.0.10/linux/include/asm-sparc/posix_types.h    Sun Apr 21 19:22:12 1996
  2232. +++ linux/include/asm-sparc/posix_types.h    Mon Jun  3 10:09:14 1996
  2233. @@ -34,6 +34,10 @@
  2234.  typedef long long    __kernel_loff_t;
  2235.  #endif
  2236.  
  2237. +typedef struct {
  2238. +    int    val[2];
  2239. +} __kernel_fsid_t;
  2240. +
  2241.  #undef __FD_SET
  2242.  static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
  2243.  {
  2244. diff -u --recursive --new-file pre2.0.10/linux/include/asm-sparc/statfs.h linux/include/asm-sparc/statfs.h
  2245. --- pre2.0.10/linux/include/asm-sparc/statfs.h    Sat Nov 25 04:32:55 1995
  2246. +++ linux/include/asm-sparc/statfs.h    Mon Jun  3 10:09:14 1996
  2247. @@ -2,9 +2,13 @@
  2248.  #ifndef _SPARC_STATFS_H
  2249.  #define _SPARC_STATFS_H
  2250.  
  2251. -typedef struct {
  2252. -    long    val[2];
  2253. -} fsid_t;
  2254. +#ifndef __KERNEL_STRICT_NAMES
  2255. +
  2256. +#include <linux/types.h>
  2257. +
  2258. +typedef __kernel_fsid_t    fsid_t;
  2259. +
  2260. +#endif
  2261.  
  2262.  struct statfs {
  2263.      long f_type;
  2264. @@ -14,7 +18,7 @@
  2265.      long f_bavail;
  2266.      long f_files;
  2267.      long f_ffree;
  2268. -    fsid_t f_fsid;
  2269. +    __kernel_fsid_t f_fsid;
  2270.      long f_namelen;  /* SunOS ignores this field. */
  2271.      long f_spare[6];
  2272.  };
  2273. diff -u --recursive --new-file pre2.0.10/linux/include/linux/interrupt.h linux/include/linux/interrupt.h
  2274. --- pre2.0.10/linux/include/linux/interrupt.h    Tue Apr 23 13:57:13 1996
  2275. +++ linux/include/linux/interrupt.h    Mon Jun  3 12:24:54 1996
  2276. @@ -14,6 +14,7 @@
  2277.      struct irqaction *next;
  2278.  };
  2279.  
  2280. +extern unsigned long intr_count;
  2281.  
  2282.  extern int bh_mask_count[32];
  2283.  extern unsigned long bh_active;
  2284. diff -u --recursive --new-file pre2.0.10/linux/include/linux/sched.h linux/include/linux/sched.h
  2285. --- pre2.0.10/linux/include/linux/sched.h    Sat May 11 10:42:07 1996
  2286. +++ linux/include/linux/sched.h    Mon Jun  3 16:03:43 1996
  2287. @@ -11,7 +11,6 @@
  2288.  
  2289.  #include <asm/param.h>    /* for HZ */
  2290.  
  2291. -extern unsigned long intr_count;
  2292.  extern unsigned long event;
  2293.  
  2294.  #include <linux/binfmts.h>
  2295. diff -u --recursive --new-file pre2.0.10/linux/include/linux/swap.h linux/include/linux/swap.h
  2296. --- pre2.0.10/linux/include/linux/swap.h    Wed Apr 17 09:06:32 1996
  2297. +++ linux/include/linux/swap.h    Mon Jun  3 15:38:37 1996
  2298. @@ -9,6 +9,8 @@
  2299.  
  2300.  #ifdef __KERNEL__
  2301.  
  2302. +#include <asm/atomic.h>
  2303. +
  2304.  #define SWP_USED    1
  2305.  #define SWP_WRITEOK    3
  2306.  
  2307. @@ -32,7 +34,7 @@
  2308.  
  2309.  extern int nr_swap_pages;
  2310.  extern int nr_free_pages;
  2311. -extern int nr_async_pages;
  2312. +extern atomic_t nr_async_pages;
  2313.  extern int min_free_pages;
  2314.  extern int free_pages_low;
  2315.  extern int free_pages_high;
  2316. diff -u --recursive --new-file pre2.0.10/linux/include/linux/sysctl.h linux/include/linux/sysctl.h
  2317. --- pre2.0.10/linux/include/linux/sysctl.h    Mon May 13 23:02:50 1996
  2318. +++ linux/include/linux/sysctl.h    Mon Jun  3 14:04:03 1996
  2319. @@ -70,33 +70,41 @@
  2320.  #define VM_MAXID    5
  2321.  
  2322.  /* CTL_NET names: */
  2323. +#define NET_CORE        1
  2324. +#define NET_ETHER       2
  2325. +#define NET_802         3
  2326. +#define NET_UNIX        4
  2327. +#define NET_IPV4        5
  2328. +#define NET_IPX         6
  2329. +#define NET_ATALK       7
  2330. +#define NET_NETROM      8
  2331. +#define NET_AX25        9
  2332. +#define NET_BRIDGE    10
  2333.  
  2334.  /* /proc/sys/net/core */
  2335. -#define NET_CORE        0x01000000
  2336.  
  2337.  /* /proc/sys/net/ethernet */
  2338. -#define NET_ETHER        0x02000000
  2339.  
  2340.  /* /proc/sys/net/802 */
  2341. -#define NET_802             0x03000000
  2342.  
  2343.  /* /proc/sys/net/unix */
  2344. -#define NET_UNIX        0x04000000
  2345.  
  2346.  /* /proc/sys/net/ipv4 */
  2347. -#define NET_IPV4        0x05000000
  2348. +#define NET_IPV4_ARP_RES_TIME           1
  2349. +#define NET_IPV4_ARP_DEAD_RES_TIME      2
  2350. +#define NET_IPV4_ARP_MAX_TRIES          3
  2351. +#define NET_IPV4_ARP_TIMEOUT            4
  2352. +#define NET_IPV4_ARP_CHECK_INTERVAL     5
  2353. +#define NET_IPV4_ARP_CONFIRM_INTERVAL   6
  2354. +#define NET_IPV4_ARP_CONFIRM_TIMEOUT    7
  2355.  
  2356.  /* /proc/sys/net/ipx */
  2357. -#define NET_IPX            0x06000000
  2358.  
  2359.  /* /proc/sys/net/appletalk */
  2360. -#define NET_ATALK        0x07000000
  2361.  
  2362.  /* /proc/sys/net/netrom */
  2363. -#define NET_NETROM        0x08000000
  2364.  
  2365.  /* /proc/sys/net/ax25 */
  2366. -#define NET_AX25        0x09000000
  2367.  
  2368.  /* CTL_PROC names: */
  2369.  
  2370. diff -u --recursive --new-file pre2.0.10/linux/include/net/ip_masq.h linux/include/net/ip_masq.h
  2371. --- pre2.0.10/linux/include/net/ip_masq.h    Fri May 17 15:32:19 1996
  2372. +++ linux/include/net/ip_masq.h    Mon Jun  3 16:09:54 1996
  2373. @@ -85,6 +85,7 @@
  2374.   *    functions called from ip layer
  2375.   */
  2376.  extern int ip_fw_masquerade(struct sk_buff **, struct device *);
  2377. +extern int ip_fw_masq_icmp(struct sk_buff **, struct device *);
  2378.  extern int ip_fw_demasquerade(struct sk_buff **, struct device *);
  2379.  
  2380.  /*
  2381. diff -u --recursive --new-file pre2.0.10/linux/ipc/msg.c linux/ipc/msg.c
  2382. --- pre2.0.10/linux/ipc/msg.c    Sun May 12 10:16:07 1996
  2383. +++ linux/ipc/msg.c    Mon Jun  3 12:25:57 1996
  2384. @@ -14,6 +14,7 @@
  2385.  #include <linux/stat.h>
  2386.  #include <linux/malloc.h>
  2387.  #include <linux/kerneld.h>
  2388. +#include <linux/interrupt.h>
  2389.  
  2390.  #include <asm/segment.h>
  2391.  
  2392. diff -u --recursive --new-file pre2.0.10/linux/kernel/exit.c linux/kernel/exit.c
  2393. --- pre2.0.10/linux/kernel/exit.c    Sat Apr 27 15:20:08 1996
  2394. +++ linux/kernel/exit.c    Mon Jun  3 12:26:38 1996
  2395. @@ -15,6 +15,7 @@
  2396.  #include <linux/mm.h>
  2397.  #include <linux/tty.h>
  2398.  #include <linux/malloc.h>
  2399. +#include <linux/interrupt.h>
  2400.  
  2401.  #include <asm/segment.h>
  2402.  #include <asm/pgtable.h>
  2403. diff -u --recursive --new-file pre2.0.10/linux/mm/kmalloc.c linux/mm/kmalloc.c
  2404. --- pre2.0.10/linux/mm/kmalloc.c    Sat Jun  1 20:11:36 1996
  2405. +++ linux/mm/kmalloc.c    Mon Jun  3 12:25:23 1996
  2406. @@ -16,6 +16,8 @@
  2407.  
  2408.  #include <linux/mm.h>
  2409.  #include <linux/delay.h>
  2410. +#include <linux/interrupt.h>
  2411. +
  2412.  #include <asm/system.h>
  2413.  #include <asm/dma.h>
  2414.  
  2415. diff -u --recursive --new-file pre2.0.10/linux/mm/page_alloc.c linux/mm/page_alloc.c
  2416. --- pre2.0.10/linux/mm/page_alloc.c    Wed Apr 17 09:06:33 1996
  2417. +++ linux/mm/page_alloc.c    Mon Jun  3 12:27:05 1996
  2418. @@ -16,6 +16,7 @@
  2419.  #include <linux/swap.h>
  2420.  #include <linux/fs.h>
  2421.  #include <linux/swapctl.h>
  2422. +#include <linux/interrupt.h>
  2423.  
  2424.  #include <asm/dma.h>
  2425.  #include <asm/system.h> /* for cli()/sti() */
  2426. diff -u --recursive --new-file pre2.0.10/linux/mm/page_io.c linux/mm/page_io.c
  2427. --- pre2.0.10/linux/mm/page_io.c    Fri May 31 08:02:20 1996
  2428. +++ linux/mm/page_io.c    Mon Jun  3 15:38:37 1996
  2429. @@ -84,7 +84,7 @@
  2430.              set_bit(PG_decr_after, &page->flags);
  2431.              set_bit(PG_swap_unlock_after, &page->flags);
  2432.              page->swap_unlock_entry = entry;
  2433. -            nr_async_pages++;
  2434. +            atomic_inc(&nr_async_pages);
  2435.          }
  2436.          ll_rw_page(rw,p->swap_device,offset,buf);
  2437.          /*
  2438. diff -u --recursive --new-file pre2.0.10/linux/mm/swap.c linux/mm/swap.c
  2439. --- pre2.0.10/linux/mm/swap.c    Fri Apr 12 15:52:10 1996
  2440. +++ linux/mm/swap.c    Mon Jun  3 15:38:37 1996
  2441. @@ -44,7 +44,7 @@
  2442.  
  2443.  /* We track the number of pages currently being asynchronously swapped
  2444.     out, so that we don't try to swap TOO many pages out at once */
  2445. -int nr_async_pages = 0;
  2446. +atomic_t nr_async_pages = 0;
  2447.  
  2448.  /*
  2449.   * Constants for the page aging mechanism: the maximum age (actually,
  2450. diff -u --recursive --new-file pre2.0.10/linux/net/bridge/Makefile linux/net/bridge/Makefile
  2451. --- pre2.0.10/linux/net/bridge/Makefile    Wed Apr 10 17:02:27 1996
  2452. +++ linux/net/bridge/Makefile    Mon Jun  3 12:42:41 1996
  2453. @@ -8,7 +8,7 @@
  2454.  # Note 2! The CFLAGS definition is now in the main makefile...
  2455.  
  2456.  O_TARGET := bridge.o
  2457. -O_OBJS     := br.o br_tree.o
  2458. +O_OBJS     := br.o br_tree.o sysctl_net_bridge.o
  2459.  M_OBJS   := $(O_TARGET)
  2460.  
  2461.  include $(TOPDIR)/Rules.make
  2462. diff -u --recursive --new-file pre2.0.10/linux/net/bridge/sysctl_net_bridge.c linux/net/bridge/sysctl_net_bridge.c
  2463. --- pre2.0.10/linux/net/bridge/sysctl_net_bridge.c    Thu Jan  1 02:00:00 1970
  2464. +++ linux/net/bridge/sysctl_net_bridge.c    Mon Jun  3 12:42:41 1996
  2465. @@ -0,0 +1,13 @@
  2466. +/* -*- linux-c -*-
  2467. + * sysctl_net_bridge.c: sysctl interface to net bridge subsystem.
  2468. + *
  2469. + * Begun June 1, 1996, Mike Shaver.
  2470. + * Added /proc/sys/net/bridge directory entry (empty =) ). [MS]
  2471. + */
  2472. +
  2473. +#include <linux/mm.h>
  2474. +#include <linux/sysctl.h>
  2475. +
  2476. +ctl_table bridge_table[] = {
  2477. +    {0}
  2478. +};
  2479. diff -u --recursive --new-file pre2.0.10/linux/net/core/datagram.c linux/net/core/datagram.c
  2480. --- pre2.0.10/linux/net/core/datagram.c    Thu Mar 21 10:46:17 1996
  2481. +++ linux/net/core/datagram.c    Mon Jun  3 12:42:41 1996
  2482. @@ -18,6 +18,7 @@
  2483.   *        Darryl Miles    :    Fixed non-blocking SOCK_SEQPACKET.
  2484.   *        Linus Torvalds    :    BSD semantic fixes.
  2485.   *        Alan Cox    :    Datagram iovec handling
  2486. + *        Darryl Miles    :    Fixed non-blocking SOCK_STREAM.
  2487.   *
  2488.   */
  2489.  
  2490. @@ -47,6 +48,7 @@
  2491.   * Interrupts off so that no packet arrives before we begin sleeping.
  2492.   * Otherwise we might miss our wake up
  2493.   */
  2494. +
  2495.  static inline void wait_for_packet(struct sock * sk)
  2496.  {
  2497.      unsigned long flags;
  2498. @@ -60,6 +62,16 @@
  2499.      lock_sock(sk);
  2500.  }
  2501.  
  2502. +/*
  2503. + *    Is a socket 'connection oriented' ?
  2504. + */
  2505. +static inline int connection_based(struct sock *sk)
  2506. +{
  2507. +    if(sk->type==SOCK_SEQPACKET || sk->type==SOCK_STREAM)
  2508. +        return 1;
  2509. +    return 0;
  2510. +}
  2511.  
  2512.  /*
  2513.   *    Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible
  2514. @@ -92,7 +104,7 @@
  2515.  
  2516.          /* Sequenced packets can come disconnected. If so we report the problem */
  2517.          error = -ENOTCONN;
  2518. -        if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED)
  2519. +        if(connection_based(sk) && sk->state!=TCP_ESTABLISHED)
  2520.              goto no_packet;
  2521.  
  2522.          /* User doesn't want to wait */
  2523. @@ -186,7 +198,7 @@
  2524.                  return 1;
  2525.              if (sk->shutdown & RCV_SHUTDOWN)
  2526.                  return 1;
  2527. -            if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE)
  2528. +            if (connection_based(sk) && sk->state==TCP_CLOSE)
  2529.              {
  2530.                  /* Connection closed: Wake up */
  2531.                  return(1);
  2532. @@ -203,7 +215,7 @@
  2533.                  return 1;
  2534.              if (sk->shutdown & SEND_SHUTDOWN)
  2535.                  return 1;
  2536. -            if (sk->type==SOCK_SEQPACKET && sk->state==TCP_SYN_SENT)
  2537. +            if (connection_based(sk) && sk->state==TCP_SYN_SENT)
  2538.              {
  2539.                  /* Connection still in progress */
  2540.                  break;
  2541. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
  2542. --- pre2.0.10/linux/net/ipv4/arp.c    Tue May 21 19:52:39 1996
  2543. +++ linux/net/ipv4/arp.c    Mon Jun  3 14:06:43 1996
  2544. @@ -4,14 +4,15 @@
  2545.   *
  2546.   * This module implements the Address Resolution Protocol ARP (RFC 826),
  2547.   * which is used to convert IP addresses (or in the future maybe other
  2548. - * high-level addresses into a low-level hardware address (like an Ethernet
  2549. + * high-level addresses) into a low-level hardware address (like an Ethernet
  2550.   * address).
  2551.   *
  2552.   * FIXME:
  2553.   *    Experiment with better retransmit timers
  2554.   *    Clean up the timer deletions
  2555. - *    If you create a proxy entry set your interface address to the address
  2556. - *    and then delete it, proxies may get out of sync with reality - check this
  2557. + *    If you create a proxy entry, set your interface address to the address
  2558. + *    and then delete it, proxies may get out of sync with reality - 
  2559. + *    check this.
  2560.   *
  2561.   * This program is free software; you can redistribute it and/or
  2562.   * modify it under the terms of the GNU General Public License
  2563. @@ -19,11 +20,12 @@
  2564.   * 2 of the License, or (at your option) any later version.
  2565.   *
  2566.   * Fixes:
  2567. - *        Alan Cox    :    Removed the ethernet assumptions in Florian's code
  2568. - *        Alan Cox    :    Fixed some small errors in the ARP logic
  2569. + *        Alan Cox    :    Removed the ethernet assumptions in 
  2570. + *                    Florian's code
  2571. + *        Alan Cox    :    Fixed some small errors in the ARP 
  2572. + *                    logic
  2573.   *        Alan Cox    :    Allow >4K in /proc
  2574.   *        Alan Cox    :    Make ARP add its own protocol entry
  2575. - *
  2576.   *        Ross Martin     :       Rewrote arp_rcv() and arp_get_info()
  2577.   *        Stephen Henson    :    Add AX25 support to arp_get_info()
  2578.   *        Alan Cox    :    Drop data when a device is downed.
  2579. @@ -46,7 +48,8 @@
  2580.   *                    during arp_rcv.
  2581.   *        Russ Nelson    :    Tidied up a few bits.
  2582.   *        Alexey Kuznetsov:    Major changes to caching and behaviour,
  2583. - *                    eg intelligent arp probing and generation
  2584. + *                    eg intelligent arp probing and 
  2585. + *                    generation
  2586.   *                    of host down events.
  2587.   *        Alan Cox    :    Missing unlock in device events.
  2588.   *        Eckes        :    ARP ioctl control errors.
  2589. @@ -54,12 +57,13 @@
  2590.   *        Manuel Rodriguez:    Gratuitous ARP.
  2591.   *              Jonathan Layes  :       Added arpd support through kerneld 
  2592.   *                                      message queue (960314)
  2593. + *        Mike Shaver    :    /proc/sys/net/ipv4/arp_* support
  2594.   */
  2595.  
  2596.  /* RFC1122 Status:
  2597.     2.3.2.1 (ARP Cache Validation):
  2598.       MUST provide mechanism to flush stale cache entries (OK)
  2599. -     SHOULD be able to configure cache timeout (NOT YET)
  2600. +     SHOULD be able to configure cache timeout (OK)
  2601.       MUST throttle ARP retransmits (OK)
  2602.     2.3.2.2 (ARP Packet Queue):
  2603.       SHOULD save at least one packet from each "conversation" with an
  2604. @@ -121,12 +125,9 @@
  2605.   *    and dynamic routing.
  2606.   */
  2607.  
  2608. -#ifndef CONFIG_ARPD
  2609. -#define ARP_TIMEOUT        (600*HZ)
  2610. -#else
  2611.  #define ARP_TIMEOUT        (60*HZ)
  2612. -#define ARPD_TIMEOUT        (600*HZ)
  2613. -#endif
  2614. +
  2615. +int sysctl_arp_timeout = ARP_TIMEOUT;
  2616.  
  2617.  /*
  2618.   *    How often is ARP cache checked for expire.
  2619. @@ -135,11 +136,13 @@
  2620.  
  2621.  #define ARP_CHECK_INTERVAL    (60*HZ)
  2622.  
  2623. +int sysctl_arp_check_interval = ARP_CHECK_INTERVAL;
  2624. +
  2625.  /*
  2626.   *    Soft limit on ARP cache size.
  2627. - *    Note that this number should be greater, than
  2628. - *    number of simultaneously opened sockets, else
  2629. - *    hardware header cache will be not efficient.
  2630. + *    Note that this number should be greater than
  2631. + *    number of simultaneously opened sockets, or else
  2632. + *    hardware header cache will not be efficient.
  2633.   */
  2634.  
  2635.  #if RT_CACHE_DEBUG >= 2
  2636. @@ -162,6 +165,8 @@
  2637.  
  2638.  #define ARP_RES_TIME        (5*HZ)
  2639.  
  2640. +int sysctl_arp_res_time = ARP_RES_TIME;
  2641. +
  2642.  /*
  2643.   *    The number of times an broadcast arp request is send, until
  2644.   *    the host is considered temporarily unreachable.
  2645. @@ -169,6 +174,8 @@
  2646.  
  2647.  #define ARP_MAX_TRIES        3
  2648.  
  2649. +int sysctl_arp_max_tries = ARP_MAX_TRIES;
  2650. +
  2651.  /*
  2652.   *    The entry is reconfirmed by sending point-to-point ARP
  2653.   *    request after ARP_CONFIRM_INTERVAL.
  2654. @@ -183,12 +190,16 @@
  2655.  
  2656.  #define ARP_CONFIRM_INTERVAL    (300*HZ)
  2657.  
  2658. +int sysctl_arp_confirm_interval = ARP_CONFIRM_INTERVAL;
  2659. +
  2660.  /*
  2661.   *    We wait for answer to unicast request for ARP_CONFIRM_TIMEOUT.
  2662.   */
  2663.  
  2664.  #define ARP_CONFIRM_TIMEOUT    ARP_RES_TIME
  2665.  
  2666. +int sysctl_arp_confirm_timeout = ARP_CONFIRM_TIMEOUT;
  2667. +
  2668.  /*
  2669.   *    The number of times an unicast arp request is retried, until
  2670.   *    the cache entry is considered suspicious.
  2671. @@ -198,6 +209,8 @@
  2672.  
  2673.  #define ARP_MAX_PINGS        1
  2674.  
  2675. +int sysctl_arp_max_pings = ARP_MAX_PINGS;
  2676. +
  2677.  /*
  2678.   *    When a host is dead, but someone tries to connect it,
  2679.   *    we do not remove corresponding cache entry (it would
  2680. @@ -211,6 +224,8 @@
  2681.  
  2682.  #define ARP_DEAD_RES_TIME    (60*HZ)
  2683.  
  2684. +int sysctl_arp_dead_res_time = ARP_DEAD_RES_TIME;
  2685. +
  2686.  /*
  2687.   *    This structure defines the ARP mapping cache.
  2688.   */
  2689. @@ -741,7 +756,7 @@
  2690.                  cli();
  2691.                  users = arp_count_hhs(entry);
  2692.  
  2693. -                if (!users && now - entry->last_used > ARP_TIMEOUT)
  2694. +                if (!users && now - entry->last_used > sysctl_arp_timeout)
  2695.                  {
  2696.                      *pentry = entry->next;
  2697.                      restore_flags(flags);
  2698. @@ -820,7 +835,7 @@
  2699.                  }
  2700.  
  2701.                  cli();
  2702. -                if (now - entry->last_used > ARP_TIMEOUT
  2703. +                if (now - entry->last_used > sysctl_arp_timeout
  2704.                      && !arp_count_hhs(entry))
  2705.                  {
  2706.                      *pentry = entry->next;
  2707. @@ -833,11 +848,11 @@
  2708.                  }
  2709.                  sti();
  2710.                  if (entry->last_updated
  2711. -                    && now - entry->last_updated > ARP_CONFIRM_INTERVAL
  2712. +                    && now - entry->last_updated > sysctl_arp_confirm_interval
  2713.                      && !(entry->flags & ATF_PERM))
  2714.                  {
  2715.                      struct device * dev = entry->dev;
  2716. -                    entry->retries = ARP_MAX_TRIES+ARP_MAX_PINGS;
  2717. +                    entry->retries = sysctl_arp_max_tries+sysctl_arp_max_pings;
  2718.                      del_timer(&entry->timer);
  2719.                      entry->timer.expires = jiffies + ARP_CONFIRM_TIMEOUT;
  2720.                      add_timer(&entry->timer);
  2721. @@ -859,7 +874,7 @@
  2722.       *    Set the timer again.
  2723.       */
  2724.  
  2725. -    arp_timer.expires = jiffies + ARP_CHECK_INTERVAL;
  2726. +    arp_timer.expires = jiffies + sysctl_arp_check_interval;
  2727.      add_timer(&arp_timer);
  2728.  }
  2729.  
  2730. @@ -909,7 +924,7 @@
  2731.       */
  2732.      
  2733.      if ((entry->flags & ATF_COM) && entry->last_updated
  2734. -        && jiffies - entry->last_updated <= ARP_CONFIRM_INTERVAL)
  2735. +        && jiffies - entry->last_updated <= sysctl_arp_confirm_interval)
  2736.      {
  2737.          restore_flags(flags);
  2738.          arp_unlock();
  2739. @@ -926,10 +941,10 @@
  2740.          printk("arp_expire_request: %08x timed out\n", entry->ip);
  2741.  #endif
  2742.          /* Set new timer. */
  2743. -        entry->timer.expires = jiffies + ARP_RES_TIME;
  2744. +        entry->timer.expires = jiffies + sysctl_arp_res_time;
  2745.          add_timer(&entry->timer);
  2746.          arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr,
  2747. -             entry->retries > ARP_MAX_TRIES ? entry->ha : NULL,
  2748. +             entry->retries > sysctl_arp_max_tries ? entry->ha : NULL,
  2749.               dev->dev_addr, NULL);
  2750.          arp_unlock();
  2751.          return;
  2752. @@ -956,7 +971,7 @@
  2753.  #if RT_CACHE_DEBUG >= 2
  2754.          printk("arp_expire_request: %08x is dead\n", entry->ip);
  2755.  #endif
  2756. -        entry->retries = ARP_MAX_TRIES;
  2757. +        entry->retries = sysctl_arp_max_tries;
  2758.          entry->flags &= ~ATF_COM;
  2759.          arp_invalidate_hhs(entry);
  2760.          restore_flags(flags);
  2761. @@ -967,7 +982,7 @@
  2762.          entry->last_updated = 0;
  2763.          arpd_update(entry);
  2764.  
  2765. -        entry->timer.expires = jiffies + ARP_DEAD_RES_TIME;
  2766. +        entry->timer.expires = jiffies + sysctl_arp_dead_res_time;
  2767.          add_timer(&entry->timer);
  2768.          arp_send(ARPOP_REQUEST, ETH_P_ARP, entry->ip, dev, dev->pa_addr, 
  2769.               NULL, dev->dev_addr, NULL);
  2770. @@ -1317,7 +1332,7 @@
  2771.              atomic_inc(&hh->hh_refcnt);
  2772.              hh->hh_arp = (void*)entry;
  2773.          }
  2774. -        entry->timer.expires = jiffies + ARP_RES_TIME;
  2775. +        entry->timer.expires = jiffies + sysctl_arp_res_time;
  2776.  
  2777.          if (skb != NULL)
  2778.          {
  2779. @@ -1331,7 +1346,7 @@
  2780.              entry->next = arp_tables[hash];
  2781.              arp_tables[hash] = entry;
  2782.              add_timer(&entry->timer);
  2783. -            entry->retries = ARP_MAX_TRIES;
  2784. +            entry->retries = sysctl_arp_max_tries;
  2785.  #ifdef CONFIG_ARPD
  2786.              if (!arpd_not_running)
  2787.                  arpd_lookup(paddr, dev);
  2788. @@ -1573,8 +1588,8 @@
  2789.                  entry->next = arp_tables[hash];
  2790.                  arp_tables[hash] = entry;
  2791.                  restore_flags(flags);
  2792. -                entry->timer.expires = jiffies + ARP_RES_TIME;
  2793. -                entry->retries = ARP_MAX_TRIES;
  2794. +                entry->timer.expires = jiffies + sysctl_arp_res_time;
  2795. +                entry->retries = sysctl_arp_max_tries;
  2796.                  entry->last_used = jiffies;
  2797.                  if (!(entry->flags & ATF_COM))
  2798.                  {
  2799. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/icmp.c linux/net/ipv4/icmp.c
  2800. --- pre2.0.10/linux/net/ipv4/icmp.c    Tue May 21 19:52:39 1996
  2801. +++ linux/net/ipv4/icmp.c    Mon Jun  3 13:23:34 1996
  2802. @@ -16,18 +16,26 @@
  2803.   *    Fixes:
  2804.   *        Mike Shaver    :    RFC1122 checks.
  2805.   *        Alan Cox    :    Multicast ping reply as self.
  2806. - *        Alan Cox    :    Fix atomicity lockup in ip_build_xmit call
  2807. - *        Alan Cox    :    Added 216,128 byte paths to the MTU code.
  2808. + *        Alan Cox    :    Fix atomicity lockup in ip_build_xmit 
  2809. + *                    call.
  2810. + *        Alan Cox    :    Added 216,128 byte paths to the MTU 
  2811. + *                    code.
  2812.   *        Martin Mares    :    RFC1812 checks.
  2813. - *        Martin Mares    :    Can be configured to follow redirects if acting
  2814. - *                    as a router _without_ a routing protocol (RFC 1812).
  2815. - *        Martin Mares    :    Echo requests may be configured to be ignored (RFC 1812).
  2816. - *        Martin Mares    :    Limitation of ICMP error message transmit rate (RFC 1812).
  2817. - *        Martin Mares    :    TOS and Precedence set correctly (RFC 1812).
  2818. - *        Martin Mares    :    Now copying as much data from the original packet
  2819. - *                    as we can without exceeding 576 bytes (RFC 1812).
  2820. + *        Martin Mares    :    Can be configured to follow redirects 
  2821. + *                    if acting as a router _without_ a
  2822. + *                    routing protocol (RFC 1812).
  2823. + *        Martin Mares    :    Echo requests may be configured to 
  2824. + *                    be ignored (RFC 1812).
  2825. + *        Martin Mares    :    Limitation of ICMP error message 
  2826. + *                    transmit rate (RFC 1812).
  2827. + *        Martin Mares    :    TOS and Precedence set correctly 
  2828. + *                    (RFC 1812).
  2829. + *        Martin Mares    :    Now copying as much data from the 
  2830. + *                    original packet as we can without
  2831. + *                    exceeding 576 bytes (RFC 1812).
  2832.   *    Willy Konynenberg    :    Transparent proxying support.
  2833. - *
  2834. + *        Keith Owens    :    RFC1191 correction for 4.2BSD based 
  2835. + *                    path MTU bug.
  2836.   *
  2837.   *
  2838.   * RFC1122 (Host Requirements -- Comm. Layer) Status:
  2839. @@ -81,7 +89,8 @@
  2840.   *   MAY discard broadcast REQUESTs.  (OK, but see source for inconsistency)
  2841.   *   MUST reply using same source address as the request was sent to. (OK)
  2842.   *   MUST reverse source route, as per ECHO (NOT YET)
  2843. - *   MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK)
  2844. + *   MUST pass REPLYs to transport/user layer (requires RAW, just like 
  2845. + *    ECHO) (OK)
  2846.   *   MUST update clock for timestamp at least 15 times/sec (OK)
  2847.   *   MUST be "correct within a few minutes" (OK)
  2848.   * 3.2.2.9 (Address Mask Request/Reply)
  2849. @@ -108,10 +117,11 @@
  2850.   *   MUST use one of addresses for the interface the orig. packet arrived as
  2851.   *     source address (OK)
  2852.   *  4.3.2.5 (TOS and Precedence)
  2853. - *   SHOULD leave TOS set to the same value unless the packet would be discarded
  2854. - *     for that reason (OK)
  2855. + *   SHOULD leave TOS set to the same value unless the packet would be 
  2856. + *     discarded for that reason (OK)
  2857.   *   MUST use TOS=0 if not possible to leave original value (OK)
  2858. - *   MUST leave IP Precedence for Source Quench messages (OK -- not sent at all)
  2859. + *   MUST leave IP Precedence for Source Quench messages (OK -- not sent 
  2860. + *    at all)
  2861.   *   SHOULD use IP Precedence = 6 (Internetwork Control) or 7 (Network Control)
  2862.   *     for all other error messages (OK, we use 6)
  2863.   *   MAY allow configuration of IP Precedence (OK -- not done)
  2864. @@ -137,7 +147,8 @@
  2865.   *     is enabled on the interface (OK -- ignores)
  2866.   *  4.3.3.3 (Source Quench)
  2867.   *   SHOULD NOT originate SQ messages (OK)
  2868. - *   MUST be able to limit SQ rate if originates them (OK as we don't send them)
  2869. + *   MUST be able to limit SQ rate if originates them (OK as we don't 
  2870. + *    send them)
  2871.   *   MAY ignore SQ messages it receives (OK -- we don't)
  2872.   *  4.3.3.4 (Time Exceeded)
  2873.   *   Requirements dealt with at IP (generating TIME_EXCEEDED).
  2874. @@ -166,16 +177,19 @@
  2875.   *   MUST reply using same source address as the request was sent to. (OK)
  2876.   *   MUST use reversed Source Route if possible (NOT YET)
  2877.   *   SHOULD update Record Route / Timestamp options (??)
  2878. - *   MUST pass REPLYs to transport/user layer (requires RAW, just like ECHO) (OK)
  2879. + *   MUST pass REPLYs to transport/user layer (requires RAW, just like 
  2880. + *    ECHO) (OK)
  2881.   *   MUST update clock for timestamp at least 16 times/sec (OK)
  2882.   *   MUST be "correct within a few minutes" (OK)
  2883.   * 4.3.3.9 (Address Mask Request/Reply)
  2884. - *   MUST have support for receiving AMRq and responding with AMRe (OK, but only as a
  2885. - *     compile-time option)
  2886. - *   SHOULD have option for each interface for AMRe's, MUST default to NO (NOT YET)
  2887. + *   MUST have support for receiving AMRq and responding with AMRe (OK, 
  2888. + *    but only as a compile-time option)
  2889. + *   SHOULD have option for each interface for AMRe's, MUST default to 
  2890. + *    NO (NOT YET)
  2891.   *   MUST NOT reply to AMRq before knows the correct AM (OK)
  2892. - *   MUST NOT respond to AMRq with source address 0.0.0.0 on physical interfaces
  2893. - *     having multiple logical i-faces with different masks (NOT YET)
  2894. + *   MUST NOT respond to AMRq with source address 0.0.0.0 on physical
  2895. + *        interfaces having multiple logical i-faces with different masks
  2896. + *    (NOT YET)
  2897.   *   SHOULD examine all AMRe's it receives and check them (NOT YET)
  2898.   *   SHOULD log invalid AMRe's (AM+sender) (NOT YET)
  2899.   *   MUST NOT use contents of AMRe to determine correct AM (OK)
  2900. @@ -192,8 +206,8 @@
  2901.   *   SHOULD NOT generate Host Isolated codes (OK)
  2902.   *   SHOULD use Communication Administratively Prohibited when administratively
  2903.   *     filtering packets (NOT YET -- bug-to-bug compatibility)
  2904. - *   MAY include config option for not generating the above and silently discard
  2905. - *     the packets instead (OK)
  2906. + *   MAY include config option for not generating the above and silently
  2907. + *    discard the packets instead (OK)
  2908.   *   MAY include config option for not generating Precedence Violation and
  2909.   *     Precedence Cutoff messages (OK as we don't generate them at all)
  2910.   *   MUST use Host Unreachable or Dest. Host Unknown codes whenever other hosts
  2911. @@ -344,7 +358,7 @@
  2912.  /*
  2913.   *    Send an ICMP frame.
  2914.   */
  2915. +
  2916.  
  2917.  /*
  2918.   *    Initialize the transmit rate limitation mechanism.
  2919. @@ -370,7 +384,8 @@
  2920.   *    Check transmit rate limitation for given message.
  2921.   *
  2922.   *    RFC 1812: 4.3.2.8 SHOULD be able to limit error message rate
  2923. - *              SHOULD allow setting of rate limits (we allow in the source)
  2924. + *              SHOULD allow setting of rate limits (we allow 
  2925. + *              in the source)
  2926.   */
  2927.  
  2928.  static int xrlim_allow(int type, __u32 addr)
  2929. @@ -385,7 +400,8 @@
  2930.      if (!r)
  2931.          return 1;
  2932.  
  2933. -    for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++)    /* Cache lookup */
  2934. +    for (c = r->cache; c < &r->cache[XRLIM_CACHE_SIZE]; c++)    
  2935. +      /* Cache lookup */
  2936.          if (c->daddr == addr)
  2937.              break;
  2938.  
  2939. @@ -644,6 +660,22 @@
  2940.              {
  2941.                  unsigned short old_mtu = ntohs(iph->tot_len);
  2942.                  unsigned short new_mtu = ntohs(icmph->un.echo.sequence);
  2943. +
  2944. +                /*
  2945. +                 * RFC1191 5.  4.2BSD based router can return incorrect
  2946. +                 * Total Length.  If current mtu is unknown or old_mtu
  2947. +                 * is not less than current mtu, reduce old_mtu by 4 times
  2948. +                 * the header length.
  2949. +                 */
  2950. +
  2951. +                if (skb->sk == NULL /* can this happen? */
  2952. +                    || skb->sk->ip_route_cache == NULL
  2953. +                    || skb->sk->ip_route_cache->rt_mtu <= old_mtu)
  2954. +                {
  2955. +                    NETDEBUG(printk(KERN_INFO "4.2BSD based fragmenting router between here and %s, mtu corrected from %d", in_ntoa(iph->daddr), old_mtu));
  2956. +                    old_mtu -= 4 * iph->ihl;
  2957. +                    NETDEBUG(printk(" to %d\n", old_mtu));
  2958. +                }
  2959.  
  2960.                  if (new_mtu < 68 || new_mtu >= old_mtu)
  2961.                  {
  2962. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/ip_forward.c linux/net/ipv4/ip_forward.c
  2963. --- pre2.0.10/linux/net/ipv4/ip_forward.c    Tue May 21 19:52:39 1996
  2964. +++ linux/net/ipv4/ip_forward.c    Mon Jun  3 13:30:42 1996
  2965. @@ -8,8 +8,10 @@
  2966.   * Authors:    see ip.c
  2967.   *
  2968.   * Fixes:
  2969. - *        Many        :    Split from ip.c , see ip_input.c for history.
  2970. - *        Dave Gregorich    :    NULL ip_rt_put fix for multicast routing.
  2971. + *        Many        :    Split from ip.c , see ip_input.c for 
  2972. + *                    history.
  2973. + *        Dave Gregorich    :    NULL ip_rt_put fix for multicast 
  2974. + *                    routing.
  2975.   *        Jos Vos        :    Add call_out_firewall before sending,
  2976.   *                    use output device for accounting.
  2977.   *        Jos Vos        :    Call forward firewall after routing
  2978. @@ -225,6 +227,23 @@
  2979.  #ifdef CONFIG_FIREWALL
  2980.      if(!(is_frag&IPFWD_MASQUERADED))
  2981.      {
  2982. +#ifdef CONFIG_IP_MASQUERADE
  2983. +        /* 
  2984. +         *    Check that any ICMP packets are not for a 
  2985. +         *    masqueraded connection.  If so rewrite them
  2986. +         *    and skip the firewall checks
  2987. +         */
  2988. +        if (iph->protocol == IPPROTO_ICMP)
  2989. +        {
  2990. +            if ((fw_res = ip_fw_masq_icmp(&skb, dev2)) < 0)
  2991. +                /* Problem - ie bad checksum */
  2992. +                return -1;
  2993. +
  2994. +            if (fw_res)
  2995. +                /* ICMP matched - skip firewall */
  2996. +                goto skip_call_fw_firewall;
  2997. +        }
  2998. +#endif
  2999.          fw_res=call_fw_firewall(PF_INET, dev2, iph, NULL);
  3000.          switch (fw_res) {
  3001.          case FW_ACCEPT:
  3002. @@ -236,6 +255,10 @@
  3003.          default:
  3004.              return -1;
  3005.          }
  3006. +
  3007. +#ifdef CONFIG_IP_MASQUERADE
  3008. +        skip_call_fw_firewall:
  3009. +#endif        
  3010.      }
  3011.  #endif
  3012.  
  3013. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/ip_masq.c linux/net/ipv4/ip_masq.c
  3014. --- pre2.0.10/linux/net/ipv4/ip_masq.c    Sat Jun  1 20:11:37 1996
  3015. +++ linux/net/ipv4/ip_masq.c    Mon Jun  3 12:42:41 1996
  3016. @@ -568,8 +568,108 @@
  3017.      return 0;
  3018.   }
  3019.  
  3020. +
  3021. +/*
  3022. + *    Handle ICMP messages in forward direction.
  3023. + *    Find any that might be relevant, check against existing connections,
  3024. + *    forward to masqueraded host if relevant.
  3025. + *    Currently handles error types - unreachable, quench, ttl exceeded
  3026. + */
  3027. +
  3028. +int ip_fw_masq_icmp(struct sk_buff **skb_p, struct device *dev)
  3029. +{
  3030. +        struct sk_buff     *skb   = *skb_p;
  3031. +     struct iphdr    *iph   = skb->h.iph;
  3032. +    struct icmphdr  *icmph = (struct icmphdr *)((char *)iph + (iph->ihl<<2));
  3033. +    struct iphdr    *ciph;    /* The ip header contained within the ICMP */
  3034. +    __u16            *pptr;    /* port numbers from TCP/UDP contained header */
  3035. +    struct ip_masq    *ms;
  3036. +    unsigned short   len   = ntohs(iph->tot_len) - (iph->ihl * 4);
  3037. +
  3038. +#ifdef DEBUG_CONFIG_IP_MASQUERADE
  3039. +     printk("Incoming forward ICMP (%d) %lX -> %lX\n",
  3040. +            icmph->type,
  3041. +         ntohl(iph->saddr), ntohl(iph->daddr));
  3042. +#endif
  3043. +
  3044. +    /* 
  3045. +     * Work through seeing if this is for us.
  3046. +     * These checks are supposed to be in an order that
  3047. +     * means easy things are checked first to speed up
  3048. +     * processing.... however this means that some
  3049. +     * packets will manage to get a long way down this
  3050. +     * stack and then be rejected, but thats life
  3051. +     */
  3052. +    if ((icmph->type != ICMP_DEST_UNREACH) &&
  3053. +        (icmph->type != ICMP_SOURCE_QUENCH) &&
  3054. +        (icmph->type != ICMP_TIME_EXCEEDED))
  3055. +        return 0;
  3056. +
  3057. +    /* Now find the contained IP header */
  3058. +    ciph = (struct iphdr *) (icmph + 1);
  3059. +
  3060. +    /* We are only interested ICMPs generated from TCP or UDP packets */
  3061. +    if ((ciph->protocol != IPPROTO_UDP) && (ciph->protocol != IPPROTO_TCP))
  3062. +        return 0;
  3063. +
  3064. +    /* 
  3065. +     * Find the ports involved - this packet was 
  3066. +     * incoming so the ports are right way round
  3067. +     * (but reversed relative to outer IP header!)
  3068. +     */
  3069. +    pptr = (__u16 *)&(((char *)ciph)[ciph->ihl*4]);
  3070. +    if (ntohs(pptr[1]) < PORT_MASQ_BEGIN ||
  3071. +         ntohs(pptr[1]) > PORT_MASQ_END)
  3072. +         return 0;
  3073. +
  3074. +    /* Ensure the checksum is correct */
  3075. +    if (ip_compute_csum((unsigned char *) icmph, len)) 
  3076. +    {
  3077. +        /* Failed checksum! */
  3078. +        printk(KERN_INFO "MASQ: forward ICMP: failed checksum from %s!\n", 
  3079. +               in_ntoa(iph->saddr));
  3080. +        return(-1);
  3081. +    }
  3082. +
  3083. +#ifdef DEBUG_CONFIG_IP_MASQUERADE
  3084. +     printk("Handling forward ICMP for %lX:%X -> %lX:%X\n",
  3085. +           ntohl(ciph->saddr), ntohs(pptr[0]),
  3086. +           ntohl(ciph->daddr), ntohs(pptr[1]));
  3087. +#endif
  3088. +
  3089. +    /* This is pretty much what ip_masq_in_get() does */
  3090. +    ms = ip_masq_in_get_2(ciph->protocol, ciph->saddr, pptr[0], ciph->daddr, pptr[1]);
  3091. +
  3092. +    if (ms == NULL)
  3093. +        return 0;
  3094. +
  3095. +    /* Now we do real damage to this packet...! */
  3096. +    /* First change the source IP address, and recalc checksum */
  3097. +    iph->saddr = ms->maddr;
  3098. +    ip_send_check(iph);
  3099. +    
  3100. +    /* Now change the *dest* address in the contained IP */
  3101. +    ciph->daddr = ms->maddr;
  3102. +    ip_send_check(ciph);
  3103. +    
  3104. +    /* the TCP/UDP dest port - cannot redo check */
  3105. +    pptr[1] = ms->mport;
  3106. +
  3107. +    /* And finally the ICMP checksum */
  3108. +    icmph->checksum = 0;
  3109. +    icmph->checksum = ip_compute_csum((unsigned char *) icmph, len);
  3110. +
  3111. +#ifdef DEBUG_CONFIG_IP_MASQUERADE
  3112. +     printk("Rewrote forward ICMP to %lX:%X -> %lX:%X\n",
  3113. +           ntohl(ciph->saddr), ntohs(pptr[0]),
  3114. +           ntohl(ciph->daddr), ntohs(pptr[1]));
  3115. +#endif
  3116. +
  3117. +    return 1;
  3118. +}
  3119. +
  3120.  /*
  3121. - *    Handle ICMP messages.
  3122. + *    Handle ICMP messages in reverse (demasquerade) direction.
  3123.   *    Find any that might be relevant, check against existing connections,
  3124.   *    forward to masqueraded host if relevant.
  3125.   *    Currently handles error types - unreachable, quench, ttl exceeded
  3126. @@ -586,7 +686,7 @@
  3127.      unsigned short   len   = ntohs(iph->tot_len) - (iph->ihl * 4);
  3128.  
  3129.  #ifdef DEBUG_CONFIG_IP_MASQUERADE
  3130. -     printk("Incoming ICMP (%d) %lX -> %lX\n",
  3131. +     printk("Incoming reverse ICMP (%d) %lX -> %lX\n",
  3132.              icmph->type,
  3133.           ntohl(iph->saddr), ntohl(iph->daddr));
  3134.  #endif
  3135. @@ -616,12 +716,13 @@
  3136.      if (ip_compute_csum((unsigned char *) icmph, len)) 
  3137.      {
  3138.          /* Failed checksum! */
  3139. -        printk(KERN_INFO "MASQ: ICMP: failed checksum from %s!\n", in_ntoa(iph->saddr));
  3140. +        printk(KERN_INFO "MASQ: reverse ICMP: failed checksum from %s!\n", 
  3141. +               in_ntoa(iph->saddr));
  3142.          return(-1);
  3143.      }
  3144.  
  3145.  #ifdef DEBUG_CONFIG_IP_MASQUERADE
  3146. -     printk("Handling ICMP for %lX:%X -> %lX:%X\n",
  3147. +     printk("Handling reverse ICMP for %lX:%X -> %lX:%X\n",
  3148.             ntohl(ciph->saddr), ntohs(pptr[0]),
  3149.             ntohl(ciph->daddr), ntohs(pptr[1]));
  3150.  #endif
  3151. @@ -649,7 +750,7 @@
  3152.      icmph->checksum = ip_compute_csum((unsigned char *) icmph, len);
  3153.  
  3154.  #ifdef DEBUG_CONFIG_IP_MASQUERADE
  3155. -     printk("Rewrote ICMP to %lX:%X -> %lX:%X\n",
  3156. +     printk("Rewrote reverse ICMP to %lX:%X -> %lX:%X\n",
  3157.             ntohl(ciph->saddr), ntohs(pptr[0]),
  3158.             ntohl(ciph->daddr), ntohs(pptr[1]));
  3159.  #endif
  3160. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/sysctl_net_ipv4.c linux/net/ipv4/sysctl_net_ipv4.c
  3161. --- pre2.0.10/linux/net/ipv4/sysctl_net_ipv4.c    Tue Apr  2 13:32:24 1996
  3162. +++ linux/net/ipv4/sysctl_net_ipv4.c    Mon Jun  3 14:07:09 1996
  3163. @@ -8,6 +8,31 @@
  3164.  #include <linux/mm.h>
  3165.  #include <linux/sysctl.h>
  3166.  
  3167. +/* From arp.c */
  3168. +extern int sysctl_arp_res_time;
  3169. +extern int sysctl_arp_dead_res_time;
  3170. +extern int sysctl_arp_max_tries;
  3171. +extern int sysctl_arp_timeout;
  3172. +extern int sysctl_arp_check_interval;
  3173. +extern int sysctl_arp_confirm_interval;
  3174. +extern int sysctl_arp_confirm_timeout;
  3175. +
  3176.  ctl_table ipv4_table[] = {
  3177. +        {NET_IPV4_ARP_RES_TIME, "arp_res_time",
  3178. +         &sysctl_arp_res_time, sizeof(int), 0644, NULL, &proc_dointvec},
  3179. +        {NET_IPV4_ARP_DEAD_RES_TIME, "arp_dead_res_time",
  3180. +         &sysctl_arp_dead_res_time, sizeof(int), 0644, NULL, &proc_dointvec},
  3181. +        {NET_IPV4_ARP_MAX_TRIES, "arp_max_tries",
  3182. +         &sysctl_arp_max_tries, sizeof(int), 0644, NULL, &proc_dointvec},
  3183. +        {NET_IPV4_ARP_TIMEOUT, "arp_timeout",
  3184. +         &sysctl_arp_timeout, sizeof(int), 0644, NULL, &proc_dointvec},
  3185. +        {NET_IPV4_ARP_CHECK_INTERVAL, "arp_check_interval",
  3186. +         &sysctl_arp_check_interval, sizeof(int), 0644, NULL, &proc_dointvec},
  3187. +        {NET_IPV4_ARP_CONFIRM_INTERVAL, "arp_confirm_interval",
  3188. +         &sysctl_arp_confirm_interval, sizeof(int), 0644, NULL,
  3189. +         &proc_dointvec},
  3190. +        {NET_IPV4_ARP_CONFIRM_TIMEOUT, "arp_confirm_timeout",
  3191. +         &sysctl_arp_confirm_timeout, sizeof(int), 0644, NULL,
  3192. +         &proc_dointvec},
  3193.      {0}
  3194.  };
  3195. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
  3196. --- pre2.0.10/linux/net/ipv4/tcp_input.c    Sat Jun  1 20:11:37 1996
  3197. +++ linux/net/ipv4/tcp_input.c    Mon Jun  3 12:42:42 1996
  3198. @@ -933,7 +933,7 @@
  3199.      /*
  3200.       * Maybe we can take some stuff off of the write queue,
  3201.       * and put it onto the xmit queue.
  3202. -     * FIXME: (?) There is bizzare case being tested here, to check if
  3203. +     * FIXME: (?) There is bizarre case being tested here, to check if
  3204.       * the data at the head of the queue ends before the start of
  3205.       * the sequence we already ACKed. This does not appear to be
  3206.       * a case that can actually occur. Why are we testing it?
  3207. @@ -1679,7 +1679,7 @@
  3208.      struct sock *sk;
  3209.      int syn_ok=0;
  3210.  #ifdef CONFIG_IP_TRANSPARENT_PROXY
  3211. -    int r;
  3212. +    int r=0;
  3213.  #endif
  3214.  
  3215.      /*
  3216. diff -u --recursive --new-file pre2.0.10/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
  3217. --- pre2.0.10/linux/net/ipv4/tcp_timer.c    Sat Jun  1 20:11:37 1996
  3218. +++ linux/net/ipv4/tcp_timer.c    Sun Jun  2 13:23:13 1996
  3219. @@ -61,7 +61,7 @@
  3220.  
  3221.      if (sk->retransmit_timer.expires < jiffies) {
  3222.          /* We can get here if we reset the timer on an event
  3223. -         * that could not fire because the interupts where disabled.
  3224. +         * that could not fire because the interrupts were disabled.
  3225.           * make sure it happens soon.
  3226.           */
  3227.          sk->retransmit_timer.expires = jiffies+2;
  3228. diff -u --recursive --new-file pre2.0.10/linux/net/netlink.c linux/net/netlink.c
  3229. --- pre2.0.10/linux/net/netlink.c    Mon May 13 23:02:53 1996
  3230. +++ linux/net/netlink.c    Mon Jun  3 12:42:42 1996
  3231. @@ -63,6 +63,21 @@
  3232.      return -EINVAL;
  3233.  }
  3234.  
  3235. +static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
  3236. +{
  3237. +    unsigned int minor = MINOR(inode->i_rdev);
  3238. +    switch (sel_type) {
  3239. +    case SEL_IN:
  3240. +        if (skb_peek(&skb_queue_rd[minor])!=NULL)
  3241. +            return 1;
  3242. +        select_wait(&read_space_wait[minor], wait);
  3243. +        break;
  3244. +    case SEL_OUT:
  3245. +        return 1;
  3246. +    }
  3247. +    return 0;
  3248. +}
  3249. +
  3250.  /*
  3251.   *    Write a message to the kernel side of a communication link
  3252.   */
  3253. @@ -161,7 +176,7 @@
  3254.      netlink_read,
  3255.      netlink_write,
  3256.      NULL,        /* netlink_readdir */
  3257. -    NULL,        /* netlink_select */
  3258. +    netlink_select,
  3259.      netlink_ioctl,
  3260.      NULL,        /* netlink_mmap */
  3261.      netlink_open,
  3262. diff -u --recursive --new-file pre2.0.10/linux/net/netsyms.c linux/net/netsyms.c
  3263. --- pre2.0.10/linux/net/netsyms.c    Wed May 15 11:01:15 1996
  3264. +++ linux/net/netsyms.c    Mon Jun  3 12:42:42 1996
  3265. @@ -31,6 +31,10 @@
  3266.  #include <linux/net_alias.h>
  3267.  #endif
  3268.  
  3269. +#ifdef CONFIG_NETLINK
  3270. +#include <net/netlink.h>
  3271. +#endif
  3272. +
  3273.  #ifdef CONFIG_NET_ALIAS
  3274.  #include <linux/net_alias.h>
  3275.  #endif
  3276. @@ -173,6 +177,12 @@
  3277.      X(arp_query),
  3278.  #endif  /* CONFIG_INET */
  3279.  
  3280. +#ifdef CONFIG_NETLINK
  3281. +    X(netlink_attach),
  3282. +    X(netlink_detach),
  3283. +    X(netlink_post),
  3284. +#endif /* CONFIG_NETLINK */
  3285. +    
  3286.  #include <linux/symtab_end.h>
  3287.  };
  3288.  
  3289. diff -u --recursive --new-file pre2.0.10/linux/net/sysctl_net.c linux/net/sysctl_net.c
  3290. --- pre2.0.10/linux/net/sysctl_net.c    Fri Apr 12 15:52:13 1996
  3291. +++ linux/net/sysctl_net.c    Mon Jun  3 12:42:42 1996
  3292. @@ -3,6 +3,13 @@
  3293.   *
  3294.   * Begun April 1, 1996, Mike Shaver.
  3295.   * Added /proc/sys/net directories for each protocol family. [MS]
  3296. + *
  3297. + * $Log: sysctl_net.c,v $
  3298. + * Revision 1.2  1996/05/08  20:24:40  shaver
  3299. + * Added bits for NET_BRIDGE and the NET_IPV4_ARP stuff and
  3300. + * NET_IPV4_IP_FORWARD.
  3301. + *
  3302. + *
  3303.   */
  3304.  
  3305.  #include <linux/config.h>
  3306. @@ -35,6 +42,10 @@
  3307.  extern ctl_table ether_table[], e802_table[];
  3308.  #endif
  3309.  
  3310. +#ifdef CONFIG_BRIDGE
  3311. +extern ctl_table bridge_table[];
  3312. +#endif
  3313. +
  3314.  ctl_table net_table[] = {
  3315.      {NET_CORE,   "core",      NULL, 0, 0555, core_table},      
  3316.          {NET_UNIX,   "unix",      NULL, 0, 0555, unix_table},
  3317. @@ -56,6 +67,9 @@
  3318.  #endif
  3319.  #ifdef CONFIG_AX25
  3320.      {NET_AX25,   "ax25",      NULL, 0, 0555, ax25_table},
  3321. +#endif
  3322. +#ifdef CONFIG_BRIDGE
  3323. +        {NET_BRIDGE, "bridge",    NULL, 0, 0555, bridge_table},
  3324.  #endif
  3325.      {0}
  3326.  };
  3327. diff -u --recursive --new-file pre2.0.10/linux/scripts/Menuconfig linux/scripts/Menuconfig
  3328. --- pre2.0.10/linux/scripts/Menuconfig    Tue May  7 16:22:43 1996
  3329. +++ linux/scripts/Menuconfig    Sun Jun  2 19:26:34 1996
  3330. @@ -627,7 +627,7 @@
  3331.      #
  3332.      for i in MCmenu*
  3333.      do
  3334. -        source $i
  3335. +        source ./$i
  3336.      done
  3337.  
  3338.      rm -f MCmenu*
  3339. @@ -646,9 +646,30 @@
  3340.          comment_ctr=0        #So comment lines get unique tags
  3341.  
  3342.          $1 "$default"        #Create the lxdialog menu & functions
  3343. -        . MCradiolists        #Source the menu's functions
  3344.  
  3345. -        . MCmenu 2>MCdialog.out    #Activate the lxdialog menu
  3346. +        if [ "$?" != "0" ]
  3347. +        then
  3348. +            clear
  3349. +            cat <<EOM
  3350. +
  3351. +Menuconfig has encountered a possible error in one of the kernel's
  3352. +configuration files and is unable to continue.
  3353. +
  3354. +Please report this to the author <roadcapw@cfw.com>.  You may also
  3355. +send a problem report to linux-kernel@vger.rutgers.edu or post a
  3356. +message to the linux.dev.kernel news group.
  3357. +
  3358. +Please indicate the kernel version you are trying to configure and
  3359. +which menu you were trying to enter when this error occured.
  3360. +
  3361. +EOM
  3362. +            cleanup
  3363. +            exit 1
  3364. +        fi
  3365. +
  3366. +        . ./MCradiolists        #Source the menu's functions
  3367. +
  3368. +        . ./MCmenu 2>MCdialog.out    #Activate the lxdialog menu
  3369.          ret=$?
  3370.  
  3371.          read selection <MCdialog.out
  3372. @@ -678,6 +699,32 @@
  3373.          255|1)
  3374.              break
  3375.              ;;
  3376. +        139)
  3377. +            stty sane
  3378. +            clear
  3379. +            cat <<EOM
  3380. +
  3381. +There seems to be a problem with the lxdialog companion utility which is
  3382. +built prior to running Menuconfig.  Usually this is an indicator that you
  3383. +have upgraded/downgraded your ncurses libraries and did not remove the 
  3384. +old ncurses header file(s) in /usr/include or /usr/include/ncurses.
  3385. +
  3386. +It is VERY important that you have only one set of ncurses header files
  3387. +and that those files are properly version matched to the ncurses libraries 
  3388. +installed on your machine.
  3389. +
  3390. +You may also need to rebuild lxdialog.  This can be done by moving to
  3391. +the /usr/src/linux/scripts/lxdialog directory and issuing the 
  3392. +"make clean all" command.
  3393. +
  3394. +If you have verified that your ncurses install is correct, you may email
  3395. +the author <roadcapw@cfw.com> or post a message on the linux.dev.kernel
  3396. +news group for additional assistance. 
  3397. +
  3398. +EOM
  3399. +            cleanup
  3400. +            exit 139
  3401. +            ;;
  3402.          esac
  3403.      done
  3404.  }
  3405. @@ -719,7 +766,7 @@
  3406.              else
  3407.                  echo -ne "\007"
  3408.                  $DIALOG    --backtitle "$backtitle" \
  3409. -                    --infobox "File does not exit!"  3 38
  3410. +                    --infobox "File does not exist!"  3 38
  3411.                  sleep 2
  3412.              fi
  3413.          else
  3414. @@ -815,7 +862,7 @@
  3415.      ! /# .* is not set.*/ { print }
  3416.      ' $1 >.tmpconfig
  3417.  
  3418. -    source .tmpconfig
  3419. +    source ./.tmpconfig
  3420.      rm -f .tmpconfig
  3421.  }
  3422.  
  3423.