Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mscp Adjust MSCP attach routines. The current code w...
details: https://anonhg.NetBSD.org/src/rev/7d25d1283530
branches: trunk
changeset: 780069:7d25d1283530
user: abs <abs%NetBSD.org@localhost>
date: Tue Jul 10 22:30:22 2012 +0000
description:
Adjust MSCP attach routines. The current code worked fine on simh-vax, but
unfortunately failed on at least one 'real' SCSI MSCP adaptor.
In the updated code
mscp_dorsp()
diffstat:
sys/dev/mscp/mscp_disk.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diffs (75 lines):
diff -r 37280a4ddbb4 -r 7d25d1283530 sys/dev/mscp/mscp_disk.c
--- a/sys/dev/mscp/mscp_disk.c Tue Jul 10 22:30:22 2012 +0000
+++ b/sys/dev/mscp/mscp_disk.c Tue Jul 10 22:30:22 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mscp_disk.c,v 1.72 2012/06/22 20:42:24 abs Exp $ */
+/* $NetBSD: mscp_disk.c,v 1.73 2012/07/10 22:30:23 abs Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -82,11 +82,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.72 2012/06/22 20:42:24 abs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.73 2012/07/10 22:30:23 abs Exp $");
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/bufq.h>
+#include <sys/cdio.h>
#include <sys/device.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
@@ -305,7 +306,7 @@
(void) tsleep(&udautab[unit], PZERO - 1,
"raclose", 0);
splx(s);
- ra->ra_state = CLOSED;
+ ra->ra_state = DK_CLOSED;
ra->ra_wlabel = 0;
}
#endif
@@ -461,9 +462,8 @@
if (cmd == ODIOCGDEFLABEL)
tp = &newlabel;
else
-#else
+#endif
tp = (struct disklabel *)data;
-#endif
memset(tp, 0, sizeof(struct disklabel));
tp->d_secsize = lp->d_secsize;
tp->d_nsectors = lp->d_nsectors;
@@ -516,14 +516,21 @@
return (dkwedge_list(&ra->ra_disk, dkwl, l));
}
+ case DIOCTUR:
+ /* test unit ready */
+ if (ra->ra_state == DK_CLOSED &&
+ ra_putonline(dev, ra) == MSCP_FAILED)
+ error = ENXIO;
+ *((int*)data) = (ra->ra_state == DK_OPEN);
+ return error;
+
default:
error = ENOTTY;
break;
}
- return (error);
+ return error;
}
-
int
radump(dev_t dev, daddr_t blkno, void *va, size_t size)
{
@@ -750,6 +757,7 @@
return MSCP_DONE;
}
+
#if NRX
/*
Home |
Main Index |
Thread Index |
Old Index