Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic #include "opt_ahc.h"
details: https://anonhg.NetBSD.org/src/rev/e1f69b51c6a0
branches: trunk
changeset: 494047:e1f69b51c6a0
user: pk <pk%NetBSD.org@localhost>
date: Thu Jun 29 23:12:19 2000 +0000
description:
#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 7da8d822239b -r e1f69b51c6a0 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c Thu Jun 29 20:15:24 2000 +0000
+++ b/sys/dev/ic/aic7xxx.c Thu Jun 29 23:12:19 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aic7xxx.c,v 1.58 2000/06/28 17:12:53 mrg Exp $ */
+/* $NetBSD: aic7xxx.c,v 1.59 2000/06/29 23:12:19 pk 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>
@@ -273,7 +274,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 *,
@@ -286,7 +287,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 *);
@@ -301,7 +302,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 *);
@@ -319,7 +320,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 *);
@@ -461,7 +462,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);
@@ -584,7 +585,7 @@
*/
static void
ahcfreescb(struct ahc_softc *ahc, struct scb *scb)
-{
+{
struct hardware_scb *hscb;
int opri;
@@ -977,7 +978,7 @@
/*
* Note that we were successfull
*/
- return 0;
+ return 0;
error_exit:
@@ -1014,7 +1015,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*/
@@ -1028,7 +1029,7 @@
{
u_int sblkctl;
int wait;
-
+
#ifdef AHC_DUMP_SEQ
if (ahc->init_level == 0)
ahc_dumpseq(ahc);
@@ -1492,7 +1493,7 @@
struct ahc_softc *ahc;
u_int intstat;
- ahc = (struct ahc_softc *)arg;
+ ahc = (struct ahc_softc *)arg;
intstat = ahc_inb(ahc, INTSTAT);
@@ -1629,7 +1630,7 @@
{
struct scb *scb;
struct ahc_devinfo devinfo;
-
+
ahc_fetch_devinfo(ahc, &devinfo);
/*
@@ -1666,15 +1667,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
@@ -1689,7 +1690,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,
@@ -1713,7 +1714,7 @@
ahc_name(ahc), devinfo.channel, devinfo.target,
ahc_inb(ahc, SCSISIGI));
}
- break;
+ break;
}
case BAD_STATUS:
{
@@ -1749,7 +1750,7 @@
goto unpause;
}
- hscb = scb->hscb;
+ hscb = scb->hscb;
xs = scb->xs;
/* Don't want to clobber the original sense code */
@@ -1790,7 +1791,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.
*/
@@ -1857,7 +1858,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);
@@ -1957,7 +1958,7 @@
ahc->msg_type =
MSG_TYPE_TARGET_MSGOUT;
ahc->msgin_index = 0;
- } else
+ } else
/* XXX Ever executed??? */
ahc_setup_target_msgin(ahc, &devinfo);
}
@@ -2089,7 +2090,7 @@
intstat, ahc_inb(ahc, SCSISIGI));
break;
}
-
+
unpause:
/*
* The sequencer is paused immediately on
@@ -2191,7 +2192,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,
@@ -2199,8 +2200,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.
@@ -2412,7 +2413,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");
}
}
@@ -2420,11 +2421,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;
@@ -2481,11 +2482,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;
@@ -2613,7 +2614,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;
@@ -2724,7 +2725,7 @@
if (ahc->msgout_len != 0)
ahc_outb(ahc, SCSISIGO,
ahc_inb(ahc, SCSISIGO) | ATNO);
- } else
+ } else
ahc->msgin_index++;
/* Ack the byte */
@@ -2813,7 +2814,7 @@
*/
return;
}
-
+
ahc->msgin_index++;
/*
@@ -3249,7 +3250,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