summaryrefslogtreecommitdiffstats
path: root/sys/dev/dpt/dpt_scsi.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1998-09-22 04:55:07 +0000
committergibbs <gibbs@FreeBSD.org>1998-09-22 04:55:07 +0000
commitb81f0d6e514649734bd32ac4818f0135574a8899 (patch)
tree770a19a4b93abadfe7d6af1a4cd2f482b62fcafe /sys/dev/dpt/dpt_scsi.c
parent1221790ff3c9e4d8796ffb8a65902317562749f7 (diff)
downloadFreeBSD-src-b81f0d6e514649734bd32ac4818f0135574a8899.zip
FreeBSD-src-b81f0d6e514649734bd32ac4818f0135574a8899.tar.gz
dpt.h:
Bump the lun field in the eata ccb to 5 bits. We still only use 3 of them, but we may use the rest at a later date. dpt_scsi.c: Default to only 32 S/G segments. Bzero our CCB array after allocation.
Diffstat (limited to 'sys/dev/dpt/dpt_scsi.c')
-rw-r--r--sys/dev/dpt/dpt_scsi.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c
index 0d96522..286bd26 100644
--- a/sys/dev/dpt/dpt_scsi.c
+++ b/sys/dev/dpt/dpt_scsi.c
@@ -43,7 +43,7 @@
* arrays that span controllers (Wow!).
*/
-#ident "$Id: dpt_scsi.c,v 1.14 1998/09/15 22:05:40 gibbs Exp $"
+#ident "$Id: dpt_scsi.c,v 1.15 1998/09/20 07:19:53 gibbs Exp $"
#define _DPT_C_
@@ -357,11 +357,10 @@ dptallocccbs(dpt_softc_t *dpt)
htonl(dptccbvtop(dpt, next_ccb)
+ offsetof(struct dpt_ccb, sense_data));
next_ccb->eata_ccb.cp_busaddr = dpt->dpt_ccb_busend;
-
next_ccb->state = DCCB_FREE;
next_ccb->tag = dpt->total_dccbs;
SLIST_INSERT_HEAD(&dpt->free_dccb_list, next_ccb, links);
- segs += dpt->sgsize;;
+ segs += dpt->sgsize;
physaddr += (dpt->sgsize * sizeof(dpt_sg_t));
dpt->dpt_ccb_busend += sizeof(*next_ccb);
next_ccb++;
@@ -758,7 +757,7 @@ dpt_action(struct cam_sim *sim, union ccb *ccb)
/*
* Explicitly set all flags so that the compiler can
- * be smart about setting our bit flags.
+ * be smart about setting them.
*/
eccb->SCSI_Reset = 0;
eccb->HBA_Init = 0;
@@ -1271,15 +1270,14 @@ dpt_init(struct dpt_softc *dpt)
dpt->hostid[1] = conf.scsi_id1;
dpt->hostid[2] = conf.scsi_id2;
- if (conf.SG_64K) {
- dpt->sgsize = SG_SIZE_BIG;
- } else if ((ntohs(conf.SGsiz) < 1)
- || (ntohs(conf.SGsiz) > SG_SIZE)) {
- /* Just a sanity check */
- dpt->sgsize = SG_SIZE;
- } else {
+ if (conf.SG_64K)
+ dpt->sgsize = 8192;
+ else
dpt->sgsize = ntohs(conf.SGsiz);
- }
+
+ /* We can only get 64k buffers, so don't bother to waste space. */
+ if (dpt->sgsize < 17 || dpt->sgsize > 32)
+ dpt->sgsize = 32;
if (dpt->sgsize > dpt_max_segs)
dpt->sgsize = dpt_max_segs;
@@ -1328,6 +1326,10 @@ dpt_init(struct dpt_softc *dpt)
+ sizeof(dpt_sp_t),
dptmapmem, &dpt->dpt_ccb_busbase, /*flags*/0);
+ /* Clear them out. */
+ bzero(dpt->dpt_dccbs,
+ (dpt->max_dccbs * sizeof(struct dpt_ccb)) + sizeof(dpt_sp_t));
+
dpt->dpt_ccb_busend = dpt->dpt_ccb_busbase;
dpt->sp = (dpt_sp_t*)&dpt->dpt_dccbs[dpt->max_dccbs];
OpenPOWER on IntegriCloud