diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-12-25 07:38:50 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-12-25 07:39:01 -0500 |
commit | bd43a42b7e9880f426ed715f18bb4f963b7352af (patch) | |
tree | 1c58540f9df8d6b45f932b77830bf21eb47dabf9 | |
parent | 6bcac508fbebdca52f5a55d69a4316997ecb5391 (diff) |
[S390] zfcp: Report microcode level through service level interface
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>
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 13 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 7 |
3 files changed, 20 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 3d4e3e3f3fc0..fc4a28953824 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/miscdevice.h> | 28 | #include <linux/miscdevice.h> |
29 | #include <linux/seq_file.h> | ||
29 | #include "zfcp_ext.h" | 30 | #include "zfcp_ext.h" |
30 | 31 | ||
31 | static char *device; | 32 | static char *device; |
@@ -436,6 +437,16 @@ static void _zfcp_status_read_scheduler(struct work_struct *work) | |||
436 | stat_work)); | 437 | stat_work)); |
437 | } | 438 | } |
438 | 439 | ||
440 | static void zfcp_print_sl(struct seq_file *m, struct service_level *sl) | ||
441 | { | ||
442 | struct zfcp_adapter *adapter = | ||
443 | container_of(sl, struct zfcp_adapter, service_level); | ||
444 | |||
445 | seq_printf(m, "zfcp: %s microcode level %x\n", | ||
446 | dev_name(&adapter->ccw_device->dev), | ||
447 | adapter->fsf_lic_version); | ||
448 | } | ||
449 | |||
439 | /** | 450 | /** |
440 | * zfcp_adapter_enqueue - enqueue a new adapter to the list | 451 | * zfcp_adapter_enqueue - enqueue a new adapter to the list |
441 | * @ccw_device: pointer to the struct cc_device | 452 | * @ccw_device: pointer to the struct cc_device |
@@ -500,6 +511,8 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
500 | INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler); | 511 | INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler); |
501 | INIT_WORK(&adapter->scan_work, _zfcp_scan_ports_later); | 512 | INIT_WORK(&adapter->scan_work, _zfcp_scan_ports_later); |
502 | 513 | ||
514 | adapter->service_level.seq_print = zfcp_print_sl; | ||
515 | |||
503 | /* mark adapter unusable as long as sysfs registration is not complete */ | 516 | /* mark adapter unusable as long as sysfs registration is not complete */ |
504 | atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); | 517 | atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); |
505 | 518 | ||
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 9ce4c75bd190..e19e46ae4a68 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/qdio.h> | 33 | #include <asm/qdio.h> |
34 | #include <asm/debug.h> | 34 | #include <asm/debug.h> |
35 | #include <asm/ebcdic.h> | 35 | #include <asm/ebcdic.h> |
36 | #include <asm/sysinfo.h> | ||
36 | #include "zfcp_dbf.h" | 37 | #include "zfcp_dbf.h" |
37 | #include "zfcp_fsf.h" | 38 | #include "zfcp_fsf.h" |
38 | 39 | ||
@@ -515,6 +516,7 @@ struct zfcp_adapter { | |||
515 | struct fsf_qtcb_bottom_port *stats_reset_data; | 516 | struct fsf_qtcb_bottom_port *stats_reset_data; |
516 | unsigned long stats_reset; | 517 | unsigned long stats_reset; |
517 | struct work_struct scan_work; | 518 | struct work_struct scan_work; |
519 | struct service_level service_level; | ||
518 | atomic_t qdio_outb_full; /* queue full incidents */ | 520 | atomic_t qdio_outb_full; /* queue full incidents */ |
519 | }; | 521 | }; |
520 | 522 | ||
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index c557ba34e1aa..174d29ce2a69 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -1281,10 +1281,13 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1281 | break; | 1281 | break; |
1282 | 1282 | ||
1283 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 1283 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
1284 | if (result != ZFCP_ERP_SUCCEEDED) | 1284 | if (result != ZFCP_ERP_SUCCEEDED) { |
1285 | unregister_service_level(&adapter->service_level); | ||
1285 | zfcp_erp_rports_del(adapter); | 1286 | zfcp_erp_rports_del(adapter); |
1286 | else | 1287 | } else { |
1288 | register_service_level(&adapter->service_level); | ||
1287 | schedule_work(&adapter->scan_work); | 1289 | schedule_work(&adapter->scan_work); |
1290 | } | ||
1288 | zfcp_adapter_put(adapter); | 1291 | zfcp_adapter_put(adapter); |
1289 | break; | 1292 | break; |
1290 | } | 1293 | } |