summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordufault <dufault@FreeBSD.org>1995-03-01 22:29:06 +0000
committerdufault <dufault@FreeBSD.org>1995-03-01 22:29:06 +0000
commite6201befc6e92c59d9d29b4253c96a63c941cc46 (patch)
tree2dbee4ad0860f826a29ea2780465b771270bf55f
parentee28b29ea87c8241c96516482eefca30a7ade630 (diff)
downloadFreeBSD-src-e6201befc6e92c59d9d29b4253c96a63c941cc46.zip
FreeBSD-src-e6201befc6e92c59d9d29b4253c96a63c941cc46.tar.gz
1. Added a "scsi" command to userconfig as a start
2. "uk" is no longer an option.
-rw-r--r--sys/i386/i386/conf.c6
-rw-r--r--sys/i386/i386/userconfig.c82
2 files changed, 84 insertions, 4 deletions
diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c
index b657ffc..cf947de 100644
--- a/sys/i386/i386/conf.c
+++ b/sys/i386/i386/conf.c
@@ -42,7 +42,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
- * $Id: conf.c,v 1.69 1995/02/27 19:46:27 ugen Exp $
+ * $Id: conf.c,v 1.70 1995/02/28 00:20:45 pst Exp $
*/
#include <sys/param.h>
@@ -629,8 +629,8 @@ d_strategy_t sustrategy;
#define sustrategy nxstrategy
#endif
-#include "uk.h"
-#if NUK > 0
+#include "scbus.h"
+#if NSCBUS > 0
d_open_t ukopen;
d_close_t ukclose;
d_ioctl_t ukioctl;
diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c
index 78ab7a5..3f9730b 100644
--- a/sys/i386/i386/userconfig.c
+++ b/sys/i386/i386/userconfig.c
@@ -38,7 +38,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: userconfig.c,v 1.17 1995/02/06 02:48:38 jkh Exp $
+ * $Id: userconfig.c,v 1.18 1995/02/27 13:39:39 ugen Exp $
*/
#include <sys/param.h>
@@ -48,6 +48,8 @@
#include <i386/isa/isa_device.h>
+#include <scsi/scsiconf.h>
+
#define PARM_DEVSPEC 0x1
#define PARM_INT 0x2
#define PARM_ADDR 0x3
@@ -74,6 +76,7 @@ typedef struct _cmd {
CmdParm *parms;
} Cmd;
+static void lsscsi(void);
static void lsdevtab(struct isa_device *);
static struct isa_device *find_device(char *, int);
static struct isa_device *search_devtable(struct isa_device *, char *, int);
@@ -82,6 +85,7 @@ static Cmd *parse_cmd(char *);
static int parse_args(char *, CmdParm *);
unsigned long strtoul(const char *, char **, int);
+static int list_scsi(CmdParm *);
static int list_devices(CmdParm *);
static int set_device_ioaddr(CmdParm *);
static int set_device_irq(CmdParm *);
@@ -131,6 +135,7 @@ static Cmd CmdList[] = {
{ "po", set_device_ioaddr, int_parms }, /* port dev addr */
{ "pr", device_probe, dev_parms }, /* probe dev */
{ "q", quitfunc, NULL }, /* quit */
+ { "s", list_scsi, NULL }, /* scsi */
{ NULL, NULL, NULL },
};
@@ -557,3 +562,78 @@ strtoul(nptr, endptr, base)
*endptr = (char *)(any ? s - 1 : nptr);
return (acc);
}
+
+/* scsi: Support for displaying configured SCSI devices.
+ * There is no way to edit them, and this is inconsistent
+ * with the ISA method. This is here as a basis for further work.
+ */
+static char *
+type_text(char *name) /* XXX: This is bogus */
+{
+ if (strcmp(name, "sd") == 0)
+ return "disk";
+
+ if (strcmp(name, "st") == 0)
+ return "tape";
+
+ return "device";
+}
+
+static void
+id_put(char *desc, int id)
+{
+ if (id != SCCONF_UNSPEC)
+ {
+ if (desc)
+ printf("%s", desc);
+
+ if (id == SCCONF_ANY)
+ printf("?");
+ else
+ printf("%d", id);
+ }
+}
+
+static void
+lsscsi(void)
+{
+ int i;
+
+ printf("scsi: (can't be edited):\n");
+
+ for (i = 0; scsi_cinit[i].driver; i++)
+ {
+ id_put("controller scbus", scsi_cinit[i].bus);
+
+ if (scsi_cinit[i].unit != -1)
+ {
+ printf(" at ");
+ id_put(scsi_cinit[i].driver, scsi_cinit[i].unit);
+ }
+
+ printf("\n");
+ }
+
+ for (i = 0; scsi_dinit[i].name; i++)
+ {
+ printf("%s ", type_text(scsi_dinit[i].name));
+
+ id_put(scsi_dinit[i].name, scsi_dinit[i].unit);
+ id_put(" at scbus", scsi_dinit[i].cunit);
+ id_put(" target ", scsi_dinit[i].target);
+ id_put(" lun ", scsi_dinit[i].lun);
+
+ if (scsi_dinit[i].flags)
+ printf("flags 0x%x\n", scsi_dinit[i].flags);
+
+ printf("\n");
+ }
+}
+
+static int
+list_scsi(CmdParm *parms)
+{
+ lineno = 0;
+ lsscsi();
+ return 0;
+}
OpenPOWER on IntegriCloud