10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance
70Sstevel@tonic-gate * with the License.
80Sstevel@tonic-gate *
90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate * See the License for the specific language governing permissions
120Sstevel@tonic-gate * and limitations under the License.
130Sstevel@tonic-gate *
140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate *
200Sstevel@tonic-gate * CDDL HEADER END
210Sstevel@tonic-gate */
220Sstevel@tonic-gate
230Sstevel@tonic-gate /*
24*767Ssjelinek * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25*767Ssjelinek * Use is subject to license terms.
260Sstevel@tonic-gate */
270Sstevel@tonic-gate
280Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
290Sstevel@tonic-gate
300Sstevel@tonic-gate /*
310Sstevel@tonic-gate * This file contains functions that implement the fdisk menu commands.
320Sstevel@tonic-gate */
330Sstevel@tonic-gate #include "global.h"
340Sstevel@tonic-gate #include <sys/time.h>
350Sstevel@tonic-gate #include <sys/resource.h>
360Sstevel@tonic-gate #include <sys/wait.h>
370Sstevel@tonic-gate #include <signal.h>
380Sstevel@tonic-gate #include <string.h>
390Sstevel@tonic-gate #include <sys/fcntl.h>
400Sstevel@tonic-gate #include <sys/stat.h>
410Sstevel@tonic-gate
420Sstevel@tonic-gate #include <sys/dklabel.h>
430Sstevel@tonic-gate
440Sstevel@tonic-gate #include "main.h"
450Sstevel@tonic-gate #include "analyze.h"
460Sstevel@tonic-gate #include "menu.h"
470Sstevel@tonic-gate #include "menu_developer.h"
480Sstevel@tonic-gate #include "param.h"
490Sstevel@tonic-gate #include "misc.h"
500Sstevel@tonic-gate #include "label.h"
510Sstevel@tonic-gate #include "startup.h"
520Sstevel@tonic-gate #include "partition.h"
530Sstevel@tonic-gate #include "prompts.h"
54*767Ssjelinek #include "checkdev.h"
550Sstevel@tonic-gate #include "io.h"
560Sstevel@tonic-gate #include "ctlr_scsi.h"
570Sstevel@tonic-gate #include "auto_sense.h"
580Sstevel@tonic-gate #include "hardware_structs.h"
590Sstevel@tonic-gate
600Sstevel@tonic-gate extern struct menu_item menu_developer[];
610Sstevel@tonic-gate
620Sstevel@tonic-gate
630Sstevel@tonic-gate int
c_developer()640Sstevel@tonic-gate c_developer()
650Sstevel@tonic-gate {
660Sstevel@tonic-gate
670Sstevel@tonic-gate cur_menu++;
680Sstevel@tonic-gate last_menu = cur_menu;
690Sstevel@tonic-gate
700Sstevel@tonic-gate /*
710Sstevel@tonic-gate * Run the menu.
720Sstevel@tonic-gate */
730Sstevel@tonic-gate run_menu(menu_developer, "DEVELOPER", "developer", 0);
740Sstevel@tonic-gate cur_menu--;
750Sstevel@tonic-gate return (0);
760Sstevel@tonic-gate }
770Sstevel@tonic-gate
780Sstevel@tonic-gate int
dv_disk()790Sstevel@tonic-gate dv_disk()
800Sstevel@tonic-gate {
810Sstevel@tonic-gate struct disk_info *diskp;
820Sstevel@tonic-gate
830Sstevel@tonic-gate diskp = disk_list;
840Sstevel@tonic-gate while (diskp != NULL) {
850Sstevel@tonic-gate
860Sstevel@tonic-gate (void) printf("\ndisk_name %s ", diskp->disk_name);
870Sstevel@tonic-gate (void) printf("disk_path %s\n", diskp->disk_path);
880Sstevel@tonic-gate (void) printf("ctlr_cname = %s ",
890Sstevel@tonic-gate diskp->disk_ctlr->ctlr_cname);
900Sstevel@tonic-gate (void) printf("cltr_dname = %s ",
910Sstevel@tonic-gate diskp->disk_ctlr->ctlr_dname);
920Sstevel@tonic-gate (void) printf("ctype_name = %s\n",
930Sstevel@tonic-gate diskp->disk_ctlr->ctlr_ctype->ctype_name);
940Sstevel@tonic-gate (void) printf("ctype_ctype = %d\n",
950Sstevel@tonic-gate diskp->disk_ctlr->ctlr_ctype->ctype_ctype);
960Sstevel@tonic-gate (void) printf("devfsname = %s\n", diskp->devfs_name);
970Sstevel@tonic-gate diskp = diskp->disk_next;
980Sstevel@tonic-gate }
990Sstevel@tonic-gate return (0);
1000Sstevel@tonic-gate }
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate int
dv_cont()1030Sstevel@tonic-gate dv_cont()
1040Sstevel@tonic-gate {
1050Sstevel@tonic-gate struct ctlr_info *contp;
1060Sstevel@tonic-gate
1070Sstevel@tonic-gate contp = ctlr_list;
1080Sstevel@tonic-gate while (contp != NULL) {
1090Sstevel@tonic-gate
1100Sstevel@tonic-gate (void) printf("\nctype_name = %s ",
1110Sstevel@tonic-gate contp->ctlr_ctype->ctype_name);
1120Sstevel@tonic-gate (void) printf("cname = %s dname = %s ",
1130Sstevel@tonic-gate contp->ctlr_cname, contp->ctlr_dname);
1140Sstevel@tonic-gate (void) printf("ctype_ctype = %d\n",
1150Sstevel@tonic-gate contp->ctlr_ctype->ctype_ctype);
1160Sstevel@tonic-gate contp = contp->ctlr_next;
1170Sstevel@tonic-gate }
1180Sstevel@tonic-gate return (0);
1190Sstevel@tonic-gate }
1200Sstevel@tonic-gate
1210Sstevel@tonic-gate int
dv_cont_chain()1220Sstevel@tonic-gate dv_cont_chain()
1230Sstevel@tonic-gate {
1240Sstevel@tonic-gate struct mctlr_list *ctlrp;
1250Sstevel@tonic-gate
1260Sstevel@tonic-gate ctlrp = controlp;
1270Sstevel@tonic-gate
1280Sstevel@tonic-gate if (ctlrp == NULL)
1290Sstevel@tonic-gate (void) printf("ctlrp is NULL!!\n");
1300Sstevel@tonic-gate
1310Sstevel@tonic-gate while (ctlrp != NULL) {
1320Sstevel@tonic-gate (void) printf("ctlrp->ctlr_type->ctype_name = %s\n",
1330Sstevel@tonic-gate ctlrp->ctlr_type->ctype_name);
1340Sstevel@tonic-gate ctlrp = ctlrp->next;
1350Sstevel@tonic-gate }
1360Sstevel@tonic-gate return (0);
1370Sstevel@tonic-gate }
1380Sstevel@tonic-gate
1390Sstevel@tonic-gate int
dv_params()1400Sstevel@tonic-gate dv_params()
1410Sstevel@tonic-gate {
1420Sstevel@tonic-gate (void) printf("ncyl = %d\n", ncyl);
1430Sstevel@tonic-gate (void) printf("acyl = %d\n", acyl);
1440Sstevel@tonic-gate (void) printf("pcyl = %d\n", pcyl);
1450Sstevel@tonic-gate (void) printf("nhead = %d\n", nhead);
1460Sstevel@tonic-gate (void) printf("nsect = %d\n", nsect);
1470Sstevel@tonic-gate
1480Sstevel@tonic-gate return (0);
1490Sstevel@tonic-gate }
150