diff options
Diffstat (limited to 'sys/i386/isa/atapi-cd.c')
| -rw-r--r-- | sys/i386/isa/atapi-cd.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/i386/isa/atapi-cd.c b/sys/i386/isa/atapi-cd.c index f475fa5083b83..62c168c8d2d37 100644 --- a/sys/i386/isa/atapi-cd.c +++ b/sys/i386/isa/atapi-cd.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: atapi-cd.c,v 1.6 1998/12/07 21:58:20 archie Exp $ + * $Id: atapi-cd.c,v 1.2 1998/10/08 06:41:44 sos Exp $ */ #include "wdc.h" @@ -94,6 +94,7 @@ static void acd_done(struct acd *, struct buf *, int, struct atapires); static int acd_read_toc(struct acd *); static int acd_request_wait(struct acd *, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, u_char, char *, int); static void acd_describe(struct acd *); +static int acd_open(dev_t, int, int); static int acd_setchan(struct acd *, u_char, u_char, u_char, u_char); static int acd_eject(struct acd *, int); static void acd_select_slot(struct acd *); @@ -261,11 +262,11 @@ acd_describe(struct acd *cdp) printf("acd%d: drive speed ", cdp->lun); if (cdp->cap.cur_speed != cdp->cap.max_speed) printf("%d - ", cdp->cap.cur_speed * 1000 / 1024); - printf("%dKB/sec", cdp->cap.max_speed * 1000 / 1024); + printf("%dKb/sec", cdp->cap.max_speed * 1000 / 1024); if (cdp->cap.buf_size) - printf(", %dKB cache\n", cdp->cap.buf_size); + printf(", %dKb cache\n", cdp->cap.buf_size); - printf("acd%d: supported read types:", cdp->lun); + printf("acd%d: supported read types:", cdp->lun); comma = 0; if (cdp->cap.read_cdr) { printf(" CD-R"); comma = 1; @@ -442,12 +443,16 @@ acdclose(dev_t dev, int flags, int fmt, struct proc *p) static int acdread(dev_t dev, struct uio *uio, int ioflag) { + struct acd *cdp = acdtab[dkunit(dev)]; + return physio(acdstrategy, NULL, dev, 1, minphys, uio); } static int acdwrite(dev_t dev, struct uio *uio, int ioflag) { + struct acd *cdp = acdtab[dkunit(dev)]; + return physio(acdstrategy, NULL, dev, 0, minphys, uio); } @@ -1147,7 +1152,7 @@ acd_read_toc(struct acd *cdp) else printf("%ld:%ld audio ", cdp->info.volsize / 75 / 60, cdp->info.volsize / 75 % 60); - printf("(%ld sectors (%ld bytes)), %d tracks\n", + printf("(%ld sectors (%d bytes)), %d tracks\n", cdp->info.volsize, cdp->info.blksize, cdp->toc.hdr.ending_track - cdp->toc.hdr.starting_track + 1); } @@ -1284,6 +1289,7 @@ acd_open_track(struct acd *cdp, struct wormio_prepare_track *ptp) { struct write_param param; struct atapires result; + int error; result = atapi_request_wait(cdp->ata, cdp->unit, ATAPI_MODE_SENSE, 0, 0x05, 0, 0, 0, 0, @@ -1569,6 +1575,8 @@ static acd_devsw_installed = 0; static void acd_drvinit(void *unused) { + dev_t dev; + if (!acd_devsw_installed) { cdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &acd_cdevsw); acd_devsw_installed = 1; |
