1. Added a "scsi" command to userconfig as a start

2. "uk" is no longer an option.
This commit is contained in:
Peter Dufault 1995-03-01 22:29:06 +00:00
parent ebc1a0e2f8
commit 2778e6ab23
2 changed files with 84 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}