[S390] zfcp: Report microcode level through service level interface
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Thu, 25 Dec 2008 12:38:50 +0000 (13:38 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Dec 2008 12:39:01 +0000 (13:39 +0100)
Register zfcp with the new /proc/service_level interface to report the
FCP microcode level. When the adapter goes offline or a channel path
disappears, zfcp unregisters, since the microcode version might change
and zfcp does not know about it.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_erp.c

index 3d4e3e3f3fc07c873846d75b56d6e338c54475ce..fc4a2895382490a6891636b38a6daf3087b789a8 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include <linux/miscdevice.h>
+#include <linux/seq_file.h>
 #include "zfcp_ext.h"
 
 static char *device;
@@ -436,6 +437,16 @@ static void _zfcp_status_read_scheduler(struct work_struct *work)
                                             stat_work));
 }
 
+static void zfcp_print_sl(struct seq_file *m, struct service_level *sl)
+{
+       struct zfcp_adapter *adapter =
+               container_of(sl, struct zfcp_adapter, service_level);
+
+       seq_printf(m, "zfcp: %s microcode level %x\n",
+                  dev_name(&adapter->ccw_device->dev),
+                  adapter->fsf_lic_version);
+}
+
 /**
  * zfcp_adapter_enqueue - enqueue a new adapter to the list
  * @ccw_device: pointer to the struct cc_device
@@ -500,6 +511,8 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
        INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler);
        INIT_WORK(&adapter->scan_work, _zfcp_scan_ports_later);
 
+       adapter->service_level.seq_print = zfcp_print_sl;
+
        /* mark adapter unusable as long as sysfs registration is not complete */
        atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
 
index 9ce4c75bd190b1a269726da0f761053c5bde100e..e19e46ae4a68a24b5803f2dc8ef9be994b6f99e5 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/qdio.h>
 #include <asm/debug.h>
 #include <asm/ebcdic.h>
+#include <asm/sysinfo.h>
 #include "zfcp_dbf.h"
 #include "zfcp_fsf.h"
 
@@ -515,6 +516,7 @@ struct zfcp_adapter {
        struct fsf_qtcb_bottom_port *stats_reset_data;
        unsigned long           stats_reset;
        struct work_struct      scan_work;
+       struct service_level    service_level;
        atomic_t                qdio_outb_full;    /* queue full incidents */
 };
 
index c557ba34e1aab5b2c5b7d732e9e076620e9dcc94..174d29ce2a69823f5e1164bed1afc2a7ddd8fe6e 100644 (file)
@@ -1281,10 +1281,13 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
                break;
 
        case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
-               if (result != ZFCP_ERP_SUCCEEDED)
+               if (result != ZFCP_ERP_SUCCEEDED) {
+                       unregister_service_level(&adapter->service_level);
                        zfcp_erp_rports_del(adapter);
-               else
+               } else {
+                       register_service_level(&adapter->service_level);
                        schedule_work(&adapter->scan_work);
+               }
                zfcp_adapter_put(adapter);
                break;
        }