1*843d17d4SRob Johnston#!/bin/ksh
2*843d17d4SRob Johnston#
3*843d17d4SRob Johnston# This file and its contents are supplied under the terms of the
4*843d17d4SRob Johnston# Common Development and Distribution License ("CDDL"), version 1.0.
5*843d17d4SRob Johnston# You may only use this file in accordance with the terms of version
6*843d17d4SRob Johnston# 1.0 of the CDDL.
7*843d17d4SRob Johnston#
8*843d17d4SRob Johnston# A full copy of the text of the CDDL should have accompanied this
9*843d17d4SRob Johnston# source.  A copy of the CDDL is also available via the Internet at
10*843d17d4SRob Johnston# http://www.illumos.org/license/CDDL.
11*843d17d4SRob Johnston#
12*843d17d4SRob Johnston
13*843d17d4SRob Johnston#
14*843d17d4SRob Johnston# Copyright (c) 2017, Joyent, Inc.
15*843d17d4SRob Johnston#
16*843d17d4SRob Johnston
17*843d17d4SRob Johnston#
18*843d17d4SRob Johnston# Generate the topology map for an expanderless system with 3 bays. HBAs
19*843d17d4SRob Johnston# are in slots 1, 3, and 5.
20*843d17d4SRob Johnston#
21*843d17d4SRob Johnston
22*843d17d4SRob Johnstonfunction do_node
23*843d17d4SRob Johnston{
24*843d17d4SRob Johnston  cat <<EOF
25*843d17d4SRob Johnston    <node instance='${1}'>
26*843d17d4SRob Johnston      <propgroup name='protocol' version='1' name-stability='Private'
27*843d17d4SRob Johnston        data-stability='Private'>
28*843d17d4SRob Johnston        <propval name='label' type='string' value='${2}' />
29*843d17d4SRob Johnston      </propgroup>
30*843d17d4SRob Johnston      <propgroup name='binding' version='1' name-stability='Private'
31*843d17d4SRob Johnston        data-stability='Private'>
32*843d17d4SRob Johnston        <propval name='driver' type='string' value='mpt_sas' />
33*843d17d4SRob Johnston        <propval name='devctl' type='string' value='${3}' />
34*843d17d4SRob Johnston        <propval name='enclosure' type='uint32' value='${4}' />
35*843d17d4SRob Johnston        <propval name='slot' type='uint32' value='${5}' />
36*843d17d4SRob Johnston      </propgroup>
37*843d17d4SRob Johnston    </node>
38*843d17d4SRob JohnstonEOF
39*843d17d4SRob Johnston}
40*843d17d4SRob Johnston
41*843d17d4SRob Johnston
42*843d17d4SRob Johnstoncat <<EOF
43*843d17d4SRob Johnston<topology name='disk' scheme='hc'>
44*843d17d4SRob Johnston  <range name='bay' min='0' max='23'>
45*843d17d4SRob Johnston    <facility name='fail' type='indicator' provider='fac_prov_mptsas' >
46*843d17d4SRob Johnston      <propgroup name='facility' version='1' name-stability='Private'
47*843d17d4SRob Johnston        data-stability='Private' >
48*843d17d4SRob Johnston        <propval name='type' type='uint32' value='0' />
49*843d17d4SRob Johnston        <propmethod name='mptsas_led_mode' version='0' propname='mode'
50*843d17d4SRob Johnston          proptype='uint32' mutable='1'>
51*843d17d4SRob Johnston        </propmethod>
52*843d17d4SRob Johnston      </propgroup>
53*843d17d4SRob Johnston    </facility>
54*843d17d4SRob Johnston    <facility name='ident' type='indicator' provider='fac_prov_mptsas' >
55*843d17d4SRob Johnston      <propgroup name='facility' version='1' name-stability='Private'
56*843d17d4SRob Johnston        data-stability='Private' >
57*843d17d4SRob Johnston        <propval name='type' type='uint32' value='1' />
58*843d17d4SRob Johnston        <propmethod name='mptsas_led_mode' version='0' propname='mode'
59*843d17d4SRob Johnston          proptype='uint32' mutable='1'>
60*843d17d4SRob Johnston        </propmethod>
61*843d17d4SRob Johnston      </propgroup>
62*843d17d4SRob Johnston    </facility>
63*843d17d4SRob Johnston    <facility name='ok2rm' type='indicator' provider='fac_prov_mptsas' >
64*843d17d4SRob Johnston      <propgroup name='facility' version='1' name-stability='Private'
65*843d17d4SRob Johnston        data-stability='Private' >
66*843d17d4SRob Johnston        <propval name='type' type='uint32' value='2' />
67*843d17d4SRob Johnston        <propmethod name='mptsas_led_mode' version='0' propname='mode'
68*843d17d4SRob Johnston          proptype='uint32' mutable='1'>
69*843d17d4SRob Johnston        </propmethod>
70*843d17d4SRob Johnston      </propgroup>
71*843d17d4SRob Johnston    </facility>
72*843d17d4SRob JohnstonEOF
73*843d17d4SRob Johnston
74*843d17d4SRob Johnstonenclosure=1
75*843d17d4SRob Johnstonbay=0
76*843d17d4SRob Johnstonslot=0
77*843d17d4SRob Johnstondevctl0='/devices/pci@0,0/pci8086,6f04@2/pci15d9,808@0:devctl'
78*843d17d4SRob Johnstonwhile (( slot <= 7 )); do
79*843d17d4SRob Johnston  do_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot
80*843d17d4SRob Johnston  (( bay = bay + 1 ))
81*843d17d4SRob Johnston  (( slot = slot + 1 ))
82*843d17d4SRob Johnstondone
83*843d17d4SRob Johnston
84*843d17d4SRob Johnstonslot=0
85*843d17d4SRob Johnstondevctl0='/devices/pci@0,0/pci8086,6f08@3/pci15d9,808@0:devctl'
86*843d17d4SRob Johnstonwhile (( slot <= 7 )); do
87*843d17d4SRob Johnston  do_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot
88*843d17d4SRob Johnston  (( bay = bay + 1 ))
89*843d17d4SRob Johnston  (( slot = slot + 1 ))
90*843d17d4SRob Johnstondone
91*843d17d4SRob Johnston
92*843d17d4SRob Johnstonslot=0
93*843d17d4SRob Johnstondevctl0='/devices/pci@78,0/pci8086,6f02@1/pci15d9,808@0:devctl'
94*843d17d4SRob Johnstonwhile (( slot <= 7 )); do
95*843d17d4SRob Johnston  do_node $bay "Front Disk $bay" "$devctl0" $enclosure $slot
96*843d17d4SRob Johnston  (( bay = bay + 1 ))
97*843d17d4SRob Johnston  (( slot = slot + 1 ))
98*843d17d4SRob Johnstondone
99*843d17d4SRob Johnston
100*843d17d4SRob Johnstoncat <<EOF
101*843d17d4SRob Johnston    <dependents grouping='children'>
102*843d17d4SRob Johnston      <range name='disk' min='0' max='0'>
103*843d17d4SRob Johnston        <enum-method name='disk' version='1' />
104*843d17d4SRob Johnston      </range>
105*843d17d4SRob Johnston    </dependents>
106*843d17d4SRob Johnston  </range>
107*843d17d4SRob Johnston</topology>
108*843d17d4SRob JohnstonEOF
109