/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This file contains the declarations of menus for the program. To add
* the function that executes it.
*/
#include <sys/isa_defs.h>
#include "global.h"
#include "menu.h"
#include "menu_partition.h"
#include "menu_command.h"
#include "menu_analyze.h"
#include "menu_defect.h"
#include "add_definition.h"
#include "menu_scsi.h"
#include "menu_developer.h"
#include "menu_cache.h"
#include "menu_fdisk.h"
/*
* This declaration is for the command menu. It is the menu first
* encountered upon entering the program.
*/
{ "disk - select a disk",
c_disk, true },
{ "type - select (define) a disk type",
c_type, true },
{ "partition - select (define) a partition table",
c_partition, true },
{ "current - describe the current disk",
c_current, true },
{ "format - format and analyze the disk",
c_format, true },
{ "fdisk - run the fdisk program",
{ "repair - repair a defective sector",
c_repair, true },
{ "show - translate a disk address",
{ "label - write label to the disk",
c_label, true },
{ "analyze - surface analysis",
c_analyze, true },
{ "defect - defect list management",
c_defect, true },
{ "backup - search for backup labels",
c_backup, true },
{ "verify - read and display labels",
c_verify, true },
{ "inquiry - show vendor, product and revision",
{ "scsi - independent SCSI mode selects",
c_scsi, scsi_expert },
{ "cache - enable, disable or query SCSI disk cache",
c_cache, scsi_expert },
{ "volname - set 8-character volume name",
c_volname, true },
{ "developer - dump developer things",
c_developer, developer },
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the partition menu. It is used to create
* and maintain partition tables.
*/
{ "0 - change `0' partition",
p_apart, true },
{ "1 - change `1' partition",
p_bpart, true },
{ "2 - change `2' partition",
p_cpart, true },
{ "3 - change `3' partition",
p_dpart, true },
{ "4 - change `4' partition",
p_epart, true },
{ "5 - change `5' partition",
p_fpart, true },
{ "6 - change `6' partition",
p_gpart, true },
{ "7 - change `7' partition",
{ "8 - change '8' partition",
#if defined(i386)
{ "9 - change `9' partition",
#endif
{ "expand - expand label to use whole disk",
{ "select - select a predefined table",
p_select, true },
{ "modify - modify a predefined partition table",
p_modify, true },
{ "name - name the current table",
p_name, true },
{ "print - display the current table",
p_print, true },
{ "label - write partition map and label to the disk",
c_label, true },
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the analysis menu. It is used to set up
* and execute surface analysis of a disk.
*/
{ "read - read only test (doesn't harm SunOS)",
a_read, true },
{ "refresh - read then write (doesn't harm data)",
a_refresh, true },
{ "test - pattern testing (doesn't harm data)",
a_test, true },
{ "write - write then read (corrupts data)",
a_write, true },
{ "compare - write, read, compare (corrupts data)",
a_compare, true },
{ "purge - write, read, write (corrupts data)",
a_purge, true },
{ "verify - write entire disk, then verify (corrupts data)",
a_verify, true },
{ "print - display data buffer",
a_print, true },
{ "setup - set analysis parameters",
a_setup, true },
{ "config - show analysis parameters",
a_config, true },
{ "!<cmd> - execute <cmd> , then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the defect menu. It is used to manipulate
* the defect list for a disk.
*/
{ "restore - set working list = current list",
{ "original - extract manufacturer's list from disk",
{ "extract - extract working list from disk",
{ "primary - extract manufacturer's defect list",
{ "grown - extract the grown defects list",
d_grown, embedded_scsi },
{ "both - extract both primary and grown defects lists",
d_both, embedded_scsi },
{ "add - add defects to working list",
{ "delete - delete a defect from working list",
{ "print - display defect list",
d_print, embedded_scsi },
{ "dump - dump defect list to file",
d_dump, embedded_scsi },
{ "print - display working list",
{ "dump - dump working list to file",
{ "load - load working list from file",
{ "commit - set current list = working list",
{ "create - recreates maufacturer's defect list on disk",
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the developer menu.
*/
{ "dump_disk - dump disk entries",
dv_disk, true },
{ "dump_cont - dump controller entries",
dv_cont, true },
{ "dump_c_chain - dump controller chain entries",
dv_cont_chain, true },
{ "dev_params - dump device parameters",
dv_params, true },
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the cache menu.
*/
{ "write_cache - display or modify write cache settings",
{ "read_cache - display or modify read cache settings",
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the write_cache menu.
*/
{ "display - display current setting of write cache",
{ "enable - enable write cache",
{ "disable - disable write cache",
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};
/*
* This declaration is for the read_cache menu.
*/
{ "display - display current setting of read cache",
{ "enable - enable read cache",
{ "disable - disable read cache",
{ "!<cmd> - execute <cmd>, then return",
execute_shell, true},
{ NULL }
};