summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-06-07 07:21:20 +0000
committersos <sos@FreeBSD.org>2001-06-07 07:21:20 +0000
commit21b6fc665722d03198c1e6e05ee59795edb7a64c (patch)
tree2ae2fd11ec0d44cbe628f4c8268c5b666fa64bde /sys
parent608ddbaef3abfdb3665ae0a62fc17f495897cf32 (diff)
downloadFreeBSD-src-21b6fc665722d03198c1e6e05ee59795edb7a64c.zip
FreeBSD-src-21b6fc665722d03198c1e6e05ee59795edb7a64c.tar.gz
Quiet the READ_TOC errors that can appear on empty CDR's.
Assure cur_write_speed can be no less than 177 to avoid divide by 0 error.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/atapi-cd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 8561da4..da0ce21 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -1229,7 +1229,7 @@ acd_read_toc(struct acd_softc *cdp)
ccb[7] = len>>8;
ccb[8] = len;
if (atapi_queue_cmd(cdp->atp, ccb, (caddr_t)&cdp->toc, len,
- ATPR_F_READ, 30, NULL, NULL)) {
+ ATPR_F_READ | ATPR_F_QUIET, 30, NULL, NULL)) {
bzero(&cdp->toc, sizeof(cdp->toc));
return;
}
@@ -1915,7 +1915,7 @@ acd_get_cap(struct acd_softc *cdp)
cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed);
cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed);
cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed);
- cdp->cap.cur_write_speed = ntohs(cdp->cap.cur_write_speed);
+ cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed), 177);
cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels);
cdp->cap.buf_size = ntohs(cdp->cap.buf_size);
}
OpenPOWER on IntegriCloud