xref: /titanic_52/usr/src/cmd/format/menu_developer.c (revision ba4e3c84e6b9390bbf7df80b5f1d11dec34cc525)
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 2005 Sun Microsystems, Inc.   All rights reserved.
25  * Use is subject to license terms.
26  */
27 
28 #pragma ident	"%Z%%M%	%I%	%E% SMI"
29 
30 /*
31  * This file contains functions that implement the fdisk menu commands.
32  */
33 #include "global.h"
34 #include <sys/time.h>
35 #include <sys/resource.h>
36 #include <sys/wait.h>
37 #include <signal.h>
38 #include <string.h>
39 #include <sys/fcntl.h>
40 #include <sys/stat.h>
41 
42 #include <sys/dklabel.h>
43 
44 #include "main.h"
45 #include "analyze.h"
46 #include "menu.h"
47 #include "menu_developer.h"
48 #include "param.h"
49 #include "misc.h"
50 #include "label.h"
51 #include "startup.h"
52 #include "partition.h"
53 #include "prompts.h"
54 #include "checkdev.h"
55 #include "io.h"
56 #include "ctlr_scsi.h"
57 #include "auto_sense.h"
58 #include "hardware_structs.h"
59 
60 extern	struct menu_item menu_developer[];
61 
62 
63 int
64 c_developer()
65 {
66 
67 	cur_menu++;
68 	last_menu = cur_menu;
69 
70 	/*
71 	 * Run the menu.
72 	 */
73 	run_menu(menu_developer, "DEVELOPER", "developer", 0);
74 	cur_menu--;
75 	return (0);
76 }
77 
78 int
79 dv_disk()
80 {
81 	struct disk_info *diskp;
82 
83 	diskp = disk_list;
84 	while (diskp != NULL) {
85 
86 		(void) printf("\ndisk_name %s  ", diskp->disk_name);
87 		(void) printf("disk_path %s\n", diskp->disk_path);
88 		(void) printf("ctlr_cname = %s  ",
89 			diskp->disk_ctlr->ctlr_cname);
90 		(void) printf("cltr_dname = %s  ",
91 			diskp->disk_ctlr->ctlr_dname);
92 		(void) printf("ctype_name = %s\n",
93 			diskp->disk_ctlr->ctlr_ctype->ctype_name);
94 		(void) printf("ctype_ctype = %d\n",
95 			diskp->disk_ctlr->ctlr_ctype->ctype_ctype);
96 		(void) printf("devfsname = %s\n", diskp->devfs_name);
97 		diskp = diskp->disk_next;
98 	}
99 	return (0);
100 }
101 
102 int
103 dv_cont()
104 {
105 	struct ctlr_info *contp;
106 
107 	contp = ctlr_list;
108 	while (contp != NULL) {
109 
110 		(void) printf("\nctype_name = %s ",
111 			contp->ctlr_ctype->ctype_name);
112 		(void) printf("cname = %s dname =  %s ",
113 			contp->ctlr_cname, contp->ctlr_dname);
114 		(void) printf("ctype_ctype = %d\n",
115 			contp->ctlr_ctype->ctype_ctype);
116 		contp = contp->ctlr_next;
117 	}
118 	return (0);
119 }
120 
121 int
122 dv_cont_chain()
123 {
124 	struct mctlr_list *ctlrp;
125 
126 	ctlrp = controlp;
127 
128 	if (ctlrp == NULL)
129 		(void) printf("ctlrp is NULL!!\n");
130 
131 	while (ctlrp != NULL) {
132 		(void) printf("ctlrp->ctlr_type->ctype_name = %s\n",
133 			ctlrp->ctlr_type->ctype_name);
134 		ctlrp = ctlrp->next;
135 	}
136 	return (0);
137 }
138 
139 int
140 dv_params()
141 {
142 	(void) printf("ncyl = %d\n", ncyl);
143 	(void) printf("acyl = %d\n", acyl);
144 	(void) printf("pcyl = %d\n", pcyl);
145 	(void) printf("nhead = %d\n", nhead);
146 	(void) printf("nsect = %d\n", nsect);
147 
148 	return (0);
149 }
150