提交 49e85c23 编写于 作者: S Saurav Kashyap 提交者: James Bottomley

[SCSI] qla2xxx: Correct fc_host port_state display.

[jejb: checkpatch fixes]
Add more fine grain parsing of vha->loop_state to export a more accurate
fc_host port_state.
Signed-off-by: NSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: NChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 63154916
......@@ -1762,12 +1762,31 @@ qla2x00_get_host_port_state(struct Scsi_Host *shost)
scsi_qla_host_t *vha = shost_priv(shost);
struct scsi_qla_host *base_vha = pci_get_drvdata(vha->hw->pdev);
if (!base_vha->flags.online)
if (!base_vha->flags.online) {
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
else if (atomic_read(&base_vha->loop_state) == LOOP_TIMEOUT)
fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
else
return;
}
switch (atomic_read(&base_vha->loop_state)) {
case LOOP_UPDATE:
fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
break;
case LOOP_DOWN:
if (test_bit(LOOP_RESYNC_NEEDED, &base_vha->dpc_flags))
fc_host_port_state(shost) = FC_PORTSTATE_DIAGNOSTICS;
else
fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
break;
case LOOP_DEAD:
fc_host_port_state(shost) = FC_PORTSTATE_LINKDOWN;
break;
case LOOP_READY:
fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
break;
default:
fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
break;
}
}
static int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册