Remove the old DSC code, it doesn't work anymore.

This commit is contained in:
sos 2000-03-18 22:42:45 +00:00
parent c35fe5e157
commit 2ae861c731
4 changed files with 5 additions and 52 deletions

View File

@ -1188,13 +1188,7 @@ ata_start(struct ata_softc *scp)
}
#endif
#if NATAPICD > 0 || NATAPIFD > 0 || NATAPIST > 0
/*
* find & call the responsible driver if anything on the ATAPI queue.
* check for device busy by polling the DSC bit, if busy, check
* for requests to the other device on the channel (if any).
* if the other device is an ATA disk it already had its chance above.
* if no request can be served, timeout a call to ata_start.
*/
/* find & call the responsible driver if anything on the ATAPI queue */
if (TAILQ_EMPTY(&scp->atapi_queue)) {
if (scp->devices & (ATA_ATAPI_MASTER) && scp->dev_softc[0])
atapi_start((struct atapi_softc *)scp->dev_softc[0]);
@ -1202,33 +1196,6 @@ ata_start(struct ata_softc *scp)
atapi_start((struct atapi_softc *)scp->dev_softc[1]);
}
if ((atapi_request = TAILQ_FIRST(&scp->atapi_queue))) {
struct atapi_softc *atp = atapi_request->device;
static int32_t interval = 1;
if (atp->flags & ATAPI_F_DSC_USED) {
outb(atp->controller->ioaddr + ATA_DRIVE, ATA_D_IBM | atp->unit);
DELAY(1);
if (!(inb(atp->controller->ioaddr + ATA_STATUS) & ATA_S_DSC)) {
while ((atapi_request = TAILQ_NEXT(atapi_request, chain))) {
if (atapi_request->device->unit != atp->unit) {
struct atapi_softc *tmp = atapi_request->device;
outb(tmp->controller->ioaddr + ATA_DRIVE,
ATA_D_IBM | tmp->unit);
DELAY(1);
if (!inb(tmp->controller->ioaddr+ATA_STATUS)&ATA_S_DSC)
atapi_request = NULL;
break;
}
}
}
if (!atapi_request) {
timeout((timeout_t *)ata_start, atp->controller, interval++);
return;
}
else
interval = 1;
}
TAILQ_REMOVE(&scp->atapi_queue, atapi_request, chain);
scp->active = ATA_ACTIVE_ATAPI;
scp->running = atapi_request;

View File

@ -237,13 +237,6 @@ atapi_transfer(struct atapi_request *request)
if (request->ccb[0] != ATAPI_REQUEST_SENSE)
atp->cmd = request->ccb[0];
/* flag if we can trust the DSC bit */
if (request->ccb[0] == ATAPI_READ || request->ccb[0] == ATAPI_READ_BIG ||
request->ccb[0] == ATAPI_WRITE || request->ccb[0] == ATAPI_WRITE_BIG)
atp->flags |= ATAPI_F_DSC_USED;
else
atp->flags &= ~ATAPI_F_DSC_USED;
/* if DMA enabled setup DMA hardware */
request->flags &= ~ATPR_F_DMA_USED;
if ((atp->controller->mode[ATA_DEV(atp->unit)] >= ATA_DMA) &&

View File

@ -148,8 +148,7 @@ struct atapi_softc {
int8_t *devname; /* this devices name */
int8_t cmd; /* last cmd executed */
u_int32_t flags; /* drive flags */
#define ATAPI_F_DSC_USED 0x0001
#define ATAPI_F_MEDIA_CHANGED 0x0002
#define ATAPI_F_MEDIA_CHANGED 0x0001
};

View File

@ -466,16 +466,10 @@ ast_start(struct atapi_softc *atp)
bzero(ccb, sizeof(ccb));
if (bp->b_flags & B_READ) {
if (bp->b_flags & B_READ)
ccb[0] = ATAPI_READ;
if (!(stp->flags & ATAPI_F_DSC_USED))
atapi_queue_cmd(stp->atp, ccb, NULL, 0, 0, 2*60, NULL, NULL);
}
else {
else
ccb[0] = ATAPI_WRITE;
if (!(stp->flags & ATAPI_F_DSC_USED))
atapi_queue_cmd(stp->atp, ccb, NULL, 0, 0, 2*60, NULL, NULL);
}
bufq_remove(&stp->buf_queue, bp);
blkcount = bp->b_bcount / stp->blksize;
@ -488,7 +482,7 @@ ast_start(struct atapi_softc *atp)
devstat_start_transaction(&stp->stats);
atapi_queue_cmd(stp->atp, ccb, bp->b_data, blkcount * stp->blksize,
bp->b_flags&B_READ ? ATPR_F_READ : 0, 60, ast_done, bp);
bp->b_flags & B_READ ? ATPR_F_READ : 0, 60, ast_done, bp);
}
static int32_t