Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/ic Pull up rev. 1.59:



details:   https://anonhg.NetBSD.org/src/rev/9e27610dba19
branches:  netbsd-1-5
changeset: 488337:9e27610dba19
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 30 00:01:25 2000 +0000

description:
Pull up rev. 1.59:
#include "opt_ahc.h"

diffstat:

 sys/dev/ic/aic7xxx.c |  133 +++++++++++++++++++++++++-------------------------
 1 files changed, 67 insertions(+), 66 deletions(-)

diffs (truncated from 559 to 300 lines):

diff -r 320db27c51d7 -r 9e27610dba19 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Thu Jun 29 23:59:57 2000 +0000
+++ b/sys/dev/ic/aic7xxx.c      Fri Jun 30 00:01:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.55.2.1 2000/06/27 18:55:55 fvdl Exp $    */
+/*     $NetBSD: aic7xxx.c,v 1.55.2.2 2000/06/30 00:01:25 thorpej Exp $ */
 
 /*
  * Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -80,13 +80,14 @@
  * made.  If either of these conditions exists, the SCB is DMAed back up to
  * the host so that it can interpret this information.  Additionally, in the
  * case of bad status, the sequencer generates a special interrupt and pauses
- * itself.  This allows the host to setup a request sense command if it 
+ * itself.  This allows the host to setup a request sense command if it
  * chooses for this target synchronously with the error so that sense
  * information isn't lost.
  *
  */
 
 #include "opt_ddb.h"
+#include "opt_ahc.h"
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -275,7 +276,7 @@
                ahc_find_syncrate(struct ahc_softc *, u_int *, u_int);
 static u_int   ahc_find_period(struct ahc_softc *, u_int, u_int);
 static void    ahc_validate_offset(struct ahc_softc *, struct ahc_syncrate *,
-                                   u_int *, int); 
+                                   u_int *, int);
 static void    ahc_update_target_msg_request(struct ahc_softc *,
                                              struct ahc_devinfo *,
                                              struct ahc_initiator_tinfo *,
@@ -288,7 +289,7 @@
 static void    ahc_set_tags(struct ahc_softc *, struct ahc_devinfo *,
                             int);
 static void    ahc_construct_sdtr(struct ahc_softc *, u_int, u_int);
- 
+
 static void    ahc_construct_wdtr(struct ahc_softc *, u_int);
 
 static void    ahc_calc_residual(struct scb *);
@@ -303,7 +304,7 @@
 static __inline void unpause_sequencer(struct ahc_softc *);
 static                 void restart_sequencer(struct ahc_softc *);
 static __inline u_int ahc_index_busy_tcl(struct ahc_softc *, u_int, int);
- 
+
 static __inline void    ahc_busy_tcl(struct ahc_softc *, struct scb *);
 static __inline int    ahc_isbusy_tcl(struct ahc_softc *, struct scb *);
 
@@ -321,7 +322,7 @@
 static int ahc_createdmamem(bus_dma_tag_t, int, int, bus_dmamap_t *,
                            caddr_t *, bus_addr_t *, bus_dma_segment_t *,
                            int *, const char *, const char *);
-static void ahc_freedmamem(bus_dma_tag_t, int, bus_dmamap_t, 
+static void ahc_freedmamem(bus_dma_tag_t, int, bus_dmamap_t,
                           caddr_t, bus_dma_segment_t *, int);
 static void ahcminphys(struct buf *);
 
@@ -463,7 +464,7 @@
         */
        ahc_outb(ahc, FREE_SCBH, SCB_LIST_NULL);
        for (i = 0; i < ahc->scb_data->maxhscbs; i++) {
-               
+
                ahc_outb(ahc, SCBPTR, i);
                if (ahc_inb(ahc, SCB_TAG) == SCB_LIST_NULL)
                        ahc_add_curscb_to_free_list(ahc);
@@ -586,7 +587,7 @@
  */
 static void
 ahcfreescb(struct ahc_softc *ahc, struct scb *scb)
-{       
+{
        struct hardware_scb *hscb;
        int opri;
 
@@ -979,7 +980,7 @@
        /*
          * Note that we were successfull
          */
-        return 0; 
+        return 0;
 
 error_exit:
 
@@ -1016,7 +1017,7 @@
        /*FALLTHROUGH*/
        case 1:
                ahc_freedmamem(ahc->parent_dmat,
-                   AHC_SCB_MAX * sizeof(struct hardware_scb), 
+                   AHC_SCB_MAX * sizeof(struct hardware_scb),
                    scb_data->hscb_dmamap, (caddr_t)scb_data->hscbs,
                    &scb_data->hscb_seg, scb_data->hscb_nseg);
        /*FALLTHROUGH*/
@@ -1030,7 +1031,7 @@
 {
        u_int   sblkctl;
        int     wait;
-       
+
 #ifdef AHC_DUMP_SEQ
        if (ahc->init_level == 0)
                ahc_dumpseq(ahc);
@@ -1494,7 +1495,7 @@
        struct  ahc_softc *ahc;
        u_int   intstat;
 
-       ahc = (struct ahc_softc *)arg; 
+       ahc = (struct ahc_softc *)arg;
 
        intstat = ahc_inb(ahc, INTSTAT);
 
@@ -1631,7 +1632,7 @@
 {
        struct scb *scb;
        struct ahc_devinfo devinfo;
-       
+
        ahc_fetch_devinfo(ahc, &devinfo);
 
        /*
@@ -1668,15 +1669,15 @@
                         (ahc->targ_msg_req >> 8) & 0xFF);
                ahc_outb(ahc, HS_MAILBOX, 0);
                break;
-       case SEND_REJECT: 
+       case SEND_REJECT:
        {
                u_int rejbyte = ahc_inb(ahc, ACCUM);
                printf("%s:%c:%d: Warning - unknown message received from "
-                      "target (0x%x).  Rejecting\n", 
+                      "target (0x%x).  Rejecting\n",
                       ahc_name(ahc), devinfo.channel, devinfo.target, rejbyte);
-               break; 
+               break;
        }
-       case NO_IDENT: 
+       case NO_IDENT:
        {
                /*
                 * The reconnecting target either did not send an identify
@@ -1691,7 +1692,7 @@
                       "LASTPHASE = 0x%x, SAVED_TCL == 0x%x\n",
                       ahc_name(ahc), devinfo.channel, devinfo.target,
                       ahc_inb(ahc, LASTPHASE), ahc_inb(ahc, SAVED_TCL));
-               found = ahc_reset_channel(ahc, devinfo.channel, 
+               found = ahc_reset_channel(ahc, devinfo.channel,
                                          /*initiate reset*/TRUE);
                printf("%s: Issued Channel %c Bus Reset. "
                       "%d SCBs aborted\n", ahc_name(ahc), devinfo.channel,
@@ -1715,7 +1716,7 @@
                               ahc_name(ahc), devinfo.channel, devinfo.target,
                               ahc_inb(ahc, SCSISIGI));
                }
-               break; 
+               break;
        }
        case BAD_STATUS:
        {
@@ -1751,7 +1752,7 @@
                        goto unpause;
                }
 
-               hscb = scb->hscb; 
+               hscb = scb->hscb;
                xs = scb->xs;
 
                /* Don't want to clobber the original sense code */
@@ -1792,7 +1793,7 @@
                                struct tmode_tstate *tstate;
 
                                sg = scb->sg_list;
-                               sc = (struct scsipi_sense *)(&hscb->cmdstore); 
+                               sc = (struct scsipi_sense *)(&hscb->cmdstore);
                                /*
                                 * Save off the residual if there is one.
                                 */
@@ -1859,7 +1860,7 @@
                                hscb->status = 0;
                                hscb->SG_count = 1;
                                hscb->SG_pointer = scb->sg_list_phys;
-                               hscb->data = sg->addr; 
+                               hscb->data = sg->addr;
                                hscb->datalen = sg->len;
                                hscb->cmdpointer = hscb->cmdstore_busaddr;
                                hscb->cmdlen = sizeof(*sc);
@@ -1959,7 +1960,7 @@
                                        ahc->msg_type =
                                            MSG_TYPE_TARGET_MSGOUT;
                                        ahc->msgin_index = 0;
-                               } else 
+                               } else
                                        /* XXX Ever executed??? */
                                        ahc_setup_target_msgin(ahc, &devinfo);
                        }
@@ -2091,7 +2092,7 @@
                       intstat, ahc_inb(ahc, SCSISIGI));
                break;
        }
-       
+
 unpause:
        /*
         *  The sequencer is paused immediately on
@@ -2193,7 +2194,7 @@
                        printf("%s:%c:%d: ", ahc_name(ahc),
                               intr_channel,
                               TCL_TARGET(ahc_inb(ahc, SAVED_TCL)));
-               
+
                printf("parity error detected %s. "
                       "SEQADDR(0x%x) SCSIRATE(0x%x)\n",
                       phase_table[i].phasemsg,
@@ -2201,8 +2202,8 @@
                       ahc_inb(ahc, SCSIRATE));
 
                /*
-                * We've set the hardware to assert ATN if we   
-                * get a parity error on "in" phases, so all we  
+                * We've set the hardware to assert ATN if we
+                * get a parity error on "in" phases, so all we
                 * need to do is stuff the message buffer with
                 * the appropriate message.  "In" phases have set
                 * mesg_out to something other than MSG_NOP.
@@ -2414,7 +2415,7 @@
                ahc_construct_sdtr(ahc, period, offset);
        } else {
                panic("ahc_intr: AWAITING_MSG for negotiation, "
-                     "but no negotiation needed\n");   
+                     "but no negotiation needed\n");
        }
 }
 
@@ -2422,11 +2423,11 @@
 ahc_setup_initiator_msgout(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,
                           struct scb *scb)
 {
-       /*              
+       /*
         * To facilitate adding multiple messages together,
         * each routine should increment the index and len
         * variables instead of setting them explicitly.
-        */             
+        */
        ahc->msgout_index = 0;
        ahc->msgout_len = 0;
 
@@ -2483,11 +2484,11 @@
 static void
 ahc_setup_target_msgin(struct ahc_softc *ahc, struct ahc_devinfo *devinfo)
 {
-       /*              
+       /*
         * To facilitate adding multiple messages together,
         * each routine should increment the index and len
         * variables instead of setting them explicitly.
-        */             
+        */
        ahc->msgout_index = 0;
        ahc->msgout_len = 0;
 
@@ -2615,7 +2616,7 @@
 
 static void
 ahc_handle_message_phase(struct ahc_softc *ahc, struct scsipi_link *sc_link)
-{ 
+{
        struct  ahc_devinfo devinfo;
        u_int   bus_phase;
        int     end_session;
@@ -2726,7 +2727,7 @@
                        if (ahc->msgout_len != 0)
                                ahc_outb(ahc, SCSISIGO,
                                         ahc_inb(ahc, SCSISIGO) | ATNO);
-               } else 
+               } else
                        ahc->msgin_index++;
 
                /* Ack the byte */
@@ -2815,7 +2816,7 @@
                         */
                        return;
                }
-               
+
                ahc->msgin_index++;
 
                /*
@@ -3251,7 +3252,7 @@
                                data_addr = le32toh(scb->sg_list[sg_index].addr)
                                          + le32toh(scb->sg_list[sg_index].len)
                                          - 1;
-                               
+
                                /*
                                 * The physical address base points to the
                                 * second entry as it is always used for



Home | Main Index | Thread Index | Old Index