#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
#
ORIGIFS="${IFS}"
USAGE="Usage: ibd_upgrade [-v]"
#
# split device path into path components
#
{
port=
pkey=
IFS=":"
set -- $bname
node_at_addr=$1
IFS="@"
set -- $node_at_addr
node_name=$1
IFS=","
set -- $2
port=$1
pkey=0x$2
service=$3
IFS="${ORIGIFS}"
}
{
echo "$1"
fi
$1
}
{
device=$1
#
# Get the instance number of ibd
# Device name format would be ibd#,
#
IFS="d"
set -- ${device}
IFS="${ORIGIFS}"
if [ "$1" != "ib" ]; then
return
fi
inst=$2
IFS=","
set -- ${enable_rc}
IFS="${ORIGIFS}"
eval "linkmode=\$${inst}"
else
linkmode=0
fi
do_cmd "dladm set-linkprop -p linkmode=ud ${device}"
fi
}
verbose=0
while getopts v c
do
case $c in
v) verbose=1;;
exit 2;;
esac
done
if [ -f ${DRVCONF} ]; then
enable_rc=`egrep "^[ ]*enable_rc[ ]*=" ${DRVCONF} | sed -e "s/[ ]*//g" -e "s/enable_rc=//" -e "s/;$//" 2>/dev/null`
fi
#
# Loop through all ibd devices based on the old model (i.e., one ibd instance
# per partition; consequently device names have non zero pkey)
# and create data links with the same names as in the old model under the
# new model.
#
do
continue
fi
# verify that the hca path exists
if [ $? -ne 0 ]; then
continue
fi
if [ -c "$fn" ]; then
IFS=":"
set -- $fn
IFS="${ORIGIFS}"
if [ $? -ne 0 ]; then
do_cmd "ibd_delete_link $partition_name"
fi
do_cmd "dladm create-part -f -l $2 -P $pkey $partition_name"
if [ "$enable_rc" != "" ]; then
fi
fi
done
exit 0