Package: s390-netdevice
Version: 0.0.38
Severity: important
Tags: d-i patch

Hi,

below is another patch for the s390-netdevice regarding qeth device
configuration.  Some cards require the specification of the relative
port number on the OSA card.   Ths s390-netdevice has template and
state information for this attribute but lacks the actual
implementation.

The attached patch will let the user specify the relative OSA port
number.  The setting can also be preseeded if necessary.


Thanks and kind regards,
  Hendrik
>From 439483cd533d865d96a8c8119b221e9a56f25925 Mon Sep 17 00:00:00 2001
From: Hendrik Brueckner <brueck...@linux.vnet.ibm.com>
Date: Fri, 20 Nov 2015 12:57:36 +0100
Subject: [PATCH 2/4] qeth: ask for the relative OSA port number

Let the user specify the port number because this is required for
particular OSA cards.

Reported-by: Elisabeth Puritscher <elisabeth.puritsc...@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueck...@linux.vnet.ibm.com>
---
 netdevice.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/netdevice.c b/netdevice.c
index 6ddece9..6905c2d 100644
--- a/netdevice.c
+++ b/netdevice.c
@@ -638,6 +638,22 @@ static enum state_wanted write_sysfs (void)
                        syslog (LOG_ERR, "Can't write ccwgroup device attribute 
layer2");
                        return WANT_ERROR;
                }
+
+               /* Set the relative port number.
+                * Valid port numbers are 0 (default) or 1
+                */
+               if (device_current->qeth.port)
+               {
+                       attr = sysfs_get_device_attr (device, "portno");
+                       if (attr)
+                       {
+                               if (sysfs_write_attribute (attr, "1", 1) < 0)
+                               {
+                                       syslog (LOG_ERR, "Could not write 
device attribute portno");
+                                       return WANT_ERROR;
+                               }
+                       }
+               }
        }
 
        attr = sysfs_get_device_attr (device, "online");
@@ -703,6 +719,7 @@ static enum state_wanted write_qeth (void)
 
        if (device_current->qeth.layer2)
                fprintf (config, "QETH_OPTIONS=(layer2)\n");
+       fprintf (config, "QETH_PORTNO=%d", device_current->qeth.port);
 
        fclose (config);
 
@@ -837,8 +854,7 @@ int main (int argc __attribute__ ((unused)), char *argv[] 
__attribute__ ((unused
                                                state = GET_QETH_LAYER2;
                                                break;
                                        case GET_QETH_LAYER2:
-                                               /* state = GET_QETH_PORT; */
-                                               state = CONFIRM_QETH;
+                                               state = GET_QETH_PORT;
                                                break;
                                        case GET_QETH_PORT:
                                                state = CONFIRM_QETH;
-- 
2.7.0.rc3

Reply via email to