[master&rhel6-branch 2/2] Rebind hybrid lcs/ctc network devices to correct driver if necessary (#596826)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are two network device types 3088/08 and 3088/1f which can be
either lcs or ctc. Therefore, both device drivers lcs and ctcm are
loaded and the one that happens to get loaded first binds such devices.
If the user specified the device to be handled by the other driver,
then rebind the subchannels to the specified driver.

Related: rhbz#557522
Related: rhbz#561814
---
 loader/linuxrc.s390 |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 093e38d..8be39f1 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -1338,6 +1338,32 @@ function handle_subchannels() {
     else
         driver=$NETTYPE
     fi
+    # if necessary,
+    # rebind hybrid devices (3088/08 and 3088/1f) to user specified driver
+    local curdrv
+    curdrv=$(readlink /sys/bus/ccw/devices/$SCH_R_DEVBUSID/driver)
+    curdrv=${curdrv##*/}
+    if [ "$curdrv" = "lcs" -a "$NETTYPE" = "ctc" ]; then
+        sysecho /sys/bus/ccw/drivers/lcs/unbind "$SCH_R_DEVBUSID"
+        sysecho /sys/bus/ccw/drivers/ctcm/bind "$SCH_R_DEVBUSID"
+    fi
+    if [ "$curdrv" = "ctcm" -a "$NETTYPE" = "lcs" ]; then
+        sysecho /sys/bus/ccw/drivers/ctcm/unbind "$SCH_R_DEVBUSID"
+        sysecho /sys/bus/ccw/drivers/lcs/bind "$SCH_R_DEVBUSID"
+    fi
+    local channel2
+    channel2=${SUBCHANNELS##*,}
+    curdrv=$(readlink /sys/bus/ccw/devices/$channel2/driver)
+    curdrv=${curdrv##*/}
+    if [ "$curdrv" = "lcs" -a "$NETTYPE" = "ctc" ]; then
+        sysecho /sys/bus/ccw/drivers/lcs/unbind "$channel2"
+        sysecho /sys/bus/ccw/drivers/ctcm/bind "$channel2"
+    fi
+    if [ "$curdrv" = "ctcm" -a "$NETTYPE" = "lcs" ]; then
+        sysecho /sys/bus/ccw/drivers/ctcm/unbind "$channel2"
+        sysecho /sys/bus/ccw/drivers/lcs/bind "$channel2"
+    fi
+    # create ccwgroup
     if sysecho /sys/bus/ccwgroup/drivers/${driver}/group "$SUBCHANNELS"; then
         udevadm settle
         case "$NETTYPE" in
-- 
1.7.0.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux