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>
This commit is contained in:
parent
c955886962
commit
c0c462c8a0
|
@ -2303,6 +2303,7 @@ typedef struct fc_port {
|
||||||
unsigned int send_els_logo:1;
|
unsigned int send_els_logo:1;
|
||||||
unsigned int login_pause:1;
|
unsigned int login_pause:1;
|
||||||
unsigned int login_succ:1;
|
unsigned int login_succ:1;
|
||||||
|
unsigned int query:1;
|
||||||
|
|
||||||
struct work_struct nvme_del_work;
|
struct work_struct nvme_del_work;
|
||||||
struct completion nvme_del_done;
|
struct completion nvme_del_done;
|
||||||
|
@ -2369,6 +2370,8 @@ typedef struct fc_port {
|
||||||
struct list_head gnl_entry;
|
struct list_head gnl_entry;
|
||||||
struct work_struct del_work;
|
struct work_struct del_work;
|
||||||
u8 iocb[IOCB_SIZE];
|
u8 iocb[IOCB_SIZE];
|
||||||
|
u8 current_login_state;
|
||||||
|
u8 last_login_state;
|
||||||
} fc_port_t;
|
} fc_port_t;
|
||||||
|
|
||||||
#define QLA_FCPORT_SCAN 1
|
#define QLA_FCPORT_SCAN 1
|
||||||
|
@ -4114,6 +4117,7 @@ typedef struct scsi_qla_host {
|
||||||
#define QPAIR_ONLINE_CHECK_NEEDED 27
|
#define QPAIR_ONLINE_CHECK_NEEDED 27
|
||||||
#define SET_ZIO_THRESHOLD_NEEDED 28
|
#define SET_ZIO_THRESHOLD_NEEDED 28
|
||||||
#define DETECT_SFP_CHANGE 29
|
#define DETECT_SFP_CHANGE 29
|
||||||
|
#define N2N_LOGIN_NEEDED 30
|
||||||
|
|
||||||
unsigned long pci_flags;
|
unsigned long pci_flags;
|
||||||
#define PFLG_DISCONNECTED 0 /* PCI device removed */
|
#define PFLG_DISCONNECTED 0 /* PCI device removed */
|
||||||
|
|
|
@ -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)) {
|
if (IS_FWI2_CAPABLE(ha)) {
|
||||||
uint64_t zero = 0;
|
uint64_t zero = 0;
|
||||||
|
u8 current_login_state, last_login_state;
|
||||||
|
|
||||||
pd24 = (struct port_database_24xx *) pd;
|
pd24 = (struct port_database_24xx *) pd;
|
||||||
|
|
||||||
/* Check for logged in state. */
|
/* Check for logged in state. */
|
||||||
if (pd24->current_login_state != PDS_PRLI_COMPLETE &&
|
if (fcport->fc4f_nvme) {
|
||||||
pd24->last_login_state != PDS_PRLI_COMPLETE) {
|
current_login_state = pd24->current_login_state >> 4;
|
||||||
ql_dbg(ql_dbg_mbx, vha, 0x1051,
|
last_login_state = pd24->last_login_state >> 4;
|
||||||
"Unable to verify login-state (%x/%x) for "
|
} else {
|
||||||
"loop_id %x.\n", pd24->current_login_state,
|
current_login_state = pd24->current_login_state & 0xf;
|
||||||
pd24->last_login_state, fcport->loop_id);
|
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;
|
rval = QLA_FUNCTION_FAILED;
|
||||||
goto gpd_error_out;
|
|
||||||
|
if (!fcport->query)
|
||||||
|
goto gpd_error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fcport->loop_id == FC_NO_LOOP_ID ||
|
if (fcport->loop_id == FC_NO_LOOP_ID ||
|
||||||
|
|
Loading…
Reference in New Issue