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