Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x68k/stand/libsa Fix CD support.
details: https://anonhg.NetBSD.org/src/rev/5a3b0526d627
branches: trunk
changeset: 778237:5a3b0526d627
user: minoura <minoura%NetBSD.org@localhost>
date: Tue Mar 20 12:38:53 2012 +0000
description:
Fix CD support.
diffstat:
sys/arch/x68k/stand/libsa/sdcd.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (53 lines):
diff -r 29024afa0c67 -r 5a3b0526d627 sys/arch/x68k/stand/libsa/sdcd.c
--- a/sys/arch/x68k/stand/libsa/sdcd.c Tue Mar 20 12:38:33 2012 +0000
+++ b/sys/arch/x68k/stand/libsa/sdcd.c Tue Mar 20 12:38:53 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdcd.c,v 1.11 2011/07/17 20:54:49 joerg Exp $ */
+/* $NetBSD: sdcd.c,v 1.12 2012/03/20 12:38:53 minoura Exp $ */
/*
* Copyright (c) 2001 MINOURA Makoto.
@@ -67,7 +67,7 @@
}
{
- struct iocs_inquiry *inqdata = buffer;
+ struct iocs_inquiry *inqdata= buffer;
error = IOCS_S_INQUIRY(100, id, inqdata);
if (error < 0) { /* WHY??? */
@@ -75,6 +75,7 @@
goto out;
}
if ((inqdata->unit != 0) && /* direct */
+ (inqdata->unit != 5) && /* cdrom */
(inqdata->unit != 7)) { /* optical */
error = EUNIT;
goto out;
@@ -327,7 +328,7 @@
if (id < 0 || id > 7)
return ENXIO;
- if (part == 0 || part == 2)
+ if (part != 0 && part != 2)
return ENXIO;
if (current_id != id) {
error = check_unit(id);
@@ -341,6 +342,8 @@
sc->sc_partinfo.size = current_devsize;
sc->sc_blocksize = current_blklen << 9;
f->f_devdata = sc;
+ current_id = id;
+
return 0;
}
@@ -358,6 +361,7 @@
{
struct sdcd_softc *sc = arg;
- return sdstrategy(arg, rw, dblk * DEV_BSIZE / sc->sc_blocksize,
+ /* cast dblk to avoid divdi3; 32bit is enough even for BD-ROMs. */
+ return sdstrategy(arg, rw, (unsigned int) dblk / sc->sc_blocksize,
size, buf, rsize);
}
Home |
Main Index |
Thread Index |
Old Index