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