17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate /*
243e1bd7a2Ssjelinek  * Copyright 2005 Sun Microsystems, Inc.   All rights reserved.
253e1bd7a2Ssjelinek  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * This file contains functions that implement the fdisk menu commands.
307c478bd9Sstevel@tonic-gate  */
317c478bd9Sstevel@tonic-gate #include "global.h"
327c478bd9Sstevel@tonic-gate #include <sys/time.h>
337c478bd9Sstevel@tonic-gate #include <sys/resource.h>
347c478bd9Sstevel@tonic-gate #include <sys/wait.h>
357c478bd9Sstevel@tonic-gate #include <signal.h>
367c478bd9Sstevel@tonic-gate #include <string.h>
377c478bd9Sstevel@tonic-gate #include <sys/fcntl.h>
387c478bd9Sstevel@tonic-gate #include <sys/stat.h>
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #include <sys/dklabel.h>
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #include "main.h"
437c478bd9Sstevel@tonic-gate #include "analyze.h"
447c478bd9Sstevel@tonic-gate #include "menu.h"
457c478bd9Sstevel@tonic-gate #include "menu_developer.h"
467c478bd9Sstevel@tonic-gate #include "param.h"
477c478bd9Sstevel@tonic-gate #include "misc.h"
487c478bd9Sstevel@tonic-gate #include "label.h"
497c478bd9Sstevel@tonic-gate #include "startup.h"
507c478bd9Sstevel@tonic-gate #include "partition.h"
517c478bd9Sstevel@tonic-gate #include "prompts.h"
523e1bd7a2Ssjelinek #include "checkdev.h"
537c478bd9Sstevel@tonic-gate #include "io.h"
547c478bd9Sstevel@tonic-gate #include "ctlr_scsi.h"
557c478bd9Sstevel@tonic-gate #include "auto_sense.h"
567c478bd9Sstevel@tonic-gate #include "hardware_structs.h"
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate extern	struct menu_item menu_developer[];
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate int
c_developer(void)62*b12aaafbSToomas Soome c_developer(void)
637c478bd9Sstevel@tonic-gate {
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate 	cur_menu++;
667c478bd9Sstevel@tonic-gate 	last_menu = cur_menu;
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate 	/*
697c478bd9Sstevel@tonic-gate 	 * Run the menu.
707c478bd9Sstevel@tonic-gate 	 */
717c478bd9Sstevel@tonic-gate 	run_menu(menu_developer, "DEVELOPER", "developer", 0);
727c478bd9Sstevel@tonic-gate 	cur_menu--;
737c478bd9Sstevel@tonic-gate 	return (0);
747c478bd9Sstevel@tonic-gate }
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate int
dv_disk(void)77*b12aaafbSToomas Soome dv_disk(void)
787c478bd9Sstevel@tonic-gate {
797c478bd9Sstevel@tonic-gate 	struct disk_info *diskp;
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate 	diskp = disk_list;
827c478bd9Sstevel@tonic-gate 	while (diskp != NULL) {
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate 		(void) printf("\ndisk_name %s  ", diskp->disk_name);
857c478bd9Sstevel@tonic-gate 		(void) printf("disk_path %s\n", diskp->disk_path);
867c478bd9Sstevel@tonic-gate 		(void) printf("ctlr_cname = %s  ",
87*b12aaafbSToomas Soome 		    diskp->disk_ctlr->ctlr_cname);
887c478bd9Sstevel@tonic-gate 		(void) printf("cltr_dname = %s  ",
89*b12aaafbSToomas Soome 		    diskp->disk_ctlr->ctlr_dname);
907c478bd9Sstevel@tonic-gate 		(void) printf("ctype_name = %s\n",
91*b12aaafbSToomas Soome 		    diskp->disk_ctlr->ctlr_ctype->ctype_name);
927c478bd9Sstevel@tonic-gate 		(void) printf("ctype_ctype = %d\n",
93*b12aaafbSToomas Soome 		    diskp->disk_ctlr->ctlr_ctype->ctype_ctype);
947c478bd9Sstevel@tonic-gate 		(void) printf("devfsname = %s\n", diskp->devfs_name);
957c478bd9Sstevel@tonic-gate 		diskp = diskp->disk_next;
967c478bd9Sstevel@tonic-gate 	}
977c478bd9Sstevel@tonic-gate 	return (0);
987c478bd9Sstevel@tonic-gate }
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate int
dv_cont(void)101*b12aaafbSToomas Soome dv_cont(void)
1027c478bd9Sstevel@tonic-gate {
1037c478bd9Sstevel@tonic-gate 	struct ctlr_info *contp;
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate 	contp = ctlr_list;
1067c478bd9Sstevel@tonic-gate 	while (contp != NULL) {
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate 		(void) printf("\nctype_name = %s ",
109*b12aaafbSToomas Soome 		    contp->ctlr_ctype->ctype_name);
1107c478bd9Sstevel@tonic-gate 		(void) printf("cname = %s dname =  %s ",
111*b12aaafbSToomas Soome 		    contp->ctlr_cname, contp->ctlr_dname);
1127c478bd9Sstevel@tonic-gate 		(void) printf("ctype_ctype = %d\n",
113*b12aaafbSToomas Soome 		    contp->ctlr_ctype->ctype_ctype);
1147c478bd9Sstevel@tonic-gate 		contp = contp->ctlr_next;
1157c478bd9Sstevel@tonic-gate 	}
1167c478bd9Sstevel@tonic-gate 	return (0);
1177c478bd9Sstevel@tonic-gate }
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate int
dv_cont_chain(void)120*b12aaafbSToomas Soome dv_cont_chain(void)
1217c478bd9Sstevel@tonic-gate {
1227c478bd9Sstevel@tonic-gate 	struct mctlr_list *ctlrp;
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate 	ctlrp = controlp;
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate 	if (ctlrp == NULL)
1277c478bd9Sstevel@tonic-gate 		(void) printf("ctlrp is NULL!!\n");
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate 	while (ctlrp != NULL) {
1307c478bd9Sstevel@tonic-gate 		(void) printf("ctlrp->ctlr_type->ctype_name = %s\n",
131*b12aaafbSToomas Soome 		    ctlrp->ctlr_type->ctype_name);
1327c478bd9Sstevel@tonic-gate 		ctlrp = ctlrp->next;
1337c478bd9Sstevel@tonic-gate 	}
1347c478bd9Sstevel@tonic-gate 	return (0);
1357c478bd9Sstevel@tonic-gate }
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate int
dv_params(void)138*b12aaafbSToomas Soome dv_params(void)
1397c478bd9Sstevel@tonic-gate {
1407c478bd9Sstevel@tonic-gate 	(void) printf("ncyl = %d\n", ncyl);
1417c478bd9Sstevel@tonic-gate 	(void) printf("acyl = %d\n", acyl);
1427c478bd9Sstevel@tonic-gate 	(void) printf("pcyl = %d\n", pcyl);
1437c478bd9Sstevel@tonic-gate 	(void) printf("nhead = %d\n", nhead);
1447c478bd9Sstevel@tonic-gate 	(void) printf("nsect = %d\n", nsect);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate 	return (0);
1477c478bd9Sstevel@tonic-gate }
148