home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.3 / patch-1.006 / patch-1.3.18
Text File  |  1995-08-13  |  155KB  |  4,676 lines

  1. diff -u --recursive --new-file v1.3.17/linux/CREDITS linux/CREDITS
  2. --- v1.3.17/linux/CREDITS    Wed Aug  9 14:55:38 1995
  3. +++ linux/CREDITS    Sun Aug 13 11:05:45 1995
  4. @@ -795,6 +795,14 @@
  5.  S: B2240 Zandhoven
  6.  S: Belgium
  7.  
  8. +N: Martin Schulze
  9. +E: joey@infodrom.north.de
  10. +D: Random Linux Hacker, Linux Promoter
  11. +D: CD-List, Books-List, Ex-FAQ
  12. +D: Linux-Support, -Mailbox, -Stammtisch
  13. +D: several improvements to system programs
  14. +S: Oldenburg, Germany
  15. +
  16.  N: Darren Senn
  17.  E: sinster@scintilla.santa-clara.ca.us
  18.  D: Whatever I notice needs doing (so far: itimers, /proc)
  19. @@ -958,7 +966,6 @@
  20.  S: 205 Gray Street NE
  21.  S: Wilson, North Carolina 27893
  22.  S: USA
  23. -
  24.  
  25.  N: Marco van Wieringen
  26.  E: mvw@mercury.mcs.nl.mugnet.org
  27. diff -u --recursive --new-file v1.3.17/linux/Makefile linux/Makefile
  28. --- v1.3.17/linux/Makefile    Wed Aug  9 14:55:38 1995
  29. +++ linux/Makefile    Fri Aug 11 10:01:21 1995
  30. @@ -1,6 +1,6 @@
  31.  VERSION = 1
  32.  PATCHLEVEL = 3
  33. -SUBLEVEL = 17
  34. +SUBLEVEL = 18
  35.  
  36.  ARCH = i386
  37.  
  38. diff -u --recursive --new-file v1.3.17/linux/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
  39. --- v1.3.17/linux/arch/alpha/kernel/ptrace.c    Tue Jul 25 18:21:20 1995
  40. +++ linux/arch/alpha/kernel/ptrace.c    Fri Aug 11 11:52:26 1995
  41. @@ -222,10 +222,8 @@
  42.          goto repeat;
  43.      }
  44.  /* this is a hack for non-kernel-mapped video buffers and similar */
  45. -    if (page < high_memory) {
  46. -        page += addr & ~PAGE_MASK;
  47. -        *(unsigned long *) page = data;
  48. -    }
  49. +    if (page < high_memory)
  50. +        *(unsigned long *) (page + (addr & ~PAGE_MASK)) = data;
  51.  /* we're bypassing pagetables, so we have to set the dirty bit ourselves */
  52.  /* this should also re-instate whatever read-only mode there was before */
  53.      *pgtable = pte_mkdirty(mk_pte(page, vma->vm_page_prot));
  54. diff -u --recursive --new-file v1.3.17/linux/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
  55. --- v1.3.17/linux/arch/i386/kernel/ptrace.c    Tue Jul 18 16:28:56 1995
  56. +++ linux/arch/i386/kernel/ptrace.c    Fri Aug 11 11:52:56 1995
  57. @@ -173,10 +173,8 @@
  58.          goto repeat;
  59.      }
  60.  /* this is a hack for non-kernel-mapped video buffers and similar */
  61. -    if (page < high_memory) {
  62. -        page += addr & ~PAGE_MASK;
  63. -        *(unsigned long *) page = data;
  64. -    }
  65. +    if (page < high_memory)
  66. +        *(unsigned long *) (page + (addr & ~PAGE_MASK)) = data;
  67.  /* we're bypassing pagetables, so we have to set the dirty bit ourselves */
  68.  /* this should also re-instate whatever read-only mode there was before */
  69.      *pgtable = pte_mkdirty(mk_pte(page, vma->vm_page_prot));
  70. diff -u --recursive --new-file v1.3.17/linux/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
  71. --- v1.3.17/linux/arch/i386/kernel/setup.c    Tue Aug  8 12:31:32 1995
  72. +++ linux/arch/i386/kernel/setup.c    Wed Aug  9 19:02:51 1995
  73. @@ -130,8 +130,7 @@
  74.      request_region(0x70,0x10,"rtc");
  75.      request_region(0x80,0x20,"dma page reg");
  76.      request_region(0xc0,0x20,"dma2");
  77. -    request_region(0xf0,0x2,"npu");
  78. -    request_region(0xf8,0x8,"npu");
  79. +    request_region(0xf0,0x10,"npu");
  80.  }
  81.  
  82.  int get_cpuinfo(char * buffer)
  83. diff -u --recursive --new-file v1.3.17/linux/drivers/block/README.aztcd linux/drivers/block/README.aztcd
  84. --- v1.3.17/linux/drivers/block/README.aztcd    Mon Jul 31 15:58:59 1995
  85. +++ linux/drivers/block/README.aztcd    Wed Aug  9 18:50:27 1995
  86. @@ -1,8 +1,8 @@
  87. -$Id: README.aztcd,v 1.50 1995/07/29 20:33:35 root Exp root $
  88. +$Id: README.aztcd,v 1.60 1995/08/09 12:37:46 root Exp root $
  89.                         Readme-File README.aztcd
  90.     for Aztech CD-ROM CDA268-01A, ORCHID CD-3110, OKANO/WEARNES CDD110 
  91.                            CD-ROM  Driver 
  92. -                       Version 1.5 and newer
  93. +                       Version 1.6 and newer
  94.                     (for other drives see 6.-8.)
  95.  
  96.  NOTE: THIS DRIVER WILL WORK WITH THE CD-ROM DRIVES LISTED, WHICH HAVE
  97. @@ -73,7 +73,8 @@
  98.  address can be overwritten by boot parameter aztcd=....You should reboot and 
  99.  start Linux with boot parameter aztcd=<base address>, e.g. aztcd=0x320. If 
  100.  you do not know the base address, start your PC with DOS and look at the boot 
  101. -message of your CD-ROM's DOS driver. 
  102. +message of your CD-ROM's DOS driver. If that still does not help, use boot
  103. +parameter aztcd=<base address>,0x79 , this tells aztcd to try a little harder.
  104.  
  105.  If the message looks correct, as user 'root' you should be able to mount the 
  106.  drive by
  107. @@ -181,11 +182,10 @@
  108.  5. KNOWN PROBLEMS, FUTURE DEVELOPMENTS
  109.  5.1 MULTISESSION SUPPORT
  110.  I have now (July 1995) started support of multisession CDs. Unfortunately I
  111. -do neither have a multisession CD nor use appropriate applications, so I can
  112. -program, but will not test it :-(. If you'd like to help me, please contact
  113. -me. As of version 1.4 you can enable the multisession support in aztcd.h by
  114. -setting AZT_MULTISESSION to 1. As I have not tested it, I don't know, if it
  115. -works ...
  116. +do only have one multisession CD and no appropriate applications, so I can
  117. +program, but testing is a little too less :-(. If you'd like to help me, 
  118. +please contact me. As of version 1.4 you can enable the multisession support 
  119. +in aztcd.h by setting AZT_MULTISESSION to 1. 
  120.  
  121.  5.2 STATUS RECOGNITION
  122.  The drive status recognition does not work correctly in all cases. Changing
  123. @@ -497,7 +497,7 @@
  124.  
  125.     Copyright 1994, 1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
  126.  
  127. -This programm originally was written to test the audio functions of the
  128. +This program originally was written to test the audio functions of the
  129.  AZTECH.CDROM-driver, but it should work with every CD-ROM drive. Before 
  130.  using it, you should set a symlink from /dev/cdrom to your real CDROM
  131.  device.
  132. @@ -545,7 +545,7 @@
  133.           } azt;
  134.    struct cdrom_volctrl  volctrl;
  135.  
  136. -  printf("\nMini-Audio CD-Player V0.7   (C) 1994,1995  W.Zimmermann\n");
  137. +  printf("\nMini-Audio CD-Player V0.71   (C) 1994,1995  W.Zimmermann\n");
  138.    handle=open("/dev/cdrom",O_RDWR);
  139.    ioctl(handle,CDROMRESUME);
  140.    
  141. @@ -675,7 +675,7 @@
  142.                              }
  143.                            break;
  144.                case 'a':   cmd=CDROMPLAYMSF;
  145. -                          printf("Adress (min:sec:frame)  ");
  146. +                          printf("Address (min:sec:frame)  ");
  147.                            scanf("%d:%d:%d",&arg1,&arg2,&arg3);
  148.                            msf.cdmsf_min0  =arg1;
  149.                            msf.cdmsf_sec0  =arg2;
  150. @@ -686,12 +686,12 @@
  151.                            msf.cdmsf_sec1=00;
  152.                            msf.cdmsf_frame1=00;
  153.                            if (ioctl(handle,cmd,&msf)) 
  154. -                           { printf("Drive error or invalid adress\n");
  155. +                           { printf("Drive error or invalid address\n");
  156.                             }
  157.                            break;
  158.  #ifdef AZT_PRIVATE_IOCTLS /*not supported by every CDROM driver*/
  159.                case 'd':   cmd=CDROMREADCOOKED;
  160. -                          printf("Adress (min:sec:frame)  ");
  161. +                          printf("Address (min:sec:frame)  ");
  162.                            scanf("%d:%d:%d",&arg1,&arg2,&arg3);
  163.                            azt.msf.cdmsf_min0  =arg1;
  164.                            azt.msf.cdmsf_sec0  =arg2;
  165. @@ -699,7 +699,7 @@
  166.                            if (azt.msf.cdmsf_sec0  > 59) azt.msf.cdmsf_sec0  =59;
  167.                            if (azt.msf.cdmsf_frame0> 74) azt.msf.cdmsf_frame0=74;
  168.                            if (ioctl(handle,cmd,&azt.msf)) 
  169. -                           { printf("Drive error, invalid adress or unsupported command\n");
  170. +                           { printf("Drive error, invalid address or unsupported command\n");
  171.                             }
  172.                            k=0;
  173.                            getchar();
  174. @@ -724,7 +724,7 @@
  175.                             } 
  176.                            break;
  177.                case 'w':   cmd=CDROMREADRAW;
  178. -                          printf("Adress (min:sec:frame)  ");
  179. +                          printf("Address (min:sec:frame)  ");
  180.                            scanf("%d:%d:%d",&arg1,&arg2,&arg3);
  181.                            azt.msf.cdmsf_min0  =arg1;
  182.                            azt.msf.cdmsf_sec0  =arg2;
  183. @@ -732,7 +732,7 @@
  184.                            if (azt.msf.cdmsf_sec0  > 59) azt.msf.cdmsf_sec0  =59;
  185.                            if (azt.msf.cdmsf_frame0> 74) azt.msf.cdmsf_frame0=74;
  186.                            if (ioctl(handle,cmd,&azt)) 
  187. -                           { printf("Drive error, invalid adress or unsupported command\n");
  188. +                           { printf("Drive error, invalid address or unsupported command\n");
  189.                             }
  190.                            k=0;
  191.                            for (i=0;i<147;i++)
  192. diff -u --recursive --new-file v1.3.17/linux/drivers/block/aztcd.c linux/drivers/block/aztcd.c
  193. --- v1.3.17/linux/drivers/block/aztcd.c    Mon Jul 31 15:58:59 1995
  194. +++ linux/drivers/block/aztcd.c    Fri Aug 11 09:27:01 1995
  195. @@ -1,5 +1,5 @@
  196. -#define AZT_VERSION "1.50"
  197. -/*      $Id: aztcd.c,v 1.50 1995/07/28 16:43:59 root Exp root $
  198. +#define AZT_VERSION "1.60"
  199. +/*      $Id: aztcd.c,v 1.60 1995/08/09 12:37:38 root Exp root $
  200.      linux/drivers/block/aztcd.c - AztechCD268 CDROM driver
  201.  
  202.      Copyright (C) 1994,1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
  203. @@ -112,7 +112,7 @@
  204.                  sometimes DOSEMU may hang for 30 seconds or so. A fully functional ver-
  205.                  sion needs an update of Dosemu0.60's cdrom.c, which will come with the 
  206.                  next revision of Dosemu.
  207. -                Also Soundwave32 support no works.
  208. +                Also Soundwave32 support now works.
  209.                  Werner Zimmermann, May 22, 95
  210.      V1.30   Auto-eject feature. Inspired by Franc Racis (racis@psu.edu)
  211.              Werner Zimmermann, July 4, 95
  212. @@ -124,6 +124,9 @@
  213.                  XA, but still untested. Heavy modifications to drive status de-
  214.                  tection.
  215.                  Werner Zimmermann, July 25, 95
  216. +        V1.60   XA support now should work. Speeded up drive recognition in cases, 
  217. +                where no drive is installed.
  218. +                Werner Zimmermann, August 8, 1995
  219.      NOTE: 
  220.      Points marked with ??? are questionable !
  221.  */
  222. @@ -193,7 +196,6 @@
  223.  
  224.  #define AFL_STATUSorDATA (AFL_STATUS | AFL_DATA)
  225.  #define AZT_BUF_SIZ 16
  226. -#define CD_XA_HEAD_SUBHEAD CD_XA_HEAD+8
  227.  
  228.  static volatile int azt_transfer_is_active=0;
  229.  
  230. @@ -254,7 +256,6 @@
  231.  static void azt_transfer(void);
  232.  static void azt_poll(void);
  233.  static void azt_invalidate_buffers(void);
  234. -static void do_aztcd_request(void);
  235.  static void azt_hsg2msf(long hsg, struct msf *msf);
  236.  static void azt_bin2bcd(unsigned char *p);
  237.  static int  azt_bcd2bin(unsigned char bcd);
  238. @@ -439,7 +440,7 @@
  239.     int retry;
  240.  
  241.  #ifdef AZT_DEBUG
  242. -   printk("start=%02x:%02x:%02x  end=%02x:%02x:%02x\n", \
  243. +   printk("aztcd: play start=%02x:%02x:%02x  end=%02x:%02x:%02x\n", \
  244.         params->start.min, params->start.sec, params->start.frame, \
  245.         params->end.min,   params->end.sec,   params->end.frame);
  246.  #endif   
  247. @@ -633,7 +634,7 @@
  248.          aztAudioStatus = CDROM_AUDIO_PLAY;
  249.          break;
  250.  #if AZT_MULTISESSION
  251. -    case CDROMMULTISESSION: /*multisession support -- not tested ???*/
  252. +    case CDROMMULTISESSION: /*multisession support -- experimental*/
  253.              { struct cdrom_multisession ms;
  254.  #ifdef AZT_DEBUG
  255.               printk("aztcd ioctl MULTISESSION\n");
  256. @@ -656,12 +657,12 @@
  257.              memcpy_tofs((void*) arg, &ms, sizeof(struct cdrom_multisession));
  258.  #ifdef AZT_DEBUG 
  259.             if (ms.addr_format == CDROM_MSF) 
  260. -                      printk("aztcd multisession %d, %02x:%02x.%02x [%02x:%02x.%02x])\n",
  261. +                      printk("aztcd multisession xa:%d, msf:%02x:%02x.%02x [%02x:%02x.%02x])\n",
  262.                    ms.xa_flag, ms.addr.msf.minute, ms.addr.msf.second, 
  263.                    ms.addr.msf.frame, DiskInfo.lastTrack.min,
  264.                    DiskInfo.lastTrack.sec, DiskInfo.lastTrack.frame);
  265.            else
  266. -              printk("atzcd multisession %d, 0x%08x [%02x:%02x.%02x])\n",
  267. +              printk("atzcd multisession %d, lba:0x%08x [%02x:%02x.%02x])\n",
  268.                    ms.xa_flag, ms.addr.lba, DiskInfo.lastTrack.min,
  269.                    DiskInfo.lastTrack.sec, DiskInfo.lastTrack.frame);
  270.  #endif
  271. @@ -870,24 +871,26 @@
  272.            azt_Play.end.min = msf.cdmsf_min1;
  273.            azt_Play.end.sec = msf.cdmsf_sec1;
  274.            azt_Play.end.frame = msf.cdmsf_frame1;
  275. -          if (cmd==CDROMREADCOOKED)
  276. -          { sendAztCmd(ACMD_PLAY_READ, &azt_Play);
  277. +          if (cmd==CDROMREADRAW)
  278. +          { if (DiskInfo.xa)
  279. +               { return -1;         /*XA Disks can't be read raw*/
  280. +               }
  281. +            else   
  282. +               { if (sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play)) return -1;
  283. +                 DTEN_LOW;
  284. +                 insb(DATA_PORT,buf,CD_FRAMESIZE_RAW);
  285. +                 memcpy_tofs((void *) arg, &buf, CD_FRAMESIZE_RAW);
  286. +               }  
  287. +          }
  288. +          else /*CDROMREADCOOKED*/
  289. +          { if (sendAztCmd(ACMD_PLAY_READ, &azt_Play)) return -1;
  290.              DTEN_LOW;
  291.              insb(DATA_PORT,buf,CD_FRAMESIZE);
  292.              memcpy_tofs((void *) arg, &buf, CD_FRAMESIZE);
  293.            }
  294. -          else /*CDROMREADRAW*/
  295. -          { sendAztCmd(ACMD_PLAY_READ_RAW, &azt_Play);
  296. -            DTEN_LOW;
  297. -            insb(DATA_PORT,buf,CD_FRAMESIZE_RAW);
  298. -            memcpy_tofs((void *) arg, &buf, CD_FRAMESIZE_RAW);
  299. -          }
  300.           } 
  301.                  break;
  302.  #endif /*end of incompatible code*/       
  303. -        case CDROMREADMODE0: /*set read data in mode 0, does not work with my drive*/
  304. -                printk ("aztcd Status %x\n", getAztStatus());
  305. -                return aztSetDiskType(AZT_MODE_0);
  306.      case CDROMREADMODE1: /*set read data in mode 1*/
  307.                  return aztSetDiskType(AZT_MODE_1);
  308.      case CDROMREADMODE2: /*set read data in mode 2*/
  309. @@ -1239,15 +1242,7 @@
  310.            }
  311.           else
  312.            { if (azt_read_mode==AZT_MODE_2)
  313. -               { if (DiskInfo.xa) /*With XA disks skip head and tail*/
  314. -                    { unsigned char tmp_buf[CD_XA_TAIL];
  315. -                      insb(DATA_PORT, tmp_buf , CD_XA_HEAD_SUBHEAD);
  316. -                      insb(DATA_PORT, azt_buf + CD_FRAMESIZE * azt_buf_in, CD_FRAMESIZE);
  317. -                      insb(DATA_PORT, tmp_buf , CD_XA_TAIL);
  318. -                            }
  319. -                         else   
  320. -                    { insb(DATA_PORT, azt_buf + CD_FRAMESIZE_RAW * azt_buf_in, CD_FRAMESIZE_RAW);
  321. -                    }
  322. +               { insb(DATA_PORT, azt_buf + CD_FRAMESIZE_RAW * azt_buf_in, CD_FRAMESIZE_RAW);
  323.                 }
  324.              else
  325.                 { insb(DATA_PORT, azt_buf + CD_FRAMESIZE * azt_buf_in, CD_FRAMESIZE);
  326. @@ -1417,25 +1412,24 @@
  327.                 }        
  328.  
  329.          if ((st & AST_NOT_READY) || (st & AST_DSK_CHG)) /*no disk in drive or changed*/
  330. -           { printk("aztcd: No Disk in Drive or Disk Changed?\n");
  331. +           { printk("aztcd: Disk Changed or No Disk in Drive?\n");
  332.  /*             return -EIO;
  333.  */           }
  334.  
  335.          if (aztUpdateToc() < 0)    return -EIO;
  336.  
  337. -/*          Detect XA disks. XA disks will be read in raw mode, others not
  338. -          --> must set read command to read raw       --> to be done ???
  339. -*/          if (aztSetDiskType(DiskInfo.xa ? AZT_MODE_2 : AZT_MODE_1)) return -EIO;
  340. -            if (DiskInfo.xa) printk("aztcd: XA support not yet tested - please mail 'zimmerma@rz.fht-esslingen.de'\n");
  341. +            /* XA detection was already done in aztGetToc */
  342. +            if (DiskInfo.xa) 
  343. +               { printk("aztcd: XA support experimental - mail results to zimmerma@rz.fht-esslingen.de\n");
  344. +               }
  345.  
  346.              /* audio detection was already done in aztGetToc */
  347.          if (DiskInfo.audio) 
  348.             { printk(("aztcd: Audio-CD found\n"));
  349.             } 
  350.          else 
  351. -           { printk("aztcd: %s%s CD-ROM found\n",
  352. -                   DiskInfo.xa    ? "XA " : "",
  353. -             DiskInfo.multi ? "Multi Session" : "Single Session");
  354. +           { printk("aztcd: %sCD-ROM found\n",
  355. +                   DiskInfo.xa ? "XA " : "");
  356.             }
  357.        }
  358.      ++azt_open_count;
  359. @@ -1546,45 +1540,65 @@
  360.      inb(CMD_PORT);
  361.      inb(CMD_PORT);
  362.      outb(ACMD_GET_VERSION,CMD_PORT); /*Try to get version info*/
  363. -    STEN_LOW;
  364. -    if (inb(DATA_PORT)!=AFL_OP_OK)   /*OP_OK? If not, reset and try again*/
  365. -     { printk("aztcd: drive reset - please wait\n");
  366. -       for (count=0;count<50;count++)
  367. -         { inb(STATUS_PORT);    /*removing all data from earlier tries*/
  368. -           inb(DATA_PORT);
  369. -         }
  370. -       outb(POLLED,MODE_PORT);              /*???*/
  371. -       inb(CMD_PORT);
  372. -       inb(CMD_PORT);
  373. -       outb(ACMD_SOFT_RESET,CMD_PORT);   /*send reset*/
  374. -       STEN_LOW;
  375. -       if (inb(DATA_PORT)!=AFL_OP_OK)    /*OP_OK?*/
  376. -        { printk("aztcd: no AZTECH CD-ROM drive found\n");
  377. +
  378. +/*    STEN_LOW  - special implementation for drive recognition
  379. +*/      aztTimeOutCount=0;   
  380. +    do { aztIndatum=inb(STATUS_PORT);
  381. +         aztTimeOutCount++; 
  382. +         if (aztTimeOutCount>=AZT_FAST_TIMEOUT) break; 
  383. +       } while (aztIndatum&AFL_STATUS); 
  384. +
  385. +    if (inb(DATA_PORT)!=AFL_OP_OK) /*OP_OK? If not, reset and try again*/
  386. +           { 
  387. +#ifndef MODULE
  388. +             if (azt_cont!=0x79)   
  389. +            { printk("aztcd: no AZTECH CD-ROM drive found-Try boot parameter aztcd=<BaseAddress>,0x79\n");
  390. +              return (mem_start);
  391. +                }
  392. +#else        
  393. +             if (0)
  394. +                {
  395. +                }
  396. +#endif         
  397. +             else   
  398. +                   { printk("aztcd: drive reset - please wait\n");
  399. +              for (count=0;count<50;count++)
  400. +                { inb(STATUS_PORT);    /*removing all data from earlier tries*/
  401. +                  inb(DATA_PORT);
  402. +                }
  403. +              outb(POLLED,MODE_PORT);              /*???*/
  404. +              inb(CMD_PORT);
  405. +              inb(CMD_PORT);
  406. +              outb(ACMD_SOFT_RESET,CMD_PORT);   /*send reset*/
  407. +              STEN_LOW;
  408. +              if (inb(DATA_PORT)!=AFL_OP_OK)    /*OP_OK?*/
  409. +                 { printk("aztcd: no AZTECH CD-ROM drive found\n");
  410.  #ifndef MODULE
  411. -          return (mem_start);
  412. +                   return (mem_start);
  413.  #else
  414. -              return -EIO;
  415. +                       return -EIO;
  416.  #endif         
  417. -        } 
  418. -       for (count = 0; count < AZT_TIMEOUT; count++);  /* delay a bit */
  419. -       if ((st=getAztStatus())==-1)
  420. -        { printk("aztcd: Drive Status Error Status=%x\n",st);
  421. +                 } 
  422. +              for (count = 0; count < AZT_TIMEOUT; count++);  /* delay a bit */
  423. +              if ((st=getAztStatus())==-1)
  424. +                 { printk("aztcd: Drive Status Error Status=%x\n",st);
  425.  #ifndef MODULE
  426. -          return (mem_start);
  427. +                   return (mem_start);
  428.  #else
  429. -              return -EIO;
  430. +                       return -EIO;
  431.  #endif          
  432. -        }
  433. +                 }
  434.  #ifdef AZT_DEBUG
  435. -       printk("aztcd: Status = %x\n",st);
  436. +              printk("aztcd: Status = %x\n",st);
  437.  #endif
  438. -       outb(POLLED,MODE_PORT);              /*???*/
  439. -       inb(CMD_PORT);
  440. -       inb(CMD_PORT);
  441. -       outb(ACMD_GET_VERSION,CMD_PORT); /*GetVersion*/
  442. -       STEN_LOW;
  443. -       OP_OK;
  444. -     } 
  445. +              outb(POLLED,MODE_PORT);              /*???*/
  446. +              inb(CMD_PORT);
  447. +              inb(CMD_PORT);
  448. +              outb(ACMD_GET_VERSION,CMD_PORT); /*GetVersion*/
  449. +              STEN_LOW;
  450. +              OP_OK;
  451. +            } 
  452. +           }
  453.      azt_init_end=1;
  454.      STEN_LOW;
  455.      result[0]=inb(DATA_PORT);        /*reading in a null byte???*/
  456. @@ -1612,7 +1626,7 @@
  457.      else                                               /*OTHERS or none*/
  458.       { printk("aztcd: : unknown drive or firmware version detected\n");
  459.         printk("                      azt may not run stable, if you want to try anyhow,\n");
  460. -       printk("                      boot with: aztcd=base_address,0x79\n");
  461. +       printk("                      boot with: aztcd=<BaseAddress>,0x79\n");
  462.         if ((azt_cont!=0x79))     
  463.           { printk("aztcd: FirmwareVersion=");
  464.             for (count=1;count<5;count++) printk("%c",result[count]);
  465. @@ -1872,14 +1886,16 @@
  466.  
  467.      Toc[DiskInfo.last + 1].diskTime = DiskInfo.diskLength;
  468.  
  469. -/*support for XA and multisession CDs not yet working  ???*/
  470. -        DiskInfo.multi = 0;     /*how to get this info ???*/
  471. -        if (!DiskInfo.multi) DiskInfo.lastTrack.sec=2;
  472. +        /*support for multisession CDs is done automatically with Aztech drives,
  473. +          we don't have to take care about TOC redirection */
  474. +        DiskInfo.multi = 0;    
  475. +        DiskInfo.lastTrack.min  = Toc[DiskInfo.last].diskTime.min;
  476. +    DiskInfo.lastTrack.sec  = Toc[DiskInfo.last].diskTime.sec;
  477. +        DiskInfo.lastTrack.frame= Toc[DiskInfo.last].diskTime.frame;
  478. +
  479. +        /*try to detect XA disks*/
  480.          i = getAztStatus();
  481. -      DiskInfo.xa    = i & AST_MODE; /* I doubt this will work ??? */
  482. -        DiskInfo.lastTrack.min  =Toc[DiskInfo.last].diskTime.min;
  483. -    DiskInfo.lastTrack.sec  =Toc[DiskInfo.last].diskTime.sec;
  484. -        DiskInfo.lastTrack.frame=Toc[DiskInfo.last].diskTime.frame;
  485. +      DiskInfo.xa    = i & AST_MODE; /* XA info sometimes unreliable ??? */
  486.  
  487.          /*try to detect audio disks; with my Aztech drive there is no audio
  488.            status bit, so I use the copy protection bit of the first track. If
  489. diff -u --recursive --new-file v1.3.17/linux/drivers/block/mcd.c linux/drivers/block/mcd.c
  490. --- v1.3.17/linux/drivers/block/mcd.c    Tue Jul 25 18:21:21 1995
  491. +++ linux/drivers/block/mcd.c    Fri Aug 11 09:27:01 1995
  492. @@ -186,7 +186,6 @@
  493.  static void mcd_transfer(void);
  494.  static void mcd_poll(void);
  495.  static void mcd_invalidate_buffers(void);
  496. -static void do_mcd_request(void);
  497.  static void hsg2msf(long hsg, struct msf *msf);
  498.  static void bin2bcd(unsigned char *p);
  499.  static int bcd2bin(unsigned char bcd);
  500. diff -u --recursive --new-file v1.3.17/linux/drivers/block/ramdisk.c linux/drivers/block/ramdisk.c
  501. --- v1.3.17/linux/drivers/block/ramdisk.c    Mon Jan 23 23:04:09 1995
  502. +++ linux/drivers/block/ramdisk.c    Fri Aug 11 09:26:58 1995
  503. @@ -148,9 +148,7 @@
  504.          }
  505.  
  506.          /* Try ext2 */
  507. -        if (nblocks == -1 && (ext2sb->s_magic ==
  508. -            EXT2_PRE_02B_MAGIC ||
  509. -            ext2sb->s_magic == EXT2_SUPER_MAGIC))
  510. +        if (nblocks == -1 && ext2sb->s_magic == EXT2_SUPER_MAGIC)
  511.              {
  512.              printk("RAMDISK: Ext2 filesystem found at block %d\n",
  513.                  block);
  514. diff -u --recursive --new-file v1.3.17/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
  515. --- v1.3.17/linux/drivers/char/keyboard.c    Tue Aug  8 12:31:34 1995
  516. +++ linux/drivers/char/keyboard.c    Wed Aug  9 19:02:51 1995
  517. @@ -1180,8 +1180,7 @@
  518.  
  519.      bh_base[KEYBOARD_BH].routine = kbd_bh;
  520.      request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard");
  521. -    request_region(0x60,1,"kbd");
  522. -    request_region(0x64,1,"kbd");
  523. +    request_region(0x60,16,"kbd");
  524.  #ifdef __alpha__
  525.      /* enable keyboard interrupts, PC/AT mode */
  526.      kb_wait();
  527. diff -u --recursive --new-file v1.3.17/linux/drivers/char/lp.c linux/drivers/char/lp.c
  528. --- v1.3.17/linux/drivers/char/lp.c    Wed Aug  2 13:21:00 1995
  529. +++ linux/drivers/char/lp.c    Wed Aug  9 19:12:20 1995
  530. @@ -6,6 +6,7 @@
  531.   * Copyright (C) 1993 by Nigel Gamble (added interrupt code)
  532.   * Copyright (C) 1994 by Alan Cox (Modularised it)
  533.   * LPCAREFUL, LPABORT, LPGETSTATUS added by Chris Metcalf, metcalf@lcs.mit.edu
  534. + * Statistics and support for slow printers by Rob Janssen, rob@knoware.nl
  535.   */
  536.  
  537.  #ifdef MODULE
  538. @@ -24,6 +25,7 @@
  539.  #include <linux/malloc.h>
  540.  #include <linux/ioport.h>
  541.  #include <linux/fcntl.h>
  542. +#include <linux/delay.h>
  543.  
  544.  #include <asm/io.h>
  545.  #include <asm/segment.h>
  546. @@ -36,9 +38,9 @@
  547.   * if you have more than 3 printers, remember to increase LP_NO
  548.   */
  549.  struct lp_struct lp_table[] = {
  550. -    { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
  551. -    { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
  552. -    { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, },
  553. +    { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} },
  554. +    { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} },
  555. +    { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} },
  556.  }; 
  557.  #define LP_NO 3
  558.  
  559. @@ -54,33 +56,24 @@
  560.  /* 
  561.   * All my debugging code assumes that you debug with only one printer at
  562.   * a time. RWWH
  563. + * Debug info moved into stats area, so this is no longer true (Rob Janssen)
  564.   */
  565.  
  566.  #undef LP_DEBUG
  567.  
  568.  static int lp_reset(int minor)
  569.  {
  570. -    int testvalue;
  571. -    unsigned char command;
  572. -
  573. -    command = LP_PSELECP | LP_PINITP;
  574. -
  575. -    /* reset value */
  576. -    outb_p(0, LP_C(minor));
  577. -    for (testvalue = 0 ; testvalue < LP_DELAY ; testvalue++)
  578. -        ;
  579. -    outb_p(command, LP_C(minor));
  580. +    outb_p(LP_PSELECP, LP_C(minor));
  581. +    udelay(LP_DELAY);
  582. +    outb_p(LP_PSELECP | LP_PINITP, LP_C(minor));
  583.      return LP_S(minor);
  584.  }
  585.  
  586. -#ifdef LP_DEBUG
  587. -static int lp_max_count = 1;
  588. -#endif
  589. -
  590. -static int lp_char_polled(char lpchar, int minor)
  591. +static inline int lp_char_polled(char lpchar, int minor)
  592.  {
  593. -    int status = 0, wait = 0;
  594. +    int status, wait = 0;
  595.      unsigned long count  = 0; 
  596. +    struct lp_stats *stats;
  597.  
  598.      do {
  599.          status = LP_S(minor);
  600. @@ -93,13 +86,9 @@
  601.          return 0;
  602.          /* we timed out, and the character was /not/ printed */
  603.      }
  604. -#ifdef LP_DEBUG
  605. -    if (count > lp_max_count) {
  606. -        printk("lp success after %d counts.\n",count);
  607. -        lp_max_count=count;
  608. -    }
  609. -#endif
  610.      outb_p(lpchar, LP_B(minor));
  611. +    stats = &LP_STAT(minor);
  612. +    stats->chars++;
  613.      /* must wait before taking strobe high, and after taking strobe
  614.         low, according spec.  Some printers need it, others don't. */
  615.      while(wait != LP_WAIT(minor)) wait++;
  616. @@ -108,58 +97,76 @@
  617.      while(wait) wait--;
  618.          /* take strobe low */
  619.      outb_p(( LP_PSELECP | LP_PINITP ), ( LP_C( minor )));
  620. +    /* update waittime statistics */
  621. +    if (count > stats->maxwait) {
  622. +#ifdef LP_DEBUG
  623. +        printk(KERN_DEBUG "lp%d success after %d counts.\n",minor,count);
  624. +#endif
  625. +        stats->maxwait = count;
  626. +    }
  627. +    count *= 256;
  628. +    wait = (count > stats->meanwait)? count - stats->meanwait :
  629. +                      stats->meanwait - count;
  630. +    stats->meanwait = (255*stats->meanwait + count + 128) / 256;
  631. +    stats->mdev = ((127 * stats->mdev) + wait + 64) / 128;
  632.  
  633.      return 1;
  634.  }
  635.  
  636. -static int lp_char_interrupt(char lpchar, int minor)
  637. +static inline int lp_char_interrupt(char lpchar, int minor)
  638.  {
  639. -    int wait = 0;
  640. +    int wait;
  641. +    unsigned long count = 0; 
  642.      unsigned char status;
  643. +    struct lp_stats *stats;
  644.  
  645. -
  646. -    if (!((status = LP_S(minor)) & LP_PACK) || (status & LP_PBUSY)
  647. -    || !((status = LP_S(minor)) & LP_PACK) || (status & LP_PBUSY)
  648. -    || !((status = LP_S(minor)) & LP_PACK) || (status & LP_PBUSY)) {
  649. -
  650. +    do {
  651. +        if ((status = LP_S(minor)) & LP_PBUSY) {
  652.          if (!LP_CAREFUL_READY(minor, status))
  653.              return 0;
  654.          outb_p(lpchar, LP_B(minor));
  655. +        stats = &LP_STAT(minor);
  656. +        stats->chars++;
  657.          /* must wait before taking strobe high, and after taking strobe
  658.             low, according spec.  Some printers need it, others don't. */
  659. +        wait = 0;
  660.          while(wait != LP_WAIT(minor)) wait++;
  661.          /* control port takes strobe high */
  662.          outb_p(( LP_PSELECP | LP_PINITP | LP_PSTROBE ), ( LP_C( minor )));
  663.          while(wait) wait--;
  664.          /* take strobe low */
  665.          outb_p(( LP_PSELECP | LP_PINITP ), ( LP_C( minor )));
  666. +        /* update waittime statistics */
  667. +        if (count) {
  668. +            if (count > stats->maxwait)
  669. +            stats->maxwait = count;
  670. +            count *= 256;
  671. +            wait = (count > stats->meanwait)? count - stats->meanwait :
  672. +                              stats->meanwait - count;
  673. +            stats->meanwait = (255*stats->meanwait + count + 128) / 256;
  674. +            stats->mdev = ((127 * stats->mdev) + wait + 64) / 128;
  675. +        }
  676.          return 1;
  677. -    }
  678. +        }
  679. +    } while (count++ < LP_CHAR(minor));
  680.  
  681.      return 0;
  682.  }
  683.  
  684. -#ifdef LP_DEBUG
  685. -    unsigned int lp_total_chars = 0;
  686. -    unsigned int lp_last_call = 0;
  687. -#endif
  688. -
  689.  static void lp_interrupt(int irq, struct pt_regs *regs)
  690.  {
  691.      struct lp_struct *lp = &lp_table[0];
  692. -    struct lp_struct *lp_end = &lp_table[LP_NO];
  693.  
  694.      while (irq != lp->irq) {
  695. -        if (++lp >= lp_end)
  696. +        if (++lp >= &lp_table[LP_NO])
  697.              return;
  698.      }
  699.  
  700.      wake_up(&lp->lp_wait_q);
  701.  }
  702.  
  703. -static int lp_write_interrupt(struct inode * inode, struct file * file, const char * buf, int count)
  704. +static inline int lp_write_interrupt(unsigned int minor, const char * buf, int count)
  705.  {
  706. -    unsigned int minor = MINOR(inode->i_rdev);
  707.      unsigned long copy_size;
  708.      unsigned long total_bytes_written = 0;
  709.      unsigned long bytes_written;
  710. @@ -175,8 +182,11 @@
  711.              if (lp_char_interrupt(lp->lp_buffer[bytes_written], minor)) {
  712.                  --copy_size;
  713.                  ++bytes_written;
  714. +                lp_table[minor].runchars++;
  715.              } else {
  716.                  int rc = total_bytes_written + bytes_written;
  717. +                if (lp_table[minor].runchars > LP_STAT(minor).maxrun)
  718. +                     LP_STAT(minor).maxrun = lp_table[minor].runchars;
  719.                  status = LP_S(minor);
  720.                  if ((status & LP_POUTPA)) {
  721.                      printk(KERN_INFO "lp%d out of paper\n", minor);
  722. @@ -191,6 +201,7 @@
  723.                      if (LP_F(minor) & LP_ABORT)
  724.                          return rc?rc:-EIO;
  725.                  }
  726. +                LP_STAT(minor).sleeps++;
  727.                  cli();
  728.                  outb_p((LP_PSELECP|LP_PINITP|LP_PINTEN), (LP_C(minor)));
  729.                  status = LP_S(minor);
  730. @@ -200,6 +211,7 @@
  731.                      sti();
  732.                      continue;
  733.                  }
  734. +                lp_table[minor].runchars=0;
  735.                  current->timeout = jiffies + LP_TIMEOUT_INTERRUPT;
  736.                  interruptible_sleep_on(&lp->lp_wait_q);
  737.                  outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor)));
  738. @@ -222,34 +234,24 @@
  739.      return total_bytes_written;
  740.  }
  741.  
  742. -static int lp_write_polled(struct inode * inode, struct file * file,
  743. -               const char * buf, int count)
  744. +static inline int lp_write_polled(unsigned int minor, const char * buf, int count)
  745.  {
  746. -    int  retval;
  747. -    unsigned int minor = MINOR(inode->i_rdev);
  748. +    int  retval,status;
  749.      char c;
  750. -    const char *temp = buf;
  751. -
  752. -#ifdef LP_DEBUG
  753. -    if (jiffies-lp_last_call > LP_TIME(minor)) {
  754. -        lp_total_chars = 0;
  755. -        lp_max_count = 1;
  756. -    }
  757. -    lp_last_call = jiffies;
  758. -#endif
  759. +    const char *temp;
  760.  
  761.      temp = buf;
  762.      while (count > 0) {
  763.          c = get_user(temp);
  764.          retval = lp_char_polled(c, minor);
  765.          /* only update counting vars if character was printed */
  766. -        if (retval) { count--; temp++;
  767. -#ifdef LP_DEBUG
  768. -            lp_total_chars++;
  769. -#endif
  770. -        }
  771. -        if (!retval) { /* if printer timed out */
  772. -            int status = LP_S(minor);
  773. +        if (retval) {
  774. +            count--; temp++;
  775. +            lp_table[minor].runchars++;
  776. +        } else { /* if printer timed out */
  777. +            if (lp_table[minor].runchars > LP_STAT(minor).maxrun)
  778. +                 LP_STAT(minor).maxrun = lp_table[minor].runchars;
  779. +            status = LP_S(minor);
  780.  
  781.              if (status & LP_POUTPA) {
  782.                  printk(KERN_INFO "lp%d out of paper\n", minor);
  783. @@ -284,11 +286,12 @@
  784.                  else
  785.                      return -EINTR;
  786.              }
  787. +            LP_STAT(minor).sleeps++;
  788.  #ifdef LP_DEBUG
  789. -            printk("lp sleeping at %d characters for %d jiffies\n",
  790. -                lp_total_chars, LP_TIME(minor));
  791. -            lp_total_chars=0;
  792. +            printk(KERN_DEBUG "lp%d sleeping at %d characters for %d jiffies\n",
  793. +                minor,lp_table[minor].runchars, LP_TIME(minor));
  794.  #endif
  795. +            lp_table[minor].runchars=0;
  796.              current->state = TASK_INTERRUPTIBLE;
  797.              current->timeout = jiffies + LP_TIME(minor);
  798.              schedule();
  799. @@ -299,10 +302,16 @@
  800.  
  801.  static int lp_write(struct inode * inode, struct file * file, const char * buf, int count)
  802.  {
  803. -    if (LP_IRQ(MINOR(inode->i_rdev)))
  804. -        return lp_write_interrupt(inode, file, buf, count);
  805. +    unsigned int minor = MINOR(inode->i_rdev);
  806. +
  807. +    if (jiffies-lp_table[minor].lastcall > LP_TIME(minor))
  808. +        lp_table[minor].runchars = 0;
  809. +    lp_table[minor].lastcall = jiffies;
  810. +
  811. +    if (LP_IRQ(minor))
  812. +        return lp_write_interrupt(minor, buf, count);
  813.      else
  814. -        return lp_write_polled(inode, file, buf, count);
  815. +        return lp_write_polled(minor, buf, count);
  816.  }
  817.  
  818.  static int lp_lseek(struct inode * inode, struct file * file,
  819. @@ -392,7 +401,7 @@
  820.      int retval = 0;
  821.  
  822.  #ifdef LP_DEBUG
  823. -    printk("lp%d ioctl, cmd: 0x%x, arg: 0x%x\n", minor, cmd, arg);
  824. +    printk(KERN_DEBUG "lp%d ioctl, cmd: 0x%x, arg: 0x%x\n", minor, cmd, arg);
  825.  #endif
  826.      if (minor >= LP_NO)
  827.          return -ENODEV;
  828. @@ -489,6 +498,17 @@
  829.          case LPRESET:
  830.              lp_reset(minor);
  831.              break;
  832. +        case LPGETSTATS:
  833. +            retval = verify_area(VERIFY_WRITE, (void *) arg,
  834. +                sizeof(struct lp_stats));
  835. +                if (retval)
  836. +                    return retval;
  837. +            else {
  838. +                memcpy_tofs((int *) arg, &LP_STAT(minor), sizeof(struct lp_stats));
  839. +                if (suser())
  840. +                    memset(&LP_STAT(minor), 0, sizeof(struct lp_stats));
  841. +            }
  842. +            break;
  843.          default:
  844.              retval = -EINVAL;
  845.      }
  846. @@ -517,8 +537,9 @@
  847.  #endif
  848.  {
  849.      int offset = 0;
  850. -    unsigned int testvalue = 0;
  851. +    unsigned int testvalue;
  852.      int count = 0;
  853. +    int base,size;
  854.  
  855.      if (register_chrdev(LP_MAJOR,"lp",&lp_fops)) {
  856.          printk("lp: unable to get major %d\n", LP_MAJOR);
  857. @@ -530,18 +551,19 @@
  858.      }
  859.      /* take on all known port values */
  860.      for (offset = 0; offset < LP_NO; offset++) {
  861. -        if (check_region(LP_B(offset), 3))
  862. +        base = LP_B(offset);
  863. +        size = (base == 0x3bc)? 3 : 8;
  864. +        if (check_region(base, size))
  865.              continue;
  866.          /* write to port & read back to check */
  867. -        outb_p( LP_DUMMY, LP_B(offset));
  868. -        for (testvalue = 0 ; testvalue < LP_DELAY ; testvalue++)
  869. -            ;
  870. -        testvalue = inb_p(LP_B(offset));
  871. +        outb_p( LP_DUMMY, base);
  872. +        udelay(LP_DELAY);
  873. +        testvalue = inb_p(base);
  874.          if (testvalue == LP_DUMMY) {
  875.              LP_F(offset) |= LP_EXIST;
  876.              lp_reset(offset);
  877. -            printk("lp%d at 0x%04x, ", offset,LP_B(offset));
  878. -            request_region(LP_B(offset), 3, "lp");
  879. +            printk("lp%d at 0x%04x, ", offset,base);
  880. +            request_region(base, size, "lp");
  881.              if (LP_IRQ(offset))
  882.                  printk("(irq = %d)\n", LP_IRQ(offset));
  883.              else
  884. @@ -559,6 +581,7 @@
  885.      return kmem_start;
  886.  #endif
  887.  }
  888. +    int base,size;
  889.  
  890.  #ifdef MODULE
  891.  void cleanup_module(void)
  892. diff -u --recursive --new-file v1.3.17/linux/drivers/char/serial.c linux/drivers/char/serial.c
  893. --- v1.3.17/linux/drivers/char/serial.c    Wed Aug  2 13:21:01 1995
  894. +++ linux/drivers/char/serial.c    Wed Aug  9 19:02:51 1995
  895. @@ -1785,21 +1785,37 @@
  896.      
  897.      multi->port_monitor = new_multi.port_monitor;
  898.      
  899. +    if (multi->port1)
  900. +        release_region(multi->port1,1);
  901.      multi->port1 = new_multi.port1;
  902.      multi->mask1 = new_multi.mask1;
  903.      multi->match1 = new_multi.match1;
  904. +    if (multi->port1)
  905. +        request_region(multi->port1,1,"serial(multiport1)");
  906.  
  907. +    if (multi->port2)
  908. +        release_region(multi->port2,1);
  909.      multi->port2 = new_multi.port2;
  910.      multi->mask2 = new_multi.mask2;
  911.      multi->match2 = new_multi.match2;
  912. +    if (multi->port2)
  913. +        request_region(multi->port2,1,"serial(multiport2)");
  914.  
  915. +    if (multi->port3)
  916. +        release_region(multi->port3,1);
  917.      multi->port3 = new_multi.port3;
  918.      multi->mask3 = new_multi.mask3;
  919.      multi->match3 = new_multi.match3;
  920. +    if (multi->port3)
  921. +        request_region(multi->port3,1,"serial(multiport3)");
  922.  
  923. +    if (multi->port4)
  924. +        release_region(multi->port4,1);
  925.      multi->port4 = new_multi.port4;
  926.      multi->mask4 = new_multi.mask4;
  927.      multi->match4 = new_multi.match4;
  928. +    if (multi->port4)
  929. +        request_region(multi->port4,1,"serial(multiport4)");
  930.  
  931.      now_multi = (multi->port1 != 0);
  932.      
  933. diff -u --recursive --new-file v1.3.17/linux/drivers/net/3c503.c linux/drivers/net/3c503.c
  934. --- v1.3.17/linux/drivers/net/3c503.c    Wed Aug  9 14:55:39 1995
  935. +++ linux/drivers/net/3c503.c    Fri Aug 11 09:26:58 1995
  936. @@ -473,7 +473,7 @@
  937.  static struct device el2pio_drv =
  938.  {"3c503pio", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el2_pio_probe };
  939.  
  940. -int io = 0;
  941. +int io = 0x300;
  942.  int irq = 0;
  943.  
  944.  static int no_pio = 1;
  945. @@ -484,6 +484,9 @@
  946.      el2_drv.irq       = irq;
  947.      el2pio_drv.base_addr = io;
  948.      el2pio_drv.irq       = irq;
  949. +
  950. +    if (io == 0)
  951. +      printk("3c503: You should not use auto-probing with insmod!\n");
  952.  
  953.      rc2 = 0;
  954.      no_pio = 1;
  955. diff -u --recursive --new-file v1.3.17/linux/drivers/net/3c505.c linux/drivers/net/3c505.c
  956. --- v1.3.17/linux/drivers/net/3c505.c    Wed Aug  9 14:55:39 1995
  957. +++ linux/drivers/net/3c505.c    Fri Aug 11 09:26:59 1995
  958. @@ -1462,11 +1462,13 @@
  959.  static struct device dev_3c505 = {
  960.      "        " /*"3c505"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, elplus_probe };
  961.  
  962. -int io = 0;
  963. +int io = 0x300;
  964.  int irq = 0;
  965.  
  966.  int init_module(void)
  967.  {
  968. +    if (io == 0)
  969. +      printk("3c505: You should not use auto-probing with insmod!\n");
  970.      dev_3c505.base_addr = io;
  971.      dev_3c505.irq       = irq;
  972.      if (register_netdev(&dev_3c505) != 0) {
  973. diff -u --recursive --new-file v1.3.17/linux/drivers/net/3c507.c linux/drivers/net/3c507.c
  974. --- v1.3.17/linux/drivers/net/3c507.c    Wed Aug  9 14:55:39 1995
  975. +++ linux/drivers/net/3c507.c    Fri Aug 11 09:26:59 1995
  976. @@ -888,11 +888,13 @@
  977.  static struct device dev_3c507 = {
  978.      "        " /*"3c507"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el16_probe };
  979.  
  980. -int io = 0;
  981. +int io = 0x300;
  982.  int irq = 0;
  983.  
  984.  int init_module(void)
  985.  {
  986. +    if (io == 0)
  987. +      printk("3c507: You should not use auto-probing with insmod!\n");
  988.      dev_3c507.base_addr = io;
  989.      dev_3c507.irq       = irq;
  990.      if (register_netdev(&dev_3c507) != 0) {
  991. diff -u --recursive --new-file v1.3.17/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
  992. --- v1.3.17/linux/drivers/net/3c509.c    Wed Aug  2 13:21:02 1995
  993. +++ linux/drivers/net/3c509.c    Fri Aug 11 09:26:59 1995
  994. @@ -171,6 +171,14 @@
  995.         ID_PORT.  We find cards past the first by setting the 'current_tag'
  996.         on cards as they are found.  Cards with their tag set will not
  997.         respond to subsequent ID sequences. */
  998. +
  999. +    if (check_region(ID_PORT,1)) {
  1000. +      static int once = 1;
  1001. +      if (once) printk("3c509: Somebody has reserved 0x%x, can't do ID_PORT lookup, nor card auto-probing\n",ID_PORT);
  1002. +      once = 0;
  1003. +      return -ENODEV;
  1004. +    }
  1005. +
  1006.      outb(0x00, ID_PORT);
  1007.      outb(0x00, ID_PORT);
  1008.      for(i = 0; i < 255; i++) {
  1009. @@ -698,9 +706,17 @@
  1010.  static struct device dev_3c509 = {
  1011.      "        " /*"3c509"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el3_probe };
  1012.  
  1013. +int io = 0;
  1014. +int irq = 0;
  1015. +
  1016.  int
  1017.  init_module(void)
  1018.  {
  1019. +    dev_3c509.base_addr = io;
  1020. +    dev_3c509.irq       = irq;
  1021. +    if (!EISA_bus) {
  1022. +        printk("3c509: WARNING! Module load-time probing works reliably only for EISA-bus!\n");
  1023. +    }
  1024.      if (register_netdev(&dev_3c509) != 0)
  1025.          return -EIO;
  1026.      return 0;
  1027. diff -u --recursive --new-file v1.3.17/linux/drivers/net/8390.c linux/drivers/net/8390.c
  1028. --- v1.3.17/linux/drivers/net/8390.c    Wed Aug  9 14:55:39 1995
  1029. +++ linux/drivers/net/8390.c    Fri Aug 11 09:26:59 1995
  1030. @@ -84,12 +84,12 @@
  1031.  #ifdef EI_DEBUG
  1032.  int ei_debug = EI_DEBUG;
  1033.  #else
  1034. -int ei_debug = 0;
  1035. +int ei_debug = 1;
  1036.  #endif
  1037. -#ifdef EI_NOPINGPONG
  1038. -static int ei_pingpong = 0;
  1039. -#else
  1040. +#ifdef EI_PINGPONG
  1041.  static int ei_pingpong = 1;
  1042. +#else
  1043. +static int ei_pingpong = 0;
  1044.  #endif
  1045.  
  1046.  /* Max number of packets received at one Intr.
  1047. diff -u --recursive --new-file v1.3.17/linux/drivers/net/README.arcnet linux/drivers/net/README.arcnet
  1048. --- v1.3.17/linux/drivers/net/README.arcnet    Thu Jul 13 16:20:20 1995
  1049. +++ linux/drivers/net/README.arcnet    Fri Aug 11 09:26:58 1995
  1050. @@ -145,10 +145,12 @@
  1051.  LAN Manager and Windows for Workgroups: These programs use protocols that
  1052.          are incompatible with the internet standard.  They try to pretend
  1053.          the cards are ethernet, and confuse everyone else on the network. 
  1054. -        However, v1.90 ALPHA and later of the Linux ARCnet driver support
  1055. -        this protocol via the 'arc0w' device.  After setting up arc0 as
  1056. -        usual, ifconfig and set up routes to your WfWg-protocol hosts
  1057. -        through arc0w.
  1058. +        However, v1.93 ALPHA and later of the Linux ARCnet driver support
  1059. +        this protocol via the 'arc0e' device.  After setting up arc0 as
  1060. +        usual, ifconfig and set up routes to your ethernet-encap hosts
  1061. +        through arc0e.  There may be non-Microsoft products that support
  1062. +        this protocol as well, so it was changed in 1.93 ALPHA from arc0w
  1063. +        to arc0e.
  1064.          
  1065.      Using the freeware Samba server and clients for Linux, you can now
  1066.      interface quite nicely with TCP/IP-based WfWg or Lan Manager
  1067. diff -u --recursive --new-file v1.3.17/linux/drivers/net/README.modules linux/drivers/net/README.modules
  1068. --- v1.3.17/linux/drivers/net/README.modules    Wed Aug  9 14:55:39 1995
  1069. +++ linux/drivers/net/README.modules    Fri Aug 11 09:26:59 1995
  1070. @@ -2,12 +2,34 @@
  1071.  
  1072.          Linux network driver modules
  1073.  
  1074. -    This is a potpourri of INSMOD-time(*) configuration
  1075. -    options (if exist) and their default values of various
  1076. -    modules on Linux network drivers collection.
  1077. -
  1078. -    Do NOT mistake this to "README.modules" at the top-level
  1079. -    directory!
  1080. +    Do not mistake this to "README.modules" at the top-level
  1081. +    directory!  That document tells about modules in general, while
  1082. +    this one tells only about network device driver modules.
  1083. +
  1084. +    This is a potpourri of INSMOD-time(*) configuration options
  1085. +    (if such exists) and their default values of various modules
  1086. +    on Linux network drivers collection.
  1087. +
  1088. +    Some modules have also hidden (= non-documented) tunable values.
  1089. +    Choice of not documenting them is based on general belief, that
  1090. +    the less user needs to know, the better.  (There are things that
  1091. +    driver developer can use, others should not confuse themselves.)
  1092. +
  1093. +    In many cases it is highly preferred that insmod:ing is done
  1094. +    ONLY with defining an explicite address for the card, AND BY
  1095. +    NOT USING AUTO-PROBING!
  1096. +
  1097. +    Now most cards have some explicitely defined base address, they
  1098. +    are compiled with (to avoid auto-probing, among other things).
  1099. +    If that compiled value does not match your actual configuration,
  1100. +    do use  "io=0xXXX" -parameter for the  insmod, and give there
  1101. +    a value matching your environment.
  1102. +
  1103. +    If you are adventureous, you can ask the driver to autoprobe
  1104. +    by using "io=0" parameter, however it is potentially dangerous
  1105. +    thing to do in a live system.  (If you don't know where the
  1106. +    card is located, you can try autoprobing, and after possible
  1107. +    crash recovery, insmod with proper IO-address..)
  1108.  
  1109.      --------------------------
  1110.      (*)    "INSMOD-time" means when you load module with
  1111. @@ -22,29 +44,29 @@
  1112.      (Probes ports:    0x280, 0x300)
  1113.  
  1114.  3c503.c:
  1115. -    io = 0
  1116. +    io = 0x300
  1117.      irq = 0
  1118.      (Probes ports: 0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2A0, 0x2E0)
  1119.  
  1120.  3c505.c:
  1121. -    io = 0
  1122. +    io = 0x300
  1123.      irq = 0
  1124.      (Probes ports: 0x300, 0x280, 0x310)
  1125.  
  1126.  3c507.c:
  1127. -    io = 0
  1128. +    io = 0x300
  1129.      irq = 0
  1130.      (Probes ports: 0x300, 0x320, 0x340, 0x280)
  1131.  
  1132.  3c509.c:
  1133. -    No parameters (autoprobes)
  1134. -    (EISA, and MCA probes in addition to ISA-probes;
  1135. -     ISA probing via PCMCIA AutoConfig (or similar)
  1136. -     via port 0x100.)
  1137. +    io = 0
  1138. +    irq = 0
  1139. +    ( Module load-time probing Works reliably only on EISA, ISA ID-PROBE
  1140. +      IS NOT RELIABLE!  Compile this driver statically into kernel for
  1141. +      now, if you need it auto-probing on an ISA-bus machine. )
  1142.  
  1143.  8390.c:
  1144. -    ei_debug = 0
  1145. -    ei_pingpong = 1      (If no Rx/Tx PINGPONG is desired, set to zero)
  1146. +    (No public options, several other modules need this one)
  1147.  
  1148.  ac3200.c:
  1149.      io = 0
  1150. @@ -60,6 +82,7 @@
  1151.      irqnum = 0
  1152.      shmem = 0
  1153.      num = 0
  1154. +    DO SET THESE MANUALLY AT INSMOD!
  1155.      (When probing, looks at the following possible addresses:
  1156.       Suggested ones:
  1157.          0x300, 0x2E0, 0x2F0, 0x2D0
  1158. @@ -70,7 +93,7 @@
  1159.          0x380, 0x390, 0x3A0,              0x3E0, 0x3F0  )
  1160.  
  1161.  at1700.c:
  1162. -    io = 0
  1163. +    io = 0x260
  1164.      irq = 0
  1165.      (Probes ports: 0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300)
  1166.  
  1167. @@ -107,17 +130,17 @@
  1168.      No options
  1169.  
  1170.  e2100.c:
  1171. -    io = 0
  1172. +    io = 0x300
  1173.      irq = 0
  1174.      (Probes ports: 0x300, 0x280, 0x380, 0x220)
  1175.  
  1176.  eepro.c:
  1177. -    io = 0
  1178. +    io = 0x200
  1179.      irq = 0
  1180.      (Probes ports: 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0x360)
  1181.  
  1182.  eexpress.c:
  1183. -    io = 0
  1184. +    io = 0x300
  1185.      irq = 0
  1186.      (Probes ports: 0x300, 0x270, 0x320, 0x340)
  1187.  
  1188. @@ -135,14 +158,13 @@
  1189.          0x300,        0x340, 0x360, 0x380, 0x3A0, 0x3C0)
  1190.  
  1191.  hp-plus.c:
  1192. -    io = 0
  1193. +    io = 0x200
  1194.      irq = 0
  1195.      (Probes ports: 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340)
  1196.  
  1197.  hp.c:
  1198. -    io = 0
  1199. +    io = 0x300
  1200.      irq = 0
  1201. -    ne8390_rw_bugfix = 0
  1202.      (Probes ports: 0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240)
  1203.  
  1204.  hp100.c:
  1205. @@ -152,7 +174,7 @@
  1206.       in increments of 0x020)
  1207.  
  1208.  ibmtr.c:
  1209. -    io = 0
  1210. +    io = 0xA20
  1211.      (Probes ports: 0xA20, 0xA24 -- Ok, 0x220, 0x224, but IBM style..)
  1212.  
  1213.  lance.c: *Not modularized*
  1214. @@ -162,10 +184,8 @@
  1215.  loopback.c: *Static kernel component*
  1216.  
  1217.  ne.c:
  1218. -    io = 0
  1219. +    io = 0x300
  1220.      irq = 0
  1221. -    config_ne_sanity = 0
  1222. -    ne8390_rw_bugfix = 0;
  1223.      (Probes ports: 0x300, 0x280, 0x320, 0x340, 0x360)
  1224.  
  1225.  net_init.c: *Static kernel component*
  1226. @@ -205,7 +225,7 @@
  1227.  
  1228.  
  1229.  smc-ultra.c:
  1230. -    io = 0
  1231. +    io = 0x200
  1232.      irq = 0
  1233.      (Probes ports:    0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380)
  1234.  
  1235. @@ -220,7 +240,7 @@
  1236.      irq = 0        (Not honoured, if changed..)
  1237.  
  1238.  wd.c:
  1239. -    io = 0
  1240. +    io = 0x300
  1241.      irq = 0
  1242.      mem = 0        (Force shared-memory on address 0xC8000, or whatever..)
  1243.      (Probes ports:    0x300, 0x280, 0x380, 0x240,
  1244. diff -u --recursive --new-file v1.3.17/linux/drivers/net/arcnet.c linux/drivers/net/arcnet.c
  1245. --- v1.3.17/linux/drivers/net/arcnet.c    Wed Aug  2 13:21:02 1995
  1246. +++ linux/drivers/net/arcnet.c    Fri Aug 11 09:57:37 1995
  1247. @@ -17,6 +17,12 @@
  1248.           
  1249.      **********************
  1250.      
  1251. +    v1.93 ALPHA (95/08/10)
  1252. +      - Should work with both 1.2.x and 1.3.x now. (I hope)
  1253. +      - Renamed arc0w ("Windows" protocol) to arc0e ("Ethernet-Encap")
  1254. +        because the protocol used isn't necessarily limited to
  1255. +        Microsoft.
  1256. +
  1257.      v1.92 ALPHA (95/07/11)
  1258.        - Fixes to make things work with kernel 1.3.x.  Completely broke
  1259.          1.2.x support.  Oops?  1.2.x users keep using 1.91 ALPHA until I
  1260. @@ -24,7 +30,7 @@
  1261.  
  1262.      v1.91 ALPHA (95/07/02)
  1263.        - Oops.  Exception packets hit us again!  I remembered to test
  1264. -        them in Windows-protocol mode, but due to the many various
  1265. +        them in ethernet-protocol mode, but due to the many various
  1266.          changes they broke in RFC1201 instead.  All fixed.
  1267.        - A long-standing bug with "exception" packets not setting
  1268.          protocol_id properly has been corrected.  This would have caused
  1269. @@ -52,8 +58,8 @@
  1270.          IRQ.
  1271.        - Initial support for "multiprotocol" ARCnet (this involved a LOT
  1272.          of reorganizing!).  Added an arc0w device, which allows us to
  1273. -        talk to "Windows" ARCnet TCP/IP protocol.  To use it, ifconfig
  1274. -        arc0 and arc0w (in that order).  For now, Windows-protocol
  1275. +        talk to ethernet-over-ARCnet TCP/IP protocol.  To use it, ifconfig
  1276. +        arc0 and arc0w (in that order).  For now, ethernet-protocol
  1277.          hosts should have routes through arc0w - eventually I hope to
  1278.          make things more automatic.
  1279.      v1.11 ALPHA (95/06/07)
  1280. @@ -102,6 +108,11 @@
  1281.             If someone sends me information, I'll try to implement it.
  1282.           - Remove excess lock variables that are probably not necessary
  1283.             anymore due to the changes in Linux 1.2.9.
  1284. +         - Dump Linux 1.2 and properly use the extended 1.3.x skb functions.
  1285. +         - Problems forwarding from arc0e to arc0 in 1.3.x? (it may be a
  1286. +           general kernel bug, though, since I heard other people complaining
  1287. +           about forwarding problems on ethernet cards)
  1288. +         - D_SKB doesn't work right on 1.3.x kernels.
  1289.  
  1290.             
  1291.      Sources:
  1292. @@ -120,8 +131,8 @@
  1293.  */
  1294.  
  1295.  static const char *version =
  1296. - "arcnet.c:v1.92 ALPHA 95/07/11 Avery Pennarun <apenwarr@foxnet.net>\n";
  1297. + "arcnet.c:v1.93 ALPHA 95/08/10 Avery Pennarun <apenwarr@foxnet.net>\n";
  1298. +
  1299.  /**************************************************************************/
  1300.  
  1301.  /* Define this if you want to detect network reconfigurations.
  1302. @@ -156,11 +167,19 @@
  1303.   
  1304.  
  1305.  #include <linux/config.h>
  1306. +#include <linux/version.h>
  1307. +
  1308.  #ifdef MODULE
  1309.  #include <linux/module.h>
  1310. -#include <linux/version.h>
  1311.  #endif /* MODULE */
  1312.  
  1313. +
  1314. +/* are we Linux 1.2.x? */
  1315. +#if LINUX_VERSION_CODE < 0x10300
  1316. +#define LINUX12
  1317. +#endif
  1318. +
  1319. +
  1320.  #include <linux/kernel.h>
  1321.  #include <linux/sched.h>
  1322.  #include <linux/types.h>
  1323. @@ -229,11 +248,11 @@
  1324.  
  1325.  /* Some useful multiprotocol macros */
  1326.  #define TBUSY lp->adev->tbusy \
  1327. -        =lp->wdev->tbusy
  1328. +        =lp->edev->tbusy
  1329.  #define IF_TBUSY (lp->adev->tbusy \
  1330. -        || lp->wdev->tbusy)
  1331. +        || lp->edev->tbusy)
  1332.  #define START lp->adev->start \
  1333. -        =lp->wdev->start
  1334. +        =lp->edev->start
  1335.  
  1336.  
  1337.  /* The number of low I/O ports used by the ethercard. */
  1338. @@ -416,7 +435,7 @@
  1339.      struct Outgoing outgoing; /* packet currently being sent */
  1340.      
  1341.      struct device *adev;    /* RFC1201 protocol device */
  1342. -    struct device *wdev;    /* Windows protocol device */
  1343. +    struct device *edev;    /* Ethernet-Encap device */
  1344.  };
  1345.  
  1346.  
  1347. @@ -426,7 +445,7 @@
  1348.  static int arcnet_memprobe(struct device *dev,u_char *addr);
  1349.  static int arcnet_ioprobe(struct device *dev, short ioaddr);
  1350.  #endif
  1351. -static int arcnetW_init(struct device *dev);
  1352. +static int arcnetE_init(struct device *dev);
  1353.  
  1354.  static int arcnet_open(struct device *dev);
  1355.  static int arcnet_close(struct device *dev);
  1356. @@ -438,7 +457,7 @@
  1357.          short length,char *data);
  1358.  static void arcnetA_go_tx(struct device *dev);
  1359.  
  1360. -static int arcnetW_send_packet(struct sk_buff *skb, struct device *dev);
  1361. +static int arcnetE_send_packet(struct sk_buff *skb, struct device *dev);
  1362.  
  1363.  static void arcnet_interrupt(int irq,struct pt_regs *regs);
  1364.  static void arcnet_inthandler(struct device *dev);
  1365. @@ -446,15 +465,21 @@
  1366.  static void arcnet_rx(struct device *dev,int recbuf);
  1367.  static void arcnetA_rx(struct device *dev,struct ClientData *arcsoft,
  1368.      int length,u_char saddr, u_char daddr);
  1369. -static void arcnetW_rx(struct device *dev,u_char *arcsoft,
  1370. +static void arcnetE_rx(struct device *dev,u_char *arcsoft,
  1371.      int length,u_char saddr, u_char daddr);
  1372.  
  1373.  static struct enet_statistics *arcnet_get_stats(struct device *dev);
  1374.  static void set_multicast_list(struct device *dev, int num_addrs, void *addrs);
  1375.  
  1376. -    /* annoying functions for header/arp/etc building */
  1377. -int arcnetA_header(struct sk_buff *skb,struct device *dev,unsigned short type,
  1378. -        void *daddr,void *saddr,unsigned len);
  1379. +    /* functions for header/arp/etc building */
  1380. +#ifdef LINUX12
  1381. +int arcnetA_header(unsigned char *buff,struct device *dev,
  1382. +        unsigned short type,void *daddr,void *saddr,unsigned len,
  1383. +        struct sk_buff *skb);
  1384. +#else
  1385. +int arcnetA_header(struct sk_buff *skb,struct device *dev,
  1386. +        unsigned short type,void *daddr,void *saddr,unsigned len);
  1387. +#endif
  1388.  int arcnetA_rebuild_header(void *eth,struct device *dev,unsigned long raddr,
  1389.          struct sk_buff *skb);
  1390.  unsigned short arcnetA_type_trans(struct sk_buff *skb,struct device *dev);
  1391. @@ -652,6 +677,10 @@
  1392.  
  1393.      dev->hard_header=arcnetA_header;
  1394.      dev->rebuild_header=arcnetA_rebuild_header;
  1395. +    
  1396. +    #ifdef LINUX12
  1397. +    dev->type_trans=arcnetA_type_trans;
  1398. +    #endif
  1399.  
  1400.      return 0;
  1401.  }
  1402. @@ -886,21 +915,21 @@
  1403.      return 0;
  1404.  }
  1405.  
  1406. -static int arcnetW_init(struct device *dev)
  1407. +static int arcnetE_init(struct device *dev)
  1408.  {
  1409.      struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
  1410.  
  1411. -    ether_setup(lp->wdev);
  1412. +    ether_setup(lp->edev);
  1413.      dev->dev_addr[0]=0;
  1414.      dev->dev_addr[5]=lp->arcnum;
  1415.      dev->mtu=493;    /* MTU is small because of missing packet splitting */
  1416. -    lp->wdev->open=NULL;
  1417. -    lp->wdev->stop=NULL;
  1418. -    lp->wdev->hard_start_xmit=arcnetW_send_packet;
  1419. +    lp->edev->open=NULL;
  1420. +    lp->edev->stop=NULL;
  1421. +    lp->edev->hard_start_xmit=arcnetE_send_packet;
  1422.  
  1423.      BUGLVL(D_EXTRA)
  1424. -        printk("%s: ARCnet \"Windows\" protocol initialized.\n",
  1425. -            lp->wdev->name);
  1426. +        printk("%s: ARCnet \"Ethernet-Encap\" protocol initialized.\n",
  1427. +            lp->edev->name);
  1428.              
  1429.      return 0;
  1430.  }
  1431. @@ -953,13 +982,13 @@
  1432.          printk("%s:  ARCnet RFC1201 protocol initialized.\n",
  1433.              lp->adev->name);
  1434.      
  1435. -    /* Initialize the Windows protocol driver */
  1436. -    lp->wdev=(struct device *)kmalloc(sizeof(struct device),GFP_KERNEL);
  1437. -    memcpy(lp->wdev,dev,sizeof(struct device));
  1438. -    lp->wdev->name=(char *)kmalloc(10,GFP_KERNEL);
  1439. -    sprintf(lp->wdev->name,"%sw",dev->name);
  1440. -    lp->wdev->init=arcnetW_init;
  1441. -    register_netdev(lp->wdev);
  1442. +    /* Initialize the ethernet-encap protocol driver */
  1443. +    lp->edev=(struct device *)kmalloc(sizeof(struct device),GFP_KERNEL);
  1444. +    memcpy(lp->edev,dev,sizeof(struct device));
  1445. +    lp->edev->name=(char *)kmalloc(10,GFP_KERNEL);
  1446. +    sprintf(lp->edev->name,"%se",dev->name);
  1447. +    lp->edev->init=arcnetE_init;
  1448. +    register_netdev(lp->edev);
  1449.  
  1450.      /* we're started */
  1451.      START=1;
  1452. @@ -992,13 +1021,13 @@
  1453.      /* do NOT free lp->adev!!  It's static! */
  1454.      lp->adev=NULL;
  1455.      
  1456. -    /* free the Windows protocol device */
  1457. -    lp->wdev->start=0;
  1458. -    lp->wdev->priv=NULL;
  1459. -    unregister_netdev(lp->wdev);
  1460. -    kfree(lp->wdev->name);
  1461. -    kfree(lp->wdev);
  1462. -    lp->wdev=NULL;
  1463. +    /* free the ethernet-encap protocol device */
  1464. +    lp->edev->start=0;
  1465. +    lp->edev->priv=NULL;
  1466. +    unregister_netdev(lp->edev);
  1467. +    kfree(lp->edev->name);
  1468. +    kfree(lp->edev);
  1469. +    lp->edev=NULL;
  1470.  
  1471.      /* Update the statistics here. */
  1472.      
  1473. @@ -1408,15 +1437,15 @@
  1474.  }
  1475.  
  1476.  
  1477. -/* Called by the kernel in order to transmit a "Windows" packet.
  1478. +/* Called by the kernel in order to transmit an ethernet-type packet.
  1479.   */
  1480.  static int
  1481. -arcnetW_send_packet(struct sk_buff *skb, struct device *dev)
  1482. +arcnetE_send_packet(struct sk_buff *skb, struct device *dev)
  1483.  {
  1484.      struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
  1485.      
  1486.      BUGLVL(D_DURING)
  1487. -        printk("%s: in arcnetW_send_packet (skb=%p)\n",dev->name,skb);
  1488. +        printk("%s: in arcnetE_send_packet (skb=%p)\n",dev->name,skb);
  1489.  
  1490.      if (IF_TBUSY)
  1491.      {
  1492. @@ -1457,8 +1486,8 @@
  1493.          
  1494.          if (length>XMTU)
  1495.          {
  1496. -            printk("arcnet: MTU for %s and %s must be <= 493 for Windows protocol.\n",
  1497. -                lp->adev->name,lp->wdev->name);
  1498. +            printk("arcnet: MTU for %s and %s must be <= 493 for ethernet encap.\n",
  1499. +                lp->adev->name,lp->edev->name);
  1500.              printk("arcnet: transmit aborted.\n");
  1501.  
  1502.              dev_kfree_skb(skb,FREE_WRITE);
  1503. @@ -1827,7 +1856,7 @@
  1504.              length,saddr,daddr);
  1505.          break;
  1506.      case ARC_P_MS_TCPIP:
  1507. -        arcnetW_rx(dev,arcsoft,length,saddr,daddr);
  1508. +        arcnetE_rx(dev,arcsoft,length,saddr,daddr);
  1509.          break;        
  1510.      default:
  1511.          printk("arcnet: received unknown protocol %d (%Xh)\n",
  1512. @@ -1853,6 +1882,11 @@
  1513.             }
  1514.  
  1515.  
  1516. +    /* clean out the page to make debugging make more sense :) */
  1517. +    BUGLVL(D_DURING)
  1518. +        memset((void *)arcpacket->raw,0x42,512);
  1519. +
  1520. +
  1521.      /* If any worth-while packets have been received, a mark_bh(NET_BH)
  1522.       * has been done by netif_rx and Linux will handle them after we
  1523.       * return.
  1524. @@ -1972,7 +2006,9 @@
  1525.                         printk("\n");
  1526.                  }
  1527.  
  1528. -        skb->protocol=arcnetA_type_trans(skb,dev);
  1529. +            #ifndef LINUX12
  1530. +            skb->protocol=arcnetA_type_trans(skb,dev);
  1531. +            #endif
  1532.  
  1533.               netif_rx(skb);
  1534.               lp->stats.rx_packets++;
  1535. @@ -2136,8 +2172,11 @@
  1536.                             printk("\n");
  1537.                      }
  1538.  
  1539. -            skb->protocol=arcnetA_type_trans(skb,dev);
  1540. -
  1541. +            
  1542. +                #ifndef LINUX12
  1543. +                skb->protocol=arcnetA_type_trans(skb,dev);
  1544. +                #endif
  1545. +                
  1546.                   netif_rx(skb);
  1547.                   lp->stats.rx_packets++;
  1548.              }
  1549. @@ -2145,17 +2184,17 @@
  1550.  }
  1551.  
  1552.  
  1553. -/* Packet receiver for non-standard Windows-style packets
  1554. +/* Packet receiver for non-standard ethernet-style packets
  1555.   */
  1556.  static void
  1557. -arcnetW_rx(struct device *dev,u_char *arcsoft,
  1558. +arcnetE_rx(struct device *dev,u_char *arcsoft,
  1559.      int length,u_char saddr, u_char daddr)
  1560.  {
  1561.      struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
  1562.      struct sk_buff *skb;
  1563.      
  1564.      BUGLVL(D_DURING)
  1565. -        printk("arcnet: it's a Windows packet (length=%d)\n",
  1566. +        printk("arcnet: it's an ethernet-encap packet (length=%d)\n",
  1567.              length);
  1568.  
  1569.             skb = alloc_skb(length, GFP_ATOMIC);
  1570. @@ -2166,7 +2205,7 @@
  1571.             }
  1572.             
  1573.             skb->len = length;
  1574. -           skb->dev = lp->wdev;
  1575. +           skb->dev = lp->edev;
  1576.             
  1577.             memcpy(skb->data,(u_char *)arcsoft+1,length-1);
  1578.  
  1579. @@ -2184,7 +2223,9 @@
  1580.                  printk("\n");
  1581.          }
  1582.          
  1583. -    skb->protocol=eth_type_trans(skb,dev);
  1584. +        #ifndef LINUX12
  1585. +        skb->protocol=eth_type_trans(skb,dev);
  1586. +        #endif
  1587.          
  1588.          netif_rx(skb);
  1589.          lp->stats.rx_packets++;
  1590. @@ -2235,11 +2276,21 @@
  1591.   * saddr=NULL    means use device source address (always will anyway)
  1592.   * daddr=NULL    means leave destination address (eg unresolved arp)
  1593.   */
  1594. -int arcnetA_header(struct sk_buff *skb,struct device *dev,unsigned short type,
  1595. -        void *daddr,void *saddr,unsigned len)
  1596. +#ifdef LINUX12
  1597. +int arcnetA_header(unsigned char *buff,struct device *dev,
  1598. +        unsigned short type,void *daddr,void *saddr,unsigned len,
  1599. +        struct sk_buff *skb)
  1600. +#else
  1601. +int arcnetA_header(struct sk_buff *skb,struct device *dev,
  1602. +        unsigned short type,void *daddr,void *saddr,unsigned len)
  1603. +#endif
  1604.  {
  1605.      struct ClientData *head = (struct ClientData *)
  1606. +#ifdef LINUX12
  1607. +        buff;
  1608. +#else
  1609.          skb_push(skb,dev->hard_header_len);
  1610. +#endif
  1611.  /*    struct arcnet_local *lp=(struct arcnet_local *)(dev->priv);*/
  1612.  
  1613.      /* set the protocol ID according to RFC-1201 */
  1614. @@ -2350,9 +2401,11 @@
  1615.      struct ClientData *head = (struct ClientData *) skb->data;
  1616.      struct arcnet_local *lp=(struct arcnet_local *) (dev->priv);
  1617.  
  1618. +#ifndef LINUX12
  1619.      /* Pull off the arcnet header. */
  1620.      skb->mac.raw=skb->data;
  1621.      skb_pull(skb,dev->hard_header_len);
  1622. +#endif
  1623.      
  1624.      if (head->daddr==0)
  1625.          skb->pkt_type=PACKET_BROADCAST;
  1626. @@ -2409,6 +2462,9 @@
  1627.  int
  1628.  init_module(void)
  1629.  {
  1630. +    if (io == 0)
  1631. +      printk("arcnet: You should not use auto-probing with insmod!\n");
  1632. +
  1633.      sprintf(thiscard.name,"arc%d",num);
  1634.  
  1635.      thiscard.base_addr=io;
  1636. diff -u --recursive --new-file v1.3.17/linux/drivers/net/at1700.c linux/drivers/net/at1700.c
  1637. --- v1.3.17/linux/drivers/net/at1700.c    Wed Aug  9 14:55:40 1995
  1638. +++ linux/drivers/net/at1700.c    Fri Aug 11 09:27:01 1995
  1639. @@ -57,8 +57,6 @@
  1640.  #include <linux/netdevice.h>
  1641.  #include <linux/etherdevice.h>
  1642.  #include <linux/skbuff.h>
  1643. -extern struct device *init_etherdev(struct device *dev, int sizeof_private,
  1644. -                                    unsigned long *mem_startp);
  1645.  
  1646.  /* This unusual address order is used to verify the CONFIG register. */
  1647.  static int at1700_probe_list[] =
  1648. @@ -634,11 +632,13 @@
  1649.  static struct device dev_at1700 = {
  1650.      "        " /*"at1700"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, at1700_probe };
  1651.  
  1652. -int io = 0;
  1653. +int io = 0x260;
  1654.  int irq = 0;
  1655.  
  1656.  int init_module(void)
  1657.  {
  1658. +    if (io == 0)
  1659. +      printk("at1700: You should not use auto-probing with insmod!\n");
  1660.      dev_at1700.base_addr = io;
  1661.      dev_at1700.irq       = irq;
  1662.      if (register_netdev(&dev_at1700) != 0) {
  1663. diff -u --recursive --new-file v1.3.17/linux/drivers/net/depca.c linux/drivers/net/depca.c
  1664. --- v1.3.17/linux/drivers/net/depca.c    Wed Aug  2 13:21:03 1995
  1665. +++ linux/drivers/net/depca.c    Fri Aug 11 09:26:59 1995
  1666. @@ -1829,6 +1829,8 @@
  1667.  int
  1668.  init_module(void)
  1669.  {
  1670. +  if (io == 0)
  1671. +    printk("depca: You should not use auto-probing with insmod!\n");
  1672.    thisDepca.irq=irq;
  1673.    thisDepca.base_addr=io;
  1674.    if (register_netdev(&thisDepca) != 0)
  1675. diff -u --recursive --new-file v1.3.17/linux/drivers/net/e2100.c linux/drivers/net/e2100.c
  1676. --- v1.3.17/linux/drivers/net/e2100.c    Wed Aug  9 14:55:40 1995
  1677. +++ linux/drivers/net/e2100.c    Fri Aug 11 09:26:59 1995
  1678. @@ -359,11 +359,13 @@
  1679.  static struct device dev_e2100 = {
  1680.      "        " /*"e2100"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, e2100_probe };
  1681.  
  1682. -int io = 0;
  1683. +int io = 0x300;
  1684.  int irq = 0;
  1685.  
  1686.  int init_module(void)
  1687.  {
  1688. +    if (io == 0)
  1689. +      printk("e2100: You should not use auto-probing with insmod!\n");
  1690.      dev_e2100.base_addr = io;
  1691.      dev_e2100.irq       = irq;
  1692.      if (register_netdev(&dev_e2100) != 0) {
  1693. diff -u --recursive --new-file v1.3.17/linux/drivers/net/eepro.c linux/drivers/net/eepro.c
  1694. --- v1.3.17/linux/drivers/net/eepro.c    Wed Aug  9 14:55:40 1995
  1695. +++ linux/drivers/net/eepro.c    Fri Aug 11 09:27:01 1995
  1696. @@ -103,8 +103,7 @@
  1697.  #include <linux/netdevice.h>
  1698.  #include <linux/etherdevice.h>
  1699.  #include <linux/skbuff.h>
  1700. -extern struct device *init_etherdev(struct device *dev, int sizeof_private,
  1701. -                        unsigned long *mem_startp);
  1702. +
  1703.  
  1704.  /* First, a few definitions that the brave might change. */
  1705.  /* A zero-terminated list of I/O addresses to be probed. */
  1706. @@ -1137,12 +1136,14 @@
  1707.  static struct device dev_eepro = {
  1708.      "        " /*"eepro"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, eepro_probe };
  1709.  
  1710. -int io = 0;
  1711. +int io = 0x200;
  1712.  int irq = 0;
  1713.  
  1714.  int
  1715.  init_module(void)
  1716.  {
  1717. +    if (io == 0)
  1718. +      printk("eepro: You should not use auto-probing with insmod!\n");
  1719.      dev_eepro.base_addr = io;
  1720.      dev_eepro.irq       = irq;
  1721.  
  1722. diff -u --recursive --new-file v1.3.17/linux/drivers/net/eexpress.c linux/drivers/net/eexpress.c
  1723. --- v1.3.17/linux/drivers/net/eexpress.c    Wed Aug  2 13:21:03 1995
  1724. +++ linux/drivers/net/eexpress.c    Fri Aug 11 09:27:00 1995
  1725. @@ -1006,12 +1006,14 @@
  1726.      "        " /*"eexpress"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, express_probe };
  1727.      
  1728.  
  1729. -int irq=0;
  1730. +int irq=0x300;
  1731.  int io=0;    
  1732.  
  1733.  int
  1734.  init_module(void)
  1735.  {
  1736. +    if (io == 0)
  1737. +      printk("eexpress: You should not use auto-probing with insmod!\n");
  1738.      dev_eexpress.base_addr=io;
  1739.      dev_eexpress.irq=irq;
  1740.      if (register_netdev(&dev_eexpress) != 0)
  1741. diff -u --recursive --new-file v1.3.17/linux/drivers/net/hp-plus.c linux/drivers/net/hp-plus.c
  1742. --- v1.3.17/linux/drivers/net/hp-plus.c    Wed Aug  9 14:55:40 1995
  1743. +++ linux/drivers/net/hp-plus.c    Fri Aug 11 09:27:01 1995
  1744. @@ -39,8 +39,6 @@
  1745.  
  1746.  
  1747.  #include "8390.h"
  1748. -extern struct device *init_etherdev(struct device *dev, int sizeof_private,
  1749. -                                    unsigned long *mem_startp);
  1750.  
  1751.  /* A zero-terminated list of I/O addresses to be probed. */
  1752.  static unsigned int hpplus_portlist[] =
  1753. @@ -372,11 +370,13 @@
  1754.  static struct device dev_hp = {
  1755.      "        " /*"hp"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, hp_plus_probe };
  1756.  
  1757. -int io = 0;
  1758. +int io = 0x200;
  1759.  int irq = 0;
  1760.  
  1761.  int init_module(void)
  1762.  {
  1763. +    if (io == 0)
  1764. +      printk("HP-plus: You should not use auto-probing with insmod!\n");
  1765.      dev_hp.base_addr = io;
  1766.      dev_hp.irq       = irq;
  1767.      if (register_netdev(&dev_hp) != 0) {
  1768. diff -u --recursive --new-file v1.3.17/linux/drivers/net/hp.c linux/drivers/net/hp.c
  1769. --- v1.3.17/linux/drivers/net/hp.c    Wed Aug  9 14:55:40 1995
  1770. +++ linux/drivers/net/hp.c    Fri Aug 11 09:27:00 1995
  1771. @@ -72,9 +72,6 @@
  1772.  /* My default is IRQ5       0  1     2  3  4  5  6    7  8  9 10 11 */
  1773.  static char irqmap[16] = { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};
  1774.  
  1775. -/* NE2000, et.al. bug-fix code */
  1776. -static int ne8390_rw_bugfix = 0;
  1777. -
  1778.  
  1779.  /*    Probe for an HP LAN adaptor.
  1780.      Also initialize the card and fill in STATION_ADDR with the station
  1781. @@ -275,19 +272,19 @@
  1782.      /* We should already be in page 0, but to be safe... */
  1783.      outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base);
  1784.  
  1785. -    if (ne8390_rw_bugfix) {
  1786. -        /* Handle the read-before-write bug the same way as the
  1787. -           Crynwr packet driver -- the NatSemi method doesn't work. */
  1788. -        outb_p(0x42, nic_base + EN0_RCNTLO);
  1789. -        outb_p(0,    nic_base + EN0_RCNTHI);
  1790. -        outb_p(0xff, nic_base + EN0_RSARLO);
  1791. -        outb_p(0x00, nic_base + EN0_RSARHI);
  1792. +#ifdef NE8390_RW_BUGFIX
  1793. +    /* Handle the read-before-write bug the same way as the
  1794. +       Crynwr packet driver -- the NatSemi method doesn't work. */
  1795. +    outb_p(0x42, nic_base + EN0_RCNTLO);
  1796. +    outb_p(0,    nic_base + EN0_RCNTHI);
  1797. +    outb_p(0xff, nic_base + EN0_RSARLO);
  1798. +    outb_p(0x00, nic_base + EN0_RSARHI);
  1799.  #define NE_CMD         0x00
  1800. -        outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
  1801. -        /* Make certain that the dummy read has occurred. */
  1802. -        inb_p(0x61);
  1803. -        inb_p(0x61);
  1804. -    }
  1805. +    outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
  1806. +    /* Make certain that the dummy read has occurred. */
  1807. +    inb_p(0x61);
  1808. +    inb_p(0x61);
  1809. +#endif
  1810.  
  1811.      outb_p(count & 0xff, nic_base + EN0_RCNTLO);
  1812.      outb_p(count >> 8,     nic_base + EN0_RCNTHI);
  1813. @@ -333,11 +330,13 @@
  1814.  static struct device dev_hp = {
  1815.      "        " /*"hp"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, hp_probe };
  1816.  
  1817. -int io = 0;
  1818. +int io = 300;
  1819.  int irq = 0;
  1820.  
  1821.  int init_module(void)
  1822.  {
  1823. +    if (io == 0)
  1824. +      printk("hp: You should not use auto-probing with insmod!\n");
  1825.      dev_hp.base_addr = io;
  1826.      dev_hp.irq       = irq;
  1827.      if (register_netdev(&dev_hp) != 0) {
  1828. diff -u --recursive --new-file v1.3.17/linux/drivers/net/hp100.c linux/drivers/net/hp100.c
  1829. --- v1.3.17/linux/drivers/net/hp100.c    Tue Aug  8 12:31:36 1995
  1830. +++ linux/drivers/net/hp100.c    Fri Aug 11 09:27:00 1995
  1831. @@ -1135,6 +1135,8 @@
  1832.  
  1833.  int init_module( void )
  1834.  {
  1835. +  if (hp100_port == 0 && !EISA_bus)
  1836. +    printk("HP100: You should not use auto-probing with insmod!\n");
  1837.    if ( hp100_port > 0 )
  1838.      dev_hp100.base_addr = hp100_port;
  1839.    if ( register_netdev( &dev_hp100 ) != 0 )
  1840. diff -u --recursive --new-file v1.3.17/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c
  1841. --- v1.3.17/linux/drivers/net/ibmtr.c    Wed Aug  9 14:55:40 1995
  1842. +++ linux/drivers/net/ibmtr.c    Fri Aug 11 09:27:00 1995
  1843. @@ -1201,10 +1201,12 @@
  1844.  static struct device dev_ibmtr = {
  1845.      "        " /*"ibmtr"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, tok_probe };
  1846.  
  1847. -int io = 0;
  1848. +int io = 0xa20;
  1849.  
  1850.  int init_module(void)
  1851.  {
  1852. +    if (io == 0)
  1853. +      printk("ibmtr: You should not use auto-probing with insmod!\n");
  1854.      dev_ibmtr.base_addr = io;
  1855.      dev_ibmtr.irq       = 0;
  1856.      if (register_netdev(&dev_ibmtr) != 0) {
  1857. diff -u --recursive --new-file v1.3.17/linux/drivers/net/ne.c linux/drivers/net/ne.c
  1858. --- v1.3.17/linux/drivers/net/ne.c    Wed Aug  9 14:55:41 1995
  1859. +++ linux/drivers/net/ne.c    Fri Aug 11 09:27:00 1995
  1860. @@ -51,19 +51,9 @@
  1861.  
  1862.  /* Do we perform extra sanity checks on stuff ? */
  1863.  /* #define CONFIG_NE_SANITY */
  1864. -#ifdef CONFIG_NE_SANITY
  1865. -static int config_ne_sanity = 1;
  1866. -#else
  1867. -static int config_ne_sanity = 0;
  1868. -#endif
  1869.  
  1870.  /* Do we implement the read before write bugfix ? */
  1871.  /* #define CONFIG_NE_RW_BUGFIX */
  1872. -#ifdef CONFIG_NE_RW_BUGFIX
  1873. -static int ne8390_rw_bugfix = 1;
  1874. -#else
  1875. -static int ne8390_rw_bugfix = 0;
  1876. -#endif
  1877.  
  1878.  /* ---- No user-serviceable parts below ---- */
  1879.  
  1880. @@ -388,8 +378,9 @@
  1881.  ne_block_input(struct device *dev, int count, char *buf, int ring_offset)
  1882.  {
  1883.      int nic_base = dev->base_addr;
  1884. -    /* CONFIG_NE_SANITY */
  1885. +#ifdef CONFIG_NE_SANITY
  1886.      int xfer_count = count;
  1887. +#endif
  1888.  
  1889.      /* This *shouldn't* happen. If it does, it's the last thing you'll see */
  1890.      if (ei_status.dmaing) {
  1891. @@ -411,19 +402,20 @@
  1892.        insw(NE_BASE + NE_DATAPORT,buf,count>>1);
  1893.        if (count & 0x01) {
  1894.      buf[count-1] = inb(NE_BASE + NE_DATAPORT);
  1895. -    /* CONFIG_NE_SANITY */
  1896. +#ifdef CONFIG_NE_SANITY
  1897.      xfer_count++;
  1898. +#endif
  1899.        }
  1900.      } else {
  1901.      insb(NE_BASE + NE_DATAPORT, buf, count);
  1902.      }
  1903.  
  1904. +#ifdef CONFIG_NE_SANITY
  1905.      /* This was for the ALPHA version only, but enough people have
  1906.         been encountering problems so it is still here.  If you see
  1907.         this message you either 1) have a slightly incompatible clone
  1908.         or 2) have noise/speed problems with your bus. */
  1909. -    if (config_ne_sanity &&
  1910. -    ei_debug > 1) {        /* DMA termination address check... */
  1911. +    if (ei_debug > 1) {        /* DMA termination address check... */
  1912.      int addr, tries = 20;
  1913.      do {
  1914.          /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
  1915. @@ -439,6 +431,7 @@
  1916.             "%#4.4x (expected) vs. %#4.4x (actual).\n",
  1917.             dev->name, ring_offset + xfer_count, addr);
  1918.      }
  1919. +#endif
  1920.      outb_p(ENISR_RDC, nic_base + EN0_ISR);    /* Ack intr. */
  1921.      ei_status.dmaing &= ~0x01;
  1922.      return ring_offset + count;
  1923. @@ -450,8 +443,9 @@
  1924.  {
  1925.      int nic_base = NE_BASE;
  1926.      unsigned long dma_start;
  1927. -    /* CONFIG_NE_SANITY */
  1928. +#ifdef CONFIG_NE_SANITY
  1929.      int retries = 0;
  1930. +#endif
  1931.  
  1932.      /* Round the count up for word writes.  Do we need to do this?
  1933.         What effect will an odd byte count have on the 8390?
  1934. @@ -472,23 +466,25 @@
  1935.      /* We should already be in page 0, but to be safe... */
  1936.      outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD);
  1937.  
  1938. +#ifdef CONFIG_NE_SANITY
  1939.   retry:
  1940. +#endif
  1941.  
  1942. -    if (ne8390_rw_bugfix) { 
  1943. -    /* Handle the read-before-write bug the same way as the
  1944. -       Crynwr packet driver -- the NatSemi method doesn't work.
  1945. -       Actually this doesn't always work either, but if you have
  1946. -       problems with your NEx000 this is better than nothing! */
  1947. -    outb_p(0x42, nic_base + EN0_RCNTLO);
  1948. -    outb_p(0x00,   nic_base + EN0_RCNTHI);
  1949. -    outb_p(0x42, nic_base + EN0_RSARLO);
  1950. -    outb_p(0x00, nic_base + EN0_RSARHI);
  1951. -    outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
  1952. -    /* Make certain that the dummy read has occurred. */
  1953. -    SLOW_DOWN_IO;
  1954. -    SLOW_DOWN_IO;
  1955. -    SLOW_DOWN_IO;
  1956. -    }
  1957. +#ifdef NE8390_RW_BUGFIX
  1958. +    /* Handle the read-before-write bug the same way as the
  1959. +       Crynwr packet driver -- the NatSemi method doesn't work.
  1960. +       Actually this doesn't always work either, but if you have
  1961. +       problems with your NEx000 this is better than nothing! */
  1962. +    outb_p(0x42, nic_base + EN0_RCNTLO);
  1963. +    outb_p(0x00,   nic_base + EN0_RCNTHI);
  1964. +    outb_p(0x42, nic_base + EN0_RSARLO);
  1965. +    outb_p(0x00, nic_base + EN0_RSARHI);
  1966. +    outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
  1967. +    /* Make certain that the dummy read has occurred. */
  1968. +    SLOW_DOWN_IO;
  1969. +    SLOW_DOWN_IO;
  1970. +    SLOW_DOWN_IO;
  1971. +#endif
  1972.  
  1973.      outb_p(ENISR_RDC, nic_base + EN0_ISR);
  1974.  
  1975. @@ -507,10 +503,10 @@
  1976.  
  1977.      dma_start = jiffies;
  1978.  
  1979. +#ifdef CONFIG_NE_SANITY
  1980.      /* This was for the ALPHA version only, but enough people have
  1981.         been encountering problems so it is still here. */
  1982. -    if (config_ne_sanity &&
  1983. -    ei_debug > 1) {        /* DMA termination address check... */
  1984. +    if (ei_debug > 1) {        /* DMA termination address check... */
  1985.      int addr, tries = 20;
  1986.      do {
  1987.          int high = inb_p(nic_base + EN0_RSARHI);
  1988. @@ -527,6 +523,7 @@
  1989.          goto retry;
  1990.      }
  1991.      }
  1992. +#endif
  1993.  
  1994.      while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
  1995.      if (jiffies - dma_start > 2*HZ/100) {        /* 20ms */
  1996. @@ -546,11 +543,13 @@
  1997.  static struct device dev_ne2000 = {
  1998.      "        " /*"ne2000"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, ne_probe };
  1999.  
  2000. -int io = 0;
  2001. +int io = 0x300;
  2002.  int irq = 0;
  2003.  
  2004.  int init_module(void)
  2005.  {
  2006. +    if (io == 0)
  2007. +        printk("ne: You should not use auto-probing with insmod!\n");
  2008.      dev_ne2000.base_addr = io;
  2009.      dev_ne2000.irq       = irq;
  2010.      if (register_netdev(&dev_ne2000) != 0)
  2011. diff -u --recursive --new-file v1.3.17/linux/drivers/net/net_init.c linux/drivers/net/net_init.c
  2012. --- v1.3.17/linux/drivers/net/net_init.c    Tue Aug  8 12:31:36 1995
  2013. +++ linux/drivers/net/net_init.c    Fri Aug 11 13:14:43 1995
  2014. @@ -312,8 +312,6 @@
  2015.      save_flags(flags);
  2016.      cli();
  2017.  
  2018. -    printk("unregister_netdev: device ");
  2019. -
  2020.      if (dev == NULL) 
  2021.      {
  2022.          printk("was NULL\n");
  2023. @@ -333,11 +331,10 @@
  2024.          if (d && (d->next == dev)) 
  2025.          {
  2026.              d->next = dev->next;
  2027. -            printk("'%s' unlinked\n", dev->name);
  2028.          }
  2029.          else 
  2030.          {
  2031. -            printk("'%s' not found\n", dev->name);
  2032. +            printk("unregister_netdev: '%s' not found\n", dev->name);
  2033.              restore_flags(flags);
  2034.              return;
  2035.          }
  2036. diff -u --recursive --new-file v1.3.17/linux/drivers/net/plip.c linux/drivers/net/plip.c
  2037. --- v1.3.17/linux/drivers/net/plip.c    Wed Aug  9 14:55:41 1995
  2038. +++ linux/drivers/net/plip.c    Wed Aug  9 19:02:51 1995
  2039. @@ -207,7 +207,7 @@
  2040.      struct net_local *nl;
  2041.  
  2042.      /* Check region before the probe */
  2043. -    if (check_region(PAR_DATA(dev), 3) < 0)
  2044. +    if (check_region(PAR_DATA(dev), (PAR_DATA(dev) == 0x3bc)? 4 : 8) < 0)
  2045.          return -ENODEV;
  2046.  
  2047.      /* Check that there is something at base_addr. */
  2048. @@ -244,7 +244,7 @@
  2049.                     " Please set IRQ by ifconfig.\n", irq);
  2050.      }
  2051.  
  2052. -    request_region(PAR_DATA(dev), 3, dev->name);
  2053. +    request_region(PAR_DATA(dev), (PAR_DATA(dev) == 0x3bc)? 4 : 8, dev->name);
  2054.  
  2055.      /* Fill in the generic fields of the device structure. */
  2056.      ether_setup(dev);
  2057. @@ -1082,19 +1082,19 @@
  2058.  {
  2059.      if (dev_plip0.priv) {
  2060.          unregister_netdev(&dev_plip0);
  2061. -        release_region(PAR_DATA(&dev_plip0), 3);
  2062. +        release_region(PAR_DATA(&dev_plip0), (PAR_DATA(&dev_plip0) == 0x3bc)? 4 : 8);
  2063.          kfree_s(dev_plip0.priv, sizeof(struct net_local));
  2064.          dev_plip0.priv = NULL;
  2065.      }
  2066.      if (dev_plip1.priv) {
  2067.          unregister_netdev(&dev_plip1);
  2068. -        release_region(PAR_DATA(&dev_plip1), 3);
  2069. +        release_region(PAR_DATA(&dev_plip1), (PAR_DATA(&dev_plip1) == 0x3bc)? 4 : 8);
  2070.          kfree_s(dev_plip1.priv, sizeof(struct net_local));
  2071.          dev_plip1.priv = NULL;
  2072.      }
  2073.      if (dev_plip2.priv) {
  2074.          unregister_netdev(&dev_plip2);
  2075. -        release_region(PAR_DATA(&dev_plip2), 3);
  2076. +        release_region(PAR_DATA(&dev_plip2), (PAR_DATA(&dev_plip2) == 0x3bc)? 4 : 8);
  2077.          kfree_s(dev_plip2.priv, sizeof(struct net_local));
  2078.          dev_plip2.priv = NULL;
  2079.      }
  2080. diff -u --recursive --new-file v1.3.17/linux/drivers/net/slip.c linux/drivers/net/slip.c
  2081. --- v1.3.17/linux/drivers/net/slip.c    Wed Aug  9 14:55:41 1995
  2082. +++ linux/drivers/net/slip.c    Fri Aug 11 13:14:43 1995
  2083. @@ -1175,8 +1175,8 @@
  2084.       *  now needs to be unregistered.
  2085.       */
  2086.  #ifndef MODULE
  2087. -    printk("SLIP: Unregistering bootstrap device "
  2088. -           "'slip_proto' - slip OK\n");
  2089. +/*    printk("SLIP: Unregistering bootstrap device "
  2090. +           "'slip_proto' - slip OK\n");*/
  2091.      unregister_netdev(dummy);
  2092.  #endif
  2093.      return status;
  2094. diff -u --recursive --new-file v1.3.17/linux/drivers/net/smc-ultra.c linux/drivers/net/smc-ultra.c
  2095. --- v1.3.17/linux/drivers/net/smc-ultra.c    Wed Aug  9 14:55:41 1995
  2096. +++ linux/drivers/net/smc-ultra.c    Fri Aug 11 09:27:00 1995
  2097. @@ -328,11 +328,13 @@
  2098.  static struct device dev_ultra = {
  2099.      "        " /*"smc-ultra"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, ultra_probe };
  2100.  
  2101. -int io = 0;
  2102. +int io = 0x200;
  2103.  int irq = 0;
  2104.  
  2105.  int init_module(void)
  2106.  {
  2107. +    if (io == 0)
  2108. +      printk("smc-ultra: You should not use auto-probing with insmod!\n");
  2109.      dev_ultra.base_addr = io;
  2110.      dev_ultra.irq       = irq;
  2111.      if (register_netdev(&dev_ultra) != 0) {
  2112. diff -u --recursive --new-file v1.3.17/linux/drivers/net/tulip.c linux/drivers/net/tulip.c
  2113. --- v1.3.17/linux/drivers/net/tulip.c    Wed Aug  9 14:55:41 1995
  2114. +++ linux/drivers/net/tulip.c    Fri Aug 11 09:27:01 1995
  2115. @@ -14,7 +14,7 @@
  2116.         Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
  2117.  */
  2118.  
  2119. -static char *version = "tulip.c:v0.05 1/20/95 becker@cesdis.gsfc.nasa.gov\n";
  2120. +static const char *version = "tulip.c:v0.05 1/20/95 becker@cesdis.gsfc.nasa.gov\n";
  2121.  
  2122.  #ifdef MODULE
  2123.  #include <linux/module.h>
  2124. @@ -40,10 +40,6 @@
  2125.  #include <linux/etherdevice.h>
  2126.  #include <linux/skbuff.h>
  2127.  
  2128. -/* This will be in linux/etherdevice.h someday. */
  2129. -struct device *init_etherdev(struct device *dev, int sizeof_private,
  2130. -                             unsigned long *mem_startp);
  2131. -
  2132.  /* The total size is unusually large: The 21040 aligns each of its 16
  2133.     longword-wide registers on a quadword boundary. */
  2134.  #define TULIP_TOTAL_SIZE 0x80
  2135. @@ -757,6 +753,11 @@
  2136.  
  2137.  int init_module(void)
  2138.  {
  2139. +    printk("tulip: Sorry, modularization is not completed\n");
  2140. +    return -EIO;
  2141. +#if 0
  2142. +    if (io == 0)
  2143. +      printk("tulip: You should not use auto-probing with insmod!\n");
  2144.      dev_tulip.base_addr = io;
  2145.      dev_tulip.irq       = irq;
  2146.      if (register_netdev(&dev_tulip) != 0) {
  2147. @@ -764,6 +765,7 @@
  2148.          return -EIO;
  2149.      }
  2150.      return 0;
  2151. +#endif
  2152.  }
  2153.  
  2154.  void
  2155. diff -u --recursive --new-file v1.3.17/linux/drivers/net/wavelan.c linux/drivers/net/wavelan.c
  2156. --- v1.3.17/linux/drivers/net/wavelan.c    Wed Aug  9 14:55:41 1995
  2157. +++ linux/drivers/net/wavelan.c    Fri Aug 11 19:03:17 1995
  2158. @@ -839,8 +839,8 @@
  2159.              if (wavelan_debug > 0)
  2160.                  printk("%s: <-wavelan_probe(): 0\n", dev->name);
  2161.              proc_net_register(&(struct proc_dir_entry)
  2162. -                      { PROC_NET_WAVELAN, wavelan_get_info,
  2163. -                          7, "wavelan" });
  2164. +                      { PROC_NET_WAVELAN, 7, "wavelan",
  2165. +                        wavelan_get_info });
  2166.  
  2167.              return 0;
  2168.          }
  2169. diff -u --recursive --new-file v1.3.17/linux/drivers/net/wd.c linux/drivers/net/wd.c
  2170. --- v1.3.17/linux/drivers/net/wd.c    Wed Aug  9 14:55:41 1995
  2171. +++ linux/drivers/net/wd.c    Fri Aug 11 09:27:01 1995
  2172. @@ -400,12 +400,14 @@
  2173.  static struct device dev_wd80x3 = {
  2174.      "        " /*"wd80x3"*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, wd_probe };
  2175.  
  2176. -int io = 0;
  2177. +int io = 0x300;
  2178.  int irq = 0;
  2179.  int mem = 0;
  2180.  
  2181.  int init_module(void)
  2182.  {
  2183. +    if (io == 0)
  2184. +      printk("wd: You should not use auto-probing with insmod!\n");
  2185.      dev_wd80x3.base_addr = io;
  2186.      dev_wd80x3.irq       = irq;
  2187.      dev_wd80x3.mem_start = mem;
  2188. @@ -421,6 +423,11 @@
  2189.          printk("wd80x3: device busy, remove delayed\n");
  2190.      else
  2191.      {
  2192. +        int ioaddr = dev_wd80x3.base_addr - WD_NIC_OFFSET;
  2193. +
  2194. +        free_irq(dev_wd80x3.irq);
  2195. +        release_region(ioaddr, WD_IO_EXTENT);
  2196. +
  2197.          unregister_netdev(&dev_wd80x3);
  2198.      }
  2199.  }
  2200. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/.version linux/drivers/sound/.version
  2201. --- v1.3.17/linux/drivers/sound/.version    Tue Jul 11 10:02:51 1995
  2202. +++ linux/drivers/sound/.version    Sat Aug 12 21:56:08 1995
  2203. @@ -1 +1 @@
  2204. -3.0
  2205. +3.0.1
  2206. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/CHANGELOG linux/drivers/sound/CHANGELOG
  2207. --- v1.3.17/linux/drivers/sound/CHANGELOG    Tue Jul 11 10:02:51 1995
  2208. +++ linux/drivers/sound/CHANGELOG    Sat Aug 12 21:55:01 1995
  2209. @@ -1,5 +1,14 @@
  2210. -Changelog for version 3.0
  2211. --------------------------
  2212. +Changelog for version 3.0.1
  2213. +---------------------------
  2214. +
  2215. +Since 3.0
  2216. +- Some important bug fixes. 
  2217. +- select() for /dev/dsp and /dev/audio (Linux only).
  2218. +(To use select() with read, you have to call read() to start
  2219. +the recording. Calling write() kills recording immediately so
  2220. +use select() carefully when you are writing a half duplex app.
  2221. +Full duplex mode is not implemented yet.) Select works also with
  2222. +/dev/sequencer and /dev/music. Maybe with /dev/midi## too.
  2223.  
  2224.  Since 3.0-beta2
  2225.  - Minor fixes.
  2226. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/Readme linux/drivers/sound/Readme
  2227. --- v1.3.17/linux/drivers/sound/Readme    Tue Jul 11 10:02:51 1995
  2228. +++ linux/drivers/sound/Readme    Sat Aug 12 21:58:06 1995
  2229. @@ -7,22 +7,13 @@
  2230.  * about configuring various cards.                *
  2231.  *****************************************************************
  2232.  
  2233. -VoxWare v3.0 release notes
  2234. ---------------------------
  2235. +VoxWare v3.0.1 release notes
  2236. +----------------------------
  2237.  
  2238.  This version is the final v3.0. All features I have planned to
  2239.  include in v3.0 are there but some of them are completely untested
  2240.  (see experimental.txt).
  2241.  
  2242. -NOTE!    This Linux only distribution doesn't contain files required
  2243. -    for other operating systems than Linux. They are distributed
  2244. -    in file VoxWare-3.0.tar.gz which is available from
  2245. -    sunsite.unc.edu:pub/Linux/kernel/sound (or pub/Linux/Incoming).
  2246. -
  2247. -    Also some utilities for SoundScape, PSS and AudioTriX cards
  2248. -    have been removed. They are available in VoxWare-3.0.tar.gz and
  2249. -    in snd-util-3.0.tar.gz (when I have time to release it).
  2250. -
  2251.  *** GUS MAX enhancements *****************************************************
  2252.  Recording with GUS MAX works now. The configuration program asks
  2253.  two DMA channels for GUS MAX. You have to use two different 16 bit
  2254. @@ -178,7 +169,8 @@
  2255.  The following companies have greatly helped development of this driver 
  2256.  in form of a free copy of their product:
  2257.  
  2258. -Novell Inc,        UnixWare personal edition + SDK
  2259. +Novell, Inc.        UnixWare personal edition + SDK
  2260. +The Santa Cruz Operation, Inc.     A SCO OpenServer + SDK
  2261.  Ensoniq Corp,        a SoundScape card and extensive amount of assistance
  2262.  MediaTriX Peripherals Inc, a AudioTriX Pro card + SDK
  2263.  
  2264. @@ -202,6 +194,8 @@
  2265.  =========================
  2266.  
  2267.  Read the sound HOWTO (sunsite.unc.edu:/pub/Linux/docs/...?).
  2268. +Also look at the home page (http://personal.eunet.fi/pp/voxware). It may
  2269. +contain info about some recent bug fixes.
  2270.  
  2271.  It's likely that you have some problems when trying to use the sound driver
  2272.  first time. Soundcards don't have standard configuration so there are no
  2273. @@ -248,6 +242,13 @@
  2274.  In general the printout of of /dev/sndstat should tell what is the problem.
  2275.  It's possible that there are bugs in the sound driver but 99% of the problems
  2276.  reported to me are caused by somehow incorrect setup during "make config".
  2277. +
  2278. +For owners of TI TM4000M notebooks
  2279. +----------------------------------
  2280. +
  2281. +There appears to be some kind of conflict between the sound support
  2282. +(MV Jazz), mouse port and VoxWare. You could try to configure kernel
  2283. +with the C&T 82C710 mouse port support disabled.
  2284.  
  2285.  Hannu
  2286.  
  2287. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/Readme.cards linux/drivers/sound/Readme.cards
  2288. --- v1.3.17/linux/drivers/sound/Readme.cards    Mon Jul 31 15:59:02 1995
  2289. +++ linux/drivers/sound/Readme.cards    Sat Aug 12 21:54:55 1995
  2290. @@ -109,7 +109,7 @@
  2291.  MediaTriX AudioTriX Pro
  2292.      The ATP card is built around a CS4231 codec and a OPL4 synthesizer
  2293.      chips. The OPL4 mode is supported by a microcontroller running a
  2294. -    General MIDI emulator. There is also SB 1.5 playback mode.
  2295. +    General MIDI emulator. There is also a SB 1.5 compatible playback mode.
  2296.  
  2297.  Ensoniq SoundScape and compatibles
  2298.      Ensoniq has designed a soundcard architecture based on the
  2299. @@ -128,6 +128,39 @@
  2300.      Support for this card is made by Riccardo Faccetti
  2301.      (riccardo@cdc8g5.cdc.polimi.it). See aedsp16.c for more info.
  2302.  
  2303. +Jumpers and software configuration
  2304. +----------------------------------
  2305. +
  2306. +Some of the earliest soundcards were jumper configurable. You have to
  2307. +configure VoxWare to configure VoxWare use I/O, IRQ and DMA settings
  2308. +that match the jumpers. Just few 8 bit cards are fully jumper 
  2309. +configurable (SB 1.x/2.x, SB Pro and clones).
  2310. +Some cards made by Aztech have an EEPROM which contains the 
  2311. +config info. These cards behave much like hardware jumpered cards.
  2312. +
  2313. +Most cards have jumper for the base I/O address but other parameters
  2314. +are software configurable. Sometimes there are few other jumpers too.
  2315. +
  2316. +Latest cards are fully software configurable or they are PnP ISA
  2317. +compatible. There are no jumpers on the board.
  2318. +
  2319. +VoxWare handles software configurable cards automaticly. Just configure
  2320. +the driver to use I/O, IRQ and DMA settings which are known to work.
  2321. +You could usually use the same values than with DOS and/or Windows.
  2322. +Using different settings is possible but not recommended since it may cause
  2323. +some trouble (for example when warm booting from an OS to another or
  2324. +when installing new hardware to the machine).
  2325. +
  2326. +VoxWare sets the soft configurable parameters of the card automaticly
  2327. +during boot. Usually you don't need to run any extra initialization
  2328. +programs when booting Linux but there are some exceptions. See the
  2329. +card specific instructions (below) for more info.
  2330. +
  2331. +The drawback of software configuration is that the driver needs to know
  2332. +how the card must be initialized. It cannot initialize unknown cards
  2333. +even if they are otherwise compatible with some other cards (like SB,
  2334. +MPU401 or Windows Sound System).
  2335. +
  2336.  What if your card was not listed above?
  2337.  ---------------------------------------
  2338.  
  2339. @@ -495,7 +528,7 @@
  2340.  -------------
  2341.  
  2342.  You have to enable the OPL3 and SB (not SB Pro or SB16) drivers in addition
  2343. -to the native AudioTriX driver. You don't need to enable MSS or MPU drivers.
  2344. +to the native AudioTriX driver. Don't enable MSS or MPU drivers.
  2345.  
  2346.  Configuring ATP is little bit tricky since it uses so many I/O, IRQ and
  2347.  DMA numbers. Using the same values than with DOS/Win is a good idea. Don't
  2348. @@ -607,6 +640,10 @@
  2349.  
  2350.  Some MAD16 based cards may cause feedback, whistle or terrible noise if the
  2351.  line3 mixer channel is turned too high.
  2352. +
  2353. +If you have a MAD16 card which have an OPL4 (FM + Wave table) synthesizer
  2354. +chip (_not_ an OPL3), you have to apped line containing #define MAD16_OPL4
  2355. +to the file linux/dirvers/sound/local.h (after running make config).
  2356.  
  2357.  MV Jazz (ProSonic)
  2358.  ------------------
  2359. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c
  2360. --- v1.3.17/linux/drivers/sound/ad1848.c    Tue Jul 11 10:02:52 1995
  2361. +++ linux/drivers/sound/ad1848.c    Sat Aug 12 21:54:35 1995
  2362. @@ -7,6 +7,11 @@
  2363.   * The CS4231 which is used in the GUS MAX and some other cards is
  2364.   * upwards compatible with AD1848 and this driver is able to drive it.
  2365.   *
  2366. + * CS4231A and AD1845 are upward compatible with CS4231. However
  2367. + * the new features of these chips are different.
  2368. + *
  2369. + * CS4232 is a PnP audio chip which contains a CS4231A.
  2370. + *
  2371.   * Copyright by Hannu Savolainen 1994, 1995
  2372.   *
  2373.   * Redistribution and use in source and binary forms, with or without
  2374. @@ -1039,7 +1044,7 @@
  2375.    OUTB (0, io_Status (devc));    /* Clear interrupt status */
  2376.    ad_leave_MCE (devc);
  2377.  
  2378. -  DMAbuf_reset_dma (dev);
  2379. +  /* DMAbuf_reset_dma (dev); */
  2380.  }
  2381.  
  2382.  int
  2383. @@ -1181,17 +1186,46 @@
  2384.        if ((ad_read (devc, 25) & 0xe7) == (tmp1 & 0xe7))
  2385.          {
  2386.            /*
  2387. -             *      It's a CS4231
  2388. +           *      It's at least CS4231
  2389.             */
  2390.            devc->chip_name = "CS4231";
  2391.  
  2392. -
  2393.  #ifdef MOZART_PORT
  2394.            if (devc->base != MOZART_PORT + 4)
  2395.  #endif
  2396.          devc->mode = 2;
  2397.  
  2398. +          /*
  2399. +           * It could be an AD1845 or CS4231A as well.
  2400. +           * CS4231 and AD1845 report the same revision info in I25
  2401. +           * while the CS4231A reports different.
  2402. +           */
  2403. +
  2404. +          if ((ad_read (devc, 25) & 0xe7) == 0xa0)
  2405. +        {
  2406. +          devc->chip_name = "CS4231A";
  2407. +        }
  2408. +          else if ((ad_read (devc, 25) & 0xe7) == 0x80)
  2409. +        {
  2410. +          /* 
  2411. +           * It must be a CS4231 or AD1845. The register I23 of
  2412. +           * CS4231 is undefined and it appears to be read only.
  2413. +           * AD1845 uses I23 for setting sample rate. Assume
  2414. +           * the chip is AD1845 if I23 is changeable.
  2415. +           */
  2416. +
  2417. +          unsigned char   tmp = ad_read (devc, 23);
  2418. +
  2419. +          ad_write (devc, 23, ~tmp);
  2420. +          if (ad_read (devc, 23) != tmp)    /* AD1845 ? */
  2421. +            {
  2422. +              devc->chip_name = "AD1845";
  2423. +            }
  2424. +
  2425. +          ad_write (devc, 23, tmp);    /* Restore */
  2426. +        }
  2427.  
  2428. +          /* Otherwise behave just as if the chip is a CS4231 */
  2429.          }
  2430.        ad_write (devc, 25, tmp1);    /* Restore bits */
  2431.      }
  2432. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/audio.c linux/drivers/sound/audio.c
  2433. --- v1.3.17/linux/drivers/sound/audio.c    Tue Jul 11 10:02:52 1995
  2434. +++ linux/drivers/sound/audio.c    Sat Aug 12 21:54:35 1995
  2435. @@ -410,9 +410,6 @@
  2436.        if (err < 0)
  2437.          return err;
  2438.  
  2439. -      if (wr_buff_no[dev] != -1)
  2440. -        info.bytes += wr_buff_ptr[dev];
  2441. -
  2442.        IOCTL_TO_USER ((char *) arg, 0, (char *) &info, sizeof (info));
  2443.        return 0;
  2444.      }
  2445. @@ -478,7 +475,7 @@
  2446.        break;
  2447.  
  2448.      case SEL_OUT:
  2449. -      if (audio_mode[dev] != AM_WRITE)    /* Wrong direction */
  2450. +      if (audio_mode[dev] == AM_READ)    /* Wrong direction */
  2451.      return 0;
  2452.  
  2453.        if (wr_buff_no[dev] != -1)
  2454. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
  2455. --- v1.3.17/linux/drivers/sound/dmabuf.c    Tue Jul 11 10:02:52 1995
  2456. +++ linux/drivers/sound/dmabuf.c    Sat Aug 12 21:54:35 1995
  2457. @@ -489,14 +489,46 @@
  2458.      case SNDCTL_DSP_GETOSPACE:
  2459.        if (!local)
  2460.      return RET_ERROR (EINVAL);
  2461. +      else
  2462. +    {
  2463. +      audio_buf_info *info = (audio_buf_info *) arg;
  2464. +
  2465. +      if (!(dmap->flags & DMA_ALLOC_DONE))
  2466. +        reorganize_buffers (dev);
  2467. +
  2468. +      if (cmd == SNDCTL_DSP_GETISPACE)
  2469. +        info->fragments = dmap->qlen;
  2470. +      else
  2471. +        {
  2472. +          if (!space_in_queue (dev))
  2473. +        info->fragments = 0;
  2474. +          else
  2475. +        {
  2476. +          info->fragments = dmap->nbufs - dmap->qlen;
  2477. +          if (audio_devs[dev]->local_qlen)
  2478. +            {
  2479. +              int             tmp = audio_devs[dev]->local_qlen (dev);
  2480. +
  2481. +              if (tmp & info->fragments)
  2482. +            tmp--;    /*
  2483. +                   * This buffer has been counted twice
  2484. +                 */
  2485. +              info->fragments -= tmp;
  2486. +            }
  2487. +        }
  2488. +        }
  2489. +
  2490. +      if (info->fragments < 0)
  2491. +        info->fragments = 0;
  2492. +      else if (info->fragments > dmap->nbufs)
  2493. +        info->fragments = dmap->nbufs;
  2494.  
  2495. -      {
  2496. -    audio_buf_info *info = (audio_buf_info *) arg;
  2497. +      info->fragsize = dmap->fragment_size;
  2498. +      info->bytes = info->fragments * dmap->fragment_size;
  2499.  
  2500. -    info->fragments = dmap->qlen;
  2501. -    info->fragsize = dmap->fragment_size;
  2502. -    info->bytes = dmap->qlen * dmap->fragment_size;
  2503. -      }
  2504. +      if (cmd == SNDCTL_DSP_GETISPACE && dmap->qlen)
  2505. +        info->bytes -= dmap->counts[dmap->qhead];
  2506. +    }
  2507.        return 0;
  2508.  
  2509.      default:
  2510. @@ -511,7 +543,7 @@
  2511.    int             len, max, tmp;
  2512.    struct dma_buffparms *dmap = audio_devs[dev]->dmap;
  2513.  
  2514. -  if (dmap->qlen == dmap->nbufs)    /* No space at all */
  2515. +  if (dmap->qlen >= dmap->nbufs)    /* No space at all */
  2516.      return 0;
  2517.  
  2518.    /*
  2519. @@ -929,6 +961,7 @@
  2520.    switch (sel_type)
  2521.      {
  2522.      case SEL_IN:
  2523. +
  2524.        if (dmap->dma_mode != DMODE_INPUT)
  2525.      return 0;
  2526.  
  2527. @@ -945,10 +978,14 @@
  2528.  
  2529.      case SEL_OUT:
  2530.        if (dmap->dma_mode == DMODE_INPUT)
  2531. -    return 0;
  2532. +    {
  2533. +      return 0;
  2534. +    }
  2535.  
  2536.        if (dmap->dma_mode == DMODE_NONE)
  2537. -    return 1;
  2538. +    {
  2539. +      return 1;
  2540. +    }
  2541.  
  2542.        if (!space_in_queue (dev))
  2543.      {
  2544. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/mad16.c linux/drivers/sound/mad16.c
  2545. --- v1.3.17/linux/drivers/sound/mad16.c    Mon Jul 31 15:59:02 1995
  2546. +++ linux/drivers/sound/mad16.c    Sat Aug 12 21:54:35 1995
  2547. @@ -1,3 +1,4 @@
  2548. +#define MAD16_OPL4        /* Disable this if you have problems with OPL3 */
  2549.  /*
  2550.   * sound/mad16.c
  2551.   *
  2552. @@ -20,14 +21,17 @@
  2553.   *      0x01    - joystick disabled
  2554.   *
  2555.   *      CD-ROM type selection (select just one):
  2556. + *      0x00    - none
  2557.   *      0x02    - Sony 31A
  2558.   *      0x04    - Mitsumi
  2559. - *      0x06    - Panasonic
  2560. - *      0x08    - Secondary IDE
  2561. - *      0x0a    - Primary IDE
  2562. + *      0x06    - Panasonic (type "LaserMate", not "SoundBlaster")
  2563. + *      0x08    - Secondary IDE (address 0x170)
  2564. + *      0x0a    - Primary IDE (address 0x1F0)
  2565.   *      
  2566.   *      For example Mitsumi with joystick disabled = 0x04|0x01 = 0x05
  2567. + *      For example LaserMate (for use with sbpcd) plus joystick = 0x06
  2568.   *      
  2569. + *    MAD16_CDSEL:
  2570.   *      This defaults to CD I/O 0x340, no IRQ and DMA3 
  2571.   *      (DMA5 with Mitsumi or IDE). If you like to change these, define
  2572.   *      MAD16_CDSEL with the following bits:
  2573. @@ -41,6 +45,8 @@
  2574.   *   or
  2575.   *      CD-ROM DMA (Mitsumi or IDE):    0x00=DMA5, 0x01=DMA6, 0x02=DMA7 or 0x03=disabled
  2576.   *
  2577. + *      For use with sbpcd, address 0x340, set MAD16_CDSEL to 0x03 or 0x23.
  2578. + *
  2579.   * Copyright by Hannu Savolainen 1995
  2580.   *
  2581.   * Redistribution and use in source and binary forms, with or without
  2582. @@ -84,8 +90,8 @@
  2583.   *      only until the next I/O read or write.
  2584.   */
  2585.  
  2586. -#define MC1_PORT    0xf8d
  2587. -#define MC2_PORT    0xf8e
  2588. +#define MC1_PORT    0xf8d    /* SB address, CDROM interface type, joystick */
  2589. +#define MC2_PORT    0xf8e    /* CDROM address, IRQ, DMA, plus OPL4 bit */
  2590.  #define MC3_PORT    0xf8f
  2591.  #define PASSWD_REG    0xf8f
  2592.  #define MC4_PORT    0xf90
  2593. @@ -236,9 +242,9 @@
  2594.      }
  2595.    else
  2596.      {
  2597. -      unsigned char model;
  2598. +      unsigned char   model;
  2599.  
  2600. -      if (((model=mad_read (MC3_PORT)) & 0x03) == 0x03)
  2601. +      if (((model = mad_read (MC3_PORT)) & 0x03) == 0x03)
  2602.      {
  2603.        printk ("mad16.c: Mozart detected???\n");
  2604.        board_type = MOZART;
  2605. @@ -277,6 +283,8 @@
  2606.  /*
  2607.   * Set optional CD-ROM and joystick settings.
  2608.   */
  2609. +#define MAD16_CONF 0x06
  2610. +#define MAD16_CDSEL 0x03
  2611.  
  2612.  #ifdef MAD16_CONF
  2613.    tmp |= ((MAD16_CONF) & 0x0f);    /* CD-ROM and joystick bits */
  2614. @@ -327,22 +335,20 @@
  2615.  attach_mad16_mpu (long mem_start, struct address_info *hw_config)
  2616.  {
  2617.  
  2618. -#ifdef EXCLUDE_MIDI
  2619. -  return mem_start;
  2620. -#else
  2621. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2622.    if (!already_initialized)
  2623.      return mem_start;
  2624.  
  2625.    return attach_mpu401 (mem_start, hw_config);
  2626. +#else
  2627. +  return mem_start;
  2628.  #endif
  2629.  }
  2630.  
  2631.  int
  2632.  probe_mad16_mpu (struct address_info *hw_config)
  2633.  {
  2634. -#ifdef EXCLUDE_MIDI
  2635. -  return 0;
  2636. -#else
  2637. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2638.    static int      mpu_attached = 0;
  2639.    static int      valid_ports[] =
  2640.    {0x330, 0x320, 0x310, 0x300};
  2641. @@ -365,7 +371,7 @@
  2642.        return 0;
  2643.      }
  2644.  
  2645. -  tmp = 0x80;            /* MPU-401 enable */
  2646. +  tmp = 0x83;            /* MPU-401 enable */
  2647.  
  2648.  /*
  2649.   * Set the MPU base bits
  2650. @@ -403,12 +409,12 @@
  2651.        tmp |= i << 3;
  2652.        break;
  2653.      }
  2654. -
  2655. -      tmp |= 0x03;        /* ???????? */
  2656. -      mad_write (MC6_PORT, tmp);    /* Write MPU401 config */
  2657.      }
  2658. +  mad_write (MC6_PORT, tmp);    /* Write MPU401 config */
  2659.  
  2660.    return probe_mpu401 (hw_config);
  2661. +#else
  2662. +  return 0;
  2663.  #endif
  2664.  }
  2665.  
  2666. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/mpu401.c linux/drivers/sound/mpu401.c
  2667. --- v1.3.17/linux/drivers/sound/mpu401.c    Tue Jul 11 10:02:53 1995
  2668. +++ linux/drivers/sound/mpu401.c    Sat Aug 12 21:54:35 1995
  2669. @@ -96,7 +96,7 @@
  2670.  
  2671.  #define    OUTPUT_READY    0x40
  2672.  #define    INPUT_AVAIL    0x80
  2673. -#define    MPU_ACK        0xF7
  2674. +#define    MPU_ACK        0xFE
  2675.  #define    MPU_RESET    0xFF
  2676.  #define    UART_MODE_ON    0x3F
  2677.  
  2678. @@ -638,10 +638,16 @@
  2679.    ok = 0;
  2680.    for (timeout = 50000; timeout > 0 && !ok; timeout--)
  2681.      if (input_avail (devc->base))
  2682. -      {
  2683. -    if (mpu_input_scanner (devc, read_data (devc->base)) == MPU_ACK)
  2684. -      ok = 1;
  2685. -      }
  2686. +      if (devc->opened && devc->mode == MODE_SYNTH)
  2687. +    {
  2688. +      if (mpu_input_scanner (devc, read_data (devc->base)) == MPU_ACK)
  2689. +        ok = 1;
  2690. +    }
  2691. +      else
  2692. +    {            /* Device is not currently open. Use simplier method */
  2693. +      if (read_data (devc->base) == MPU_ACK)
  2694. +        ok = 1;
  2695. +    }
  2696.  
  2697.    if (!ok)
  2698.      {
  2699. @@ -680,7 +686,7 @@
  2700.      if (!ok)
  2701.        {
  2702.          RESTORE_INTR (flags);
  2703. -        /* printk ("MPU: No response(%d) to command (0x%x)\n", i, (int) cmd->cmd); */
  2704. +        /* printk ("MPU: No response(%d) to command (0x%x)\n", i, (int) cmd->cmd);  */
  2705.          return RET_ERROR (EIO);
  2706.        }
  2707.        }
  2708. @@ -1219,6 +1225,7 @@
  2709.    tmp_devc.base = hw_config->io_base;
  2710.    tmp_devc.irq = hw_config->irq;
  2711.    tmp_devc.initialized = 0;
  2712. +  tmp_devc.opened = 0;
  2713.  
  2714.  #if !defined(EXCLUDE_AEDSP16) && defined(AEDSP16_MPU401)
  2715.    /*
  2716. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/opl3.c linux/drivers/sound/opl3.c
  2717. --- v1.3.17/linux/drivers/sound/opl3.c    Tue Jul 11 10:02:53 1995
  2718. +++ linux/drivers/sound/opl3.c    Sat Aug 12 21:54:35 1995
  2719. @@ -1094,7 +1094,7 @@
  2720.    if (voice < 0 || voice >= nr_voices)
  2721.      return;
  2722.  
  2723. -  bend_pitch (dev, voice, value);
  2724. +  bend_pitch (dev, voice, value - 8192);
  2725.  }
  2726.  
  2727.  static int
  2728. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/os.h linux/drivers/sound/os.h
  2729. --- v1.3.17/linux/drivers/sound/os.h    Mon Jul 31 15:59:02 1995
  2730. +++ linux/drivers/sound/os.h    Sun Aug 13 12:01:26 1995
  2731. @@ -52,7 +52,7 @@
  2732.  #include <linux/malloc.h>
  2733.  #include <linux/string.h>
  2734.  
  2735. -#include "linux/soundcard.h"
  2736. +#include <linux/soundcard.h>
  2737.  
  2738.  typedef char snd_rw_buf;
  2739.  
  2740. @@ -155,7 +155,7 @@
  2741.   */
  2742.  
  2743.  #define ACTIVATE_TIMER(name, proc, time) \
  2744. -  {name.expires = jiffies+(time); \
  2745. +  {name.expires = time; \
  2746.    add_timer (&name);}
  2747.  
  2748.  #define INB    inb
  2749. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/pas2_card.c linux/drivers/sound/pas2_card.c
  2750. --- v1.3.17/linux/drivers/sound/pas2_card.c    Mon Jul 31 15:59:02 1995
  2751. +++ linux/drivers/sound/pas2_card.c    Sat Aug 12 21:54:35 1995
  2752. @@ -57,7 +57,7 @@
  2753.  /*
  2754.   * to support other than the default base address
  2755.   */
  2756. -extern void mix_write (unsigned char data, int ioaddr);
  2757. +extern void     mix_write (unsigned char data, int ioaddr);
  2758.  
  2759.  unsigned char
  2760.  pas_read (int ioaddr)
  2761. @@ -99,10 +99,8 @@
  2762.    if (status & I_S_MIDI_IRQ)
  2763.      {
  2764.  #ifndef EXCLUDE_MIDI
  2765. -#ifdef EXCLUDE_PRO_MIDI
  2766.        pas_midi_interrupt ();
  2767.  #endif
  2768. -#endif
  2769.        status &= ~I_S_MIDI_IRQ;
  2770.      }
  2771.  
  2772. @@ -253,7 +251,7 @@
  2773.                                   * 17.897 kHz
  2774.                                   */
  2775.  #if 1
  2776. -    pas_write (8, PRESCALE_DIVIDER);
  2777. +  pas_write (8, PRESCALE_DIVIDER);
  2778.  #else
  2779.    if (pas_model == PAS_16 || pas_model == PAS_16D)
  2780.      pas_write (8, PRESCALE_DIVIDER);
  2781. @@ -264,7 +262,7 @@
  2782.    mix_write (P_M_MV508_ADDRESS | 5, PARALLEL_MIXER);
  2783.    mix_write (5, PARALLEL_MIXER);
  2784.  
  2785. -#if !defined(EXCLUDE_SB_EMULATION) || !defined(EXCLUDE_SB)
  2786. +#if !defined(EXCLUDE_SB_EMULATION) && !defined(EXCLUDE_SB)
  2787.  
  2788.    {
  2789.      struct address_info *sb_config;
  2790. @@ -396,9 +394,7 @@
  2791.  #endif
  2792.  
  2793.  #ifndef EXCLUDE_MIDI
  2794. -#ifdef EXCLUDE_PRO_MIDI
  2795.        mem_start = pas_midi_init (mem_start);
  2796. -#endif
  2797.  #endif
  2798.  
  2799.        pas_init_mixer ();
  2800. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/pss.c linux/drivers/sound/pss.c
  2801. --- v1.3.17/linux/drivers/sound/pss.c    Wed Aug  2 13:21:15 1995
  2802. +++ linux/drivers/sound/pss.c    Sat Aug 12 21:54:35 1995
  2803. @@ -395,10 +395,10 @@
  2804.      break;            /* No more input */
  2805.      }
  2806.  
  2807. -#ifdef EXCLUDE_MIDI
  2808. -  return 0;
  2809. -#else
  2810. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2811.    return probe_mpu401 (hw_config);
  2812. +#else
  2813. +  return 0
  2814.  #endif
  2815.  }
  2816.  
  2817. @@ -662,7 +662,7 @@
  2818.    int             prev_devs;
  2819.    long            ret;
  2820.  
  2821. -#ifndef EXCLUDE_MIDI
  2822. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2823.    prev_devs = num_midis;
  2824.    ret = attach_mpu401 (mem_start, hw_config);
  2825.  
  2826. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/sb16_dsp.c linux/drivers/sound/sb16_dsp.c
  2827. --- v1.3.17/linux/drivers/sound/sb16_dsp.c    Tue Jul 11 10:02:54 1995
  2828. +++ linux/drivers/sound/sb16_dsp.c    Sat Aug 12 21:54:35 1995
  2829. @@ -436,7 +436,7 @@
  2830.        sb_dsp_command01 (0xda);
  2831.        sb_dsp_command01 (0xd0);
  2832.      }
  2833. -  DMAbuf_reset_dma (dev);
  2834. +  /* DMAbuf_reset_dma (dev); */
  2835.  }
  2836.  
  2837.  static void
  2838. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/sb_dsp.c linux/drivers/sound/sb_dsp.c
  2839. --- v1.3.17/linux/drivers/sound/sb_dsp.c    Mon Jul 31 15:59:02 1995
  2840. +++ linux/drivers/sound/sb_dsp.c    Sat Aug 12 21:54:35 1995
  2841. @@ -1139,6 +1139,13 @@
  2842.      }
  2843.      }
  2844.  
  2845. +  if (sbc_major == 0)
  2846. +    {
  2847. +      printk ("\n\nFailed to get SB version (%x) - possible I/O conflict\n\n",
  2848. +          INB (DSP_DATA_AVAIL));
  2849. +      sbc_major = 1;
  2850. +    }
  2851. +
  2852.    if (sbc_major == 2 || sbc_major == 3)
  2853.      sb_duplex_midi = 1;
  2854.  
  2855. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
  2856. --- v1.3.17/linux/drivers/sound/sequencer.c    Mon Jul 31 15:59:02 1995
  2857. +++ linux/drivers/sound/sequencer.c    Sat Aug 12 21:54:36 1995
  2858. @@ -1818,7 +1818,7 @@
  2859.      369998, 391998, 415306, 440000, 466162, 493880
  2860.    };
  2861.  
  2862. -#define BASE_OCTAVE    4
  2863. +#define BASE_OCTAVE    5
  2864.  
  2865.    octave = note_num / 12;
  2866.    note = note_num % 12;
  2867. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/sound_config.h linux/drivers/sound/sound_config.h
  2868. --- v1.3.17/linux/drivers/sound/sound_config.h    Thu Jul 13 16:20:21 1995
  2869. +++ linux/drivers/sound/sound_config.h    Sat Aug 12 21:54:42 1995
  2870. @@ -33,7 +33,7 @@
  2871.  #include "soundvers.h"
  2872.  
  2873.  #if !defined(PSS_MPU_BASE) && defined(EXCLUDE_SSCAPE) && \
  2874. -                  defined(EXCLUDE_TRIX) && !defined(MAD16_MPU_BASE)
  2875. +      defined(EXCLUDE_TRIX) && !defined(MAD16_MPU_BASE)
  2876.  #define EXCLUDE_MPU_EMU
  2877.  #endif
  2878.  
  2879. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/sound_switch.c linux/drivers/sound/sound_switch.c
  2880. --- v1.3.17/linux/drivers/sound/sound_switch.c    Mon Jul 31 15:59:02 1995
  2881. +++ linux/drivers/sound/sound_switch.c    Sat Aug 12 21:54:36 1995
  2882. @@ -58,8 +58,8 @@
  2883.  {
  2884.    int             l;
  2885.  
  2886. -  for (l = 0; l < 256 && s[l]; l++);    /*
  2887. -                     * l=strnlen(s,256);
  2888. +  for (l = 0; l < 256, s[l]; l++);    /*
  2889. +                     * l=strlen(s);
  2890.                       */
  2891.  
  2892.    if (status_len + l >= 4000)
  2893. @@ -115,10 +115,17 @@
  2894.  
  2895.    status_ptr = 0;
  2896.  
  2897. +#ifdef SOUND_UNAME_A
  2898. +  put_status ("VoxWare Sound Driver:" SOUND_VERSION_STRING
  2899. +          " (" SOUND_CONFIG_DATE " " SOUND_CONFIG_BY ",\n"
  2900. +          SOUND_UNAME_A ")"
  2901. +          "\n");
  2902. +#else
  2903.    put_status ("VoxWare Sound Driver:" SOUND_VERSION_STRING
  2904.            " (" SOUND_CONFIG_DATE " " SOUND_CONFIG_BY "@"
  2905.            SOUND_CONFIG_HOST "." SOUND_CONFIG_DOMAIN ")"
  2906.            "\n");
  2907. +#endif
  2908.  
  2909.    if (!put_status ("Config options: "))
  2910.      return;
  2911. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/soundvers.h linux/drivers/sound/soundvers.h
  2912. --- v1.3.17/linux/drivers/sound/soundvers.h    Mon Jul 31 15:59:02 1995
  2913. +++ linux/drivers/sound/soundvers.h    Sat Aug 12 21:54:42 1995
  2914. @@ -1 +1 @@
  2915. -#define SOUND_VERSION_STRING "3.0-950728"
  2916. +#define SOUND_VERSION_STRING "3.0.1-950812"
  2917. diff -u --recursive --new-file v1.3.17/linux/drivers/sound/trix.c linux/drivers/sound/trix.c
  2918. --- v1.3.17/linux/drivers/sound/trix.c    Tue Jul 11 10:02:55 1995
  2919. +++ linux/drivers/sound/trix.c    Sat Aug 12 21:54:36 1995
  2920. @@ -88,11 +88,11 @@
  2921.    if (kilroy_was_here)        /* Already initialized */
  2922.      return 0;
  2923.  
  2924. -  kilroy_was_here = 1;
  2925. -
  2926.    if (trix_read (0x15) != 0x71)    /* No asic signature */
  2927.      return 0;
  2928.  
  2929. +  kilroy_was_here = 1;
  2930. +
  2931.    /*
  2932.       * Disable separate wave playback and recording DMA channels since
  2933.       * the driver doesn't support duplex mode yet.
  2934. @@ -276,12 +276,17 @@
  2935.  long
  2936.  attach_trix_mpu (long mem_start, struct address_info *hw_config)
  2937.  {
  2938. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2939.    return attach_mpu401 (mem_start, hw_config);
  2940. +#else
  2941. +  return mem_start;
  2942. +#endif
  2943.  }
  2944.  
  2945.  int
  2946.  probe_trix_mpu (struct address_info *hw_config)
  2947.  {
  2948. +#if (!defined(EXCLUDE_MPU401) || !defined(EXCLUDE_MPU_EMU)) && !defined(EXCLUDE_MIDI)
  2949.    unsigned char   conf;
  2950.    static char     irq_bits[] =
  2951.    {-1, -1, -1, 1, 2, 3, -1, 4, -1, 5};
  2952. @@ -326,6 +331,9 @@
  2953.    mpu_initialized = 1;
  2954.  
  2955.    return probe_mpu401 (hw_config);
  2956. +#else
  2957. +  return 0;
  2958. +#endif
  2959.  }
  2960.  
  2961.  #endif
  2962. diff -u --recursive --new-file v1.3.17/linux/fs/ext2/CHANGES linux/fs/ext2/CHANGES
  2963. --- v1.3.17/linux/fs/ext2/CHANGES    Tue Jul 11 10:02:57 1995
  2964. +++ linux/fs/ext2/CHANGES    Fri Aug 11 09:26:58 1995
  2965. @@ -1,5 +1,6 @@
  2966.  Changes from version 0.5a to version 0.5b
  2967.  =========================================
  2968. +    - Some cleanups in the code.
  2969.      - More consistency checks on directories.
  2970.      - The ext2.diff patch from Tom May <ftom@netcom.com> has been
  2971.        integrated.  This patch replaces expensive "/" and "%" with
  2972. diff -u --recursive --new-file v1.3.17/linux/fs/ext2/super.c linux/fs/ext2/super.c
  2973. --- v1.3.17/linux/fs/ext2/super.c    Tue Jul 11 10:02:58 1995
  2974. +++ linux/fs/ext2/super.c    Fri Aug 11 09:26:58 1995
  2975. @@ -128,48 +128,6 @@
  2976.      ext2_remount
  2977.  };
  2978.  
  2979. -#ifdef EXT2FS_PRE_02B_COMPAT
  2980. -
  2981. -static int convert_pre_02b_fs (struct super_block * sb,
  2982. -                   struct buffer_head * bh)
  2983. -{
  2984. -    struct ext2_super_block * es;
  2985. -    struct ext2_old_group_desc old_group_desc [BLOCK_SIZE / sizeof (struct ext2_old_group_desc)];
  2986. -    struct ext2_group_desc * gdp;
  2987. -    struct buffer_head * bh2;
  2988. -    int groups_count;
  2989. -    int i;
  2990. -
  2991. -    es = (struct ext2_super_block *) bh->b_data;
  2992. -    bh2 = bread (sb->s_dev, 2, BLOCK_SIZE);
  2993. -    if (!bh2) {
  2994. -        printk ("Cannot read descriptor blocks while converting !\n");
  2995. -        return 0;
  2996. -    }
  2997. -    memcpy (old_group_desc, bh2->b_data, BLOCK_SIZE);
  2998. -    groups_count = (sb->u.ext2_sb.s_blocks_count - 
  2999. -            sb->u.ext2_sb.s_first_data_block +
  3000. -            (EXT2_BLOCK_SIZE(sb) * 8) - 1) /
  3001. -                (EXT2_BLOCK_SIZE(sb) * 8);
  3002. -    memset (bh2->b_data, 0, BLOCK_SIZE);
  3003. -    gdp = (struct ext2_group_desc *) bh2->b_data;
  3004. -    for (i = 0; i < groups_count; i++) {
  3005. -        gdp[i].bg_block_bitmap = old_group_desc[i].bg_block_bitmap;
  3006. -        gdp[i].bg_inode_bitmap = old_group_desc[i].bg_inode_bitmap;
  3007. -        gdp[i].bg_inode_table = old_group_desc[i].bg_inode_table;
  3008. -        gdp[i].bg_free_blocks_count = old_group_desc[i].bg_free_blocks_count;
  3009. -        gdp[i].bg_free_inodes_count = old_group_desc[i].bg_free_inodes_count;
  3010. -    }
  3011. -    mark_buffer_dirty(bh2, 1);
  3012. -    brelse (bh2);
  3013. -    es->s_magic = EXT2_SUPER_MAGIC;
  3014. -    mark_buffer_dirty(bh, 1);
  3015. -    sb->s_magic = EXT2_SUPER_MAGIC;
  3016. -    return 1;
  3017. -}
  3018. -
  3019. -#endif
  3020. -
  3021.  /*
  3022.   * This function has been shamelessly adapted from the msdos fs
  3023.   */
  3024. @@ -403,9 +361,6 @@
  3025.      int dev = sb->s_dev;
  3026.      int db_count;
  3027.      int i, j;
  3028. -#ifdef EXT2FS_PRE_02B_COMPAT
  3029. -    int fs_converted = 0;
  3030. -#endif
  3031.  
  3032.      set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL);
  3033.      if (!parse_options ((char *) data, &sb_block, &resuid, &resgid,
  3034. @@ -429,11 +384,7 @@
  3035.      es = (struct ext2_super_block *) bh->b_data;
  3036.      sb->u.ext2_sb.s_es = es;
  3037.      sb->s_magic = es->s_magic;
  3038. -    if (sb->s_magic != EXT2_SUPER_MAGIC
  3039. -#ifdef EXT2FS_PRE_02B_COMPAT
  3040. -       && sb->s_magic != EXT2_PRE_02B_MAGIC
  3041. -#endif
  3042. -       ) {
  3043. +    if (sb->s_magic != EXT2_SUPER_MAGIC) {
  3044.          sb->s_dev = 0;
  3045.          unlock_super (sb);
  3046.          brelse (bh);
  3047. @@ -500,39 +451,6 @@
  3048.          log2 (EXT2_INODES_PER_BLOCK(sb));
  3049.      sb->u.ext2_sb.s_desc_per_block_bits =
  3050.          log2 (EXT2_DESC_PER_BLOCK(sb));
  3051. -#ifdef EXT2FS_PRE_02B_COMPAT
  3052. -    if (sb->s_magic == EXT2_PRE_02B_MAGIC) {
  3053. -        if (es->s_blocks_count > 262144) {
  3054. -            /*
  3055. -             * fs > 256 MB can't be converted
  3056. -             */ 
  3057. -            sb->s_dev = 0;
  3058. -            unlock_super (sb);
  3059. -            brelse (bh);
  3060. -            printk ("EXT2-fs: trying to mount a pre-0.2b file"
  3061. -                "system which cannot be converted\n");
  3062. -            return NULL;
  3063. -        }
  3064. -        printk ("EXT2-fs: mounting a pre 0.2b file system, "
  3065. -            "will try to convert the structure\n");
  3066. -        if (!(sb->s_flags & MS_RDONLY)) {
  3067. -            sb->s_dev = 0;
  3068. -            unlock_super (sb);
  3069. -            brelse (bh);
  3070. -            printk ("EXT2-fs: cannot convert a read-only fs\n");
  3071. -            return NULL;
  3072. -        }
  3073. -        if (!convert_pre_02b_fs (sb, bh)) {
  3074. -            sb->s_dev = 0;
  3075. -            unlock_super (sb);
  3076. -            brelse (bh);
  3077. -            printk ("EXT2-fs: conversion failed !!!\n");
  3078. -            return NULL;
  3079. -        }
  3080. -        printk ("EXT2-fs: conversion succeeded !!!\n");
  3081. -        fs_converted = 1;
  3082. -    }
  3083. -#endif
  3084.      if (sb->s_magic != EXT2_SUPER_MAGIC) {
  3085.          sb->s_dev = 0;
  3086.          unlock_super (sb);
  3087. @@ -652,13 +570,6 @@
  3088.          printk ("EXT2-fs: get root inode failed\n");
  3089.          return NULL;
  3090.      }
  3091. -#ifdef EXT2FS_PRE_02B_COMPAT
  3092. -    if (fs_converted) {
  3093. -        for (i = 0; i < db_count; i++)
  3094. -            mark_buffer_dirty(sb->u.ext2_sb.s_group_desc[i], 1);
  3095. -        sb->s_dirt = 1;
  3096. -    }
  3097. -#endif
  3098.      ext2_setup_super (sb, es);
  3099.      return sb;
  3100.  }
  3101. diff -u --recursive --new-file v1.3.17/linux/fs/proc/base.c linux/fs/proc/base.c
  3102. --- v1.3.17/linux/fs/proc/base.c    Wed Aug  9 14:55:42 1995
  3103. +++ linux/fs/proc/base.c    Sun Aug 13 13:53:46 1995
  3104. @@ -51,18 +51,18 @@
  3105.  };
  3106.  
  3107.  static struct proc_dir_entry base_dir[] = {
  3108. -    { PROC_PID_INO,        NULL,    1, "." },
  3109. -    { PROC_ROOT_INO,    NULL,    2, ".." },
  3110. -    { PROC_PID_MEM,        NULL,    3, "mem" },
  3111. -    { PROC_PID_CWD,        NULL,    3, "cwd" },
  3112. -    { PROC_PID_ROOT,    NULL,    4, "root" },
  3113. -    { PROC_PID_EXE,        NULL,    3, "exe" },
  3114. -    { PROC_PID_FD,        NULL,    2, "fd" },
  3115. -    { PROC_PID_ENVIRON,    NULL,    7, "environ" },
  3116. -    { PROC_PID_CMDLINE,    NULL,    7, "cmdline" },
  3117. -    { PROC_PID_STAT,    NULL,    4, "stat" },
  3118. -    { PROC_PID_STATM,    NULL,    5, "statm" },
  3119. -    { PROC_PID_MAPS,    NULL,    4, "maps" }
  3120. +    { PROC_PID_INO,        1, "." },
  3121. +    { PROC_ROOT_INO,    2, ".." },
  3122. +    { PROC_PID_MEM,        3, "mem" },
  3123. +    { PROC_PID_CWD,        3, "cwd" },
  3124. +    { PROC_PID_ROOT,    4, "root" },
  3125. +    { PROC_PID_EXE,        3, "exe" },
  3126. +    { PROC_PID_FD,        2, "fd" },
  3127. +    { PROC_PID_ENVIRON,    7, "environ" },
  3128. +    { PROC_PID_CMDLINE,    7, "cmdline" },
  3129. +    { PROC_PID_STAT,    4, "stat" },
  3130. +    { PROC_PID_STATM,    5, "statm" },
  3131. +    { PROC_PID_MAPS,    4, "maps" }
  3132.  };
  3133.  
  3134.  #define NR_BASE_DIRENTRY ((sizeof (base_dir))/(sizeof (base_dir[0])))
  3135. @@ -82,6 +82,7 @@
  3136.  static int proc_lookupbase(struct inode * dir,const char * name, int len,
  3137.      struct inode ** result)
  3138.  {
  3139. +    struct proc_dir_entry * de = NULL;
  3140.      unsigned int pid, ino;
  3141.      int i;
  3142.  
  3143. @@ -94,17 +95,20 @@
  3144.      }
  3145.      ino = dir->i_ino;
  3146.      pid = ino >> 16;
  3147. -    i = NR_BASE_DIRENTRY;
  3148. -    while (i-- > 0 && !proc_match(len,name,base_dir+i))
  3149. -        /* nothing */;
  3150. -    if (i < 0) {
  3151. +    for (i = 0; i < NR_BASE_DIRENTRY; i++) {
  3152. +        if (!proc_match(len, name, base_dir+i))
  3153. +            continue;
  3154. +        de = base_dir+i;
  3155. +        break;
  3156. +    }
  3157. +    if (!de) {
  3158.          iput(dir);
  3159.          return -ENOENT;
  3160.      }
  3161. -    if (base_dir[i].low_ino == 1)
  3162. +    if (de->low_ino == 1)
  3163.          ino = 1;
  3164.      else
  3165. -        ino = (pid << 16) + base_dir[i].low_ino;
  3166. +        ino = (pid << 16) + de->low_ino;
  3167.      for (i = 0 ; i < NR_TASKS ; i++)
  3168.          if (task[i] && task[i]->pid == pid)
  3169.              break;
  3170. @@ -117,6 +121,7 @@
  3171.          return -ENOENT;
  3172.      }
  3173.      iput(dir);
  3174. +    (*result)->u.generic_ip = de;
  3175.      return 0;
  3176.  }
  3177.  
  3178. diff -u --recursive --new-file v1.3.17/linux/fs/proc/inode.c linux/fs/proc/inode.c
  3179. --- v1.3.17/linux/fs/proc/inode.c    Wed Aug  9 14:55:42 1995
  3180. +++ linux/fs/proc/inode.c    Sun Aug 13 14:04:58 1995
  3181. @@ -205,7 +205,7 @@
  3182.              case PROC_NET:
  3183.                  inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
  3184.                  inode->i_nlink = 2;
  3185. -                inode->i_op = &proc_net_inode_operations;
  3186. +                inode->i_op = &proc_netdir_inode_operations;
  3187.                  break;
  3188.              case PROC_SCSI:
  3189.                                  inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO;
  3190. diff -u --recursive --new-file v1.3.17/linux/fs/proc/net.c linux/fs/proc/net.c
  3191. --- v1.3.17/linux/fs/proc/net.c    Wed Aug  9 14:55:42 1995
  3192. +++ linux/fs/proc/net.c    Sun Aug 13 14:03:56 1995
  3193. @@ -36,81 +36,29 @@
  3194.  #include <linux/config.h>
  3195.  #include <linux/mm.h>
  3196.  
  3197. -/* forward references */
  3198. -static int proc_readnet(struct inode * inode, struct file * file,
  3199. -             char * buf, int count);
  3200. -static int proc_readnetdir(struct inode *, struct file *,
  3201. -               void *, filldir_t filldir);
  3202. -static int proc_lookupnet(struct inode *,const char *,int,struct inode **);
  3203. -
  3204. -static struct file_operations proc_net_operations = {
  3205. -    NULL,            /* lseek - default */
  3206. -    proc_readnet,        /* read - bad */
  3207. -    NULL,            /* write - bad */
  3208. -    proc_readnetdir,    /* readdir */
  3209. -    NULL,            /* select - default */
  3210. -    NULL,            /* ioctl - default */
  3211. -    NULL,            /* mmap */
  3212. -    NULL,            /* no special open code */
  3213. -    NULL,            /* no special release code */
  3214. -    NULL            /* can't fsync */
  3215. -};
  3216. -
  3217. -/*
  3218. - * proc directories can do almost nothing..
  3219. - */
  3220. -struct inode_operations proc_net_inode_operations = {
  3221. -    &proc_net_operations,    /* default net directory file-ops */
  3222. -    NULL,            /* create */
  3223. -    proc_lookupnet,        /* lookup */
  3224. -    NULL,            /* link */
  3225. -    NULL,            /* unlink */
  3226. -    NULL,            /* symlink */
  3227. -    NULL,            /* mkdir */
  3228. -    NULL,            /* rmdir */
  3229. -    NULL,            /* mknod */
  3230. -    NULL,            /* rename */
  3231. -    NULL,            /* readlink */
  3232. -    NULL,            /* follow_link */
  3233. -    NULL,            /* bmap */
  3234. -    NULL,            /* truncate */
  3235. -    NULL            /* permission */
  3236. -};
  3237. -
  3238. -#define NR_MAX_PROC_NET_DIR 100
  3239. -static struct proc_dir_entry *net_dir[NR_MAX_PROC_NET_DIR] = {
  3240. -    NULL,
  3241. -};
  3242. -
  3243. -static int nr_net_direntry = 0;
  3244. +static struct proc_dir_entry *net_dir = NULL;
  3245.  
  3246.  int proc_net_register(struct proc_dir_entry *dp)
  3247.  {
  3248. -    int i;
  3249. -
  3250. -    for (i = 0; net_dir[i] != NULL; ++i ) ;
  3251. -
  3252. -    if (i >= NR_MAX_PROC_NET_DIR)
  3253. -      return -ENOMEM;
  3254. -
  3255. -    net_dir[i] = dp;
  3256. -    net_dir[i+1] = NULL; /* Just make sure.. */
  3257. -    ++nr_net_direntry;
  3258. -    return i;
  3259. +    dp->next = net_dir;
  3260. +    net_dir = dp;
  3261. +    return 0;
  3262.  }
  3263.  
  3264.  int proc_net_unregister(int ino)
  3265.  {
  3266. -    int i;
  3267. -    for (i = 0; net_dir[i] != NULL && i < nr_net_direntry; ++i)
  3268. -      if (net_dir[i]->low_ino == ino) {
  3269. -        for ( ; net_dir[i] != NULL; ++i )
  3270. -          net_dir[i] = net_dir[i+1];
  3271. -        --nr_net_direntry;
  3272. -        return 0;
  3273. -      }
  3274. -    return -ENOENT;
  3275. -}
  3276. +    struct proc_dir_entry **p = &net_dir, *dp;
  3277. +
  3278. +    while ((dp = *p) != NULL) {
  3279. +        if (dp->low_ino == ino) {
  3280. +            *p = dp->next;
  3281. +            dp->next = NULL;
  3282. +            return 0;
  3283. +        }
  3284. +        p = &dp->next;
  3285. +    }
  3286. +    return -EINVAL;
  3287. +}    
  3288.  
  3289.  static int dir_get_info(char * a, char ** b, off_t d, int e, int f)
  3290.  {
  3291. @@ -120,8 +68,8 @@
  3292.  void proc_net_init(void)
  3293.  {
  3294.      static struct proc_dir_entry
  3295. -      nd_thisdir = { PROC_NET, dir_get_info, 1, "." },
  3296. -      nd_rootdir = { PROC_ROOT_INO, dir_get_info, 1, ".." };
  3297. +      nd_thisdir = { PROC_NET, 1, ".", dir_get_info },
  3298. +      nd_rootdir = { PROC_ROOT_INO, 2, "..", dir_get_info };
  3299.      static int already = 0;
  3300.  
  3301.      if (already) return;
  3302. @@ -135,7 +83,7 @@
  3303.  static int proc_lookupnet(struct inode * dir,const char * name, int len,
  3304.                struct inode ** result)
  3305.  {
  3306. -    struct proc_dir_entry **de;
  3307. +    struct proc_dir_entry *de;
  3308.  
  3309.      *result = NULL;
  3310.      if (!dir)
  3311. @@ -144,13 +92,18 @@
  3312.          iput(dir);
  3313.          return -ENOENT;
  3314.      }
  3315. -    for (de = net_dir ; (*de)->name ; de++) {
  3316. -        if (!proc_match(len, name, *de))
  3317. +    for (de = net_dir ; de ; de = de->next) {
  3318. +        struct inode * inode;
  3319. +        if (!proc_match(len, name, de))
  3320.              continue;
  3321. -        *result = iget(dir->i_sb, (*de)->low_ino);
  3322. +        inode = iget(dir->i_sb, de->low_ino);
  3323.          iput(dir);
  3324. -        if (!*result)
  3325. +        if (!inode)
  3326.              return -ENOENT;
  3327. +        inode->u.generic_ip = de;
  3328. +        if (de->fill_inode)
  3329. +            de->fill_inode(inode);
  3330. +        *result = inode;
  3331.          return 0;
  3332.      }
  3333.      iput(dir);
  3334. @@ -162,16 +115,29 @@
  3335.  {
  3336.      struct proc_dir_entry * de;
  3337.      unsigned int ino;
  3338. +    int i;
  3339.  
  3340.      if (!inode || !S_ISDIR(inode->i_mode))
  3341.          return -EBADF;
  3342.      ino = inode->i_ino;
  3343. -    while (((unsigned) filp->f_pos) < nr_net_direntry) {
  3344. -        de = net_dir[filp->f_pos];
  3345. -        if (filldir(dirent, de->name, de->namelen, filp->f_pos, de->low_ino) < 0)
  3346. +    de = net_dir;
  3347. +    i = filp->f_pos;
  3348. +    for (;;) {
  3349. +        if (!de)
  3350. +            return 0;
  3351. +        if (!i)
  3352.              break;
  3353. -        filp->f_pos++;
  3354. +        de = de->next;
  3355. +        i--;
  3356.      }
  3357. +
  3358. +    do {
  3359. +        if (filldir(dirent, de->name, de->namelen, filp->f_pos, de->low_ino) < 0)
  3360. +            return 0;
  3361. +        filp->f_pos++;
  3362. +        de = de->next;
  3363. +    } while (de);
  3364. +
  3365.      return 0;
  3366.  }
  3367.  
  3368. @@ -182,22 +148,14 @@
  3369.              char * buf, int count)
  3370.  {
  3371.      char * page;
  3372. -    unsigned int ino;
  3373.      int bytes=count;
  3374. -    int i;
  3375.      int copied=0;
  3376.      char *start;
  3377.      struct proc_dir_entry * dp;
  3378.  
  3379.      if (count < 0)
  3380.          return -EINVAL;
  3381. -    ino = inode->i_ino;
  3382. -    for (i = 0; ;i++) {
  3383. -        if (i >= NR_MAX_PROC_NET_DIR || (dp = net_dir[i]) == NULL)
  3384. -            return -EBADF;
  3385. -        if (dp->low_ino == ino)
  3386. -            break;
  3387. -    }
  3388. +    dp = (struct proc_dir_entry *) inode->u.generic_ip;
  3389.      if (!(page = (char*) __get_free_page(GFP_KERNEL)))
  3390.          return -ENOMEM;
  3391.  
  3392. @@ -233,3 +191,71 @@
  3393.      free_page((unsigned long) page);
  3394.      return copied;
  3395.  }
  3396. +
  3397. +static struct file_operations proc_net_operations = {
  3398. +    NULL,            /* lseek - default */
  3399. +    proc_readnet,        /* read - bad */
  3400. +    NULL,            /* write - bad */
  3401. +    NULL,            /* readdir */
  3402. +    NULL,            /* select - default */
  3403. +    NULL,            /* ioctl - default */
  3404. +    NULL,            /* mmap */
  3405. +    NULL,            /* no special open code */
  3406. +    NULL,            /* no special release code */
  3407. +    NULL            /* can't fsync */
  3408. +};
  3409. +
  3410. +/*
  3411. + * proc directories can do almost nothing..
  3412. + */
  3413. +struct inode_operations proc_net_inode_operations = {
  3414. +    &proc_net_operations,    /* default net file-ops */
  3415. +    NULL,            /* create */
  3416. +    NULL,            /* lookup */
  3417. +    NULL,            /* link */
  3418. +    NULL,            /* unlink */
  3419. +    NULL,            /* symlink */
  3420. +    NULL,            /* mkdir */
  3421. +    NULL,            /* rmdir */
  3422. +    NULL,            /* mknod */
  3423. +    NULL,            /* rename */
  3424. +    NULL,            /* readlink */
  3425. +    NULL,            /* follow_link */
  3426. +    NULL,            /* bmap */
  3427. +    NULL,            /* truncate */
  3428. +    NULL            /* permission */
  3429. +};
  3430. +
  3431. +static struct file_operations proc_netdir_operations = {
  3432. +    NULL,            /* lseek - default */
  3433. +    NULL,            /* read - bad */
  3434. +    NULL,            /* write - bad */
  3435. +    proc_readnetdir,    /* readdir */
  3436. +    NULL,            /* select - default */
  3437. +    NULL,            /* ioctl - default */
  3438. +    NULL,            /* mmap */
  3439. +    NULL,            /* no special open code */
  3440. +    NULL,            /* no special release code */
  3441. +    NULL            /* can't fsync */
  3442. +};
  3443. +
  3444. +/*
  3445. + * proc directories can do almost nothing..
  3446. + */
  3447. +struct inode_operations proc_netdir_inode_operations = {
  3448. +    &proc_netdir_operations,    /* default net directory file-ops */
  3449. +    NULL,            /* create */
  3450. +    proc_lookupnet,        /* lookup */
  3451. +    NULL,            /* link */
  3452. +    NULL,            /* unlink */
  3453. +    NULL,            /* symlink */
  3454. +    NULL,            /* mkdir */
  3455. +    NULL,            /* rmdir */
  3456. +    NULL,            /* mknod */
  3457. +    NULL,            /* rename */
  3458. +    NULL,            /* readlink */
  3459. +    NULL,            /* follow_link */
  3460. +    NULL,            /* bmap */
  3461. +    NULL,            /* truncate */
  3462. +    NULL            /* permission */
  3463. +};
  3464. diff -u --recursive --new-file v1.3.17/linux/fs/proc/root.c linux/fs/proc/root.c
  3465. --- v1.3.17/linux/fs/proc/root.c    Wed Aug  9 14:55:42 1995
  3466. +++ linux/fs/proc/root.c    Sun Aug 13 13:49:30 1995
  3467. @@ -52,34 +52,34 @@
  3468.  };
  3469.  
  3470.  static struct proc_dir_entry root_dir[] = {
  3471. -    { PROC_ROOT_INO,    NULL,    1, "." },
  3472. -    { PROC_ROOT_INO,    NULL,    2, ".." },
  3473. -    { PROC_LOADAVG,        NULL,    7, "loadavg" },
  3474. -    { PROC_UPTIME,        NULL,    6, "uptime" },
  3475. -    { PROC_MEMINFO,        NULL,    7, "meminfo" },
  3476. -    { PROC_KMSG,        NULL,    4, "kmsg" },
  3477. -    { PROC_VERSION,        NULL,    7, "version" },
  3478. +    { PROC_ROOT_INO,    1, "." },
  3479. +    { PROC_ROOT_INO,    2, ".." },
  3480. +    { PROC_LOADAVG,        7, "loadavg" },
  3481. +    { PROC_UPTIME,        6, "uptime" },
  3482. +    { PROC_MEMINFO,        7, "meminfo" },
  3483. +    { PROC_KMSG,        4, "kmsg" },
  3484. +    { PROC_VERSION,        7, "version" },
  3485.  #ifdef CONFIG_PCI
  3486. -    { PROC_PCI,             NULL,    3, "pci"  },
  3487. +    { PROC_PCI,             3, "pci" },
  3488.  #endif
  3489. -    { PROC_CPUINFO,        NULL,    7, "cpuinfo" },
  3490. -    { PROC_SELF,        NULL,    4, "self" },    /* will change inode # */
  3491. -    { PROC_NET,        NULL,    3, "net" },
  3492. -       { PROC_SCSI,            NULL,    4, "scsi" },
  3493. +    { PROC_CPUINFO,        7, "cpuinfo" },
  3494. +    { PROC_SELF,        4, "self" },    /* will change inode # */
  3495. +    { PROC_NET,        3, "net" },
  3496. +       { PROC_SCSI,            4, "scsi" },
  3497.  #ifdef CONFIG_DEBUG_MALLOC
  3498. -    { PROC_MALLOC,        NULL,    6, "malloc" },
  3499. +    { PROC_MALLOC,        6, "malloc" },
  3500.  #endif
  3501. -    { PROC_KCORE,        NULL,    5, "kcore" },
  3502. -       { PROC_MODULES,        NULL,    7, "modules" },
  3503. -       { PROC_STAT,        NULL,    4, "stat" },
  3504. -       { PROC_DEVICES,        NULL,    7, "devices" },
  3505. -    { PROC_INTERRUPTS,    NULL,    10,"interrupts" },
  3506. -       { PROC_FILESYSTEMS,    NULL,    11,"filesystems" },
  3507. -       { PROC_KSYMS,        NULL,    5, "ksyms" },
  3508. -       { PROC_DMA,        NULL,    3, "dma" },
  3509. -    { PROC_IOPORTS,        NULL,    7, "ioports"},
  3510. +    { PROC_KCORE,        5, "kcore" },
  3511. +       { PROC_MODULES,        7, "modules" },
  3512. +       { PROC_STAT,        4, "stat" },
  3513. +       { PROC_DEVICES,        7, "devices" },
  3514. +    { PROC_INTERRUPTS,    10,"interrupts" },
  3515. +       { PROC_FILESYSTEMS,    11,"filesystems" },
  3516. +       { PROC_KSYMS,        5, "ksyms" },
  3517. +       { PROC_DMA,        3, "dma" },
  3518. +    { PROC_IOPORTS,        7, "ioports" },
  3519.  #ifdef CONFIG_PROFILE
  3520. -    { PROC_PROFILE,        NULL,    7, "profile"},
  3521. +    { PROC_PROFILE,        7, "profile" },
  3522.  #endif
  3523.  };
  3524.  
  3525. @@ -88,6 +88,7 @@
  3526.  static int proc_lookuproot(struct inode * dir,const char * name, int len,
  3527.      struct inode ** result)
  3528.  {
  3529. +    struct proc_dir_entry * de = NULL;
  3530.      unsigned int pid, c;
  3531.      int i, ino;
  3532.  
  3533. @@ -98,11 +99,14 @@
  3534.          iput(dir);
  3535.          return -ENOENT;
  3536.      }
  3537. -    i = NR_ROOT_DIRENTRY;
  3538. -    while (i-- > 0 && !proc_match(len,name,root_dir+i))
  3539. -        /* nothing */;
  3540. -    if (i >= 0) {
  3541. -        ino = root_dir[i].low_ino;
  3542. +    for (i = 0; i < NR_ROOT_DIRENTRY; i++) {
  3543. +        if (!proc_match(len,name,root_dir+i))
  3544. +            continue;
  3545. +        de = root_dir + i;
  3546. +        break;
  3547. +    }
  3548. +    if (de) {
  3549. +        ino = de->low_ino;
  3550.          if (ino == PROC_ROOT_INO) {
  3551.              *result = dir;
  3552.              return 0;
  3553. @@ -139,6 +143,7 @@
  3554.          return -ENOENT;
  3555.      }
  3556.      iput(dir);
  3557. +    (*result)->u.generic_ip = de;
  3558.      return 0;
  3559.  }
  3560.  
  3561. diff -u --recursive --new-file v1.3.17/linux/fs/proc/scsi.c linux/fs/proc/scsi.c
  3562. --- v1.3.17/linux/fs/proc/scsi.c    Wed Aug  9 14:55:42 1995
  3563. +++ linux/fs/proc/scsi.c    Fri Aug 11 18:49:56 1995
  3564. @@ -84,10 +84,10 @@
  3565.  struct proc_dir_entry scsi_hba_dir[(PROC_SCSI_LAST - PROC_SCSI_FILE) * 4]; 
  3566.  
  3567.  static struct proc_dir_entry scsi_dir2[] = {
  3568. -    { PROC_SCSI,        NULL,     1, "." },
  3569. -    { PROC_ROOT_INO,        NULL,     2, ".." },
  3570. -    { PROC_SCSI_NOT_PRESENT,    NULL,    11, "not.present" },
  3571. -    { 0,            NULL,     0, NULL }
  3572. +    { PROC_SCSI,         1, "." },
  3573. +    { PROC_ROOT_INO,         2, ".." },
  3574. +    { PROC_SCSI_NOT_PRESENT,    11, "not.present" },
  3575. +    { 0,             0, NULL }
  3576.  };
  3577.  
  3578.  inline static uint count_dir_entries(uint inode, uint *num)
  3579. diff -u --recursive --new-file v1.3.17/linux/include/linux/aztcd.h linux/include/linux/aztcd.h
  3580. --- v1.3.17/linux/include/linux/aztcd.h    Mon Jul 31 15:59:02 1995
  3581. +++ linux/include/linux/aztcd.h    Wed Aug  9 18:50:27 1995
  3582. @@ -1,4 +1,4 @@
  3583. -/* $Id: aztcd.h,v 1.50 1995/07/29 20:31:32 root Exp $
  3584. +/* $Id: aztcd.h,v 1.60 1995/08/09 12:38:12 root Exp root $
  3585.   *
  3586.   * Definitions for a AztechCD268 CD-ROM interface
  3587.   *    Copyright (C) 1994, 1995  Werner Zimmermann
  3588. @@ -32,7 +32,7 @@
  3589.  */
  3590.  
  3591.  #ifdef AZT_SW32 
  3592. -#define AZT_SW32_BASE_ADDR       0x220  /*I/O port base adress of your soundcard*/
  3593. +#define AZT_SW32_BASE_ADDR       0x220  /*I/O port base address of your soundcard*/
  3594.  #endif
  3595.  
  3596.  /* Set this to 1, if you want your tray to be locked, set to 0 to prevent tray 
  3597. diff -u --recursive --new-file v1.3.17/linux/include/linux/cdrom.h linux/include/linux/cdrom.h
  3598. --- v1.3.17/linux/include/linux/cdrom.h    Mon Jul 31 15:59:02 1995
  3599. +++ linux/include/linux/cdrom.h    Wed Aug  9 18:50:27 1995
  3600. @@ -14,20 +14,20 @@
  3601.  /*
  3602.   * some fix numbers
  3603.   */
  3604. -#define CD_MINS                   74  /* max. minutes per CD             */
  3605. -#define CD_SECS                   60  /* seconds per minute              */
  3606. -#define CD_FRAMES                 75  /* frames per second               */
  3607. -#define CD_CHUNK_SIZE             24  /* lowest-level "data bytes piece" */
  3608. -#define CD_NUM_OF_CHUNKS          98  /* chunks per frame                */
  3609. -#define CD_FRAMESIZE            2048  /* bytes per frame, cooked mode    */
  3610. -#define CD_FRAMESIZE_RAW0       2336  /* bytes per frame, "raw" mode     */
  3611. -#define CD_FRAMESIZE_XA         2340  /* bytes per frame, "xa" mode      */
  3612. -#define CD_FRAMESIZE_RAW        2352  /* bytes per frame, "raw" mode     */
  3613. -#define CD_FRAMESIZE_SUB          96  /* subchannel data size            */
  3614. -#define CD_BLOCK_OFFSET          150  /* offset of first logical frame   */
  3615. -#define CD_XA_HEAD                12  /* header size of XA frame         */
  3616. -#define CD_XA_TAIL               280  /* tail size of XA frame           */
  3617. -
  3618. +#define CD_MINS                    74  /* max. minutes per CD             */
  3619. +#define CD_SECS                    60  /* seconds per minute              */
  3620. +#define CD_FRAMES                  75  /* frames per second               */
  3621. +#define CD_CHUNK_SIZE              24  /* lowest-level "data bytes piece" */
  3622. +#define CD_NUM_OF_CHUNKS           98  /* chunks per frame                */
  3623. +#define CD_FRAMESIZE             2048  /* bytes per frame, cooked mode    */
  3624. +#define CD_FRAMESIZE_RAW0        2336  /* bytes per frame, "raw" mode     */
  3625. +#define CD_FRAMESIZE_XA          2340  /* bytes per frame, "xa" mode      */
  3626. +#define CD_FRAMESIZE_RAW         2352  /* bytes per frame, "raw" mode     */
  3627. +#define CD_FRAMESIZE_SUB           96  /* subchannel data size            */
  3628. +#define CD_BLOCK_OFFSET           150  /* offset of first logical frame   */
  3629. +#define CD_XA_HEAD                 12  /* header size of XA frame         */
  3630. +#define CD_XA_TAIL                280  /* tail size of XA frame           */
  3631. +#define CD_XA_SYNC_HEAD (CD_XA_HEAD+12)/* sync bytes + header of XA frame */
  3632.  /*
  3633.   *
  3634.   * For IOCTL calls, we will commandeer byte 0x53, or 'S'.
  3635. @@ -424,8 +424,7 @@
  3636.  #define    CDROMVOLREAD        0x5313 /* let the drive tell its volume setting */
  3637.                      /* (struct cdrom_volctrl) */
  3638.  
  3639. -#define CDROMREADMODE0          0x5314  /*read data in audio mode*/
  3640. -#define CDROMREADRAW            0x5315  /*read data in raw mode*/
  3641. -#define CDROMREADCOOKED         0x5316  /*read data in cooked mode*/
  3642. +#define CDROMREADRAW            0x5314  /*read data in raw mode*/
  3643. +#define CDROMREADCOOKED         0x5315  /*read data in cooked mode*/
  3644.  
  3645.  #endif  _LINUX_CDROM_H
  3646. diff -u --recursive --new-file v1.3.17/linux/include/linux/ext2_fs.h linux/include/linux/ext2_fs.h
  3647. --- v1.3.17/linux/include/linux/ext2_fs.h    Wed Aug  2 13:21:16 1995
  3648. +++ linux/include/linux/ext2_fs.h    Fri Aug 11 09:26:58 1995
  3649. @@ -28,21 +28,6 @@
  3650.  #undef EXT2FS_DEBUG
  3651.  
  3652.  /*
  3653. - * Define EXT2FS_DEBUG_CACHE to produce cache debug messages
  3654. - */
  3655. -#undef EXT2FS_DEBUG_CACHE
  3656. -
  3657. -/*
  3658. - * Define EXT2FS_CHECK_CACHE to add some checks to the name cache code
  3659. - */
  3660. -#undef EXT2FS_CHECK_CACHE
  3661. -
  3662. -/*
  3663. - * Define EXT2FS_PRE_02B_COMPAT to convert ext 2 fs prior to 0.2b
  3664. - */
  3665. -#undef EXT2FS_PRE_02B_COMPAT
  3666. -
  3667. -/*
  3668.   * Define EXT2_PREALLOCATE to preallocate data blocks for expanding files
  3669.   */
  3670.  #define EXT2_PREALLOCATE
  3671. @@ -50,7 +35,7 @@
  3672.  /*
  3673.   * The second extended file system version
  3674.   */
  3675. -#define EXT2FS_DATE        "95/07/02"
  3676. +#define EXT2FS_DATE        "95/08/09"
  3677.  #define EXT2FS_VERSION        "0.5b"
  3678.  
  3679.  /*
  3680. @@ -80,7 +65,6 @@
  3681.  /*
  3682.   * The second extended file system magic number
  3683.   */
  3684. -#define EXT2_PRE_02B_MAGIC    0xEF51
  3685.  #define EXT2_SUPER_MAGIC    0xEF53
  3686.  
  3687.  /*
  3688. @@ -151,15 +135,6 @@
  3689.  /*
  3690.   * Structure of a blocks group descriptor
  3691.   */
  3692. -struct ext2_old_group_desc
  3693. -{
  3694. -    __u32    bg_block_bitmap;        /* Blocks bitmap block */
  3695. -    __u32    bg_inode_bitmap;        /* Inodes bitmap block */
  3696. -    __u32    bg_inode_table;        /* Inodes table block */
  3697. -    __u16    bg_free_blocks_count;    /* Free blocks count */
  3698. -    __u16    bg_free_inodes_count;    /* Free inodes count */
  3699. -};
  3700. -
  3701.  struct ext2_group_desc
  3702.  {
  3703.      __u32    bg_block_bitmap;        /* Blocks bitmap block */
  3704. @@ -362,12 +337,25 @@
  3705.      __u32    s_reserved[235];    /* Padding to the end of the block */
  3706.  };
  3707.  
  3708. +/*
  3709. + * Codes for operating systems
  3710. + */
  3711.  #define EXT2_OS_LINUX        0
  3712.  #define EXT2_OS_HURD        1
  3713.  #define EXT2_OS_MASIX        2
  3714. +#define EXT2_OS_FREEBSD        3
  3715. +#define EXT2_OS_LITES        4
  3716. +
  3717. +/*
  3718. + * Revision levels
  3719. + */
  3720. +#define EXT2_GOOD_OLD_REV    0    /* The good old (original) format */
  3721.  
  3722. -#define EXT2_CURRENT_REV    0
  3723. +#define EXT2_CURRENT_REV    EXT2_GOOD_OLD_REV
  3724.  
  3725. +/*
  3726. + * Default values for user and/or group using reserved blocks
  3727. + */
  3728.  #define    EXT2_DEF_RESUID        0
  3729.  #define    EXT2_DEF_RESGID        0
  3730.  
  3731. diff -u --recursive --new-file v1.3.17/linux/include/linux/ip_fw.h linux/include/linux/ip_fw.h
  3732. --- v1.3.17/linux/include/linux/ip_fw.h    Tue Aug  8 12:31:42 1995
  3733. +++ linux/include/linux/ip_fw.h    Sun Aug 13 12:51:42 1995
  3734. @@ -163,6 +163,7 @@
  3735.  extern int ip_acct_ctl(int, void *, int);
  3736.  #endif
  3737.  extern int ip_fw_chk(struct iphdr *, struct device *rif,struct ip_fw *, int, int);
  3738. +extern void ip_fw_init(void);
  3739.  #endif /* KERNEL */
  3740.  
  3741.  #ifdef CONFIG_IP_MASQUERADE
  3742. diff -u --recursive --new-file v1.3.17/linux/include/linux/lp.h linux/include/linux/lp.h
  3743. --- v1.3.17/linux/include/linux/lp.h    Sun Jan 15 00:55:50 1995
  3744. +++ linux/include/linux/lp.h    Sun Aug 13 11:26:12 1995
  3745. @@ -68,6 +68,7 @@
  3746.                  FALSE to ignore error.  Default is ignore.  */
  3747.  #define LPGETSTATUS 0x060b  /* return LP_S(minor) */
  3748.  #define LPRESET     0x060c  /* reset printer */
  3749. +#define LPGETSTATS  0x060d  /* get statistics (struct lp_stats) */
  3750.  
  3751.  /* timeout for printk'ing a timeout, in jiffies (100ths of a second).
  3752.     This is also used for re-checking error conditions if LP_ABORT is
  3753. @@ -85,9 +86,19 @@
  3754.  #define LP_WAIT(minor)    lp_table[(minor)].wait        /* strobe wait */
  3755.  #define LP_IRQ(minor)    lp_table[(minor)].irq        /* interrupt # */
  3756.                              /* 0 means polled */
  3757. +#define LP_STAT(minor)    lp_table[(minor)].stats        /* statistics area */
  3758.  
  3759.  #define LP_BUFFER_SIZE 256
  3760.  
  3761. +struct lp_stats {
  3762. +    unsigned long chars;
  3763. +    unsigned long sleeps;
  3764. +    unsigned int maxrun;
  3765. +    unsigned int maxwait;
  3766. +    unsigned int meanwait;
  3767. +    unsigned int mdev;
  3768. +};
  3769. +
  3770.  struct lp_struct {
  3771.      int base;
  3772.      unsigned int irq;
  3773. @@ -97,6 +108,10 @@
  3774.      unsigned int wait;
  3775.      struct wait_queue *lp_wait_q;
  3776.      char *lp_buffer;
  3777. +    unsigned int lastcall;
  3778. +    unsigned int runchars;
  3779. +    unsigned int waittime;
  3780. +    struct lp_stats stats;
  3781.  };
  3782.  
  3783.  /*
  3784. @@ -123,11 +138,11 @@
  3785.   * base + 2 
  3786.   * accessed with LP_C(minor)
  3787.   */
  3788. -#define LP_PINTEN    0x10
  3789. +#define LP_PINTEN    0x10  /* high to read data in or-ed with data out */
  3790.  #define LP_PSELECP    0x08  /* inverted output, active low */
  3791.  #define LP_PINITP    0x04  /* unchanged output, active low */
  3792.  #define LP_PAUTOLF    0x02  /* inverted output, active low */
  3793. -#define LP_PSTROBE    0x01  /* inverted output, active low */
  3794. +#define LP_PSTROBE    0x01  /* short high output on raising edge */
  3795.  
  3796.  /* 
  3797.   * the value written to ports to test existence. PC-style ports will 
  3798. @@ -137,10 +152,10 @@
  3799.  #define LP_DUMMY    0x00
  3800.  
  3801.  /*
  3802. - * This is the port delay time.  Your mileage may vary.
  3803. - * It is used only in the lp_init() routine.
  3804. + * This is the port delay time, in microseconds.
  3805. + * It is used only in the lp_init() and lp_reset() routine.
  3806.   */
  3807. -#define LP_DELAY     150000
  3808. +#define LP_DELAY     50
  3809.  
  3810.  /*
  3811.   * function prototypes
  3812. diff -u --recursive --new-file v1.3.17/linux/include/linux/proc_fs.h linux/include/linux/proc_fs.h
  3813. --- v1.3.17/linux/include/linux/proc_fs.h    Wed Aug  9 14:55:43 1995
  3814. +++ linux/include/linux/proc_fs.h    Sun Aug 13 14:04:18 1995
  3815. @@ -116,11 +116,28 @@
  3816.  
  3817.  #define PROC_SUPER_MAGIC 0x9fa0
  3818.  
  3819. +/*
  3820. + * This is not completely implemented yet. The idea is to
  3821. + * create a in-memory tree (like the actual /proc filesystem
  3822. + * tree) of these proc_dir_entries, so that we can dynamically
  3823. + * add new files to /proc.
  3824. + *
  3825. + * The "next" pointer creates a linked list of one /proc directory,
  3826. + * while parent/subdir create the directory structure (every
  3827. + * /proc file has a parent, but "subdir" is NULL for all
  3828. + * non-directory entries).
  3829. + *
  3830. + * "get_info" is called at "read", while "fill_inode" is used to
  3831. + * fill in file type/protection/owner information specific to the
  3832. + * particular /proc file.
  3833. + */
  3834.  struct proc_dir_entry {
  3835.      unsigned short low_ino;
  3836. -    int (*get_info)(char *, char **, off_t, int, int);
  3837.      unsigned short namelen;
  3838. -    const char * name;
  3839. +    const char *name;
  3840. +    int (*get_info)(char *, char **, off_t, int, int);
  3841. +    void (*fill_inode)(struct inode *);
  3842. +    struct proc_dir_entry *next, *parent, *subdir;
  3843.  };
  3844.  
  3845.  extern struct super_block *proc_read_super(struct super_block *,void *,int);
  3846. @@ -136,6 +153,7 @@
  3847.  extern struct inode_operations proc_root_inode_operations;
  3848.  extern struct inode_operations proc_base_inode_operations;
  3849.  extern struct inode_operations proc_net_inode_operations;
  3850. +extern struct inode_operations proc_netdir_inode_operations;
  3851.  extern struct inode_operations proc_scsi_inode_operations;
  3852.  extern struct inode_operations proc_mem_inode_operations;
  3853.  extern struct inode_operations proc_array_inode_operations;
  3854. diff -u --recursive --new-file v1.3.17/linux/include/net/netrom.h linux/include/net/netrom.h
  3855. --- v1.3.17/linux/include/net/netrom.h    Mon Jul 31 15:59:03 1995
  3856. +++ linux/include/net/netrom.h    Fri Aug 11 13:14:42 1995
  3857. @@ -91,7 +91,7 @@
  3858.  extern struct nr_parms_struct nr_default;
  3859.  extern int  nr_rx_frame(struct sk_buff *, struct device *);
  3860.  extern void nr_destroy_socket(struct sock *);
  3861. -extern int  nr_get_info(char *, char **, off_t, int);
  3862. +extern int  nr_get_info(char *, char **, off_t, int, int);
  3863.  
  3864.  /* nr_dev.c */
  3865.  extern int  nr_rx_ip(struct sk_buff *, struct device *);
  3866. @@ -119,8 +119,8 @@
  3867.  extern int  nr_rt_ioctl(unsigned int, void *);
  3868.  extern void nr_link_failed(ax25_address *, struct device *);
  3869.  extern int  nr_route_frame(struct sk_buff *, ax25_cb *);
  3870. -extern int  nr_nodes_get_info(char *, char **, off_t, int);
  3871. -extern int  nr_neigh_get_info(char *, char **, off_t, int);
  3872. +extern int  nr_nodes_get_info(char *, char **, off_t, int, int);
  3873. +extern int  nr_neigh_get_info(char *, char **, off_t, int, int);
  3874.  
  3875.  /* nr_subr.c */
  3876.  extern void nr_clear_queues(struct sock *);
  3877. diff -u --recursive --new-file v1.3.17/linux/include/net/route.h linux/include/net/route.h
  3878. --- v1.3.17/linux/include/net/route.h    Wed Aug  9 14:55:43 1995
  3879. +++ linux/include/net/route.h    Fri Aug 11 13:14:42 1995
  3880. @@ -33,7 +33,7 @@
  3881.      unsigned long        rt_mask;
  3882.      unsigned long        rt_gateway;
  3883.      unsigned short        rt_flags;
  3884. -    unsigned short        rt_metric;
  3885. +    short            rt_metric;
  3886.      unsigned int        rt_refcnt;
  3887.      unsigned long        rt_use;
  3888.      unsigned short        rt_mss;
  3889. @@ -45,7 +45,7 @@
  3890.  
  3891.  extern void        ip_rt_flush(struct device *dev);
  3892.  extern void        ip_rt_add(short flags, unsigned long addr, unsigned long mask,
  3893. -                   unsigned long gw, struct device *dev, unsigned short mss, unsigned long window, unsigned short irtt, unsigned char metric);
  3894. +                   unsigned long gw, struct device *dev, unsigned short mss, unsigned long window, unsigned short irtt, short metric);
  3895.  extern struct rtable    *ip_rt_route(unsigned long daddr, struct options *opt, unsigned long *src_addr);
  3896.  extern struct rtable     *ip_rt_local(unsigned long daddr, struct options *opt, unsigned long *src_addr);
  3897.  extern int        rt_get_info(char * buffer, char **start, off_t offset, int length, int dummy);
  3898. diff -u --recursive --new-file v1.3.17/linux/include/net/sock.h linux/include/net/sock.h
  3899. --- v1.3.17/linux/include/net/sock.h    Tue Aug  8 12:31:42 1995
  3900. +++ linux/include/net/sock.h    Fri Aug 11 09:27:01 1995
  3901. @@ -53,7 +53,8 @@
  3902.  
  3903.  #include <linux/igmp.h>
  3904.  
  3905. -#define SOCK_ARRAY_SIZE    256        /* Think big (also on some systems a byte is faster */
  3906. +/* Think big (also on some systems a byte is faster) */
  3907. +#define SOCK_ARRAY_SIZE    256
  3908.  
  3909.  
  3910.  /*
  3911. @@ -177,8 +178,8 @@
  3912.  #endif
  3913.    
  3914.  /*
  3915. - *    This is where all the private (optional) areas that dont overlap will eventually live
  3916. - *    for now just AF_UNIX is here.
  3917. + *    This is where all the private (optional) areas that don't
  3918. + *    overlap will eventually live. For now just AF_UNIX is here.
  3919.   */
  3920.  
  3921.    union
  3922. @@ -187,57 +188,59 @@
  3923.    } protinfo;          
  3924.  
  3925.  /* IP 'private area' or will be eventually */
  3926. -  int                ip_ttl;            /* TTL setting                 */
  3927. -  int                ip_tos;            /* TOS                     */
  3928. -  struct tcphdr            dummy_th;
  3929. -  struct timer_list        keepalive_timer;    /* TCP keepalive hack             */
  3930. -  struct timer_list        retransmit_timer;    /* TCP retransmit timer         */
  3931. -  struct timer_list        ack_timer;        /* TCP delayed ack timer        */
  3932. -  int                ip_xmit_timeout;    /* Why the timeout is running         */
  3933. -  struct rtable            *ip_route_cache;    /* Cached output route             */
  3934. -  unsigned long            ip_route_stamp;        /* Route cache stamp             */
  3935. -  unsigned long            ip_route_daddr;        /* Target address             */
  3936. -  unsigned long            ip_route_saddr;        /* Source address            */
  3937. -  int                ip_route_local;        /* State of locality flag        */
  3938. -  unsigned long            ip_hcache_stamp;    /* Header cache stamp            */
  3939. -  unsigned long         *ip_hcache_ver;        /* Pointer to version of cache        */
  3940. -  char                ip_hcache_data[16];    /* Cached header            */
  3941. -  int                ip_hcache_state;    /* Have we a cached header        */
  3942. -  unsigned char            ip_option_len;        /* Length of IP options            */
  3943. -  unsigned char            ip_option_flen;        /* Second fragment option length    */
  3944. -  unsigned char            ip_opt_next_strict;    /* Next hop is strict route        */
  3945. -  unsigned long            ip_opt_next_hop;    /* Next hop if forced            */
  3946. -  unsigned char         *ip_opt_ptr[2];        /* IP option pointers            */
  3947. +  int            ip_ttl;            /* TTL setting */
  3948. +  int            ip_tos;            /* TOS */
  3949. +  struct tcphdr        dummy_th;
  3950. +  struct timer_list    keepalive_timer;    /* TCP keepalive hack */
  3951. +  struct timer_list    retransmit_timer;    /* TCP retransmit timer */
  3952. +  struct timer_list    ack_timer;        /* TCP delayed ack timer */
  3953. +  int            ip_xmit_timeout;    /* Why the timeout is running */
  3954. +  struct rtable        *ip_route_cache;    /* Cached output route */
  3955. +  unsigned long        ip_route_stamp;        /* Route cache stamp */
  3956. +  unsigned long        ip_route_daddr;        /* Target address */
  3957. +  unsigned long        ip_route_saddr;        /* Source address */
  3958. +  int            ip_route_local;        /* State of locality flag */
  3959. +  unsigned long        ip_hcache_stamp;    /* Header cache stamp */
  3960. +  unsigned long     *ip_hcache_ver;        /* Pointer to version of cache */
  3961. +  char            ip_hcache_data[16];    /* Cached header */
  3962. +  int            ip_hcache_state;    /* Have we a cached header */
  3963. +  unsigned char        ip_option_len;        /* Length of IP options */
  3964. +  unsigned char        ip_option_flen;        /* Second fragment option length */
  3965. +  unsigned char        ip_opt_next_strict;    /* Next hop is strict route */
  3966. +  unsigned long        ip_opt_next_hop;    /* Next hop if forced */
  3967. +  unsigned char     *ip_opt_ptr[2];        /* IP option pointers */
  3968.  #ifdef CONFIG_IP_MULTICAST  
  3969. -  int                ip_mc_ttl;            /* Multicasting TTL         */
  3970. -  int                ip_mc_loop;            /* Loopback             */
  3971. -  char                ip_mc_name[MAX_ADDR_LEN];    /* Multicast device name     */
  3972. -  struct ip_mc_socklist        *ip_mc_list;            /* Group array             */
  3973. +  int            ip_mc_ttl;        /* Multicasting TTL */
  3974. +  int            ip_mc_loop;        /* Loopback */
  3975. +  char            ip_mc_name[MAX_ADDR_LEN];/* Multicast device name */
  3976. +  struct ip_mc_socklist    *ip_mc_list;        /* Group array */
  3977.  #endif  
  3978.  
  3979.    /* This part is used for the timeout functions (timer.c). */
  3980. -  int                timeout;    /* What are we waiting for? */
  3981. -  struct timer_list        timer;        /* This is the TIME_WAIT/receive timer when we are doing IP */
  3982. -  struct timeval        stamp;
  3983. +  int            timeout;    /* What are we waiting for? */
  3984. +  struct timer_list    timer;        /* This is the TIME_WAIT/receive timer
  3985. +                     * when we are doing IP
  3986. +                     */
  3987. +  struct timeval    stamp;
  3988.  
  3989.    /* identd */
  3990. -  struct socket            *socket;
  3991. +  struct socket        *socket;
  3992.    
  3993.    /* Callbacks */
  3994. -  void                (*state_change)(struct sock *sk);
  3995. -  void                (*data_ready)(struct sock *sk,int bytes);
  3996. -  void                (*write_space)(struct sock *sk);
  3997. -  void                (*error_report)(struct sock *sk);
  3998. +  void            (*state_change)(struct sock *sk);
  3999. +  void            (*data_ready)(struct sock *sk,int bytes);
  4000. +  void            (*write_space)(struct sock *sk);
  4001. +  void            (*error_report)(struct sock *sk);
  4002.    
  4003.  };
  4004.  
  4005.  struct proto {
  4006.    struct sk_buff *    (*wmalloc)(struct sock *sk,
  4007. -                    unsigned long size, int force,
  4008. -                    int priority);
  4009. +                   unsigned long size, int force,
  4010. +                   int priority);
  4011.    struct sk_buff *    (*rmalloc)(struct sock *sk,
  4012. -                    unsigned long size, int force,
  4013. -                    int priority);
  4014. +                   unsigned long size, int force,
  4015. +                   int priority);
  4016.    void            (*wfree)(struct sock *sk, struct sk_buff *skb);
  4017.    void            (*rfree)(struct sock *sk, struct sk_buff *skb);
  4018.    unsigned long        (*rspace)(struct sock *sk);
  4019. @@ -248,9 +251,9 @@
  4020.    int            (*write)(struct sock *sk, const unsigned char *to,
  4021.                   int len, int nonblock, unsigned flags);
  4022.    int            (*sendto)(struct sock *sk,
  4023. -                  const unsigned char *from, int len, int noblock,
  4024. -                  unsigned flags, struct sockaddr_in *usin,
  4025. -                  int addr_len);
  4026. +                  const unsigned char *from, int len, 
  4027. +                  int noblock, unsigned flags,
  4028. +                  struct sockaddr_in *usin, int addr_len);
  4029.    int            (*recvfrom)(struct sock *sk,
  4030.                      unsigned char *from, int len, int noblock,
  4031.                      unsigned flags, struct sockaddr_in *usin,
  4032. @@ -259,9 +262,10 @@
  4033.                      unsigned long saddr,
  4034.                      unsigned long daddr,
  4035.                      struct device **dev, int type,
  4036. -                    struct options *opt, int len, int tos, int ttl);
  4037. +                    struct options *opt, int len,
  4038. +                    int tos, int ttl);
  4039.    int            (*connect)(struct sock *sk,
  4040. -                  struct sockaddr_in *usin, int addr_len);
  4041. +                   struct sockaddr_in *usin, int addr_len);
  4042.    struct sock *        (*accept) (struct sock *sk, int flags);
  4043.    void            (*queue_xmit)(struct sock *sk,
  4044.                        struct device *dev, struct sk_buff *skb,
  4045. @@ -280,9 +284,9 @@
  4046.    int            (*init)(struct sock *sk);
  4047.    void            (*shutdown)(struct sock *sk, int how);
  4048.    int            (*setsockopt)(struct sock *sk, int level, int optname,
  4049. -                   char *optval, int optlen);
  4050. +                      char *optval, int optlen);
  4051.    int            (*getsockopt)(struct sock *sk, int level, int optname,
  4052. -                  char *optval, int *option);       
  4053. +                      char *optval, int *option);       
  4054.    unsigned short    max_header;
  4055.    unsigned long        retransmits;
  4056.    char            name[32];
  4057. @@ -298,9 +302,13 @@
  4058.  #define TIME_DESTROY    4
  4059.  #define TIME_DONE    5    /* used to absorb those last few packets */
  4060.  #define TIME_PROBE0    6
  4061. -#define SOCK_DESTROY_TIME 1000    /* about 10 seconds            */
  4062. +/* about 10 seconds */
  4063. +#define SOCK_DESTROY_TIME (10*HZ)
  4064. +
  4065. +
  4066. +/* Sockets 0-1023 can't be bound too unless you are superuser */
  4067. +#define PROT_SOCK    1024
  4068.  
  4069. -#define PROT_SOCK    1024    /* Sockets 0-1023 can't be bound too unless you are superuser */
  4070.  
  4071.  #define SHUTDOWN_MASK    3
  4072.  #define RCV_SHUTDOWN    1
  4073. @@ -308,7 +316,8 @@
  4074.  
  4075.  
  4076.  extern void            destroy_sock(struct sock *sk);
  4077. -extern unsigned short        get_new_socknum(struct proto *, unsigned short);
  4078. +extern unsigned short        get_new_socknum(struct proto *,
  4079. +                        unsigned short);
  4080.  extern void            put_sock(unsigned short, struct sock *); 
  4081.  extern void            release_sock(struct sock *sk);
  4082.  extern struct sock        *get_sock(struct proto *, unsigned short,
  4083. @@ -326,22 +335,32 @@
  4084.  extern struct sk_buff        *sock_rmalloc(struct sock *sk,
  4085.                            unsigned long size, int force,
  4086.                            int priority);
  4087. -extern void            sock_wfree(struct sock *sk, struct sk_buff *skb);
  4088. -extern void            sock_rfree(struct sock *sk, struct sk_buff *skb);
  4089. +extern void            sock_wfree(struct sock *sk,
  4090. +                       struct sk_buff *skb);
  4091. +extern void            sock_rfree(struct sock *sk,
  4092. +                       struct sk_buff *skb);
  4093.  extern unsigned long        sock_rspace(struct sock *sk);
  4094.  extern unsigned long        sock_wspace(struct sock *sk);
  4095.  
  4096. -extern int            sock_setsockopt(struct sock *sk,int level,int op,char *optval,int optlen);
  4097. -
  4098. -extern int            sock_getsockopt(struct sock *sk,int level,int op,char *optval,int *optlen);
  4099. -extern struct sk_buff         *sock_alloc_send_skb(struct sock *skb, unsigned long size, int noblock, int *errcode);
  4100. +extern int            sock_setsockopt(struct sock *sk, int level,
  4101. +                        int op, char *optval,
  4102. +                        int optlen);
  4103. +
  4104. +extern int            sock_getsockopt(struct sock *sk, int level,
  4105. +                        int op, char *optval, 
  4106. +                        int *optlen);
  4107. +extern struct sk_buff         *sock_alloc_send_skb(struct sock *skb,
  4108. +                             unsigned long size,
  4109. +                             int noblock,
  4110. +                             int *errcode);
  4111.  
  4112.  /*
  4113. - *    Queue a received datagram if it will fit. Stream and sequenced protocols
  4114. - *    can't normally use this as they need to fit buffers in and play with them.
  4115. + *     Queue a received datagram if it will fit. Stream and sequenced
  4116. + *    protocols can't normally use this as they need to fit buffers in
  4117. + *    and play with them.
  4118.   *
  4119. - *    Inlined as its very short and called for pretty much every packet ever
  4120. - *    received.
  4121. + *     Inlined as its very short and called for pretty much every
  4122. + *    packet ever received.
  4123.   */
  4124.  
  4125.  extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
  4126. @@ -363,9 +382,9 @@
  4127.  /* declarations from timer.c */
  4128.  extern struct sock *timer_base;
  4129.  
  4130. -void delete_timer (struct sock *);
  4131. -void reset_timer (struct sock *, int, unsigned long);
  4132. -void net_timer (unsigned long);
  4133. +extern void delete_timer (struct sock *);
  4134. +extern void reset_timer (struct sock *, int, unsigned long);
  4135. +extern void net_timer (unsigned long);
  4136.  
  4137.  
  4138.  /* Enable debug/info messages */
  4139. diff -u --recursive --new-file v1.3.17/linux/kernel/sys.c linux/kernel/sys.c
  4140. --- v1.3.17/linux/kernel/sys.c    Fri Jul  7 08:54:56 1995
  4141. +++ linux/kernel/sys.c    Thu Aug 10 09:05:26 1995
  4142. @@ -436,7 +436,7 @@
  4143.      freepages = buffermem >> 12;
  4144.      freepages += nr_free_pages;
  4145.      freepages += nr_swap_pages;
  4146. -    freepages -= (high_memory - 0x100000) >> 16;
  4147. +    freepages -= MAP_NR(high_memory) >> 4;
  4148.      freepages -= (newbrk-oldbrk) >> 12;
  4149.      if (freepages < 0)
  4150.          return current->mm->brk;
  4151. diff -u --recursive --new-file v1.3.17/linux/lib/string.c linux/lib/string.c
  4152. --- v1.3.17/linux/lib/string.c    Thu Jul 27 10:13:17 1995
  4153. +++ linux/lib/string.c    Fri Aug 11 09:26:58 1995
  4154. @@ -62,8 +62,10 @@
  4155.          while (*dest)
  4156.              dest++;
  4157.          while ((*dest++ = *src++)) {
  4158. -            if (--count == 0)
  4159. +            if (--count == 0) {
  4160. +                *dest = '\0';
  4161.                  break;
  4162. +            }
  4163.          }
  4164.      }
  4165.  
  4166. diff -u --recursive --new-file v1.3.17/linux/net/Changes linux/net/Changes
  4167. --- v1.3.17/linux/net/Changes    Tue Aug  8 12:31:43 1995
  4168. +++ linux/net/Changes    Fri Aug 11 13:14:43 1995
  4169. @@ -154,14 +154,21 @@
  4170.  
  4171.  ------->>>> 1.3.16 <<<--------
  4172.  
  4173. -o    Missing patches for device change in TCP    [IN]
  4174. -o    Device locking                    [IN]
  4175. +o    Missing patches for device change in TCP    [TESTED]
  4176. +o    Device locking                    [TESTED]
  4177.  o    Infinite slip devices                [IN]
  4178.  o    New AF_UNIX sockets                [IN]
  4179.  o    Sendmsg/recvmsg (for some stuff only)        [IN]
  4180. -o    Device unload loopholes fixed            [IN]
  4181. +o    Device unload loopholes fixed            [TESTED]
  4182.  o    Extra firewall abilities            [IN]
  4183. -o    Appletalk node probe bug fix            [IN]
  4184. +o    Appletalk node probe bug fix            [TESTED]
  4185. +
  4186. +------->>>> 1.3.18 <<<<---------
  4187. +
  4188. +o    AF_UNIX debugging                [IN]
  4189. +o    TCP explode on SWS bug fix            [IN]
  4190. +o    John Naylor's ARP hwtype fix            [IN]
  4191. +o    Datagram select matches BSD semantics        [IN]
  4192.  
  4193.  
  4194.  o    Finish merging the bridge code
  4195. diff -u --recursive --new-file v1.3.17/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
  4196. --- v1.3.17/linux/net/appletalk/ddp.c    Wed Aug  9 14:55:43 1995
  4197. +++ linux/net/appletalk/ddp.c    Fri Aug 11 19:02:18 1995
  4198. @@ -1865,11 +1865,11 @@
  4199.      aarp_proto_init();
  4200.  
  4201.  proc_net_register(&(struct proc_dir_entry)
  4202. -    { PROC_NET_ATALK,    atalk_get_info,        9, "appletalk" });
  4203. +    { PROC_NET_ATALK, 9, "appletalk", atalk_get_info });
  4204.  proc_net_register(&(struct proc_dir_entry)
  4205. -    { PROC_NET_AT_ROUTE,    atalk_rt_get_info,    11,"atalk_route" });
  4206. +    { PROC_NET_AT_ROUTE, 11,"atalk_route", atalk_rt_get_info });
  4207.  proc_net_register(&(struct proc_dir_entry)
  4208. -    { PROC_NET_ATIF,    atalk_if_get_info,    11,"atalk_iface" });
  4209. +    { PROC_NET_ATIF, 11,"atalk_iface", atalk_if_get_info });
  4210.  
  4211.      printk("Appletalk BETA 0.11 for Linux NET3.030\n");
  4212.  }
  4213. diff -u --recursive --new-file v1.3.17/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
  4214. --- v1.3.17/linux/net/ax25/af_ax25.c    Wed Aug  9 14:55:43 1995
  4215. +++ linux/net/ax25/af_ax25.c    Fri Aug 11 19:02:18 1995
  4216. @@ -96,6 +96,7 @@
  4217.  #include <linux/mm.h>
  4218.  #include <linux/interrupt.h>
  4219.  #include <linux/notifier.h>
  4220. +#include <linux/proc_fs.h>
  4221.  
  4222.  #include <net/ip.h>
  4223.  #include <net/arp.h>
  4224. @@ -2031,11 +2032,11 @@
  4225.      register_netdevice_notifier(&ax25_dev_notifier);
  4226.                
  4227.  proc_net_register(&(struct proc_dir_entry)
  4228. -    { PROC_NET_AX25_ROUTE,    ax25_rt_get_info,    10, "ax25_route" });
  4229. +    { PROC_NET_AX25_ROUTE, 10, "ax25_route", ax25_rt_get_info });
  4230.  proc_net_register(&(struct proc_dir_entry)
  4231. -    { PROC_NET_AX25,    ax25_get_info,        4, "ax25" });
  4232. +    { PROC_NET_AX25, 4, "ax25", ax25_get_info });
  4233.  proc_net_register(&(struct proc_dir_entry)
  4234. -    { PROC_NET_AX25_CALLS,    ax25_cs_get_info,    10, "ax25_calls" });
  4235. +    { PROC_NET_AX25_CALLS, 10, "ax25_calls", ax25_cs_get_info });
  4236.  
  4237.      printk("GW4PTS/G4KLX AX.25 for Linux. Version 0.30 ALPHA for Linux NET3.030 (Linux 1.3.0)\n");
  4238.  }
  4239. diff -u --recursive --new-file v1.3.17/linux/net/core/datagram.c linux/net/core/datagram.c
  4240. --- v1.3.17/linux/net/core/datagram.c    Wed Aug  9 14:55:44 1995
  4241. +++ linux/net/core/datagram.c    Fri Aug 11 13:14:42 1995
  4242. @@ -16,6 +16,7 @@
  4243.   *        Alan Cox    :    Fixed write select of non IP protocol crash.
  4244.   *        Florian  La Roche:    Changed for my new skbuff handling.
  4245.   *        Darryl Miles    :    Fixed non-blocking SOCK_SEQPACKET.
  4246. + *        Linus Torvalds    :    BSD semantic fixes.
  4247.   *
  4248.   *    Note:
  4249.   *        A lot of this will change when the protocol/socket separation
  4250. diff -u --recursive --new-file v1.3.17/linux/net/core/dev.c linux/net/core/dev.c
  4251. --- v1.3.17/linux/net/core/dev.c    Wed Aug  9 14:55:44 1995
  4252. +++ linux/net/core/dev.c    Fri Aug 11 19:02:18 1995
  4253. @@ -1321,7 +1321,7 @@
  4254.          }
  4255.      }
  4256.  proc_net_register(&(struct proc_dir_entry)
  4257. -    { PROC_NET_DEV,        dev_get_info,    3, "dev" });
  4258. +    { PROC_NET_DEV, 3, "dev", dev_get_info });
  4259.  
  4260.  }
  4261.  
  4262. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
  4263. --- v1.3.17/linux/net/ipv4/af_inet.c    Wed Aug  9 14:55:44 1995
  4264. +++ linux/net/ipv4/af_inet.c    Sun Aug 13 12:51:42 1995
  4265. @@ -1601,21 +1601,26 @@
  4266.         */
  4267.      ip_init();
  4268.  
  4269. +#if defined(CONFIG_IP_ACCT)||defined(CONFIG_IP_FIREWALL)|| \
  4270. +    defined(CONFIG_IP_MASQUERADE)
  4271. +    ip_fw_init();
  4272. +#endif
  4273. +
  4274.  #ifdef CONFIG_INET_RARP
  4275.  proc_net_register(&(struct proc_dir_entry)
  4276. -    { PROC_NET_RARP,    rarp_get_info,        4, "rarp"});
  4277. +    { PROC_NET_RARP, 4, "rarp", rarp_get_info });
  4278.      rarp_ioctl_hook = rarp_ioctl;
  4279.  #endif
  4280.  proc_net_register(&(struct proc_dir_entry)
  4281. -    { PROC_NET_RAW,        raw_get_info,        3, "raw" });
  4282. +    { PROC_NET_RAW, 3, "raw", raw_get_info });
  4283.  proc_net_register(&(struct proc_dir_entry)
  4284. -    { PROC_NET_SNMP,    snmp_get_info,        4, "snmp" });
  4285. +    { PROC_NET_SNMP, 4, "snmp", snmp_get_info });
  4286.  proc_net_register(&(struct proc_dir_entry)
  4287. -    { PROC_NET_SOCKSTAT,    afinet_get_info,    8, "sockstat" });
  4288. +    { PROC_NET_SOCKSTAT, 8, "sockstat", afinet_get_info });
  4289.  proc_net_register(&(struct proc_dir_entry)
  4290. -    { PROC_NET_TCP,        tcp_get_info,        3, "tcp" });
  4291. +    { PROC_NET_TCP, 3, "tcp", tcp_get_info });
  4292.  proc_net_register(&(struct proc_dir_entry)
  4293. -    { PROC_NET_UDP,        udp_get_info,        3, "udp" });
  4294. +    { PROC_NET_UDP, 3, "udp", udp_get_info });
  4295.  proc_net_register(&(struct proc_dir_entry)
  4296. -    { PROC_NET_ROUTE,    rt_get_info,        5, "route" });
  4297. +    { PROC_NET_ROUTE, 5, "route", rt_get_info });
  4298.  }
  4299. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
  4300. --- v1.3.17/linux/net/ipv4/arp.c    Wed Aug  9 14:55:44 1995
  4301. +++ linux/net/ipv4/arp.c    Fri Aug 11 19:02:18 1995
  4302. @@ -40,6 +40,8 @@
  4303.   *        Alan Cox    :    Don't proxy across hardware types!
  4304.   *        Jonathan Naylor :    Added support for NET/ROM.
  4305.   *        Mike Shaver     :       RFC1122 checks.
  4306. + *        Jonathan Naylor :    Only lookup the hardware address for
  4307. + *                    the correct hardware type.
  4308.   */
  4309.  
  4310.  /* RFC1122 Status:
  4311. @@ -160,7 +162,7 @@
  4312.  
  4313.  /* Forward declarations. */
  4314.  static void arp_check_expire (unsigned long);  
  4315. -static struct arp_table *arp_lookup(u32 paddr, enum proxy proxy);
  4316. +static struct arp_table *arp_lookup(u32 paddr, enum proxy proxy, unsigned short type);
  4317.  
  4318.  
  4319.  static struct timer_list arp_timer =
  4320. @@ -953,7 +955,7 @@
  4321.      /*
  4322.       *    Find an entry
  4323.       */
  4324. -    entry = arp_lookup(paddr, PROXY_NONE);
  4325. +    entry = arp_lookup(paddr, PROXY_NONE, dev->type);
  4326.  
  4327.      if (entry != NULL)     /* It exists */
  4328.      {
  4329. @@ -1126,13 +1128,14 @@
  4330.   *    for proxy entries, otherwise the netmask will be used
  4331.   */
  4332.  
  4333. -static struct arp_table *arp_lookup(u32 paddr, enum proxy proxy)
  4334. +static struct arp_table *arp_lookup(u32 paddr, enum proxy proxy, unsigned short type)
  4335.  {
  4336.      struct arp_table *entry;
  4337.      unsigned long hash = HASH(paddr);
  4338.      
  4339.      for (entry = arp_tables[hash]; entry != NULL; entry = entry->next)
  4340. -        if (entry->ip == paddr) break;
  4341. +        if (entry->ip == paddr && entry->htype == type)
  4342. +            break;
  4343.  
  4344.      /* it's possibly a proxy entry (with a netmask) */
  4345.      if (!entry && proxy != PROXY_NONE)
  4346. @@ -1186,7 +1189,7 @@
  4347.              return 1;
  4348.              
  4349.          default:
  4350. -            entry=arp_lookup(daddr, PROXY_NONE);
  4351. +            entry=arp_lookup(daddr, PROXY_NONE, dev->type);
  4352.              if(entry)
  4353.              {
  4354.                  memcpy(dp,entry->ha, ETH_ALEN);
  4355. @@ -1277,7 +1280,7 @@
  4356.      /*
  4357.       *    Find the entry
  4358.       */
  4359. -    entry = arp_lookup(ip, PROXY_EXACT);
  4360. +    entry = arp_lookup(ip, PROXY_EXACT, htype);
  4361.      if (entry && (entry->flags & ATF_PUBL) != (r.arp_flags & ATF_PUBL))
  4362.      {
  4363.          sti();
  4364. @@ -1358,7 +1361,7 @@
  4365.      
  4366.      si = (struct sockaddr_in *) &r.arp_pa;
  4367.      cli();
  4368. -    entry = arp_lookup(si->sin_addr.s_addr,PROXY_ANY);
  4369. +    entry = arp_lookup(si->sin_addr.s_addr, PROXY_ANY, r.arp_ha.sa_family);
  4370.  
  4371.      if (entry == NULL)
  4372.      {
  4373. @@ -1458,6 +1461,6 @@
  4374.      register_netdevice_notifier(&arp_dev_notifier);
  4375.  
  4376.  proc_net_register(&(struct proc_dir_entry)
  4377. -    { PROC_NET_ARP,        arp_get_info,    3, "arp" });
  4378. +    { PROC_NET_ARP,    3, "arp", arp_get_info });
  4379.  }
  4380.  
  4381. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/ip.c linux/net/ipv4/ip.c
  4382. --- v1.3.17/linux/net/ipv4/ip.c    Wed Aug  9 14:55:44 1995
  4383. +++ linux/net/ipv4/ip.c    Fri Aug 11 19:02:18 1995
  4384. @@ -87,6 +87,7 @@
  4385.   *        Alan Cox    :    Fixed multicast (by popular demand 8))
  4386.   *        Alan Cox    :    Fixed forwarding (by even more popular demand 8))
  4387.   *        Alan Cox    :    Fixed SNMP statistics [I think]
  4388. + *    Gerhard Koerting    :    IP fragmentation forwarding fix
  4389.   *
  4390.   *  
  4391.   *
  4392. @@ -987,6 +988,7 @@
  4393.           */
  4394.          iph = (struct iphdr *)(skb2->h.raw/*+dev->hard_header_len*/);
  4395.          iph->frag_off = htons((offset >> 3));
  4396. +        skb2->ip_hdr = iph;
  4397.          /*
  4398.           *    Added AC : If we are fragmenting a fragment thats not the
  4399.           *           last fragment then keep MF on each bit
  4400. @@ -2819,7 +2821,7 @@
  4401.  
  4402.  #ifdef CONFIG_IP_MULTICAST
  4403.      proc_net_register(&(struct proc_dir_entry)
  4404. -              { PROC_NET_IGMP,  ip_mc_procinfo,  4,  "igmp"});
  4405. +          { PROC_NET_IGMP, 4, "igmp", ip_mc_procinfo });
  4406.  #endif
  4407.  }
  4408.  
  4409. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
  4410. --- v1.3.17/linux/net/ipv4/ip_fw.c    Wed Aug  9 14:55:44 1995
  4411. +++ linux/net/ipv4/ip_fw.c    Fri Aug 11 19:02:18 1995
  4412. @@ -1551,16 +1551,16 @@
  4413.  {
  4414.  #ifdef CONFIG_IP_ACCT
  4415.  proc_net_register(&(struct proc_dir_entry)
  4416. -    { PROC_NET_IPACCT,    ip_acct_procinfo,    7,  "ip_acct"});
  4417. +    { PROC_NET_IPACCT, 7, "ip_acct", ip_acct_procinfo });
  4418.  #endif
  4419.  #ifdef CONFIG_IP_FIREWALL
  4420.  proc_net_register(&(struct proc_dir_entry)
  4421. -    { PROC_NET_IPFWBLK,    ip_fw_blk_procinfo,    8,  "ip_block"});
  4422. +    { PROC_NET_IPFWBLK, 8, "ip_block", ip_fw_blk_procinfo });
  4423.  proc_net_register(&(struct proc_dir_entry)
  4424. -    { PROC_NET_IPFWFWD,    ip_fw_fwd_procinfo,    10, "ip_forward"});
  4425. +    { PROC_NET_IPFWFWD, 10, "ip_forward", ip_fw_fwd_procinfo });
  4426.  #endif
  4427.  #ifdef CONFIG_IP_MASQUERADE
  4428.  proc_net_register(&(struct proc_dir_entry)
  4429. -    { PROC_NET_IPMSQHST,    ip_msqhst_procinfo,    13, "ip_masquerade"});
  4430. +    { PROC_NET_IPMSQHST, 13, "ip_masquerade", ip_msqhst_procinfo });
  4431.  #endif
  4432.  }
  4433. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/rarp.c linux/net/ipv4/rarp.c
  4434. --- v1.3.17/linux/net/ipv4/rarp.c    Wed Aug  9 14:55:44 1995
  4435. +++ linux/net/ipv4/rarp.c    Fri Aug 11 19:02:18 1995
  4436. @@ -546,7 +546,7 @@
  4437.  rarp_init(void)
  4438.  {
  4439.      proc_net_register(&(struct proc_dir_entry)
  4440. -              { PROC_NET_RARP, rarp_get_info, 4, "rarp"});
  4441. +          { PROC_NET_RARP, 4, "rarp", rarp_get_info });
  4442.      rarp_ioctl_hook = rarp_ioctl;
  4443.  }
  4444.  
  4445. diff -u --recursive --new-file v1.3.17/linux/net/ipv4/route.c linux/net/ipv4/route.c
  4446. --- v1.3.17/linux/net/ipv4/route.c    Wed Aug  9 14:55:44 1995
  4447. +++ linux/net/ipv4/route.c    Fri Aug 11 13:14:43 1995
  4448. @@ -30,6 +30,7 @@
  4449.   *        Alan Cox    :    TCP irtt support.
  4450.   *        Jonathan Naylor    :    Added Metric support.
  4451.   *    Miquel van Smoorenburg    :    BSD API fixes.
  4452. + *    Miquel van Smoorenburg    :    Metrics.
  4453.   *
  4454.   *        This program is free software; you can redistribute it and/or
  4455.   *        modify it under the terms of the GNU General Public License
  4456. @@ -73,9 +74,11 @@
  4457.  
  4458.  /*
  4459.   *    Remove a routing table entry.
  4460. + *    Should we return a status value here ?
  4461.   */
  4462.  
  4463. -static void rt_del(unsigned long dst, char *devname)
  4464. +static void rt_del(unsigned long dst, unsigned long mask,
  4465. +        char *devname, unsigned long gtw, short rt_flags, short metric)
  4466.  {
  4467.      struct rtable *r, **rp;
  4468.      unsigned long flags;
  4469. @@ -91,9 +94,16 @@
  4470.      cli();
  4471.      while((r = *rp) != NULL) 
  4472.      {
  4473. -        /* Make sure both the destination and the device match */
  4474. -        if ( r->rt_dst != dst ||
  4475. -        (devname != NULL && strcmp((r->rt_dev)->name,devname) != 0) )
  4476. +        /*
  4477. +         *    Make sure the destination and netmask match.
  4478. +         *    metric, gateway and device are also checked
  4479. +         *    if they were specified.
  4480. +         */
  4481. +        if (r->rt_dst != dst ||
  4482. +            (mask && r->rt_mask != mask) ||
  4483. +            (gtw && r->rt_gateway != gtw) ||
  4484. +            (metric >= 0 && r->rt_metric != metric) ||
  4485. +            (devname && strcmp((r->rt_dev)->name,devname) != 0) )
  4486.          {
  4487.              rp = &r->rt_next;
  4488.              continue;
  4489. @@ -211,11 +221,13 @@
  4490.   */
  4491.   
  4492.  void ip_rt_add(short flags, unsigned long dst, unsigned long mask,
  4493. -    unsigned long gw, struct device *dev, unsigned short mtu, unsigned long window, unsigned short irtt, unsigned char metric)
  4494. +    unsigned long gw, struct device *dev, unsigned short mtu,
  4495. +    unsigned long window, unsigned short irtt, short metric)
  4496.  {
  4497.      struct rtable *r, *rt;
  4498.      struct rtable **rp;
  4499.      unsigned long cpuflags;
  4500. +    int duplicate = 0;
  4501.  
  4502.      /*
  4503.       *    A host is a unique machine and has no network bits.
  4504. @@ -320,6 +332,12 @@
  4505.              rp = &r->rt_next;
  4506.              continue;
  4507.          }
  4508. +        if (r->rt_metric != metric && r->rt_gateway != gw)
  4509. +        {
  4510. +            duplicate = 1;
  4511. +            rp = &r->rt_next;
  4512. +            continue;
  4513. +        }
  4514.          *rp = r->rt_next;
  4515.          if (rt_loopback == r)
  4516.              rt_loopback = NULL;
  4517. @@ -332,8 +350,22 @@
  4518.       
  4519.      rp = &rt_base;
  4520.      while ((r = *rp) != NULL) {
  4521. -        if ((r->rt_mask & mask) != mask)
  4522. +        /*
  4523. +         * When adding a duplicate route, add it before
  4524. +         * the route with a higher metric.
  4525. +         */
  4526. +        if (duplicate &&
  4527. +            r->rt_dst == dst &&
  4528. +            r->rt_mask == mask &&
  4529. +            r->rt_metric > metric)
  4530.              break;
  4531. +        else
  4532. +        /*
  4533. +         * Otherwise, just add it before the
  4534. +         * route with a higher generality.
  4535. +         */
  4536. +            if ((r->rt_mask & mask) != mask)
  4537. +                break;
  4538.          rp = &r->rt_next;
  4539.      }
  4540.      rt->rt_next = r;
  4541. @@ -381,7 +413,7 @@
  4542.      char * devname;
  4543.      struct device * dev = NULL;
  4544.      unsigned long flags, daddr, mask, gw;
  4545. -    unsigned char metric;
  4546. +    short metric;
  4547.  
  4548.      /*
  4549.       *    If a device is specified find it.
  4550. @@ -489,17 +521,26 @@
  4551.  static int rt_kill(struct rtentry *r)
  4552.  {
  4553.      struct sockaddr_in *trg;
  4554. +    struct sockaddr_in *msk;
  4555. +    struct sockaddr_in *gtw;
  4556.      char *devname;
  4557.      int err;
  4558.  
  4559.      trg = (struct sockaddr_in *) &r->rt_dst;
  4560. +    msk = (struct sockaddr_in *) &r->rt_genmask;
  4561. +    gtw = (struct sockaddr_in *) &r->rt_gateway;
  4562.      if ((devname = r->rt_dev) != NULL) 
  4563.      {
  4564.          err = getname(devname, &devname);
  4565.          if (err)
  4566.              return err;
  4567.      }
  4568. -    rt_del(trg->sin_addr.s_addr, devname);
  4569. +    /*
  4570. +     * metric can become negative here if it wasn't filled in
  4571. +     * but that's a fortunate accident; we really use that in rt_del.
  4572. +     */
  4573. +    rt_del(trg->sin_addr.s_addr, msk->sin_addr.s_addr, devname,
  4574. +        gtw->sin_addr.s_addr, r->rt_flags, r->rt_metric - 1);
  4575.      if ( devname != NULL )
  4576.          putname(devname);
  4577.      return 0;
  4578. diff -u --recursive --new-file v1.3.17/linux/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
  4579. --- v1.3.17/linux/net/ipx/af_ipx.c    Wed Aug  9 14:55:45 1995
  4580. +++ linux/net/ipx/af_ipx.c    Fri Aug 11 19:02:18 1995
  4581. @@ -70,6 +70,7 @@
  4582.  #include <linux/interrupt.h>
  4583.  #include <net/p8022.h>
  4584.  #include <net/psnap.h>
  4585. +#include <linux/proc_fs.h>
  4586.  
  4587.  #ifdef CONFIG_IPX
  4588.  /* Configuration Variables */
  4589. @@ -1969,11 +1970,11 @@
  4590.      register_netdevice_notifier(&ipx_dev_notifier);
  4591.  
  4592.  proc_net_register(&(struct proc_dir_entry)
  4593. -    { PROC_NET_IPX,        ipx_get_info,    3, "ipx" });
  4594. +    { PROC_NET_IPX, 3, "ipx", ipx_get_info });
  4595.  proc_net_register(&(struct proc_dir_entry)
  4596. -    { PROC_NET_IPX_INTERFACE, ipx_interface_get_info, 13,"ipx_interface"});
  4597. +    { PROC_NET_IPX_INTERFACE, 13, "ipx_interface", ipx_interface_get_info });
  4598.  proc_net_register(&(struct proc_dir_entry)
  4599. -    { PROC_NET_IPX_ROUTE,    ipx_rt_get_info 9, "ipx_route" });
  4600. +    { PROC_NET_IPX_ROUTE, 9, "ipx_route", ipx_rt_get_info });
  4601.          
  4602.      printk("Swansea University Computer Society IPX 0.31 for NET3.030\n");
  4603.      printk("IPX Portions Copyright (c) 1995 Caldera, Inc.\n");
  4604. diff -u --recursive --new-file v1.3.17/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
  4605. --- v1.3.17/linux/net/netrom/af_netrom.c    Wed Aug  9 14:55:45 1995
  4606. +++ linux/net/netrom/af_netrom.c    Fri Aug 11 19:02:18 1995
  4607. @@ -54,6 +54,8 @@
  4608.  #include <net/ip.h>
  4609.  #include <net/arp.h>
  4610.  
  4611. +#include <linux/proc_fs.h>
  4612. +
  4613.  /************************************************************************\
  4614.  *                                    *
  4615.  *            Handlers for the socket list            *
  4616. @@ -1391,11 +1393,11 @@
  4617.      nr_default.window     = NR_DEFAULT_WINDOW;
  4618.  
  4619.  proc_net_register(&(struct proc_dir_entry)
  4620. -    { PROC_NET_NR,        nr_get_info,        2, "nr" });
  4621. +    { PROC_NET_NR, 2, "nr", nr_get_info });
  4622.  proc_net_register(&(struct proc_dir_entry)
  4623. -    { PROC_NET_NR_NEIGH,    nr_neigh_get_info,    8, "nr_neigh" });
  4624. +    { PROC_NET_NR_NEIGH, 8, "nr_neigh", nr_neigh_get_info });
  4625.  proc_net_register(&(struct proc_dir_entry)
  4626. -    { PROC_NET_NR_NODES,    nr_nodes_get_info,    8, "nr_nodes" });
  4627. +    { PROC_NET_NR_NODES, 8, "nr_nodes", nr_nodes_get_info });
  4628.  
  4629.  }
  4630.  
  4631. diff -u --recursive --new-file v1.3.17/linux/net/socket.c linux/net/socket.c
  4632. --- v1.3.17/linux/net/socket.c    Wed Aug  9 14:55:45 1995
  4633. +++ linux/net/socket.c    Fri Aug 11 09:27:01 1995
  4634. @@ -80,10 +80,6 @@
  4635.                unsigned int cmd, unsigned long arg);
  4636.  static int sock_fasync(struct inode *inode, struct file *filp, int on);
  4637.  
  4638. -extern int proc_net_register(struct proc_dir_entry *);
  4639. -extern int proc_net_unregister(int);
  4640. -           
  4641. -
  4642.  
  4643.  /*
  4644.   *    Socket files have a set of 'special' operations as well as the generic file ones. These don't appear
  4645. diff -u --recursive --new-file v1.3.17/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
  4646. --- v1.3.17/linux/net/unix/af_unix.c    Wed Aug  9 14:55:45 1995
  4647. +++ linux/net/unix/af_unix.c    Fri Aug 11 19:02:18 1995
  4648. @@ -12,6 +12,9 @@
  4649.   *        modify it under the terms of the GNU General Public License
  4650.   *        as published by the Free Software Foundation; either version
  4651.   *        2 of the License, or (at your option) any later version.
  4652. + *
  4653. + * Fixes:
  4654. + *        Linus Torvalds    :    Assorted bug cures.
  4655.   */
  4656.  
  4657.  #include <linux/config.h>
  4658. @@ -34,7 +37,6 @@
  4659.  #include <linux/malloc.h>
  4660.  #include <asm/segment.h>
  4661.  #include <linux/skbuff.h>
  4662. -/*#include <linux/netprotocol.h>*/
  4663.  #include <linux/netdevice.h>
  4664.  #include <net/sock.h>
  4665.  #include <net/tcp.h>
  4666. @@ -1015,7 +1017,7 @@
  4667.      printk("NET3: Unix domain sockets 0.07 BETA for Linux NET3.030.\n");
  4668.      sock_register(unix_proto_ops.family, &unix_proto_ops);
  4669.      proc_net_register(&(struct proc_dir_entry)
  4670. -              { PROC_NET_UNIX,  unix_get_info,  4,  "unix" });
  4671. +              { PROC_NET_UNIX,  4, "unix", unix_get_info });
  4672.  }
  4673.  /*
  4674.   * Local variables:
  4675.