1*d91236feSeschrock#!/usr/local/bin/perl
2*d91236feSeschrock#
3*d91236feSeschrock# CDDL HEADER START
4*d91236feSeschrock#
5*d91236feSeschrock# The contents of this file are subject to the terms of the
6*d91236feSeschrock# Common Development and Distribution License (the "License").
7*d91236feSeschrock# You may not use this file except in compliance with the License.
8*d91236feSeschrock#
9*d91236feSeschrock# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*d91236feSeschrock# or http://www.opensolaris.org/os/licensing.
11*d91236feSeschrock# See the License for the specific language governing permissions
12*d91236feSeschrock# and limitations under the License.
13*d91236feSeschrock#
14*d91236feSeschrock# When distributing Covered Code, include this CDDL HEADER in each
15*d91236feSeschrock# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*d91236feSeschrock# If applicable, add the following below this CDDL HEADER, with the
17*d91236feSeschrock# fields enclosed by brackets "[]" replaced with your own identifying
18*d91236feSeschrock# information: Portions Copyright [yyyy] [name of copyright owner]
19*d91236feSeschrock#
20*d91236feSeschrock# CDDL HEADER END
21*d91236feSeschrock#
22*d91236feSeschrock#
23*d91236feSeschrock# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*d91236feSeschrock# Use is subject to license terms.
25*d91236feSeschrock#
26*d91236feSeschrock#pragma ident	"%Z%%M%	%I%	%E% SMI"
27*d91236feSeschrock
28*d91236feSeschrock$num_bays = 4;
29*d91236feSeschrock$bay_label = "HD";
30*d91236feSeschrock
31*d91236feSeschrockprint <<EOF;
32*d91236feSeschrock<topology name='disk' scheme='hc'>
33*d91236feSeschrock  <range name='bay' min='0' max='3'>
34*d91236feSeschrockEOF
35*d91236feSeschrock
36*d91236feSeschrock$controller = 0;
37*d91236feSeschrockfor ($bay = 0; $bay < $num_bays; $bay++) {
38*d91236feSeschrock	$hpath = "/pci\@7b,0/pci1022,7458\@11/pci1000,3060\@2";
39*d91236feSeschrock	$tpath = sprintf("/sd\@%x,0", $bay);
40*d91236feSeschrock	$apoint = sprintf(":scsi::dsk/c%dt%dd0",
41*d91236feSeschrock	    $controller + 1, $bay);
42*d91236feSeschrock
43*d91236feSeschrock	print <<EOF;
44*d91236feSeschrock    <node instance='$bay'>
45*d91236feSeschrock      <propgroup name='protocol' version='1' name-stability='Private'
46*d91236feSeschrock        data-stability='Private'>
47*d91236feSeschrock	<propval name='label' type='string' value='$bay_label$bay' />
48*d91236feSeschrock      </propgroup>
49*d91236feSeschrock      <propgroup name='io' version='1' name-stability='Private'
50*d91236feSeschrock        data-stability='Private'>
51*d91236feSeschrock	<propval name='ap-path' type='string' value='/devices$hpath$apoint' />
52*d91236feSeschrock      </propgroup>
53*d91236feSeschrock      <propgroup name='binding' version='1' name-stability='Private'
54*d91236feSeschrock        data-stability='Private'>
55*d91236feSeschrock	<propval name='occupant-path' type='string'
56*d91236feSeschrock	  value='$hpath$tpath' />
57*d91236feSeschrock      </propgroup>
58*d91236feSeschrock    </node>
59*d91236feSeschrockEOF
60*d91236feSeschrock}
61*d91236feSeschrock
62*d91236feSeschrockprint <<EOF;
63*d91236feSeschrock    <dependents grouping='children'>
64*d91236feSeschrock      <range name='disk' min='0' max='0'>
65*d91236feSeschrock	<enum-method name='disk' version='1' />
66*d91236feSeschrock      </range>
67*d91236feSeschrock    </dependents>
68*d91236feSeschrock  </range>
69*d91236feSeschrock</topology>
70*d91236feSeschrockEOF
71