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 /* 24*3e1bd7a2Ssjelinek * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25*3e1bd7a2Ssjelinek * Use is subject to license terms. 267c478bd9Sstevel@tonic-gate */ 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * This file contains functions that implement the fdisk menu commands. 327c478bd9Sstevel@tonic-gate */ 337c478bd9Sstevel@tonic-gate #include "global.h" 347c478bd9Sstevel@tonic-gate #include <sys/time.h> 357c478bd9Sstevel@tonic-gate #include <sys/resource.h> 367c478bd9Sstevel@tonic-gate #include <sys/wait.h> 377c478bd9Sstevel@tonic-gate #include <signal.h> 387c478bd9Sstevel@tonic-gate #include <string.h> 397c478bd9Sstevel@tonic-gate #include <sys/fcntl.h> 407c478bd9Sstevel@tonic-gate #include <sys/stat.h> 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #include <sys/dklabel.h> 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #include "main.h" 457c478bd9Sstevel@tonic-gate #include "analyze.h" 467c478bd9Sstevel@tonic-gate #include "menu.h" 477c478bd9Sstevel@tonic-gate #include "menu_developer.h" 487c478bd9Sstevel@tonic-gate #include "param.h" 497c478bd9Sstevel@tonic-gate #include "misc.h" 507c478bd9Sstevel@tonic-gate #include "label.h" 517c478bd9Sstevel@tonic-gate #include "startup.h" 527c478bd9Sstevel@tonic-gate #include "partition.h" 537c478bd9Sstevel@tonic-gate #include "prompts.h" 54*3e1bd7a2Ssjelinek #include "checkdev.h" 557c478bd9Sstevel@tonic-gate #include "io.h" 567c478bd9Sstevel@tonic-gate #include "ctlr_scsi.h" 577c478bd9Sstevel@tonic-gate #include "auto_sense.h" 587c478bd9Sstevel@tonic-gate #include "hardware_structs.h" 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate extern struct menu_item menu_developer[]; 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate int 647c478bd9Sstevel@tonic-gate c_developer() 657c478bd9Sstevel@tonic-gate { 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate cur_menu++; 687c478bd9Sstevel@tonic-gate last_menu = cur_menu; 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate /* 717c478bd9Sstevel@tonic-gate * Run the menu. 727c478bd9Sstevel@tonic-gate */ 737c478bd9Sstevel@tonic-gate run_menu(menu_developer, "DEVELOPER", "developer", 0); 747c478bd9Sstevel@tonic-gate cur_menu--; 757c478bd9Sstevel@tonic-gate return (0); 767c478bd9Sstevel@tonic-gate } 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate int 797c478bd9Sstevel@tonic-gate dv_disk() 807c478bd9Sstevel@tonic-gate { 817c478bd9Sstevel@tonic-gate struct disk_info *diskp; 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate diskp = disk_list; 847c478bd9Sstevel@tonic-gate while (diskp != NULL) { 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate (void) printf("\ndisk_name %s ", diskp->disk_name); 877c478bd9Sstevel@tonic-gate (void) printf("disk_path %s\n", diskp->disk_path); 887c478bd9Sstevel@tonic-gate (void) printf("ctlr_cname = %s ", 897c478bd9Sstevel@tonic-gate diskp->disk_ctlr->ctlr_cname); 907c478bd9Sstevel@tonic-gate (void) printf("cltr_dname = %s ", 917c478bd9Sstevel@tonic-gate diskp->disk_ctlr->ctlr_dname); 927c478bd9Sstevel@tonic-gate (void) printf("ctype_name = %s\n", 937c478bd9Sstevel@tonic-gate diskp->disk_ctlr->ctlr_ctype->ctype_name); 947c478bd9Sstevel@tonic-gate (void) printf("ctype_ctype = %d\n", 957c478bd9Sstevel@tonic-gate diskp->disk_ctlr->ctlr_ctype->ctype_ctype); 967c478bd9Sstevel@tonic-gate (void) printf("devfsname = %s\n", diskp->devfs_name); 977c478bd9Sstevel@tonic-gate diskp = diskp->disk_next; 987c478bd9Sstevel@tonic-gate } 997c478bd9Sstevel@tonic-gate return (0); 1007c478bd9Sstevel@tonic-gate } 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate int 1037c478bd9Sstevel@tonic-gate dv_cont() 1047c478bd9Sstevel@tonic-gate { 1057c478bd9Sstevel@tonic-gate struct ctlr_info *contp; 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate contp = ctlr_list; 1087c478bd9Sstevel@tonic-gate while (contp != NULL) { 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate (void) printf("\nctype_name = %s ", 1117c478bd9Sstevel@tonic-gate contp->ctlr_ctype->ctype_name); 1127c478bd9Sstevel@tonic-gate (void) printf("cname = %s dname = %s ", 1137c478bd9Sstevel@tonic-gate contp->ctlr_cname, contp->ctlr_dname); 1147c478bd9Sstevel@tonic-gate (void) printf("ctype_ctype = %d\n", 1157c478bd9Sstevel@tonic-gate contp->ctlr_ctype->ctype_ctype); 1167c478bd9Sstevel@tonic-gate contp = contp->ctlr_next; 1177c478bd9Sstevel@tonic-gate } 1187c478bd9Sstevel@tonic-gate return (0); 1197c478bd9Sstevel@tonic-gate } 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate int 1227c478bd9Sstevel@tonic-gate dv_cont_chain() 1237c478bd9Sstevel@tonic-gate { 1247c478bd9Sstevel@tonic-gate struct mctlr_list *ctlrp; 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate ctlrp = controlp; 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate if (ctlrp == NULL) 1297c478bd9Sstevel@tonic-gate (void) printf("ctlrp is NULL!!\n"); 1307c478bd9Sstevel@tonic-gate 1317c478bd9Sstevel@tonic-gate while (ctlrp != NULL) { 1327c478bd9Sstevel@tonic-gate (void) printf("ctlrp->ctlr_type->ctype_name = %s\n", 1337c478bd9Sstevel@tonic-gate ctlrp->ctlr_type->ctype_name); 1347c478bd9Sstevel@tonic-gate ctlrp = ctlrp->next; 1357c478bd9Sstevel@tonic-gate } 1367c478bd9Sstevel@tonic-gate return (0); 1377c478bd9Sstevel@tonic-gate } 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate int 1407c478bd9Sstevel@tonic-gate dv_params() 1417c478bd9Sstevel@tonic-gate { 1427c478bd9Sstevel@tonic-gate (void) printf("ncyl = %d\n", ncyl); 1437c478bd9Sstevel@tonic-gate (void) printf("acyl = %d\n", acyl); 1447c478bd9Sstevel@tonic-gate (void) printf("pcyl = %d\n", pcyl); 1457c478bd9Sstevel@tonic-gate (void) printf("nhead = %d\n", nhead); 1467c478bd9Sstevel@tonic-gate (void) printf("nsect = %d\n", nsect); 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gate return (0); 1497c478bd9Sstevel@tonic-gate } 150