📄 option.c
字号:
#ifndef lintstatic char sccsid[] = "@(#)option.c 1.1 92/07/30 Copyright Sun Micro";#endif/* * Copyright (c) 1987 by Sun Microsystems, Inc. */#include <curses.h>#include "sundiag.h"#include "../../lib/include/probe_sundiag.h"#include "struct.h"#include <sundev/tmreg.h>#include <sundev/xtreg.h>#include <sundev/arreg.h>#include "tty.h"#include "disk_strings.h"#include "sundiag_msg.h"#include <netdb.h>#ifndef sun386#include <sys/mtio.h>struct mt_tape_info tapes[]=MT_TAPE_INFO;#else#include "mtio.h"#include "tape_strings.h"#endif/************ following external variables are declared in tests.c ************/extern char *sp_src; /* default ALM loopback source */extern char *sp_des; /* default ALM loopback destination */extern char *sp2_src; /* default ALM2 loopback source */extern char *sp2_des; /* default ALM2 loopback destination */extern char *scsisp_src; /* default SCSI serial port loopback source */extern char *scsisp_des; /* default SCSI serial port loopback destination */extern char *sunlink_src[]; /* default SunLink loopback source */extern char *sunlink_des[]; /* default SunLink loopback destination *//******************************************************************************/extern char *malloc();extern char *strcpy();extern char *sprintf();extern char *mktemp();static Panel_item item1,item2,item3,item4,item5,item6,item7,item8,item9,item10;static Panel_item item11, item12, item13, item14, item15, item16, item17;static Panel_item item18, item19, item20, item21, item22, item23;static Panel_item processor_item[30];static int qic150; /* if this is a qic150 drive */static int exabyte_8200; /* if this is a Exabyte 2 G.B drive */static int exabyte_8500; /* if this is a Exabyte 5 G.B drive */static int hp_flt; /* if this is a hp reel drive(front load) */static int halfin; /* if this is a 1/2"(magnetics) drive */static int cart_tape; /* if this is a cartridge tape drive */static int ctlr_type; /* to keep the SCSI controller types(SCSI2/3) */static hsi_mixport_proc(); /* forward declaration */static sbus_hsi_mixport_proc(); /* forward declaration */static hawk_subtest_loop_proc(); /* forward declaration */static disk_rawtest_proc(); /* forward declaration */static zebra_access_proc(); /* forward declaration */ static lpvi_image_proc(); /* forward declaration */static spif_tests_proc(); /* forward declaration */char audbri_ref_file[200];struct option_choice{ int num; /* number of choices */ char *label; /* label of the choice */ int type; /* item type: PANEL_CYCLE, PANEL_TOGGLE, PANEL_TEXT */ char com; /* the single letter command for TTY mode(not f,d,h) */ char *choice[18]; /* up to 16 choices, must be terminated with 2 NULL's */};/* global variables */int processors_mask;int number_processors;#define CYCLE_ITEM 0#define TOGGLE_ITEM 1#define TEXT_ITEM 2static char enable[]="Enable";static char disable[]="Disable";static struct option_choice wait_choice= /* Wait Time(VMEM) */{ 7, "Wait Time:", CYCLE_ITEM, 'w', {"0", "5", "10", "15", "30", "60", "90", "random", NULL, NULL}}; static struct option_choice reserve_choice= /* Reserve(VMEM) */{ 1, "Reserve: ", TEXT_ITEM, 'r', {NULL, NULL, NULL}}; static struct option_choice cpusp_choice= /* Loopback(CPU_SP) */{ 4, "Loopback:", CYCLE_ITEM, 'l', {"a", "b", "a b", "a-b", NULL, NULL}};static struct option_choice cpusp1_choice= /* Loopback(CPU_SP1) */{ 4, "Loopback:", CYCLE_ITEM, 'l', {"c", "d", "c d", "c-d", NULL, NULL}};static struct option_choice raw_choice= /* Raw device test(DISKS) */{ 2, "Rawtest ", TOGGLE_ITEM, 'r', {disable, enable, NULL, NULL}};static struct option_choice fs_choice= /* File system device test(DISKS) */{ 2, "Filetest", TOGGLE_ITEM, 'w', {disable, enable, NULL, NULL}};static struct option_choice raw_op_choice1= /*Raw device test options(DISKS)*/{ 2, "Rawtest Mode: ", CYCLE_ITEM, 'o', {"Readonly", "Write/Read", NULL, NULL}};static struct option_choice raw_op_choice2= /*Raw device partition(DISKS)*/{ 8, "Rawtest Partition:", CYCLE_ITEM, 'p', {"a", "b", "c", "d", "e", "f", "g", "h", NULL, NULL}};static struct option_choice raw_op_choice3= /*Raw device test size(DISKS)*/{ /* All in Mega Bytes */ 7, "Rawtest Size (MB):", CYCLE_ITEM, 'm', {"100", "200", "400", "600", "800", "1000", "1200", NULL, NULL}};static struct option_choice from_choice= /* From(loopback assignment) */{ 1, "From:", TEXT_ITEM, 'r', {NULL, NULL, NULL}};static struct option_choice to_choice= /* To(loopback assignment) */{ 1, " To:", TEXT_ITEM, 't', {NULL, NULL, NULL}};static struct option_choice audio_choice= /* audio ouput(AUDIO) */{ 2, "Audio Output:", CYCLE_ITEM, 'a', {"Speaker", "Jack", NULL, NULL}};static struct option_choice loud_choice= /* audio volume(AUDIO) */{ 1, "Volume: ", TEXT_ITEM, 'v', {NULL, NULL, NULL}};static struct option_choice cdtype_choice= /* CD type(CDROM) */{ 5, "CD Type: ", CYCLE_ITEM, 'c', {"Cdassist", "Sony2", "Hitachi4", "Pdo", "Other" , NULL, NULL}};static struct option_choice datatest1_choice= /* data test(CDROM)*/{ 2, "Data Mode 1: ", CYCLE_ITEM, 'x', {enable, disable, NULL, NULL}};static struct option_choice datatest2_choice= /* data test(CDROM)*/{ 2, "Data Mode 2: ", CYCLE_ITEM, 'y', {enable, disable, NULL, NULL}};static struct option_choice audiotest_choice= /* audio test(CDROM) */{ 2, "Audio Test: ", CYCLE_ITEM, 'a', {enable, disable, NULL, NULL}};static struct option_choice volume_choice= /* volume(CDROM) */{ 1, "Volume: ", TEXT_ITEM, 'v', {NULL, NULL, NULL}};static struct option_choice datatrack_choice= /* datatrack(CDROM) */{ 1, "% Data/Track:", TEXT_ITEM, 'p', {NULL, NULL, NULL}};static struct option_choice readmode_choice= /* read mode(CDROM) */{ 2, "Read Mode: ", CYCLE_ITEM, 'm', {"Random", "Sequential", NULL, NULL}};static struct option_choice audbri_loop_type_choice= /* AUDBRI */{ 2, "Type:", CYCLE_ITEM, 't', {"Line-in/Line-out", "Line-in/Headphone", NULL, NULL}};static struct option_choice audbri_loop_choice= /* AUDBRI */{ 2, "Loopback:", CYCLE_ITEM, 'e', {disable, enable, NULL, NULL}};static struct option_choice audbri_loop_calib_choice= /* AUDBRI */{ 2, "Calibration:", CYCLE_ITEM, 'c', {disable, enable, NULL, NULL}};static struct option_choice audbri_audio_choice= /* AUDBRI */{ 2, "Audio Test:", CYCLE_ITEM, 'm', {disable, enable, NULL, NULL}};static struct option_choice audbri_crystal_choice= /* AUDBRI */{ 2, "Crystal Test:", CYCLE_ITEM, 'x', {disable, enable, NULL, NULL}};static struct option_choice audbri_controls_choice= /* AUDBRI */{ 2, "Controls Test:", CYCLE_ITEM, 'o', {disable, enable, NULL, NULL}}; static struct option_choice audbri_ref_file_choice= /* AUDBRI */{ 1, "Reference File:", TEXT_ITEM, 'f', {NULL, NULL, NULL}}; static struct option_choice format_choice= /* format(SCSITAPE) */{ 3, "Format: ", CYCLE_ITEM, 'o', {"QIC-11", "QIC-24", "QIC-11&QIC-24", NULL, NULL}};static struct option_choice density_choice= /* density(SCSITAPE) */{ 5, "Density: ", CYCLE_ITEM, 'e', {"800-BPI", "1600-BPI", "6250-BPI", "All", "Compression", NULL, NULL}};static struct option_choice density_choice_nodc= /* density(SCSITAPE) */{ 4, "Density: ", CYCLE_ITEM, 'e', {"800-BPI", "1600-BPI", "6250-BPI", "All", NULL, NULL}};static struct option_choice density_choice_halfin= /* density(SCSITAPE) */{ 3, "Density: ", CYCLE_ITEM, 'e', {"Both", "1600-BPI", "6250-BPI", NULL, NULL}};static struct option_choice density_choice_exb8500= /* density(SCSITAPE) */{ 4, "Density: ", CYCLE_ITEM, 'e', {"EXB-8200", "EXB-8500", "All", "Compression", NULL, NULL}};static struct option_choice density_choice_exb8500_nodc= /* density(SCSITAPE) */{ 3, "Density: ", CYCLE_ITEM, 'e', {"EXB-8200", "EXB-8500", "Both", NULL, NULL}};static struct option_choice mode_choice= /* mode(SCSITAPE) */{ 2, "Mode: ", CYCLE_ITEM, 'm', {"Write/Read", "Readonly", NULL, NULL}};static struct option_choice length_choice= /* length(SCSITAPE) */{ 4, "Length: ", CYCLE_ITEM, 'l', {"EOT", "Specified", "Long", "Short", NULL, NULL}};static struct option_choice block_choice= /* block(SCSITAPE) */{ 1, "# of Blocks:", TEXT_ITEM, 'b', {NULL, NULL, NULL}};static struct option_choice file_choice= /* file test(SCSITAPE) */{ 2, "File Test: ", CYCLE_ITEM, 'i', {enable, disable, NULL, NULL}};static struct option_choice stream_choice= /* streaming(SCSITAPE) */{ 2, "Streaming: ", CYCLE_ITEM, 's', {disable, enable, NULL, NULL}};static struct option_choice recon_choice= /* recon(SCSITAPE) */{ 2, "Reconnect: ", CYCLE_ITEM, 'r', {disable, enable, NULL, NULL}};static struct option_choice retension_choice= /* retension(SCSITAPE) */{ 2, "Retension: ", CYCLE_ITEM, 't', {enable, disable, NULL, NULL}};static struct option_choice clean_choice= /* clean_head(SCSITAPE) */{ 2, "Clean Head: ", CYCLE_ITEM, 'c', {enable, disable, NULL, NULL}};static struct option_choice pass_choice= /* pass(SCSITAPE) */{ 1, "# of Passes:", TEXT_ITEM, 'p', {NULL, NULL, NULL}};static struct option_choice floppy_choice= /* floppy(IPC) */{ 2, "Floppy Drive Test:", CYCLE_ITEM, 'y', {disable, enable, NULL, NULL}};static struct option_choice printer_choice= /* printer(IPC) */{ 2, "Printer Port Test:", CYCLE_ITEM, 'p', {disable, enable, NULL, NULL}};static struct option_choice sp_choice= /* serial port(MCP) */{ 2, "Serial Port Test ", TOGGLE_ITEM, 's', {disable, enable, NULL, NULL}};static struct option_choice pp_choice= /* printer port(MCP) */{ 2, "Printer Port Test", TOGGLE_ITEM, 'p', {disable, enable, NULL, NULL}};static struct option_choice clock_choice= /* clock source(HSI) */{ 2, "Clock Source: ", CYCLE_ITEM, 'c', {"On-board", "External", NULL, NULL}};static struct option_choice type_choice= /* port type(HSI) */{ 4, "Port Type: ", CYCLE_ITEM, 't', {"RS449", "V.35", "RS449&V.35", "RS449-V.35", NULL, NULL}};static struct option_choice loopback_choice= /* loopback(HSI) */{ 4, "Loopback: ", CYCLE_ITEM, 'l', {"0", "1", "0 1", "0-1", NULL, NULL}};static struct option_choice loopback_choice1= /* loopback1(HSI) */{ 4, "Loopback: ", CYCLE_ITEM, 'l', {"2", "3", "2 3", "2-3", NULL, NULL}};/* * ----------------------------------------------- * ...ITEM# | ITEM3 | | ITEM2 |ITEM1 | * |-------------|-------------|----------|------| * choice | loopback | | internal |clock | * | | | loopback | | * |-------------|-------------|----------|------| * default | 4 | | 0 | 0 | * |-------------|-------------|----------|------| * bit # | 7 6 5 4 | 3 2 | 1 | 0 | * ----------------------------------------------- * * This version currently supports up to three boards. Each board * having 4 ports => 12 ports supported. */static struct option_choice sbus_clock_choice= /* clock source(HSI) */{ 2, "Clock Source: ", CYCLE_ITEM, 'c', {"Baud (on-board)", "External", NULL, NULL}};static struct option_choice internal_loopback_choice={ 2, "Internal Loopback: ", CYCLE_ITEM, 'i', {disable, enable, NULL, NULL}};static struct option_choice sbus_loopback_choice= /* loopback(SBus-HSI0) */{ 8, "Loopback: ", CYCLE_ITEM, 'l', {"0", "1", "2", "3", "0,1,2,3", "0-1,2-3", "0-2,1-3", "0-3,1-2", NULL, NULL}};static struct option_choice sbus_loopback_choice1= /* loopback(SBus-HSI1) */{ 8, "Loopback: ", CYCLE_ITEM, 'l',
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -