Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src scsitest is a SCSI target emulator used by one test, and has...
details: https://anonhg.NetBSD.org/src/rev/002e16e13f14
branches: trunk
changeset: 328928:002e16e13f14
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Apr 24 21:46:44 2014 +0000
description:
scsitest is a SCSI target emulator used by one test, and has little
reason to get installed. Make the component private to the test using
it and obsolete the installed one.
IOW, rename sys/rump/dev/lib/libscsitest -> tests/dev/scsipi/libscsitest
diffstat:
distrib/sets/lists/base/shl.mi | 8 +-
distrib/sets/lists/comp/mi | 6 +-
distrib/sets/lists/comp/shl.mi | 4 +-
distrib/sets/lists/debug/mi | 4 +-
distrib/sets/lists/debug/shl.mi | 4 +-
sys/rump/dev/Makefile.rumpdevcomp | 4 +-
sys/rump/dev/lib/libscsitest/Makefile | 11 -
sys/rump/dev/lib/libscsitest/SCSITEST.ioconf | 12 -
sys/rump/dev/lib/libscsitest/scsitest.c | 258 ----------------------
sys/rump/dev/lib/libscsitest/scsitest_component.c | 46 ---
sys/rump/dev/lib/libscsitest/shlib_version | 4 -
tests/dev/scsipi/Makefile | 10 +-
tests/dev/scsipi/libscsitest/Makefile | 15 +
tests/dev/scsipi/libscsitest/SCSITEST.ioconf | 12 +
tests/dev/scsipi/libscsitest/scsitest.c | 258 ++++++++++++++++++++++
tests/dev/scsipi/libscsitest/scsitest_component.c | 46 +++
16 files changed, 354 insertions(+), 348 deletions(-)
diffs (truncated from 832 to 300 lines):
diff -r 314db369c7cd -r 002e16e13f14 distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi Thu Apr 24 20:12:56 2014 +0000
+++ b/distrib/sets/lists/base/shl.mi Thu Apr 24 21:46:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.699 2014/04/10 22:11:57 asau Exp $
+# $NetBSD: shl.mi,v 1.700 2014/04/24 21:46:44 pooka Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -520,9 +520,9 @@
./usr/lib/librumpdev_scsipi.so base-rump-shlib rump
./usr/lib/librumpdev_scsipi.so.0 base-rump-shlib rump
./usr/lib/librumpdev_scsipi.so.0.0 base-rump-shlib rump
-./usr/lib/librumpdev_scsitest.so base-rump-shlib rump
-./usr/lib/librumpdev_scsitest.so.0 base-rump-shlib rump
-./usr/lib/librumpdev_scsitest.so.0.0 base-rump-shlib rump
+./usr/lib/librumpdev_scsitest.so base-obsolete obsolete
+./usr/lib/librumpdev_scsitest.so.0 base-obsolete obsolete
+./usr/lib/librumpdev_scsitest.so.0.0 base-obsolete obsolete
./usr/lib/librumpdev_sysmon.so base-rump-shlib rump
./usr/lib/librumpdev_sysmon.so.0 base-rump-shlib rump
./usr/lib/librumpdev_sysmon.so.0.0 base-rump-shlib rump
diff -r 314db369c7cd -r 002e16e13f14 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Thu Apr 24 20:12:56 2014 +0000
+++ b/distrib/sets/lists/comp/mi Thu Apr 24 21:46:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1889 2014/04/22 15:27:50 christos Exp $
+# $NetBSD: mi,v 1.1890 2014/04/24 21:46:44 pooka Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -3762,8 +3762,8 @@
./usr/lib/librumpdev_rnd_p.a comp-c-proflib profile,rump
./usr/lib/librumpdev_scsipi.a comp-c-lib rump
./usr/lib/librumpdev_scsipi_p.a comp-c-proflib profile,rump
-./usr/lib/librumpdev_scsitest.a comp-c-lib rump
-./usr/lib/librumpdev_scsitest_p.a comp-c-proflib profile,rump
+./usr/lib/librumpdev_scsitest.a comp-obsolete obsolete
+./usr/lib/librumpdev_scsitest_p.a comp-obsolete obsolete
./usr/lib/librumpdev_sysmon.a comp-c-lib rump
./usr/lib/librumpdev_sysmon_p.a comp-c-proflib profile,rump
./usr/lib/librumpdev_ubt.a comp-c-lib rump
diff -r 314db369c7cd -r 002e16e13f14 distrib/sets/lists/comp/shl.mi
--- a/distrib/sets/lists/comp/shl.mi Thu Apr 24 20:12:56 2014 +0000
+++ b/distrib/sets/lists/comp/shl.mi Thu Apr 24 21:46:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.263 2014/04/10 00:09:09 pooka Exp $
+# $NetBSD: shl.mi,v 1.264 2014/04/24 21:46:44 pooka Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -164,7 +164,7 @@
./usr/lib/librumpdev_raidframe_pic.a comp-c-piclib rump,picinstall
./usr/lib/librumpdev_rnd_pic.a comp-c-piclib rump,picinstall
./usr/lib/librumpdev_scsipi_pic.a comp-c-piclib rump,picinstall
-./usr/lib/librumpdev_scsitest_pic.a comp-c-piclib rump,picinstall
+./usr/lib/librumpdev_scsitest_pic.a comp-obsolete obsolete
./usr/lib/librumpdev_sysmon_pic.a comp-c-piclib rump,picinstall
./usr/lib/librumpdev_ubt_pic.a comp-c-piclib rump,picinstall
./usr/lib/librumpdev_ucom_pic.a comp-c-piclib rump,picinstall
diff -r 314db369c7cd -r 002e16e13f14 distrib/sets/lists/debug/mi
--- a/distrib/sets/lists/debug/mi Thu Apr 24 20:12:56 2014 +0000
+++ b/distrib/sets/lists/debug/mi Thu Apr 24 21:46:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.58 2014/04/16 00:41:07 htodd Exp $
+# $NetBSD: mi,v 1.59 2014/04/24 21:46:44 pooka Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib
@@ -152,7 +152,7 @@
./usr/lib/librumpdev_raidframe_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpdev_rnd_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpdev_scsipi_g.a comp-c-debuglib debuglib,rump
-./usr/lib/librumpdev_scsitest_g.a comp-c-debuglib debuglib,rump
+./usr/lib/librumpdev_scsitest_g.a comp-obsolete obsolete
./usr/lib/librumpdev_sysmon_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpdev_ubt_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpdev_ucom_g.a comp-c-debuglib debuglib,rump
diff -r 314db369c7cd -r 002e16e13f14 distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi Thu Apr 24 20:12:56 2014 +0000
+++ b/distrib/sets/lists/debug/shl.mi Thu Apr 24 21:46:44 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.59 2014/04/10 00:09:09 pooka Exp $
+# $NetBSD: shl.mi,v 1.60 2014/04/24 21:46:44 pooka Exp $
./usr/libdata/debug/lib/libc.so.12.190.debug comp-sys-debug debug
./usr/libdata/debug/lib/libcrypt.so.1.0.debug comp-sys-debug debug
./usr/libdata/debug/lib/libcrypto.so.8.2.debug comp-sys-debug debug
@@ -179,7 +179,7 @@
./usr/libdata/debug/usr/lib/librumpdev_raidframe.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpdev_rnd.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpdev_scsipi.so.0.0.debug comp-rump-debug debug,rump
-./usr/libdata/debug/usr/lib/librumpdev_scsitest.so.0.0.debug comp-rump-debug debug,rump
+./usr/libdata/debug/usr/lib/librumpdev_scsitest.so.0.0.debug comp-obsolete obsolete
./usr/libdata/debug/usr/lib/librumpdev_sysmon.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpdev_ubt.so.0.0.debug comp-rump-debug debug,rump
./usr/libdata/debug/usr/lib/librumpdev_ucom.so.0.0.debug comp-rump-debug debug,rump
diff -r 314db369c7cd -r 002e16e13f14 sys/rump/dev/Makefile.rumpdevcomp
--- a/sys/rump/dev/Makefile.rumpdevcomp Thu Apr 24 20:12:56 2014 +0000
+++ b/sys/rump/dev/Makefile.rumpdevcomp Thu Apr 24 21:46:44 2014 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile.rumpdevcomp,v 1.10 2014/04/14 22:56:53 pooka Exp $
+# $NetBSD: Makefile.rumpdevcomp,v 1.11 2014/04/24 21:46:44 pooka Exp $
#
RUMPDEVCOMP= audio bpf cgd disk dm drvctl fss md netsmb pad pud \
- putter raidframe rnd scsipi scsitest sysmon wscons \
+ putter raidframe rnd scsipi sysmon wscons \
opencrypto
RUMPUSBDEVS= ubt ucom ugenhc ulpt umass usb
diff -r 314db369c7cd -r 002e16e13f14 sys/rump/dev/lib/libscsitest/Makefile
--- a/sys/rump/dev/lib/libscsitest/Makefile Thu Apr 24 20:12:56 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile,v 1.2 2014/03/13 01:58:46 pooka Exp $
-#
-
-LIB= rumpdev_scsitest
-IOCONF= SCSITEST.ioconf
-
-SRCS= scsitest.c
-SRCS+= scsitest_component.c
-
-.include <bsd.lib.mk>
-.include <bsd.klinks.mk>
diff -r 314db369c7cd -r 002e16e13f14 sys/rump/dev/lib/libscsitest/SCSITEST.ioconf
--- a/sys/rump/dev/lib/libscsitest/SCSITEST.ioconf Thu Apr 24 20:12:56 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-# $NetBSD: SCSITEST.ioconf,v 1.1 2010/08/24 11:23:35 pooka Exp $
-#
-
-ioconf scsitest
-
-include "conf/files"
-include "dev/scsipi/files.scsipi"
-include "rump/dev/files.rump"
-
-pseudo-root mainbus*
-
-scsitest0 at mainbus?
diff -r 314db369c7cd -r 002e16e13f14 sys/rump/dev/lib/libscsitest/scsitest.c
--- a/sys/rump/dev/lib/libscsitest/scsitest.c Thu Apr 24 20:12:56 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/* $NetBSD: scsitest.c,v 1.6 2013/03/15 16:14:12 martin Exp $ */
-
-/*
- * Copyright (c) 2010 Antti Kantee. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * A SCSI target which is useful for debugging our scsipi driver stack.
- * Currently it pretends to be a single CD.
- *
- * Freely add the necessary features for your tests. Just remember to
- * run the atf test suite to make sure you didn't cause regressions to
- * other tests.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsitest.c,v 1.6 2013/03/15 16:14:12 martin Exp $");
-
-#include <sys/param.h>
-#include <sys/atomic.h>
-#include <sys/buf.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/fcntl.h>
-
-#include <dev/scsipi/scsiconf.h>
-#include <dev/scsipi/scsipiconf.h>
-#include <dev/scsipi/scsi_disk.h>
-#include <dev/scsipi/scsipi_cd.h>
-#include <dev/scsipi/scsipi_all.h>
-
-#include <rump/rumpuser.h>
-#include <rump/scsitest.h>
-
-int scsitest_match(device_t, cfdata_t, void *);
-void scsitest_attach(device_t, device_t, void *);
-
-struct scsitest {
- struct scsipi_channel sc_channel;
- struct scsipi_adapter sc_adapter;
-};
-
-CFATTACH_DECL_NEW(scsitest, sizeof(struct scsitest), scsitest_match,
- scsitest_attach, NULL, NULL);
-
-/*
- * tosi.iso can be used to deliver CD requests to a host file with the
- * name in USE_TOSI_ISO (yes, it's extrasimplistic).
- */
-//#define USE_TOSI_ISO
-
-#define CDBLOCKSIZE 2048
-static uint32_t mycdsize = 2048;
-static int isofd;
-
-#define MYCDISO "tosi.iso"
-
-unsigned rump_scsitest_err[RUMP_SCSITEST_MAXERROR];
-
-static void
-sense_notready(struct scsipi_xfer *xs)
-{
- struct scsi_sense_data *sense = &xs->sense.scsi_sense;
-
- xs->error = XS_SENSE;
-
- sense->response_code = 0x70;
- sense->flags = SKEY_NOT_READY;
- sense->asc = 0x3A;
- sense->ascq = 0x00;
- sense->extra_len = 6;
-}
-
-/*
- * This is pretty much a CD target for now
- */
-static void
-scsitest_request(struct scsipi_channel *chan,
- scsipi_adapter_req_t req, void *arg)
-{
- struct scsipi_xfer *xs = arg;
- struct scsipi_generic *cmd = xs->cmd;
-#ifdef USE_TOSI_ISO
- int error;
-#endif
-
- if (req != ADAPTER_REQ_RUN_XFER)
- return;
-
- //show_scsipi_xs(xs);
-
- switch (cmd->opcode) {
- case SCSI_TEST_UNIT_READY:
- if (isofd == -1)
- sense_notready(xs);
-
- break;
- case INQUIRY: {
- struct scsipi_inquiry_data *inqbuf = (void *)xs->data;
-
- memset(inqbuf, 0, sizeof(*inqbuf));
- inqbuf->device = T_CDROM;
- inqbuf->dev_qual2 = SID_REMOVABLE;
- strcpy(inqbuf->vendor, "RUMPHOBO");
- strcpy(inqbuf->product, "It's a LIE");
- strcpy(inqbuf->revision, "0.00");
- break;
- }
- case READ_CD_CAPACITY: {
- struct scsipi_read_cd_cap_data *ret = (void *)xs->data;
-
- _lto4b(CDBLOCKSIZE, ret->length);
- _lto4b(mycdsize, ret->addr);
-
- break;
- }
- case READ_DISCINFO: {
- struct scsipi_read_discinfo_data *ret = (void *)xs->data;
-
- memset(ret, 0, sizeof(*ret));
- break;
- }
- case READ_TRACKINFO: {
- struct scsipi_read_trackinfo_data *ret = (void *)xs->data;
-
- _lto4b(mycdsize, ret->track_size);
- break;
- }
- case READ_TOC: {
- struct scsipi_toc_header *ret = (void *)xs->data;
-
- memset(ret, 0, sizeof(*ret));
- break;
- }
Home |
Main Index |
Thread Index |
Old Index