home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.2 / patch-1.006 / patch-1.2.7
Text File  |  1995-04-29  |  41KB  |  1,125 lines

  1. diff -u --recursive --new-file v1.2.6/linux/Makefile linux/Makefile
  2. --- v1.2.6/linux/Makefile    Fri Apr 28 11:10:53 1995
  3. +++ linux/Makefile    Fri Apr 28 14:05:34 1995
  4. @@ -1,6 +1,6 @@
  5.  VERSION = 1
  6.  PATCHLEVEL = 2
  7. -SUBLEVEL = 6
  8. +SUBLEVEL = 7
  9.  
  10.  ARCH = i386
  11.  
  12. diff -u --recursive --new-file v1.2.6/linux/arch/alpha/config.in linux/arch/alpha/config.in
  13. --- v1.2.6/linux/arch/alpha/config.in    Wed Feb 15 10:50:55 1995
  14. +++ linux/arch/alpha/config.in    Fri Apr 28 11:17:56 1995
  15. @@ -43,10 +43,10 @@
  16.  
  17.  comment 'SCSI support type (disk, tape, CDrom)'
  18.  
  19. -bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  20. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST n
  21. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
  22. -bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  23. +bool 'SCSI disk support' CONFIG_BLK_DEV_SD y
  24. +bool 'SCSI tape support' CONFIG_CHR_DEV_ST n
  25. +bool 'SCSI CDROM support' CONFIG_BLK_DEV_SR n
  26. +bool 'SCSI generic support' CONFIG_CHR_DEV_SG n
  27.  
  28.  comment 'SCSI low-level drivers'
  29.  
  30. @@ -233,5 +233,5 @@
  31.    int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
  32.  fi
  33.  if [ "$CONFIG_SCSI" = "y" ]; then
  34. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  35. +bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  36.  fi
  37. diff -u --recursive --new-file v1.2.6/linux/arch/i386/config.in linux/arch/i386/config.in
  38. --- v1.2.6/linux/arch/i386/config.in    Fri Apr 28 11:10:53 1995
  39. +++ linux/arch/i386/config.in    Fri Apr 28 11:17:56 1995
  40. @@ -69,10 +69,10 @@
  41.  
  42.  comment 'SCSI support type (disk, tape, CDrom)'
  43.  
  44. -bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  45. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST n
  46. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
  47. -bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  48. +bool 'SCSI disk support' CONFIG_BLK_DEV_SD y
  49. +bool 'SCSI tape support' CONFIG_CHR_DEV_ST n
  50. +bool 'SCSI CDROM support' CONFIG_BLK_DEV_SR n
  51. +bool 'SCSI generic support' CONFIG_CHR_DEV_SG n
  52.  
  53.  comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
  54.  
  55. @@ -267,5 +267,5 @@
  56.    int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
  57.  fi
  58.  if [ "$CONFIG_SCSI" = "y" ]; then
  59. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  60. +bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  61.  fi
  62. diff -u --recursive --new-file v1.2.6/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
  63. --- v1.2.6/linux/arch/i386/kernel/signal.c    Tue Feb  7 11:56:41 1995
  64. +++ linux/arch/i386/kernel/signal.c    Thu Apr 27 14:55:29 1995
  65. @@ -151,10 +151,10 @@
  66.      struct sigaction * sa;
  67.  
  68.      while ((signr = current->signal & mask)) {
  69. -        __asm__("bsf %2,%1\n\t"
  70. +        __asm__("bsf %3,%1\n\t"
  71.              "btrl %1,%0"
  72.              :"=m" (current->signal),"=r" (signr)
  73. -            :"1" (signr));
  74. +            :"0" (current->signal), "1" (signr));
  75.          sa = current->sigaction + signr;
  76.          signr++;
  77.          if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
  78. diff -u --recursive --new-file v1.2.6/linux/arch/mips/config.in linux/arch/mips/config.in
  79. --- v1.2.6/linux/arch/mips/config.in    Wed Feb 15 10:50:55 1995
  80. +++ linux/arch/mips/config.in    Fri Apr 28 11:17:56 1995
  81. @@ -63,10 +63,10 @@
  82.  
  83.  comment 'SCSI support type (disk, tape, CDrom)'
  84.  
  85. -bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  86. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST y
  87. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR y
  88. -bool 'Scsi generic support' CONFIG_CHR_DEV_SG y
  89. +bool 'SCSI disk support' CONFIG_BLK_DEV_SD y
  90. +bool 'SCSI tape support' CONFIG_CHR_DEV_ST y
  91. +bool 'SCSI CDROM support' CONFIG_BLK_DEV_SR y
  92. +bool 'SCSI generic support' CONFIG_CHR_DEV_SG y
  93.  
  94.  comment 'SCSI low-level drivers'
  95.  
  96. @@ -252,5 +252,5 @@
  97.    int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
  98.  fi
  99.  if [ "$CONFIG_SCSI" = "y" ]; then
  100. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  101. +bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  102.  fi
  103. diff -u --recursive --new-file v1.2.6/linux/arch/sparc/config.in linux/arch/sparc/config.in
  104. --- v1.2.6/linux/arch/sparc/config.in    Sun Feb 26 20:46:20 1995
  105. +++ linux/arch/sparc/config.in    Fri Apr 28 11:17:56 1995
  106. @@ -50,10 +50,10 @@
  107.  
  108.  comment 'SCSI support type (disk, tape, CDrom)'
  109.  
  110. -bool 'Scsi disk support' CONFIG_BLK_DEV_SD y
  111. -bool 'Scsi tape support' CONFIG_CHR_DEV_ST n
  112. -bool 'Scsi CDROM support' CONFIG_BLK_DEV_SR n
  113. -bool 'Scsi generic support' CONFIG_CHR_DEV_SG n
  114. +bool 'SCSI disk support' CONFIG_BLK_DEV_SD y
  115. +bool 'SCSI tape support' CONFIG_CHR_DEV_ST n
  116. +bool 'SCSI CDROM support' CONFIG_BLK_DEV_SR n
  117. +bool 'SCSI generic support' CONFIG_CHR_DEV_SG n
  118.  
  119.  comment 'SCSI low-level drivers'
  120.  
  121. @@ -242,5 +242,5 @@
  122.    int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
  123.  fi
  124.  if [ "$CONFIG_SCSI" = "y" ]; then
  125. -bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  126. +bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
  127.  fi
  128. diff -u --recursive --new-file v1.2.6/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
  129. --- v1.2.6/linux/drivers/block/ide-cd.c    Sun Jan 15 00:54:27 1995
  130. +++ linux/drivers/block/ide-cd.c    Fri Apr 28 11:17:56 1995
  131. @@ -1,5 +1,5 @@
  132.  /*
  133. - * linux/drivers/block/ide-cd.c  (BETA)
  134. + * linux/drivers/block/ide-cd.c
  135.   *
  136.   * 1.00  Oct 31, 1994 -- Initial version.
  137.   * 1.01  Nov  2, 1994 -- Fixed problem with starting request in
  138. @@ -20,10 +20,17 @@
  139.   * 2.03  Jan 10, 1995 -- Rewrite block read routines to handle block sizes
  140.   *                       other than 2k and to move multiple sectors in a
  141.   *                       single transaction.
  142. + * 2.04  Apr 21, 1995 -- Add work-around for Creative Labs CD220E drives.
  143. + *                       Thanks to Nick Saw <cwsaw@pts7.pts.mot.com> for
  144. + *                       help in figuring this out.  Ditto for Acer and
  145. + *                       Aztech drives, which seem to have the same problem.
  146. + *                       
  147.   *
  148.   * ATAPI cd-rom driver.  To be used with ide.c.
  149.   *
  150.   * Copyright (C) 1994, 1995  scott snyder  <snyder@fnald0.fnal.gov>
  151. + * May be copied or modified under the terms of the GNU General Public License
  152. + * (../../COPYING).
  153.   */
  154.  
  155.  #include <linux/cdrom.h>
  156. @@ -88,7 +95,8 @@
  157.  
  158.    unsigned media_changed : 1; /* Driver has noticed a media change. */
  159.    unsigned toc_valid     : 1; /* Saved TOC information is current. */
  160. -  unsigned reserved : 4;
  161. +  unsigned no_lba_toc    : 1; /* Drive cannot return TOC info in LBA format */
  162. +  unsigned reserved : 3;
  163.  };
  164.  
  165.  #define CDROM_FLAGS(dev) ((struct ide_cd_flags *)&((dev)->bios_sect))
  166. @@ -1094,6 +1102,7 @@
  167.  static int
  168.  cdrom_read_toc (ide_dev_t *dev)
  169.  {
  170. +  int msf_flag;
  171.    int stat, ntracks, i;
  172.    struct atapi_toc *toc = cdrom_info[dev->hwif][dev->select.b.drive].toc;
  173.  
  174. @@ -1118,8 +1127,11 @@
  175.  
  176.    if (CDROM_FLAGS (dev)->toc_valid) return 0;
  177.  
  178. +  /* Some drives can't return TOC data in LBA format. */
  179. +  msf_flag = (CDROM_FLAGS (dev)->no_lba_toc);
  180. +
  181.    /* First read just the header, so we know how long the TOC is. */
  182. -  stat = cdrom_read_tocentry (dev, 0, 0, (char *)toc,
  183. +  stat = cdrom_read_tocentry (dev, 0, msf_flag, (char *)toc,
  184.                                sizeof (struct atapi_toc_header) +
  185.                                sizeof (struct atapi_toc_entry));
  186.    if (stat) return stat;
  187. @@ -1129,13 +1141,21 @@
  188.    if (ntracks > MAX_TRACKS) ntracks = MAX_TRACKS;
  189.  
  190.    /* Now read the whole schmeer. */
  191. -  stat = cdrom_read_tocentry (dev, 0, 0, (char *)toc,
  192. +  stat = cdrom_read_tocentry (dev, 0, msf_flag, (char *)toc,
  193.                                sizeof (struct atapi_toc_header) +
  194.                                (ntracks+1) * sizeof (struct atapi_toc_entry));
  195.    if (stat) return stat;
  196.    byte_swap_word (&toc->hdr.toc_length);
  197.    for (i=0; i<=ntracks; i++)
  198. -    byte_swap_long (&toc->ent[i].lba);
  199. +    {
  200. +      if (msf_flag)
  201. +    {
  202. +      byte *adr = (byte *)&(toc->ent[i].lba);
  203. +      toc->ent[i].lba = msf_to_lba (adr[1], adr[2], adr[3]);
  204. +    }
  205. +      else
  206. +    byte_swap_long (&toc->ent[i].lba);
  207. +    }
  208.  
  209.    /* Remember that we've read this stuff. */
  210.    CDROM_FLAGS (dev)->toc_valid = 1;
  211. @@ -1618,7 +1638,19 @@
  212.    CDROM_FLAGS (dev)->toc_valid     = 0;
  213.  
  214.    CDROM_FLAGS (dev)->no_playaudio12 = 0;
  215. +  CDROM_FLAGS (dev)->no_lba_toc = 0;
  216.    CDROM_FLAGS (dev)->drq_interrupt = ((dev->id->config & 0x0060) == 0x20);
  217. +
  218. +  /* Accommodate some broken drives... */
  219. +  if (strcmp (dev->id->model, "CD220E") == 0)  /* Creative Labs */
  220. +    CDROM_FLAGS (dev)->no_lba_toc = 1;
  221. +
  222. +  else if (strcmp (dev->id->model, "TO-ICSLYAL") == 0 ||  /* Acer CD525E */
  223. +           strcmp (dev->id->model, "OTI-SCYLLA") == 0)
  224. +    CDROM_FLAGS (dev)->no_lba_toc = 1;
  225. +
  226. +  else if (strcmp (dev->id->model, "CDA26803I SE") == 0) /* Aztech */
  227. +    CDROM_FLAGS (dev)->no_lba_toc = 1;
  228.  
  229.    cdrom_info[dev->hwif][dev->select.b.drive].toc               = NULL;
  230.    cdrom_info[dev->hwif][dev->select.b.drive].sector_buffer     = NULL;
  231. diff -u --recursive --new-file v1.2.6/linux/drivers/char/ChangeLog linux/drivers/char/ChangeLog
  232. --- v1.2.6/linux/drivers/char/ChangeLog    Fri Apr 28 11:10:53 1995
  233. +++ linux/drivers/char/ChangeLog    Fri Apr 28 11:17:57 1995
  234. @@ -1,3 +1,16 @@
  235. +Wed Apr 26 10:23:44 1995  Theodore Y. Ts'o  <tytso@localhost>
  236. +
  237. +    * tty_io.c (release_dev): Try to shutdown the line discpline
  238. +        *before* decrementing the tty count variable; this removes
  239. +        a potential race condition which occurs when the line
  240. +        discpline close blocks, and another process then tries
  241. +        open the same serial port.
  242. +
  243. +    * serial.c (rs_hangup): When hanging up, flush the output buffer
  244. +        befure shutting down the UART.  Otherwise the line
  245. +        discpline close blocks waiting for the characters to get
  246. +        flushed, which never happens until the serial port gets reused.
  247. +
  248.  Wed Apr 12 08:06:16 1995  Theodore Y. Ts'o  <tytso@localhost>
  249.  
  250.      * serial.c (do_serial_hangup, do_softint, check_modem_status,
  251. diff -u --recursive --new-file v1.2.6/linux/drivers/char/serial.c linux/drivers/char/serial.c
  252. --- v1.2.6/linux/drivers/char/serial.c    Fri Apr 28 11:10:53 1995
  253. +++ linux/drivers/char/serial.c    Fri Apr 28 11:17:57 1995
  254. @@ -2090,6 +2090,7 @@
  255.      if (serial_paranoia_check(info, tty->device, "rs_hangup"))
  256.          return;
  257.      
  258. +    rs_flush_buffer(tty);
  259.      shutdown(info);
  260.      info->event = 0;
  261.      info->count = 0;
  262. diff -u --recursive --new-file v1.2.6/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
  263. --- v1.2.6/linux/drivers/char/tty_io.c    Sat Mar 18 12:45:46 1995
  264. +++ linux/drivers/char/tty_io.c    Fri Apr 28 11:17:57 1995
  265. @@ -1006,6 +1006,22 @@
  266.              tty->link->count = 0;
  267.          }
  268.      }
  269. +    if (tty->count <= 1) {
  270. +        /*
  271. +         * Shutdown the current line discipline, and reset it
  272. +         * to N_TTY.
  273. +         */
  274. +        if (tty->ldisc.close)
  275. +            (tty->ldisc.close)(tty);
  276. +        tty->ldisc = ldiscs[N_TTY];
  277. +        tty->termios->c_line = N_TTY;
  278. +        if (o_tty && o_tty->count <= 0) {
  279. +            if (o_tty->ldisc.close)
  280. +                (o_tty->ldisc.close)(o_tty);
  281. +            o_tty->ldisc = ldiscs[N_TTY];
  282. +            o_tty->termios->c_line = N_TTY;
  283. +        }
  284. +    }
  285.      if (--tty->count < 0) {
  286.          printk("release_dev: bad tty->count (%d) for %s\n",
  287.                 tty->count, tty_name(tty));
  288. @@ -1039,23 +1055,6 @@
  289.              (*p)->tty = NULL;
  290.      }
  291.  
  292. -    /*
  293. -     * Shutdown the current line discipline, and reset it to
  294. -     * N_TTY.
  295. -     */
  296. -    if (tty->ldisc.close)
  297. -        (tty->ldisc.close)(tty);
  298. -    tty->ldisc = ldiscs[N_TTY];
  299. -    tty->termios->c_line = N_TTY;
  300. -    if (o_tty) {
  301. -        if (o_tty->ldisc.close)
  302. -            (o_tty->ldisc.close)(o_tty);
  303. -        o_tty->ldisc = ldiscs[N_TTY];
  304. -#if 0 /* No way! We just released the termios struct! */
  305. -        o_tty->termios->c_line = N_TTY;
  306. -#endif
  307. -    }
  308. -    
  309.      tty->driver.table[idx] = NULL;
  310.      if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
  311.          tty->driver.termios[idx] = NULL;
  312. diff -u --recursive --new-file v1.2.6/linux/drivers/net/3c503.c linux/drivers/net/3c503.c
  313. --- v1.2.6/linux/drivers/net/3c503.c    Mon Feb 27 11:06:24 1995
  314. +++ linux/drivers/net/3c503.c    Fri Apr 28 16:56:52 1995
  315. @@ -317,6 +317,7 @@
  316.      outb(EGACFR_IRQOFF, E33G_GACFR);    /* disable interrupts. */
  317.  
  318.      NS8390_init(dev, 0);
  319. +    dev->start = 0;
  320.  
  321.      return 0;
  322.  }
  323. diff -u --recursive --new-file v1.2.6/linux/drivers/net/8390.c linux/drivers/net/8390.c
  324. --- v1.2.6/linux/drivers/net/8390.c    Mon Jan 23 10:38:28 1995
  325. +++ linux/drivers/net/8390.c    Sat Apr 29 09:49:58 1995
  326. @@ -15,6 +15,11 @@
  327.    This is the chip-specific code for many 8390-based ethernet adaptors.
  328.    This is not a complete driver, it must be combined with board-specific
  329.    code such as ne.c, wd.c, 3c503.c, etc.
  330. +
  331. +  13/04/95 -- Don't blindly swallow ENISR_RDC interrupts for non-shared
  332. +  memory cards. We need to follow these closely for neX000 cards.
  333. +  Plus other minor cleanups.   -- Paul Gortmaker
  334. +
  335.    */
  336.  
  337.  static char *version =
  338. @@ -83,7 +88,7 @@
  339.  #endif
  340.  
  341.  /* Max number of packets received at one Intr.
  342. -   Current this may only be examined by a kernel debugger. */
  343. +   Currently this may only be examined by a kernel debugger. */
  344.  static int high_water_mark = 0;
  345.  
  346.  /* Index to functions. */
  347. @@ -124,16 +129,18 @@
  348.      int e8390_base = dev->base_addr;
  349.      struct ei_device *ei_local = (struct ei_device *) dev->priv;
  350.      int length, send_length;
  351. +    unsigned long flags;
  352.      
  353. -    /* We normally shouldn't be called if dev->tbusy is set, but the
  354. -       existing code does anyway.
  355. -       If it has been too long (> 100 or 150ms.) since the last Tx we assume
  356. -       the board has died and kick it. */
  357. -
  358. +/*
  359. + *  We normally shouldn't be called if dev->tbusy is set, but the
  360. + *  existing code does anyway. If it has been too long since the
  361. + *  last Tx, we assume the board has died and kick it.
  362. + */
  363.      if (dev->tbusy) {    /* Do timeouts, just like the 8003 driver. */
  364.          int txsr = inb(e8390_base+EN0_TSR), isr;
  365.          int tickssofar = jiffies - dev->trans_start;
  366. -        if (tickssofar < 10    ||    (tickssofar < 15 && ! (txsr & ENTSR_PTX))) {
  367. +        if (tickssofar < TX_TIMEOUT ||    (tickssofar < (TX_TIMEOUT+5) && ! (txsr & ENTSR_PTX))) {
  368.              return 1;
  369.          }
  370.          isr = inb(e8390_base+EN0_ISR);
  371. @@ -170,15 +177,22 @@
  372.      if (skb->len <= 0)
  373.          return 0;
  374.  
  375. -    /* Block a timer-based transmit from overlapping. */
  376. -    if (set_bit(0, (void*)&dev->tbusy) != 0) {
  377. -        printk("%s: Transmitter access conflict.\n", dev->name);
  378. -        return 1;
  379. -    }
  380. +    save_flags(flags);
  381. +    cli();
  382. +
  383. +    /* Block a timer-based transmit from overlapping. */
  384. +    if ((set_bit(0, (void*)&dev->tbusy) != 0) || ei_local->irqlock) {
  385. +    printk("%s: Tx access conflict. irq=%d lock=%d tx1=%d tx2=%d last=%d\n",
  386. +        dev->name, dev->interrupt, ei_local->irqlock, ei_local->tx1,
  387. +        ei_local->tx2, ei_local->lasttx);
  388. +    restore_flags(flags);
  389. +    return 1;
  390. +    }
  391.  
  392.      /* Mask interrupts from the ethercard. */
  393. -    outb(0x00,    e8390_base + EN0_IMR);
  394. +    outb(0x00, e8390_base + EN0_IMR);
  395.      ei_local->irqlock = 1;
  396. +    restore_flags(flags);
  397.  
  398.      send_length = ETH_ZLEN < length ? length : ETH_ZLEN;
  399.  
  400. @@ -200,28 +214,30 @@
  401.                         ei_local->txing);
  402.          } else {    /* We should never get here. */
  403.              if (ei_debug)
  404. -                printk("%s: No packet buffer space for ping-pong use.\n",
  405. -                       dev->name);
  406. +                printk("%s: No Tx buffers free. irq=%d tx1=%d tx2=%d last=%d\n",
  407. +                    dev->name, dev->interrupt, ei_local->tx1, 
  408. +                    ei_local->tx2, ei_local->lasttx);
  409.              ei_local->irqlock = 0;
  410.              dev->tbusy = 1;
  411. -            outb_p(ENISR_ALL,  e8390_base + EN0_IMR);
  412. +            outb_p(ENISR_ALL, e8390_base + EN0_IMR);
  413.              return 1;
  414.          }
  415.          ei_block_output(dev, length, skb->data, output_page);
  416.          if (! ei_local->txing) {
  417. +            ei_local->txing = 1;
  418.              NS8390_trigger_send(dev, send_length, output_page);
  419.              dev->trans_start = jiffies;
  420.              if (output_page == ei_local->tx_start_page)
  421.                  ei_local->tx1 = -1, ei_local->lasttx = -1;
  422.              else
  423.                  ei_local->tx2 = -1, ei_local->lasttx = -2;
  424. -            ei_local->txing = 1;
  425.          } else
  426.              ei_local->txqueue++;
  427.  
  428.          dev->tbusy = (ei_local->tx1  &&  ei_local->tx2);
  429.      } else {  /* No pingpong, just a single Tx buffer. */
  430.          ei_block_output(dev, length, skb->data, ei_local->tx_start_page);
  431. +        ei_local->txing = 1;
  432.          NS8390_trigger_send(dev, send_length, ei_local->tx_start_page);
  433.          dev->trans_start = jiffies;
  434.          dev->tbusy = 1;
  435. @@ -242,7 +258,7 @@
  436.  {
  437.      struct device *dev = (struct device *)(irq2dev_map[irq]);
  438.      int e8390_base;
  439. -    int interrupts, boguscount = 0;
  440. +    int interrupts, nr_serviced = 0;
  441.      struct ei_device *ei_local;
  442.      
  443.      if (dev == NULL) {
  444. @@ -253,7 +269,6 @@
  445.      ei_local = (struct ei_device *) dev->priv;
  446.      if (dev->interrupt || ei_local->irqlock) {
  447.          /* The "irqlock" check is only for testing. */
  448. -        sti();
  449.          printk(ei_local->irqlock
  450.                 ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n"
  451.                 : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n",
  452. @@ -263,7 +278,6 @@
  453.      }
  454.      
  455.      dev->interrupt = 1;
  456. -    sti(); /* Allow other interrupts. */
  457.      
  458.      /* Change to page 0 and read the intr status reg. */
  459.      outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD);
  460. @@ -273,16 +287,12 @@
  461.      
  462.      /* !!Assumption!! -- we stay in page 0.     Don't break this. */
  463.      while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0
  464. -           && ++boguscount < 9) {
  465. +           && ++nr_serviced < MAX_SERVICE) {
  466.          if (dev->start == 0) {
  467.              printk("%s: interrupt from stopped card\n", dev->name);
  468.              interrupts = 0;
  469.              break;
  470.          }
  471. -        if (interrupts & ENISR_RDC) {
  472. -            /* Ack meaningless DMA complete. */
  473. -            outb_p(ENISR_RDC, e8390_base + EN0_ISR);
  474. -        }
  475.          if (interrupts & ENISR_OVER) {
  476.              ei_rx_overrun(dev);
  477.          } else if (interrupts & (ENISR_RX+ENISR_RX_ERR)) {
  478. @@ -303,17 +313,25 @@
  479.          if (interrupts & ENISR_TX_ERR) {
  480.              outb_p(ENISR_TX_ERR, e8390_base + EN0_ISR); /* Ack intr. */
  481.          }
  482. +
  483. +        if (interrupts & ENISR_RDC) {
  484. +            if (dev->mem_start)
  485. +                outb_p(ENISR_RDC, e8390_base + EN0_ISR);
  486. +        }
  487. +
  488.          outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
  489.      }
  490.      
  491. -    if (interrupts && ei_debug) {
  492. -        if (boguscount == 9)
  493. +    if ((interrupts & ~ENISR_RDC) && ei_debug) {
  494. +        outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
  495. +        if (nr_serviced == MAX_SERVICE) {
  496.              printk("%s: Too much work at interrupt, status %#2.2x\n",
  497.                     dev->name, interrupts);
  498. -        else
  499. +            outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */
  500. +        } else {
  501.              printk("%s: unknown interrupt %#2x\n", dev->name, interrupts);
  502. -        outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
  503. -        outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */
  504. +            outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */
  505. +        }
  506.      }
  507.      dev->interrupt = 0;
  508.      return;
  509. @@ -338,9 +356,9 @@
  510.              ei_local->tx1 = 0;
  511.              dev->tbusy = 0;
  512.              if (ei_local->tx2 > 0) {
  513. +                ei_local->txing = 1;
  514.                  NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
  515.                  dev->trans_start = jiffies;
  516. -                ei_local->txing = 1;
  517.                  ei_local->tx2 = -1,
  518.                  ei_local->lasttx = 2;
  519.              } else
  520. @@ -352,9 +370,9 @@
  521.              ei_local->tx2 = 0;
  522.              dev->tbusy = 0;
  523.              if (ei_local->tx1 > 0) {
  524. +                ei_local->txing = 1;
  525.                  NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page);
  526.                  dev->trans_start = jiffies;
  527. -                ei_local->txing = 1;
  528.                  ei_local->tx1 = -1;
  529.                  ei_local->lasttx = 1;
  530.              } else
  531. @@ -402,7 +420,7 @@
  532.          rxing_page = inb_p(e8390_base + EN1_CURPAG);
  533.          outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD);
  534.          
  535. -        /* Remove one frame from the ring.  Boundary is alway a page behind. */
  536. +        /* Remove one frame from the ring.  Boundary is always a page behind. */
  537.          this_frame = inb_p(e8390_base + EN0_BOUNDARY) + 1;
  538.          if (this_frame >= ei_local->stop_page)
  539.              this_frame = ei_local->rx_start_page;
  540. @@ -475,12 +493,12 @@
  541.          
  542.          /* This _should_ never happen: it's here for avoiding bad clones. */
  543.          if (next_frame >= ei_local->stop_page) {
  544. -            printk("%s: next frame inconsistency, %#2x..", dev->name,
  545. +            printk("%s: next frame inconsistency, %#2x\n", dev->name,
  546.                     next_frame);
  547.              next_frame = ei_local->rx_start_page;
  548.          }
  549.          ei_local->current_page = next_frame;
  550. -        outb(next_frame-1, e8390_base+EN0_BOUNDARY);
  551. +        outb_p(next_frame-1, e8390_base+EN0_BOUNDARY);
  552.      }
  553.      /* If any worth-while packets have been received, dev_rint()
  554.         has done a mark_bh(NET_BH) for us and will work on them
  555. @@ -539,6 +557,9 @@
  556.      short ioaddr = dev->base_addr;
  557.      struct ei_device *ei_local = (struct ei_device *) dev->priv;
  558.      
  559. +    /* If the card is stopped, just return the present stats. */
  560. +    if (dev->start == 0) return &ei_local->stat;
  561. +
  562.      /* Read the counter registers, assuming we are in page 0. */
  563.      ei_local->stat.rx_frame_errors += inb_p(ioaddr + EN0_COUNTER0);
  564.      ei_local->stat.rx_crc_errors   += inb_p(ioaddr + EN0_COUNTER1);
  565. @@ -610,6 +631,7 @@
  566.      struct ei_device *ei_local = (struct ei_device *) dev->priv;
  567.      int i;
  568.      int endcfg = ei_local->word16 ? (0x48 | ENDCFG_WTS) : 0x48;
  569. +    unsigned long flags;
  570.      
  571.      /* Follow National Semi's recommendations for initing the DP83902. */
  572.      outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base); /* 0x21 */
  573. @@ -633,6 +655,7 @@
  574.      
  575.      /* Copy the station address into the DS8390 registers,
  576.         and set the multicast hash bitmap to receive all multicasts. */
  577. +    save_flags(flags);
  578.      cli();
  579.      outb_p(E8390_NODMA + E8390_PAGE1 + E8390_STOP, e8390_base); /* 0x61 */
  580.      for(i = 0; i < 6; i++) {
  581. @@ -645,7 +668,7 @@
  582.      
  583.      outb_p(ei_local->rx_start_page,     e8390_base + EN1_CURPAG);
  584.      outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base);
  585. -    sti();
  586. +    restore_flags(flags);
  587.      dev->tbusy = 0;
  588.      dev->interrupt = 0;
  589.      ei_local->tx1 = ei_local->tx2 = 0;
  590. @@ -667,7 +690,6 @@
  591.  {
  592.      int e8390_base = dev->base_addr;
  593.      
  594. -    ei_status.txing = 1;
  595.      outb_p(E8390_NODMA+E8390_PAGE0, e8390_base);
  596.      
  597.      if (inb_p(e8390_base) & E8390_TRANS) {
  598. diff -u --recursive --new-file v1.2.6/linux/drivers/net/8390.h linux/drivers/net/8390.h
  599. --- v1.2.6/linux/drivers/net/8390.h    Mon Jan 16 07:17:36 1995
  600. +++ linux/drivers/net/8390.h    Fri Apr 28 16:56:52 1995
  601. @@ -44,14 +44,13 @@
  602.    unsigned open:1;
  603.    unsigned word16:1;  /* We have the 16-bit (vs 8-bit) version of the card. */
  604.    unsigned txing:1;        /* Transmit Active */
  605. -  unsigned dmaing:2;        /* Remote DMA Active */
  606.    unsigned irqlock:1;        /* 8390's intrs disabled when '1'. */
  607.    unsigned pingpong:1;        /* Using the ping-pong driver */
  608.    unsigned char tx_start_page, rx_start_page, stop_page;
  609.    unsigned char current_page;    /* Read pointer in buffer  */
  610.    unsigned char interface_num;    /* Net port (AUI, 10bT.) to use. */
  611.    unsigned char txqueue;    /* Tx Packet buffer queue length. */
  612. -  unsigned char in_interrupt;
  613. +  unsigned char dmaing;        /* Remote DMA (Tx/Rx/Active) */
  614.    short tx1, tx2;        /* Packet lengths for ping-pong tx. */
  615.    short lasttx;            /* Alpha version consistency check. */
  616.    unsigned char reg0;        /* Register '0' in a WD8013 */
  617. @@ -60,6 +59,12 @@
  618.    /* The new statistics table. */
  619.    struct enet_statistics stat;
  620.  };
  621. +
  622. +/* The maximum number of 8390 interrupt serivce routines called per IRQ. */
  623. +#define MAX_SERVICE 12
  624. +
  625. +/* The maximum number of jiffies waited before assuming a Tx failed. */
  626. +#define TX_TIMEOUT 20 
  627.  
  628.  #define ei_status (*(struct ei_device *)(dev->priv))
  629.  
  630. diff -u --recursive --new-file v1.2.6/linux/drivers/net/Makefile linux/drivers/net/Makefile
  631. --- v1.2.6/linux/drivers/net/Makefile    Thu Feb 23 13:51:27 1995
  632. +++ linux/drivers/net/Makefile    Tue Apr 25 07:27:16 1995
  633. @@ -11,8 +11,8 @@
  634.  MODULES :=
  635.  
  636.  NETDRV_OBJS := Space.o auto_irq.o net_init.o loopback.o
  637. -CFLAGS := $(CFLAGS) -I../../net/inet
  638. -CPP := $(CPP) -I../../net/inet
  639. +override CFLAGS := $(CFLAGS) -I../../net/inet
  640. +override CPP := $(CPP) -I../../net/inet
  641.  
  642.  .c.o:
  643.      $(CC) $(CFLAGS) -c $<
  644. diff -u --recursive --new-file v1.2.6/linux/drivers/net/ne.c linux/drivers/net/ne.c
  645. --- v1.2.6/linux/drivers/net/ne.c    Fri Apr 28 11:10:53 1995
  646. +++ linux/drivers/net/ne.c    Sat Apr 29 09:49:58 1995
  647. @@ -1,4 +1,3 @@
  648. -#define rw_bugfix
  649.  /* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. */
  650.  /*
  651.      Written 1992-94 by Donald Becker.
  652. @@ -14,8 +13,16 @@
  653.          Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
  654.  
  655.      This driver should work with many programmed-I/O 8390-based ethernet
  656. -    boards.  Currently it support the NE1000, NE2000, many clones,
  657. +    boards.  Currently it supports the NE1000, NE2000, many clones,
  658.      and some Cabletron products.
  659. +
  660. +    13/04/95 -- Change in philosophy. We now monitor ENISR_RDC for
  661. +    handshaking the Tx PIO xfers. If we don't get a RDC within a
  662. +    reasonable period of time, we know the 8390 has gone south, and we
  663. +    kick the board before it locks the system. Also use set_bit() to
  664. +    create atomic locks on the PIO xfers, and added some defines
  665. +    that the end user can play with to save memory.    -- Paul Gortmaker
  666. +
  667.  */
  668.  
  669.  /* Routines for the NatSemi-based designs (NE[12]000). */
  670. @@ -31,6 +38,20 @@
  671.  
  672.  #include <linux/netdevice.h>
  673.  #include "8390.h"
  674. +
  675. +/* Some defines that people can play with if so inclined. */
  676. +
  677. +/* Do we support clones that don't adhere to 14,15 of the SAprom ? */
  678. +#define CONFIG_NE_BAD_CLONES
  679. +
  680. +/* Do we perform extra sanity checks on stuff ? */
  681. +/* #define CONFIG_NE_SANITY */
  682. +
  683. +/* Do we implement the read before write bugfix ? */
  684. +/* #define CONFIG_NE_RW_BUGFIX */
  685. +
  686. +/* ---- No user-servicable parts below ---- */
  687. +
  688.  extern struct device *init_etherdev(struct device *dev, int sizeof_private,
  689.                      unsigned long *mem_startp);
  690.  
  691. @@ -39,6 +60,7 @@
  692.  static unsigned int netcard_portlist[] =
  693.  { 0x300, 0x280, 0x320, 0x340, 0x360, 0};
  694.  
  695. +#ifdef CONFIG_NE_BAD_CLONES
  696.  /* A list of bad clones that we none-the-less recognize. */
  697.  static struct { char *name8, *name16; unsigned char SAprefix[4];}
  698.  bad_clone_list[] = {
  699. @@ -46,8 +68,12 @@
  700.      {"DE120", "DE220", {0x00, 0x80, 0xc8,}},
  701.      {"DFI1000", "DFI2000", {'D', 'F', 'I',}}, /* Original, eh?  */
  702.      {"EtherNext UTP8", "EtherNext UTP16", {0x00, 0x00, 0x79}},
  703. +    {"NE1000","NE2000-invalid", {0x00, 0x00, 0xd8}}, /* Ancient real NE1000. */
  704. +    {"NN1000", "NN2000",  {0x08, 0x03, 0x08}}, /* Outlaw no-name clone. */
  705. +    {"4-DIM8","4-DIM16", {0x00,0x00,0x4d,}},  /* Outlaw 4-Dimension cards. */
  706.      {0,}
  707.  };
  708. +#endif
  709.  
  710.  #define NE_BASE     (dev->base_addr)
  711.  #define NE_CMD         0x00
  712. @@ -60,6 +86,8 @@
  713.  #define NESM_START_PG    0x40    /* First page of TX buffer */
  714.  #define NESM_STOP_PG    0x80    /* Last page +1 of RX ring */
  715.  
  716. +#define NE_RDC_TIMEOUT    0x03    /* Max wait in jiffies for Tx RDC */
  717. +
  718.  int ne_probe(struct device *dev);
  719.  static int ne_probe1(struct device *dev, int ioaddr);
  720.  
  721. @@ -126,9 +154,9 @@
  722.      char *name = NULL;
  723.      int start_page, stop_page;
  724.      int neX000, ctron;
  725. -    int reg0 = inb(ioaddr);
  726. +    int reg0 = inb_p(ioaddr);
  727.  
  728. -    if ( reg0 == 0xFF)
  729. +    if (reg0 == 0xFF)
  730.      return ENODEV;
  731.  
  732.      /* Do a preliminary verification that we have a 8390. */
  733. @@ -140,7 +168,7 @@
  734.      inb_p(ioaddr + EN0_COUNTER0); /* Clear the counter by reading. */
  735.      if (inb_p(ioaddr + EN0_COUNTER0) != 0) {
  736.          outb_p(reg0, ioaddr);
  737. -        outb(regd, ioaddr + 0x0d);    /* Restore the old values. */
  738. +        outb_p(regd, ioaddr + 0x0d);    /* Restore the old values. */
  739.          return ENODEV;
  740.      }
  741.      }
  742. @@ -169,6 +197,7 @@
  743.      };
  744.      for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
  745.          outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);
  746. +
  747.      }
  748.      for(i = 0; i < 32 /*sizeof(SA_prom)*/; i+=2) {
  749.      SA_prom[i] = inb(ioaddr + NE_DATAPORT);
  750. @@ -208,6 +237,7 @@
  751.      start_page = 0x01;
  752.      stop_page = (wordlength == 2) ? 0x40 : 0x20;
  753.      } else {
  754. +#ifdef CONFIG_NE_BAD_CLONES
  755.      /* Ack!  Well, there might be a *bad* NE*000 clone there.
  756.         Check for total bogus addresses. */
  757.      for (i = 0; bad_clone_list[i].name8; i++) {
  758. @@ -227,6 +257,11 @@
  759.             SA_prom[14], SA_prom[15]);
  760.          return ENXIO;
  761.      }
  762. +#else
  763. +    printk(" not found.\n");
  764. +    return ENXIO;
  765. +#endif
  766. +
  767.      }
  768.  
  769.  
  770. @@ -242,7 +277,7 @@
  771.      outb_p(0x00, ioaddr + EN0_IMR);         /* Mask it again. */
  772.      dev->irq = autoirq_report(0);
  773.      if (ei_debug > 2)
  774. -        printk(" autoirq is %d", dev->irq);
  775. +        printk(" autoirq is %d\n", dev->irq);
  776.      } else if (dev->irq == 2)
  777.      /* Fixup for users that don't know that IRQ 2 is really IRQ 9,
  778.         or don't know which one to set. */
  779. @@ -251,7 +286,7 @@
  780.      /* Snarf the interrupt now.  There's no point in waiting since we cannot
  781.         share and the board will usually be enabled. */
  782.      {
  783. -    int irqval = request_irq (dev->irq, ei_interrupt, 0, "ne");
  784. +    int irqval = request_irq (dev->irq, ei_interrupt, 0, wordlength==2 ? "ne2000":"ne1000");
  785.      if (irqval) {
  786.          printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);
  787.          return EAGAIN;
  788. @@ -260,7 +295,7 @@
  789.  
  790.      dev->base_addr = ioaddr;
  791.  
  792. -    request_region(ioaddr, NE_IO_EXTENT,"ne2000");
  793. +    request_region(ioaddr, NE_IO_EXTENT, wordlength==2 ? "ne2000":"ne1000");
  794.  
  795.      for(i = 0; i < ETHER_ADDR_LEN; i++)
  796.      dev->dev_addr[i] = SA_prom[i];
  797. @@ -318,10 +353,13 @@
  798.  static int
  799.  ne_block_input(struct device *dev, int count, char *buf, int ring_offset)
  800.  {
  801. +#ifdef CONFIG_NE_SANITY
  802.      int xfer_count = count;
  803. +#endif
  804.      int nic_base = dev->base_addr;
  805.  
  806. -    if (ei_status.dmaing) {
  807. +    /* This *shouldn't* happen. If it does, it's the last thing you'll see */
  808. +    if (set_bit(0,(void*)&ei_status.dmaing)) {
  809.      if (ei_debug > 0)
  810.          printk("%s: DMAing conflict in ne_block_input "
  811.             "[DMAstat:%d][irqlock:%d][intr:%d].\n",
  812. @@ -329,7 +367,7 @@
  813.             dev->interrupt);
  814.      return 0;
  815.      }
  816. -    ei_status.dmaing |= 0x01;
  817. +    ei_status.dmaing |= 0x02;
  818.      outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
  819.      outb_p(count & 0xff, nic_base + EN0_RCNTLO);
  820.      outb_p(count >> 8, nic_base + EN0_RCNTHI);
  821. @@ -338,14 +376,18 @@
  822.      outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
  823.      if (ei_status.word16) {
  824.        insw(NE_BASE + NE_DATAPORT,buf,count>>1);
  825. -      if (count & 0x01)
  826. -    buf[count-1] = inb(NE_BASE + NE_DATAPORT), xfer_count++;
  827. +      if (count & 0x01) {
  828. +    buf[count-1] = inb(NE_BASE + NE_DATAPORT);
  829. +#ifdef CONFIG_NE_SANITY
  830. +    xfer_count++;
  831. +#endif
  832. +      }
  833.      } else {
  834.      insb(NE_BASE + NE_DATAPORT, buf, count);
  835.      }
  836.  
  837.      /* This was for the ALPHA version only, but enough people have
  838. -       encountering problems that it is still here.  If you see
  839. +       been encountering problems so it is still here.  If you see
  840.         this message you either 1) have a slightly incompatible clone
  841.         or 2) have noise/speed problems with your bus. */
  842.  #ifdef CONFIG_NE_SANITY
  843. @@ -353,7 +395,7 @@
  844.      int addr, tries = 20;
  845.      do {
  846.          /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
  847. -           -- it's broken! Check the "DMA" address instead. */
  848. +           -- it's broken for Rx on some cards! */
  849.          int high = inb_p(nic_base + EN0_RSARHI);
  850.          int low = inb_p(nic_base + EN0_RSARLO);
  851.          addr = (high << 8) + low;
  852. @@ -366,7 +408,8 @@
  853.             dev->name, ring_offset + xfer_count, addr);
  854.      }
  855.  #endif
  856. -    ei_status.dmaing &= ~0x01;
  857. +    outb_p(ENISR_RDC, nic_base + EN0_ISR);    /* Ack intr. */
  858. +    ei_status.dmaing &= ~0x03;
  859.      return ring_offset + count;
  860.  }
  861.  
  862. @@ -374,15 +417,20 @@
  863.  ne_block_output(struct device *dev, int count,
  864.          const unsigned char *buf, const int start_page)
  865.  {
  866. +#ifdef CONFIG_NE_SANITY
  867.      int retries = 0;
  868. +#endif
  869.      int nic_base = NE_BASE;
  870. +    unsigned long dma_start;
  871.  
  872.      /* Round the count up for word writes.  Do we need to do this?
  873.         What effect will an odd byte count have on the 8390?
  874.         I should check someday. */
  875.      if (ei_status.word16 && (count & 0x01))
  876.        count++;
  877. -    if (ei_status.dmaing) {
  878. +
  879. +    /* This *shouldn't* happen. If it does, it's the last thing you'll see */
  880. +    if (set_bit(0,(void*)&ei_status.dmaing)) {
  881.      if (ei_debug > 0)
  882.          printk("%s: DMAing conflict in ne_block_output."
  883.             "[DMAstat:%d][irqlock:%d][intr:%d]\n",
  884. @@ -390,12 +438,15 @@
  885.             dev->interrupt);
  886.      return;
  887.      }
  888. -    ei_status.dmaing |= 0x02;
  889. +    ei_status.dmaing |= 0x04;
  890.      /* We should already be in page 0, but to be safe... */
  891.      outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD);
  892.  
  893. +#ifdef CONFIG_NE_SANITY
  894.   retry:
  895. -#if defined(rw_bugfix)
  896. +#endif
  897. +
  898. +#ifdef CONFIG_NE_RW_BUGFIX 
  899.      /* Handle the read-before-write bug the same way as the
  900.         Crynwr packet driver -- the NatSemi method doesn't work.
  901.         Actually this doesn't always work either, but if you have
  902. @@ -411,6 +462,9 @@
  903.      SLOW_DOWN_IO;
  904.  #endif  /* rw_bugfix */
  905.  
  906. +    dma_start = jiffies;
  907. +    outb_p(ENISR_RDC, nic_base + EN0_ISR);
  908. +
  909.     /* Now the normal output. */
  910.      outb_p(count & 0xff, nic_base + EN0_RCNTLO);
  911.      outb_p(count >> 8,   nic_base + EN0_RCNTHI);
  912. @@ -426,12 +480,10 @@
  913.  
  914.  #ifdef CONFIG_NE_SANITY
  915.      /* This was for the ALPHA version only, but enough people have
  916. -       encountering problems that it is still here. */
  917. +       been encountering problems so it is still here. */
  918.      if (ei_debug > 1) {        /* DMA termination address check... */
  919.      int addr, tries = 20;
  920.      do {
  921. -        /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
  922. -           -- it's broken! Check the "DMA" address instead. */
  923.          int high = inb_p(nic_base + EN0_RSARHI);
  924.          int low = inb_p(nic_base + EN0_RSARLO);
  925.          addr = (high << 8) + low;
  926. @@ -447,7 +499,17 @@
  927.      }
  928.      }
  929.  #endif
  930. -    ei_status.dmaing &= ~0x02;
  931. +
  932. +    while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
  933. +    if (jiffies - dma_start > NE_RDC_TIMEOUT) {
  934. +        printk("%s: timeout waiting for Tx RDC.\n", dev->name);
  935. +        ne_reset_8390(dev);
  936. +        NS8390_init(dev,1);
  937. +        break;
  938. +    }
  939. +
  940. +    outb_p(ENISR_RDC, nic_base + EN0_ISR);    /* Ack intr. */
  941. +    ei_status.dmaing &= ~0x05;
  942.      return;
  943.  }
  944.  
  945. diff -u --recursive --new-file v1.2.6/linux/drivers/net/wd.c linux/drivers/net/wd.c
  946. --- v1.2.6/linux/drivers/net/wd.c    Mon Jan  9 07:56:29 1995
  947. +++ linux/drivers/net/wd.c    Fri Apr 28 16:56:53 1995
  948. @@ -368,6 +368,7 @@
  949.      if (ei_debug > 1)
  950.          printk("%s: Shutting down ethercard.\n", dev->name);
  951.      NS8390_init(dev, 0);
  952. +    dev->start = 0;
  953.  
  954.      /* Change from 16-bit to 8-bit shared memory so reboot works. */
  955.      outb(ei_status.reg5, wd_cmdreg + WD_CMDREG5 );
  956. diff -u --recursive --new-file v1.2.6/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
  957. --- v1.2.6/linux/drivers/scsi/53c7,8xx.c    Fri Apr 28 11:10:54 1995
  958. +++ linux/drivers/scsi/53c7,8xx.c    Fri Apr 28 11:17:57 1995
  959. @@ -740,7 +740,7 @@
  960.         So, we stick it past the end of our hostdata structure.
  961.  
  962.         ASSUMPTION : 
  963. -            Irregardless of how many simultaenous SCSI commands we allow,
  964. +            Regardless of how many simultaneous SCSI commands we allow,
  965.           the probe code only executes a _single_ instruction at a time,
  966.       so we only need one here, and don't need to allocate NCR53c7x0_cmd
  967.       structures for each target until we are no longer in scan_scsis
  968. @@ -2304,8 +2304,8 @@
  969.  /*
  970.   * Function static struct NCR53c7x0_cmd *create_cmd (Scsi_Cmnd *cmd) 
  971.   *
  972. - * Purpose : If we have not allready allocated enough NCR53c7x0_cmd
  973. - *    structures to satisfy any allowable number of simultaenous 
  974. + * Purpose : If we have not already allocated enough NCR53c7x0_cmd
  975. + *    structures to satisfy any allowable number of simultaneous 
  976.   *    commands for this host; do so (using either scsi_malloc()
  977.   *    or kmalloc() depending on configuration), and add them to the 
  978.   *    hostdata free list.  Take the first structure off the free list, 
  979. @@ -2339,9 +2339,9 @@
  980.      unsigned long flags;
  981.      NCR53c7x0_local_setup(cmd->host);
  982.  
  983. -/* FIXME : when we start doing multiple simultaenous commands per LUN, 
  984. +/* FIXME : when we start doing multiple simultaneous commands per LUN, 
  985.     we will need to either
  986. -        - Do an attach_slave() and detach_slave() the right way (alocate
  987. +        - Do an attach_slave() and detach_slave() the right way (allocate
  988.            memory in attach_slave() as we do in scsi_register).
  989.          - Make sure this code works
  990.      with the former being cleaner.  At the same time, we can also go with
  991. @@ -2355,7 +2355,7 @@
  992.          !(hostdata->cmd_allocated[cmd->target] & (1 << cmd->lun))) {
  993.          for (i = host->hostt->cmd_per_lun - 1; i >= 0  --i) {
  994.  #ifdef SCSI_MALLOC
  995. -    /* scsi_malloc must allocate with a 512 byte granularity, but allways
  996. +    /* scsi_malloc must allocate with a 512 byte granularity, but always
  997.         returns buffers which are aligned on a 512 boundary */
  998.          size = (hostdata->max_cmd_size + 511) / 512 * 512;
  999.          tmp = (struct NCR53c7x0_cmd *) scsi_malloc (size);
  1000. @@ -3815,7 +3815,7 @@
  1001.      save_flags(flags);
  1002.      halt (host);
  1003.      NCR53c7x0_write8(SCNTL1_REG, SCNTL1_RST);
  1004. -    udelay(25);    /* Minimum ammount of time to assert RST */
  1005. +    udelay(25);    /* Minimum amount of time to assert RST */
  1006.      NCR53c7x0_write8(SCNTL1_REG, SCNTL1_RST);
  1007.      for (c = (struct NCR53c7x0_cmd *) hostdata->running_list, found = 0; c; 
  1008.          c = (struct NCR53c7x0_cmd *) c->next)  {
  1009. @@ -3899,7 +3899,7 @@
  1010.   *    reset.  
  1011.   */
  1012.      NCR53c7x0_write8(SCNTL1_REG, SCNTL1_RST);
  1013. -    udelay(25);    /* Minimum ammount of time to assert RST */
  1014. +    udelay(25);    /* Minimum amount of time to assert RST */
  1015.      NCR53c7x0_write8(SCNTL1_REG, SCNTL1_RST);
  1016.      restore_flags (flags);
  1017.      return 0;
  1018. diff -u --recursive --new-file v1.2.6/linux/drivers/scsi/53c7,8xx.h linux/drivers/scsi/53c7,8xx.h
  1019. --- v1.2.6/linux/drivers/scsi/53c7,8xx.h    Fri Apr 28 11:10:54 1995
  1020. +++ linux/drivers/scsi/53c7,8xx.h    Fri Apr 28 11:17:57 1995
  1021. @@ -59,7 +59,7 @@
  1022.  #endif
  1023.  
  1024.  #define NCR53c7xx {NULL, NULL, "NCR53c{7,8}xx (rel 4)", NCR53c7xx_detect,     \
  1025. -        NULL, /* info */ NULL, /* command, depricated */ NULL,         \
  1026. +        NULL, /* info */ NULL, /* command, deprecated */ NULL,         \
  1027.      NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset,    \
  1028.          NULL /* slave attach */, scsicam_bios_param, /* can queue */ 1, \
  1029.      /* id */ 7, 127 /* old SG_ALL */, /* cmd per lun */ 1 ,     \
  1030. diff -u --recursive --new-file v1.2.6/linux/drivers/scsi/ChangeLog linux/drivers/scsi/ChangeLog
  1031. --- v1.2.6/linux/drivers/scsi/ChangeLog    Fri Apr 28 11:10:55 1995
  1032. +++ linux/drivers/scsi/ChangeLog    Fri Apr 28 11:17:56 1995
  1033. @@ -89,7 +89,7 @@
  1034.      * 53c7,8xx.c: crash on AEN fixed, SCSI reset is no longer a NOP,
  1035.        NULL pointer panic on odd UDCs fixed, two bugs in diagnostic output 
  1036.        fixed, should initialize correctly if left running, now loadable, 
  1037. -       new memory allocation, extraneous diagnostic output supressed,
  1038. +       new memory allocation, extraneous diagnostic output suppressed,
  1039.        splx() replaced with save/restore flags. [ Drew ]
  1040.  
  1041.      * hosts.c, hosts.h, scsi_ioctl.c, sd.c, sd_ioctl.c, sg.c, sr.c,
  1042. @@ -111,7 +111,7 @@
  1043.      * sr.c: More photo-cd hacks to make sure we get the xa stuff right.
  1044.      * sr.h, sr.c: Change is_xa to xa_flags field.
  1045.  
  1046. -    * st.c: Diable retries for write operations.
  1047. +    * st.c: Disable retries for write operations.
  1048.  
  1049.  Wed Feb 15 10:52:56 1995  Eric Youngdale  (eric@andante)
  1050.  
  1051. @@ -181,7 +181,7 @@
  1052.  
  1053.      * Linux 1.1.89 released.
  1054.  
  1055. -    * Makefile, u14-34f.c: Modulariz.e
  1056. +    * Makefile, u14-34f.c: Modularize.
  1057.  
  1058.      * Makefile, eata.c: Modularize.  Now version 1.14
  1059.  
  1060. @@ -202,7 +202,7 @@
  1061.  
  1062.      * scsi.h: Define QUEUE_FULL condition.
  1063.  
  1064. -    * sd.c: Do not check for non-existant partition until after
  1065. +    * sd.c: Do not check for non-existent partition until after
  1066.      new media check.
  1067.  
  1068.      * sg.c: Undo previous change which was wrong.
  1069. @@ -281,7 +281,7 @@
  1070.  
  1071.      * scsi.c: Make RECOVERED_ERROR a SUGGEST_IS_OK.
  1072.  
  1073. -    * sd.c: Fail if we are opening a non-existant partition.
  1074. +    * sd.c: Fail if we are opening a non-existent partition.
  1075.  
  1076.      * sr.c: Bump SR_TIMEOUT to 15000.
  1077.      Do not probe for media size at boot time(hard on changers).
  1078. diff -u --recursive --new-file v1.2.6/linux/fs/buffer.c linux/fs/buffer.c
  1079. --- v1.2.6/linux/fs/buffer.c    Thu Mar  9 20:37:35 1995
  1080. +++ linux/fs/buffer.c    Fri Apr 28 11:30:17 1995
  1081. @@ -1849,7 +1849,7 @@
  1082.          /* If there are still a lot of dirty buffers around, skip the sleep
  1083.             and flush some more */
  1084.          
  1085. -        if(nr_buffers_type[BUF_DIRTY] < (nr_buffers - nr_buffers_type[BUF_SHARED]) * 
  1086. +        if(nr_buffers_type[BUF_DIRTY] <= (nr_buffers - nr_buffers_type[BUF_SHARED]) * 
  1087.             bdf_prm.b_un.nfract/100) {
  1088.                 if (current->signal & (1 << (SIGKILL-1))) {
  1089.                  bdflush_running--;
  1090. diff -u --recursive --new-file v1.2.6/linux/include/asm-alpha/byteorder.h linux/include/asm-alpha/byteorder.h
  1091. --- v1.2.6/linux/include/asm-alpha/byteorder.h    Fri Apr 28 11:10:56 1995
  1092. +++ linux/include/asm-alpha/byteorder.h    Sat Apr 29 10:20:21 1995
  1093. @@ -6,8 +6,13 @@
  1094.  #undef htonl
  1095.  #undef htons
  1096.  
  1097. +#ifndef LITTLE_ENDIAN
  1098.  #define LITTLE_ENDIAN
  1099. +#endif
  1100. +
  1101. +#ifndef LITTLE_ENDIAN_BITFIELD
  1102.  #define LITTLE_ENDIAN_BITFIELD
  1103. +#endif
  1104.  
  1105.  extern unsigned long int    ntohl(unsigned long int);
  1106.  extern unsigned short int    ntohs(unsigned short int);
  1107. diff -u --recursive --new-file v1.2.6/linux/include/asm-i386/byteorder.h linux/include/asm-i386/byteorder.h
  1108. --- v1.2.6/linux/include/asm-i386/byteorder.h    Fri Apr 28 11:10:56 1995
  1109. +++ linux/include/asm-i386/byteorder.h    Sat Apr 29 10:19:32 1995
  1110. @@ -6,8 +6,13 @@
  1111.  #undef htonl
  1112.  #undef htons
  1113.  
  1114. +#ifndef LITTLE_ENDIAN
  1115.  #define LITTLE_ENDIAN 1234
  1116. +#endif
  1117. +
  1118. +#ifndef LITTLE_ENDIAN_BITFIELD
  1119.  #define LITTLE_ENDIAN_BITFIELD
  1120. +#endif
  1121.  
  1122.  extern unsigned long int    ntohl(unsigned long int);
  1123.  extern unsigned short int    ntohs(unsigned short int);
  1124.