aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>2001-01-09 00:40:38 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>2001-01-09 00:40:38 +0000
commit7615058657a1e08b63a875a85f9ed21ad894eb6d (patch)
treed127ce4a294f15ade8ffff8b664c52c0e3ccf17c /sys/dev
parentdaeaccf9d95911733bc1dbfc0d3d32e1bcf6b13f (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/aic7xxx/aic7xxx.c3
-rw-r--r--sys/dev/aic7xxx/aic7xxx_freebsd.c2
-rw-r--r--sys/dev/aic7xxx/aic7xxx_inline.h25
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c2
4 files changed, 28 insertions, 4 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c
index 5f8540a936ee..70f22c7aee95 100644
--- a/sys/dev/aic7xxx/aic7xxx.c
+++ b/sys/dev/aic7xxx/aic7xxx.c
@@ -487,8 +487,7 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
printf("Sending Sense\n");
}
#endif
- sg->addr = ahc->scb_data->sense_busaddr
- + (hscb->tag*sizeof(struct scsi_sense_data));
+ sg->addr = ahc_get_sense_bufaddr(ahc, scb);
sg->len = ahc_get_sense_bufsize(ahc, scb);
sg->len |= AHC_DMA_LAST_SEG;
diff --git a/sys/dev/aic7xxx/aic7xxx_freebsd.c b/sys/dev/aic7xxx/aic7xxx_freebsd.c
index 24debda18875..6fe99ab6ac96 100644
--- a/sys/dev/aic7xxx/aic7xxx_freebsd.c
+++ b/sys/dev/aic7xxx/aic7xxx_freebsd.c
@@ -337,7 +337,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
*/
memset(&ccb->csio.sense_data, 0, sizeof(ccb->csio.sense_data));
memcpy(&ccb->csio.sense_data,
- &ahc->scb_data->sense[scb->hscb->tag],
+ ahc_get_sense_buf(ahc, scb),
(scb->sg_list->len & AHC_SG_LEN_MASK)
- ccb->csio.sense_resid);
scb->io_ctx->ccb_h.status |= CAM_AUTOSNS_VALID;
diff --git a/sys/dev/aic7xxx/aic7xxx_inline.h b/sys/dev/aic7xxx/aic7xxx_inline.h
index 875d7fe30ef4..b95fd3f5f1be 100644
--- a/sys/dev/aic7xxx/aic7xxx_inline.h
+++ b/sys/dev/aic7xxx/aic7xxx_inline.h
@@ -200,6 +200,12 @@ static __inline void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
static __inline void ahc_swap_with_next_hscb(struct ahc_softc *ahc,
struct scb *scb);
static __inline void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
+static __inline struct scsi_sense_data *
+ ahc_get_sense_buf(struct ahc_softc *ahc,
+ struct scb *scb);
+static __inline uint32_t
+ ahc_get_sense_bufaddr(struct ahc_softc *ahc,
+ struct scb *scb);
/*
* Determine whether the sequencer reported a residual
@@ -346,6 +352,25 @@ ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb)
}
}
+static __inline struct scsi_sense_data *
+ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb)
+{
+ int offset;
+
+ offset = scb - ahc->scb_data->scbarray;
+ return (&ahc->scb_data->sense[offset]);
+}
+
+static __inline uint32_t
+ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb)
+{
+ int offset;
+
+ offset = scb - ahc->scb_data->scbarray;
+ return (ahc->scb_data->sense_busaddr
+ + (offset * sizeof(struct scsi_sense_data)));
+}
+
/************************** Interrupt Processing ******************************/
static __inline u_int ahc_check_cmdcmpltqueues(struct ahc_softc *ahc);
static __inline void ahc_intr(struct ahc_softc *ahc);
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c
index 24debda18875..6fe99ab6ac96 100644
--- a/sys/dev/aic7xxx/aic7xxx_osm.c
+++ b/sys/dev/aic7xxx/aic7xxx_osm.c
@@ -337,7 +337,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
*/
memset(&ccb->csio.sense_data, 0, sizeof(ccb->csio.sense_data));
memcpy(&ccb->csio.sense_data,
- &ahc->scb_data->sense[scb->hscb->tag],
+ ahc_get_sense_buf(ahc, scb),
(scb->sg_list->len & AHC_SG_LEN_MASK)
- ccb->csio.sense_resid);
scb->io_ctx->ccb_h.status |= CAM_AUTOSNS_VALID;