7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#!/usr/bin/perl -w
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# CDDL HEADER START
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# The contents of this file are subject to the terms of the
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# Common Development and Distribution License (the "License").
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# You may not use this file except in compliance with the License.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# or http://www.opensolaris.org/os/licensing.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# See the License for the specific language governing permissions
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# and limitations under the License.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# When distributing Covered Code, include this CDDL HEADER in each
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# If applicable, add the following below this CDDL HEADER, with the
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# fields enclosed by brackets "[]" replaced with your own identifying
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# information: Portions Copyright [yyyy] [name of copyright owner]
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# CDDL HEADER END
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# Use is subject to license terms.
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston#
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston$num_bays = 4;
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston$bay_label = "HD";
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnstonprint <<EOF;
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston<topology name='disk' scheme='hc'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <range name='bay' min='0' max='3'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert JohnstonEOF
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston$controller = 0;
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnstonfor ($bay = 0; $bay < $num_bays; $bay++) {
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston $hpath = "/pci\@0,0/pci1022,7458\@11/pci1000,3060\@4";
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston $tpath = sprintf("/sd\@%x,0", $bay);
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston $apoint = sprintf(":scsi::dsk/c%dt%dd0",
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston $controller + 1, $bay);
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston print <<EOF;
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <node instance='$bay'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propgroup name='protocol' version='1' name-stability='Private'
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston data-stability='Private'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propval name='label' type='string' value='$bay_label$bay' />
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </propgroup>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propgroup name='io' version='1' name-stability='Private'
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston data-stability='Private'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propval name='ap-path' type='string' value='/devices$hpath$apoint' />
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </propgroup>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propgroup name='binding' version='1' name-stability='Private'
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston data-stability='Private'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <propval name='occupant-path' type='string'
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston value='$hpath$tpath' />
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </propgroup>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </node>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert JohnstonEOF
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston}
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnstonprint <<EOF;
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <dependents grouping='children'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <range name='disk' min='0' max='0'>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston <enum-method name='disk' version='1' />
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </range>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </dependents>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston </range>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston</topology>
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert JohnstonEOF