File powerpc-utils.bug-1041531_lsdevinfo-Add-support-for-vNIC-devices.patch of Package powerpc-utils

From 74715cc0e4db0e2738be7a19c852816c285d8284 Mon Sep 17 00:00:00 2001
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Date: Mon, 22 May 2017 16:40:58 -0400
Subject: [PATCH] lsdevinfo: Add support for vNIC devices

Add support to dump information about vNIC devices so that device info
requests from the HMC can retrieve data about vNIC devices.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
[tyreld: fixed up trailing whitespace]
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
 scripts/lsdevinfo | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/scripts/lsdevinfo b/scripts/lsdevinfo
index 2bba357..694ddf3 100755
--- a/scripts/lsdevinfo
+++ b/scripts/lsdevinfo
@@ -222,6 +222,27 @@ show_eth ()
     fi
 }
 
+# Look at every vNIC device
+for dev in $($LS -d /proc/device-tree/vdevice/vnic* 2> /dev/null); do
+    # use ofpathname to get the device name (i.e. eth0)
+    name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//"))
+    connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/l-lan@//")
+    parent="vio"
+
+    # get the physical location
+    physloc=$(tr -d '\0' < $dev/ibm,loc-code)
+    uniquetype="adapter/vdevice/IBM,vnic"
+    class="adapter"
+    subclass="vdevice"
+    type="IBM,vnic"
+    prefix="eth"
+    driver="ibmvnic"
+    status=1
+
+    show=1
+    show_eth
+done
+
 # Look at every ibmveth (Virtual Ethernet) device 
 for dev in $($LS -d /proc/device-tree/vdevice/l-lan* 2> /dev/null); do 
     # use ofpathname to get the device name (i.e. eth0)
-- 
2.10.2

openSUSE Build Service is sponsored by