From 2a14fd50d9972f6d71495a96b25adaaa66d47774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Sat, 18 Mar 2000 22:42:45 +0000 Subject: [PATCH] Remove the old DSC code, it doesn't work anymore. --- sys/dev/ata/ata-all.c | 35 +---------------------------------- sys/dev/ata/atapi-all.c | 7 ------- sys/dev/ata/atapi-all.h | 3 +-- sys/dev/ata/atapi-tape.c | 12 +++--------- 4 files changed, 5 insertions(+), 52 deletions(-) diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 63ace7c6a8c0..fe87b766abf4 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -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; diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 56103cf77d39..075081d7844f 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -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) && diff --git a/sys/dev/ata/atapi-all.h b/sys/dev/ata/atapi-all.h index 6e5bc5a7a9d5..b3e50916914f 100644 --- a/sys/dev/ata/atapi-all.h +++ b/sys/dev/ata/atapi-all.h @@ -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 }; diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 53b546e4f26b..2f737c43b2c7 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -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