1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Update to changes in generic SCSI layer.

This commit is contained in:
Justin T. Gibbs 1996-11-05 09:20:08 +00:00
parent ac323a042d
commit 16da2fbab4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19427

View File

@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id$ * $Id: advansys.c,v 1.1.1.1 1996/10/07 02:07:07 gibbs Exp $
*/ */
/* /*
* Ported from: * Ported from:
@ -65,9 +65,6 @@
static void adv_scsi_cmd __P((struct scsi_xfer *xs)); static void adv_scsi_cmd __P((struct scsi_xfer *xs));
static void advminphys __P((struct buf *bp)); static void advminphys __P((struct buf *bp));
static void * adv_get_cdb __P((void *adapter_softc, struct scsi_queue *sq));
static void adv_free_cdb __P((void *adapter_softc, struct scsi_queue *sq,
void *cdb));
static timeout_t static timeout_t
adv_timeout; adv_timeout;
static int adv_qdone __P((struct adv_softc *adv)); static int adv_qdone __P((struct adv_softc *adv));
@ -79,13 +76,11 @@ struct adv_softc *advsoftcs[NADV]; /* XXX Config should handle this */
static struct scsi_adapter adv_switch = static struct scsi_adapter adv_switch =
{ {
adv_scsi_cmd, adv_scsi_cmd,
advminphys, advminphys,
0, NULL,
0, NULL,
adv_get_cdb, "adv"
adv_free_cdb,
"adv"
}; };
static void static void
@ -121,7 +116,7 @@ adv_scsi_cmd(xs)
scsiq.q2.tag_code = xs->tag_type; scsiq.q2.tag_code = xs->tag_type;
scsiq.q2.vm_id = 0; scsiq.q2.vm_id = 0;
scsiq.sg_head = NULL; scsiq.sg_head = NULL;
scsiq.cdbptr = &xs->cmdstore; scsiq.cdbptr = &xs->cmd;
if (xs->datalen) { if (xs->datalen) {
/* /*
@ -190,10 +185,8 @@ adv_scsi_cmd(xs)
} }
if (adv_execute_scsi_queue(adv, &scsiq) != 0) { if (adv_execute_scsi_queue(adv, &scsiq) != 0) {
/* XXX Add freeze queue functionality */ xs->error = XS_QUEUE_RESOURCE_SHORTAGE;
xs->error = XS_BUSY;
scsi_done(xs); scsi_done(xs);
DELAY(20 * 1000 * 1000);
} else if ((xs->flags & SCSI_POLL) != 0) { } else if ((xs->flags & SCSI_POLL) != 0) {
/* /*
* If we can't use interrupts, poll for completion * If we can't use interrupts, poll for completion
@ -219,22 +212,6 @@ advminphys(bp)
bp->b_bcount = ((ADV_MAX_SG_LIST - 1) * PAGE_SIZE); bp->b_bcount = ((ADV_MAX_SG_LIST - 1) * PAGE_SIZE);
} }
static void *
adv_get_cdb(adapter_softc, sq)
void *adapter_softc;
struct scsi_queue *sq;
{
return ((void *)1);
}
static void
adv_free_cdb(adapter_softc, sq, cdb)
void *adapter_softc;
struct scsi_queue *sq;
void *cdb;
{
}
static void static void
adv_timeout(arg) adv_timeout(arg)
void *arg; void *arg;
@ -691,8 +668,10 @@ adv_done(adv, qdonep)
break; break;
default: default:
/* QHSTA error occurred */ /* QHSTA error occurred */
#if 0
/* XXX Can I get more explicit information here? */ /* XXX Can I get more explicit information here? */
xs->error = XS_DRIVER_STUFFUP; xs->error = XS_DRIVER_STUFFUP;
#endif
break; break;
} }
break; break;
@ -700,7 +679,8 @@ adv_done(adv, qdonep)
case QD_WITH_ERROR: case QD_WITH_ERROR:
switch (qdonep->d3.host_stat) { switch (qdonep->d3.host_stat) {
case QHSTA_NO_ERROR: case QHSTA_NO_ERROR:
if (qdonep->d3.scsi_stat == SCSI_CHECK) { if ((qdonep->d3.scsi_stat == STATUS_CHECK_CONDITION)
|| (qdonep->d3.scsi_stat == STATUS_COMMAND_TERMINATED)) {
/* We have valid sense information to return */ /* We have valid sense information to return */
xs->error = XS_SENSE; xs->error = XS_SENSE;
if (adv->sense_buffers != NULL) if (adv->sense_buffers != NULL)
@ -712,23 +692,28 @@ adv_done(adv, qdonep)
xs->error = XS_SELTIMEOUT; xs->error = XS_SELTIMEOUT;
break; break;
default: default:
#if 0
/* XXX Can I get more explicit information here? */ /* XXX Can I get more explicit information here? */
xs->error = XS_DRIVER_STUFFUP; xs->error = XS_DRIVER_STUFFUP;
#endif
break; break;
} }
break; break;
case QD_ABORTED_BY_HOST: case QD_ABORTED_BY_HOST:
/* XXX Should have an explicit ABORTED error code */ /* XXX Should have an explicit ABORTED error code */
xs->error = XS_DRIVER_STUFFUP; xs->error = XS_ABORTED;
break; break;
default: default:
printf("adv_done: Unknown done status 0x%x\n", qdonep->d3.done_stat); #if 0
printf("adv_done: Unknown done status 0x%x\n",
qdonep->d3.done_stat);
xs->error = XS_DRIVER_STUFFUP; xs->error = XS_DRIVER_STUFFUP;
#endif
break; break;
} }
xs->flags |= ITSDONE; xs->flags |= SCSI_ITSDONE;
scsi_done(xs); scsi_done(xs);
return; return;
} }
@ -748,7 +733,7 @@ adv_poll(adv, xs)
do { do {
DELAY(1000); DELAY(1000);
adv_intr((void *)adv); adv_intr((void *)adv);
} while (--wait && ((xs->flags & ITSDONE) == 0)); } while (--wait && ((xs->flags & SCSI_ITSDONE) == 0));
if (wait == 0) { if (wait == 0) {
printf("adv%d: board is not responding\n", adv->unit); printf("adv%d: board is not responding\n", adv->unit);
return (EIO); return (EIO);