Added the missing bzero after the malloc in aha1542.c that seems to
[unix-history] / sys / i386 / isa / aha1542.c
index 10cb47c..53929f4 100644 (file)
@@ -12,7 +12,7 @@
  * on the understanding that TFS is not responsible for the correct
  * functioning of this software in any circumstances.
  *
  * on the understanding that TFS is not responsible for the correct
  * functioning of this software in any circumstances.
  *
- *      $Id: aha1542.c,v 1.15 1993/11/18 05:02:12 rgrimes Exp $
+ *      $Id: aha1542.c,v 1.20 1994/01/22 21:54:10 rgrimes Exp $
  */
 
 /*
  */
 
 /*
 
 #ifdef KERNEL
 #include "ddb.h"
 
 #ifdef KERNEL
 #include "ddb.h"
-#if    NDDB > 0
-int     Debugger();
-#else  /* NDDB */
-#define Debugger() panic("should call debugger here (adaptec.c)")
-#endif /* NDDB */
-extern int hz;
+#include "kernel.h"
 #else /*KERNEL */
 #define NAHA 1
 #endif /*KERNEL */
 #else /*KERNEL */
 #define NAHA 1
 #endif /*KERNEL */
@@ -252,6 +247,7 @@ struct      aha_inquire
                                        /* 0x42 = AHA-1640 */
                                        /* 0x43 = AHA-1542C */
                                        /* 0x44 = AHA-1542CF */
                                        /* 0x42 = AHA-1640 */
                                        /* 0x43 = AHA-1542C */
                                        /* 0x44 = AHA-1542CF */
+                                       /* 0x45 = AHA-1542CF, BIOS v2.01 */
        u_char  spec_opts;              /* special options ID */
                                        /* 0x41 = Board is standard model */
        u_char  revision_1;             /* firmware revision [0-9A-Z] */
        u_char  spec_opts;              /* special options ID */
                                        /* 0x41 = Board is standard model */
        u_char  revision_1;             /* firmware revision [0-9A-Z] */
@@ -360,7 +356,7 @@ static int ahaunit = 0;
        (mbx)->cmd = AHA_MBO_START; \
        outb(AHA_CMD_DATA_PORT, AHA_START_SCSI);
 
        (mbx)->cmd = AHA_MBO_START; \
        outb(AHA_CMD_DATA_PORT, AHA_START_SCSI);
 
-#define AHA_RESET_TIMEOUT      1000    /* time to wait for reset (mSec) */
+#define AHA_RESET_TIMEOUT      2000    /* time to wait for reset (mSec) */
 #ifndef        KERNEL
 main()
 {
 #ifndef        KERNEL
 main()
 {
@@ -540,6 +536,7 @@ ahaprobe(dev)
                printf("aha%d: cannot malloc!\n", unit);
                return 0;
        }
                printf("aha%d: cannot malloc!\n", unit);
                return 0;
        }
+       bzero(aha, sizeof(struct aha_data));
        ahadata[unit] = aha;
        aha->aha_base = dev->id_iobase;
        /*
        ahadata[unit] = aha;
        aha->aha_base = dev->id_iobase;
        /*
@@ -686,7 +683,7 @@ ahaintr(unit)
 #endif /*AHADEBUG */
                        }
                        if (ccb) {
 #endif /*AHADEBUG */
                        }
                        if (ccb) {
-                               untimeout(aha_timeout, ccb);
+                               untimeout(aha_timeout, (caddr_t)ccb);
                                aha_done(unit, ccb);
                        }
                        aha->aha_mbx.mbi[i].stat = AHA_MBI_FREE;
                                aha_done(unit, ccb);
                        }
                        aha->aha_mbx.mbi[i].stat = AHA_MBI_FREE;
@@ -776,7 +773,7 @@ aha_done(unit, ccb)
         */
        if (!(xs->flags & INUSE)) {
                printf("aha%d: exiting but not in use!\n", unit);
         */
        if (!(xs->flags & INUSE)) {
                printf("aha%d: exiting but not in use!\n", unit);
-               Debugger();
+               Debugger("aha1542");
        }
        if (((ccb->host_stat != AHA_OK) || (ccb->target_stat != SCSI_OK))
            && ((xs->flags & SCSI_ERR_OK) == 0)) {
        }
        if (((ccb->host_stat != AHA_OK) || (ccb->target_stat != SCSI_OK))
            && ((xs->flags & SCSI_ERR_OK) == 0)) {
@@ -890,7 +887,8 @@ aha_init(unit)
         * No need to check the extended bios flags as some of the
         * extensions that cause us problems are not flagged in that byte.
         */
         * No need to check the extended bios flags as some of the
         * extensions that cause us problems are not flagged in that byte.
         */
-       if ((inquire.boardid == 0x43) || (inquire.boardid == 0x44)) {
+       if ((inquire.boardid == 0x43) || (inquire.boardid == 0x44) ||
+                       (inquire.boardid == 0x45)) {
                aha_cmd(unit, 0, sizeof(extbios), 0, &extbios, AHA_EXT_BIOS);
 #ifdef AHADEBUG
                printf("aha%d: extended bios flags %x\n", unit, extbios.flags);
                aha_cmd(unit, 0, sizeof(extbios), 0, &extbios, AHA_EXT_BIOS);
 #ifdef AHADEBUG
                printf("aha%d: extended bios flags %x\n", unit, extbios.flags);
@@ -1252,7 +1250,7 @@ aha_poll(unit, xs, ccb)
                 * because we are polling,
                 * take out the timeout entry aha_timeout made
                 */
                 * because we are polling,
                 * take out the timeout entry aha_timeout made
                 */
-               untimeout(aha_timeout, ccb);
+               untimeout(aha_timeout, (caddr_t)ccb);
                count = 2000;
                while (count) {
                        /*
                count = 2000;
                while (count) {
                        /*
@@ -1428,7 +1426,7 @@ aha_timeout(caddr_t arg1, int arg2)
         */
        if (ccb->mbx->cmd != AHA_MBO_FREE) {
                printf("\nadapter not taking commands.. frozen?!\n");
         */
        if (ccb->mbx->cmd != AHA_MBO_FREE) {
                printf("\nadapter not taking commands.. frozen?!\n");
-               Debugger();
+               Debugger("aha1542");
        }
        /*
         * If it has been through before, then
        }
        /*
         * If it has been through before, then