summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorDuane Grigsby <duane.grigsby@cavium.com>2017-10-13 09:34:05 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2017-10-16 22:56:21 -0400
commitc0c462c8a061658ce5ae53c423b2a14bb280c2ab (patch)
tree1cb6c093ad79faa9cbd931990d24478fc35d2e31 /drivers/scsi/qla2xxx/qla_mbx.c
parentc955886962a280eb90b6bde87448ee99c467c0b3 (diff)
scsi: qla2xxx: Allow MBC_GET_PORT_DATABASE to query and save the port states
The MBC_GET_PORT_DATABASE command normally checks the port state information. This patch allows it to save that info in the fcport structure and ignore the check if the query flag is set. [mkp: typo] Signed-off-by: Duane Grigsby <duane.grigsby@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 7f71fd378c27..71e56877e1eb 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1822,17 +1822,32 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt)
if (IS_FWI2_CAPABLE(ha)) {
uint64_t zero = 0;
+ u8 current_login_state, last_login_state;
+
pd24 = (struct port_database_24xx *) pd;
/* Check for logged in state. */
- if (pd24->current_login_state != PDS_PRLI_COMPLETE &&
- pd24->last_login_state != PDS_PRLI_COMPLETE) {
- ql_dbg(ql_dbg_mbx, vha, 0x1051,
- "Unable to verify login-state (%x/%x) for "
- "loop_id %x.\n", pd24->current_login_state,
- pd24->last_login_state, fcport->loop_id);
+ if (fcport->fc4f_nvme) {
+ current_login_state = pd24->current_login_state >> 4;
+ last_login_state = pd24->last_login_state >> 4;
+ } else {
+ current_login_state = pd24->current_login_state & 0xf;
+ last_login_state = pd24->last_login_state & 0xf;
+ }
+ fcport->current_login_state = pd24->current_login_state;
+ fcport->last_login_state = pd24->last_login_state;
+
+ /* Check for logged in state. */
+ if (current_login_state != PDS_PRLI_COMPLETE &&
+ last_login_state != PDS_PRLI_COMPLETE) {
+ ql_dbg(ql_dbg_mbx, vha, 0x119a,
+ "Unable to verify login-state (%x/%x) for loop_id %x.\n",
+ current_login_state, last_login_state,
+ fcport->loop_id);
rval = QLA_FUNCTION_FAILED;
- goto gpd_error_out;
+
+ if (!fcport->query)
+ goto gpd_error_out;
}
if (fcport->loop_id == FC_NO_LOOP_ID ||