From 002ed645baad470e826bb7206d2d48800c1263f9 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 18 May 2004 12:30:49 +0000 Subject: - add support for mainframe ccwgroup devices (QETH/HSI/CTC/LCS) --- sysconfig/network-scripts/ifup-ctc | 2 ++ sysconfig/network-scripts/network-functions | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'sysconfig/network-scripts') diff --git a/sysconfig/network-scripts/ifup-ctc b/sysconfig/network-scripts/ifup-ctc index 15860fed..b9b38196 100755 --- a/sysconfig/network-scripts/ifup-ctc +++ b/sysconfig/network-scripts/ifup-ctc @@ -23,6 +23,8 @@ then fi [ -n "${MTU}" ] && opts="${opts} mtu ${MTU}" +configure_ccwgroup_device + ifconfig ${DEVICE} ${IPADDR} ${opts} pointopoint ${REMIP} netmask ${NETMASK} # Wait for the device to come up - the chandev'ified ctc driver can take diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index b6817dfb..a7a8c91b 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -185,6 +185,9 @@ is_available () return 1 } echo "$HOTPLUG" > /proc/sys/kernel/hotplug + # if it is a mainframe ccwgroup device, configure it before + # trying to rename it: + configure_ccwgroup_device if [ -n "$HWADDR" ]; then local curdev=`ip -o link | awk -F ':' -vIGNORECASE=1 '/$HWADDR/ { print $2 }'` rename_device "$1" "$HWADDR" "$curdev" @@ -317,3 +320,28 @@ is_wireless_device () LC_ALL=C iwconfig $1 2>&1 | grep -q "no wireless extensions" || return 0 return 1 } + +# Mainframe devices: +configure_ccwgroup_device () +{ + local DIR SYSDIR + # SUBCHANNELS is only set on mainframe ccwgroup devices + [ -z "$SUBCHANNELS" ] && return + if [ "$TYPE" = "QETH" -o "$TYPE" = "HSI" ]; then + DIR="/sys/bus/ccwgroup/drivers/qeth" + elif + [ "$TYPE" = "CTC" -o "$TYPE" = "ESCON" ]; then + DIR="/sys/bus/ccwgroup/drivers/ctc" + elif + [ "$TYPE" = "LCS" ]; then + DIR="/sys/bus/ccwgroup/drivers/lcs" + else + return + fi + SYSDIR="$DIR/${SUBCHANNELS//,*/}" + [ ! -e $DIR/group ] && return + echo "$SUBCHANNELS" > $DIR/group + [ -n "$PORTNAME" -a -e $SYSDIR/portname ] && \ + echo "$PORTNAME" > $SYSDIR/portname + [ -e $SYSDIR/online ] && echo 1 > $SYSDIR/online +} -- cgit v1.2.1