xref: /titanic_52/usr/src/cmd/format/menu_developer.c (revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 /*
24  * Copyright (c) 1993-2001 by Sun Microsystems, Inc.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * This file contains functions that implement the fdisk menu commands.
31  */
32 #include "global.h"
33 #include <sys/time.h>
34 #include <sys/resource.h>
35 #include <sys/wait.h>
36 #include <signal.h>
37 #include <string.h>
38 #include <sys/fcntl.h>
39 #include <sys/stat.h>
40 
41 #include <sys/dklabel.h>
42 
43 #include "main.h"
44 #include "analyze.h"
45 #include "menu.h"
46 #include "menu_developer.h"
47 #include "param.h"
48 #include "misc.h"
49 #include "label.h"
50 #include "startup.h"
51 #include "partition.h"
52 #include "prompts.h"
53 #include "checkmount.h"
54 #include "io.h"
55 #include "ctlr_scsi.h"
56 #include "auto_sense.h"
57 #include "hardware_structs.h"
58 
59 extern	struct menu_item menu_developer[];
60 
61 
62 int
63 c_developer()
64 {
65 
66 	cur_menu++;
67 	last_menu = cur_menu;
68 
69 	/*
70 	 * Run the menu.
71 	 */
72 	run_menu(menu_developer, "DEVELOPER", "developer", 0);
73 	cur_menu--;
74 	return (0);
75 }
76 
77 int
78 dv_disk()
79 {
80 	struct disk_info *diskp;
81 
82 	diskp = disk_list;
83 	while (diskp != NULL) {
84 
85 		(void) printf("\ndisk_name %s  ", diskp->disk_name);
86 		(void) printf("disk_path %s\n", diskp->disk_path);
87 		(void) printf("ctlr_cname = %s  ",
88 			diskp->disk_ctlr->ctlr_cname);
89 		(void) printf("cltr_dname = %s  ",
90 			diskp->disk_ctlr->ctlr_dname);
91 		(void) printf("ctype_name = %s\n",
92 			diskp->disk_ctlr->ctlr_ctype->ctype_name);
93 		(void) printf("ctype_ctype = %d\n",
94 			diskp->disk_ctlr->ctlr_ctype->ctype_ctype);
95 		(void) printf("devfsname = %s\n", diskp->devfs_name);
96 		diskp = diskp->disk_next;
97 	}
98 	return (0);
99 }
100 
101 int
102 dv_cont()
103 {
104 	struct ctlr_info *contp;
105 
106 	contp = ctlr_list;
107 	while (contp != NULL) {
108 
109 		(void) printf("\nctype_name = %s ",
110 			contp->ctlr_ctype->ctype_name);
111 		(void) printf("cname = %s dname =  %s ",
112 			contp->ctlr_cname, contp->ctlr_dname);
113 		(void) printf("ctype_ctype = %d\n",
114 			contp->ctlr_ctype->ctype_ctype);
115 		contp = contp->ctlr_next;
116 	}
117 	return (0);
118 }
119 
120 int
121 dv_cont_chain()
122 {
123 	struct mctlr_list *ctlrp;
124 
125 	ctlrp = controlp;
126 
127 	if (ctlrp == NULL)
128 		(void) printf("ctlrp is NULL!!\n");
129 
130 	while (ctlrp != NULL) {
131 		(void) printf("ctlrp->ctlr_type->ctype_name = %s\n",
132 			ctlrp->ctlr_type->ctype_name);
133 		ctlrp = ctlrp->next;
134 	}
135 	return (0);
136 }
137 
138 int
139 dv_params()
140 {
141 	(void) printf("ncyl = %d\n", ncyl);
142 	(void) printf("acyl = %d\n", acyl);
143 	(void) printf("pcyl = %d\n", pcyl);
144 	(void) printf("nhead = %d\n", nhead);
145 	(void) printf("nsect = %d\n", nsect);
146 
147 	return (0);
148 }
149