aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>2000-01-29 14:10:59 +0000
committerSøren Schmidt <sos@FreeBSD.org>2000-01-29 14:10:59 +0000
commiteff43d0e8a1d27453d503e774c6edd82e3367763 (patch)
tree812fe1fb8727899feacb5d9861064c9283d901c6 /sys/dev/ata
parent2b898d39e540df95c76b5880de0a6eed72c9e231 (diff)
Notes
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/atapi-all.c15
-rw-r--r--sys/dev/ata/atapi-cd.c18
-rw-r--r--sys/dev/ata/atapi-fd.c6
3 files changed, 9 insertions, 30 deletions
diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c
index f83a6914d55ba..dc4e6488915a2 100644
--- a/sys/dev/ata/atapi-all.c
+++ b/sys/dev/ata/atapi-all.c
@@ -281,21 +281,8 @@ atapi_interrupt(struct atapi_request *request)
return ATA_OP_CONTINUES;
}
- if (atp->flags & ATAPI_F_DMA_USED)
- dma_stat = ata_dmadone(atp->controller);
-
- /* is this needed anymore ?? SOS XXX */
-#if NOT_ANY_MORE
- if (ata_wait(atp->controller, atp->unit, 0) < 0) {
- printf("%s: timeout waiting for status", atp->devname);
- atp->flags &= ~ATAPI_F_DMA_USED;
- request->result = inb(atp->controller->ioaddr + ATA_ERROR) |
- ATAPI_SK_RESERVED;
- goto op_finished;
- }
-#endif
-
if (atp->flags & ATAPI_F_DMA_USED) {
+ dma_stat = ata_dmadone(atp->controller);
atp->flags &= ~ATAPI_F_DMA_USED;
if ((atp->controller->status & (ATA_S_ERROR | ATA_S_DWF)) ||
dma_stat != ATA_BMSTAT_INTERRUPT) {
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 30b7e314e0c8b..8c4325db10cb3 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -1030,15 +1030,6 @@ acdstrategy(struct buf *bp)
struct acd_softc *cdp = bp->b_dev->si_drv1;
int32_t s;
-#ifdef NOTYET
- /* allow write only on CD-R/RW media */ /* all for now SOS */
- if (!(bp->b_flags & B_READ) && !(writeable_media)) {
- bp->b_error = EROFS;
- bp->b_flags |= B_ERROR;
- biodone(bp);
- return;
- }
-#endif
/* if it's a null transfer, return immediatly. */
if (bp->b_bcount == 0) {
bp->b_resid = 0;
@@ -1046,8 +1037,6 @@ acdstrategy(struct buf *bp)
return;
}
- /* check for valid blocksize SOS */
-
bp->b_pblkno = bp->b_blkno;
bp->b_resid = bp->b_bcount;
@@ -1288,7 +1277,8 @@ acd_open_track(struct acd_softc *cdp, struct cdr_track *track)
if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
&param, sizeof(param))))
return error;
- param.page_code = 0x05;
+
+ param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE;
param.page_length = 0x32;
param.test_write = track->test_write ? 1 : 0;
param.write_type = CDR_WTYPE_TRACK;
@@ -1349,9 +1339,9 @@ acd_open_track(struct acd_softc *cdp, struct cdr_track *track)
}
#if 1
- param.multi_session = CDR_MSES_MULTI;
+ param.multi_session = CDR_MSES_MULTI;
#else
- param.multi_session = CDR_MSES_NONE;
+ param.multi_session = CDR_MSES_NONE;
#endif
param.fp = 0;
param.packet_size = 0;
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c
index 12173323e5bcc..5358afba23e90 100644
--- a/sys/dev/ata/atapi-fd.c
+++ b/sys/dev/ata/atapi-fd.c
@@ -211,15 +211,17 @@ static int
afdopen(dev_t dev, int32_t flags, int32_t fmt, struct proc *p)
{
struct afd_softc *fdp = dev->si_drv1;
- struct disklabel *label;
+ struct disklabel *label = &fdp->disk.d_label;
atapi_test_ready(fdp->atp);
+
afd_prevent_allow(fdp, 1);
+
if (afd_sense(fdp))
printf("afd%d: sense media type failed\n", fdp->lun);
fdp->atp->flags &= ~ATAPI_F_MEDIA_CHANGED;
- label = &fdp->disk.d_label;
+
bzero(label, sizeof *label);
label->d_secsize = fdp->cap.sector_size;
label->d_nsectors = fdp->cap.sectors;