diff options
author | sos <sos@FreeBSD.org> | 2000-01-24 20:45:24 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2000-01-24 20:45:24 +0000 |
commit | 8ebb100647ff2371debb21d8f37364902ef7b402 (patch) | |
tree | 0052f0c391d8afcb6a76af2b234c0982698871bf /sys/dev/ata/atapi-fd.c | |
parent | db37470fb1ecb5247eb4e21cdbdd474ff67e0055 (diff) | |
download | FreeBSD-src-8ebb100647ff2371debb21d8f37364902ef7b402.zip FreeBSD-src-8ebb100647ff2371debb21d8f37364902ef7b402.tar.gz |
General cleanup.
Dont be so verbose in the probe, only ONE line printed now, to get more
info boot verbose. Centralise most printf's in ata-all & ata-dma to use
the ata_printf function, it saves alot of codelines.
Repeat the identify command if drive fails the first.
Protect the timeout functions with splbio.
Dont update the transfer details before we are sure the transfer
succeded, this way they are proberly retried on errors.
Move the handling of next_writeable to userland.
Use the READ_CD command to read CD's. That enables us to read _anything_
via the normal read/write interface. This kindof obsoletes the READAUDIO
ioctl, but we keep that for now.
Diffstat (limited to 'sys/dev/ata/atapi-fd.c')
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index c2b2d52..949cd75 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -111,7 +111,6 @@ afdattach(struct atapi_softc *atp) "IOMEGA ZIP", 11)) fdp->transfersize = 64; - afd_describe(fdp); devstat_add_entry(&fdp->stats, "afd", fdp->lun, DEV_BSIZE, DEVSTAT_NO_ORDERED_TAGS, DEVSTAT_TYPE_DIRECT | DEVSTAT_TYPE_IF_IDE, @@ -121,6 +120,7 @@ afdattach(struct atapi_softc *atp) dev->si_iosize_max = 252 * DEV_BSIZE; if ((fdp->atp->devname = malloc(8, M_AFD, M_NOWAIT))) sprintf(fdp->atp->devname, "afd%d", fdp->lun); + afd_describe(fdp); return 0; } @@ -156,25 +156,26 @@ afd_sense(struct afd_softc *fdp) static void afd_describe(struct afd_softc *fdp) { - printf("afd%d: <%.40s/%.8s> rewriteable drive at ata%d as %s\n", - fdp->lun, ATA_PARAM(fdp->atp->controller, fdp->atp->unit)->model, - ATA_PARAM(fdp->atp->controller, fdp->atp->unit)->revision, - fdp->atp->controller->lun, - (fdp->atp->unit == ATA_MASTER) ? "master" : "slave "); - printf("afd%d: %luMB (%u sectors), %u cyls, %u heads, %u S/T, %u B/S\n", - fdp->lun, - (fdp->cap.cylinders * fdp->cap.heads * fdp->cap.sectors) / - ((1024L * 1024L) / fdp->cap.sector_size), - fdp->cap.cylinders * fdp->cap.heads * fdp->cap.sectors, - fdp->cap.cylinders, fdp->cap.heads, fdp->cap.sectors, - fdp->cap.sector_size); - printf("afd%d: %dKB/s,", fdp->lun, fdp->cap.transfer_rate/8); - if (fdp->transfersize) - printf(" transfer limit %d blks,", fdp->transfersize); - printf(" %s\n", ata_mode2str(fdp->atp->controller->mode[ + if (bootverbose) { + printf("afd%d: <%.40s/%.8s> rewriteable drive at ata%d as %s\n", + fdp->lun, ATA_PARAM(fdp->atp->controller, fdp->atp->unit)->model, + ATA_PARAM(fdp->atp->controller, fdp->atp->unit)->revision, + fdp->atp->controller->lun, + (fdp->atp->unit == ATA_MASTER) ? "master" : "slave"); + printf("afd%d: %luMB (%u sectors), %u cyls, %u heads, %u S/T, %u B/S\n", + fdp->lun, + (fdp->cap.cylinders * fdp->cap.heads * fdp->cap.sectors) / + ((1024L * 1024L) / fdp->cap.sector_size), + fdp->cap.cylinders * fdp->cap.heads * fdp->cap.sectors, + fdp->cap.cylinders, fdp->cap.heads, fdp->cap.sectors, + fdp->cap.sector_size); + printf("afd%d: %dKB/s,", fdp->lun, fdp->cap.transfer_rate/8); + if (fdp->transfersize) + printf(" transfer limit %d blks,", fdp->transfersize); + printf(" %s\n", ata_mode2str(fdp->atp->controller->mode[ ATA_DEV(fdp->atp->unit)])); - printf("afd%d: Medium: ", fdp->lun); - switch (fdp->header.medium_type) { + printf("afd%d: Medium: ", fdp->lun); + switch (fdp->header.medium_type) { case MFD_2DD: printf("720KB DD disk"); break; @@ -187,10 +188,22 @@ afd_describe(struct afd_softc *fdp) case MFD_UHD: printf("120MB UHD disk"); break; - default: printf("Unknown media (0x%x)", fdp->header.medium_type); + default: + printf("Unknown media (0x%x)", fdp->header.medium_type); + } + if (fdp->header.wp) printf(", writeprotected"); + printf("\n"); + } + else { + printf("afd%d: %luMB floppy <%.40s> at ata%d as %s mode %s\n", + fdp->lun, (fdp->cap.cylinders*fdp->cap.heads*fdp->cap.sectors) / + ((1024L * 1024L) / fdp->cap.sector_size), + ATA_PARAM(fdp->atp->controller, fdp->atp->unit)->model, + fdp->atp->controller->lun, + (fdp->atp->unit == ATA_MASTER) ? "master" : "slave", + ata_mode2str(fdp->atp->controller->mode[ATA_DEV(fdp->atp->unit)]) + ); } - if (fdp->header.wp) printf(", writeprotected"); - printf("\n"); } static int |