diff options
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index a96e5c3b9460..446fb1da25df 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -704,6 +704,23 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost) | |||
704 | } | 704 | } |
705 | } | 705 | } |
706 | 706 | ||
707 | static void zfcp_get_host_port_state(struct Scsi_Host *shost) | ||
708 | { | ||
709 | struct zfcp_adapter *adapter = | ||
710 | (struct zfcp_adapter *)shost->hostdata[0]; | ||
711 | int status = atomic_read(&adapter->status); | ||
712 | |||
713 | if ((status & ZFCP_STATUS_COMMON_RUNNING) && | ||
714 | !(status & ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED)) | ||
715 | fc_host_port_state(shost) = FC_PORTSTATE_ONLINE; | ||
716 | else if (status & ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED) | ||
717 | fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN; | ||
718 | else if (status & ZFCP_STATUS_COMMON_ERP_FAILED) | ||
719 | fc_host_port_state(shost) = FC_PORTSTATE_ERROR; | ||
720 | else | ||
721 | fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN; | ||
722 | } | ||
723 | |||
707 | static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout) | 724 | static void zfcp_set_rport_dev_loss_tmo(struct fc_rport *rport, u32 timeout) |
708 | { | 725 | { |
709 | rport->dev_loss_tmo = timeout; | 726 | rport->dev_loss_tmo = timeout; |
@@ -726,6 +743,8 @@ struct fc_function_template zfcp_transport_functions = { | |||
726 | .get_fc_host_stats = zfcp_get_fc_host_stats, | 743 | .get_fc_host_stats = zfcp_get_fc_host_stats, |
727 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, | 744 | .reset_fc_host_stats = zfcp_reset_fc_host_stats, |
728 | .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, | 745 | .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, |
746 | .get_host_port_state = zfcp_get_host_port_state, | ||
747 | .show_host_port_state = 1, | ||
729 | /* no functions registered for following dynamic attributes but | 748 | /* no functions registered for following dynamic attributes but |
730 | directly set by LLDD */ | 749 | directly set by LLDD */ |
731 | .show_host_port_type = 1, | 750 | .show_host_port_type = 1, |