home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / kernel-s / v1.1 / scsi / 274x / pre-alph < prev    next >
Text File  |  1995-10-10  |  3KB  |  120 lines

  1. THIS IS PRE-PRE-RELEASE SOFTWARE - USE AT YOUR OWN RISK!
  2.  
  3. Hopefully if you have a 274x/284x that functions using the unmodified
  4. driver, it will continue to function.  It appears that some machines
  5. use a different interrupt type than I assumed, however - this patch
  6. attempts to detect and correct those.
  7. :ja
  8.  
  9. *** aha274x.c-rel5    Sun Sep 18 14:47:32 1994
  10. --- aha274x.c    Sun Sep 18 14:52:46 1994
  11. ***************
  12. *** 1,5 ****
  13.   /*
  14. !  *  @(#)aha274x.c 1.25 94/09/06 jda
  15.    *
  16.    *  Adaptec 274x device driver for Linux.
  17.    *  Copyright (c) 1994 The University of Calgary Department of Computer Science.
  18. --- 1,5 ----
  19.   /*
  20. !  *  @(#)aha274x.c 1.26 94/09/18 jda
  21.    *
  22.    *  Adaptec 274x device driver for Linux.
  23.    *  Copyright (c) 1994 The University of Calgary Department of Computer Science.
  24. ***************
  25. *** 153,159 ****
  26.   
  27.   struct aha274x_host {
  28.       int base;                    /* card base address */
  29. !     int unpause;                    /* value for HCNTRL */
  30.       volatile Scsi_Cmnd *SCB_array[AHA274X_MAXSCB];    /* active commands */
  31.   };
  32.   
  33. --- 153,160 ----
  34.   
  35.   struct aha274x_host {
  36.       int base;                    /* card base address */
  37. !     int startup;                    /* intr type check */
  38. !     volatile int unpause;                /* value for HCNTRL */
  39.       volatile Scsi_Cmnd *SCB_array[AHA274X_MAXSCB];    /* active commands */
  40.   };
  41.   
  42. ***************
  43. *** 437,442 ****
  44. --- 438,454 ----
  45.       base = p->base;
  46.   
  47.       /*
  48. +      *  Check the startup flag - if no commands have been queued,
  49. +      *  we probably have the interrupt type set wrong.  Unpausing
  50. +      *  the sequencer will reload the host control register.
  51. +      */
  52. +     if (p->startup) {
  53. +         p->unpause ^= 0x8;
  54. +         UNPAUSE_SEQUENCER(p);
  55. +         return;
  56. +     }
  57. +     /*
  58.        *  Handle all the interrupt sources - especially for SCSI
  59.        *  interrupts, we won't get a second chance at them.
  60.        */
  61. ***************
  62. *** 906,914 ****
  63.   
  64.       /*
  65.        *  The interrupt trigger is different depending
  66. !      *  on whether the card is EISA or VL-bus.
  67.        */
  68.       p->unpause = (type != T_274X ? 0x2 : 0xa);
  69.   
  70.       /*
  71.        *  Register IRQ with the kernel _after_ the host information
  72. --- 918,931 ----
  73.   
  74.       /*
  75.        *  The interrupt trigger is different depending
  76. !      *  on whether the card is EISA or VL-bus - sometimes.
  77. !      *  The startup variable will be cleared once the first
  78. !      *  command is queued, and is checked in the isr to
  79. !      *  try and detect when the interrupt type is set
  80. !      *  incorrectly, triggering an interrupt immediately.
  81.        */
  82.       p->unpause = (type != T_274X ? 0x2 : 0xa);
  83. +     p->startup = !0;
  84.   
  85.       /*
  86.        *  Register IRQ with the kernel _after_ the host information
  87. ***************
  88. *** 994,1000 ****
  89.       return("Adaptec AHA274x/284x (EISA/VL-bus -> Fast SCSI) "
  90.              AHA274X_SEQ_VERSION "/"
  91.              AHA274X_H_VERSION "/"
  92. !            "1.25");
  93.   }
  94.   
  95.   int aha274x_command(Scsi_Cmnd *cmd)
  96. --- 1011,1017 ----
  97.       return("Adaptec AHA274x/284x (EISA/VL-bus -> Fast SCSI) "
  98.              AHA274X_SEQ_VERSION "/"
  99.              AHA274X_H_VERSION "/"
  100. !            "1.26");
  101.   }
  102.   
  103.   int aha274x_command(Scsi_Cmnd *cmd)
  104. ***************
  105. *** 1119,1124 ****
  106. --- 1136,1147 ----
  107.        *  paused a minimal amount of time.
  108.        */
  109.       aha274x_buildscb(p, cmd, &scb);
  110. +     /*
  111. +      *  Clear the startup flag - we can now legitimately
  112. +      *  expect interrupts.
  113. +      */
  114. +     p->startup = 0;
  115.   
  116.       /*
  117.        *  This is a critical section, since we don't want the
  118.