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