Commit 8474f3a0 authored by Santosh Vernekar's avatar Santosh Vernekar Committed by James Bottomley

[SCSI] qla2xxx: Correctly set FCF_TAPE_PRESENT flag based on scsi-device.

In fabric-login based on iop BIT_8 firmware notifies presence of
a FCP2 device and not necessarily a TAPE device.  So instead of
setting FCF_TAPE_PRESENT flag there we set it using
scsi_device->type after mid-layer scan recognises "type" of the
device.

It also adds a new flag FCF_FCP2_DEVICE for any future use.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent e7a51997
...@@ -1590,6 +1590,7 @@ typedef struct fc_port { ...@@ -1590,6 +1590,7 @@ typedef struct fc_port {
#define FCF_FABRIC_DEVICE BIT_0 #define FCF_FABRIC_DEVICE BIT_0
#define FCF_LOGIN_NEEDED BIT_1 #define FCF_LOGIN_NEEDED BIT_1
#define FCF_TAPE_PRESENT BIT_2 #define FCF_TAPE_PRESENT BIT_2
#define FCF_FCP2_DEVICE BIT_3
/* No loop ID flag. */ /* No loop ID flag. */
#define FC_NO_LOOP_ID 0x1000 #define FC_NO_LOOP_ID 0x1000
......
...@@ -3341,7 +3341,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport, ...@@ -3341,7 +3341,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
} else { } else {
fcport->port_type = FCT_TARGET; fcport->port_type = FCT_TARGET;
if (mb[1] & BIT_1) { if (mb[1] & BIT_1) {
fcport->flags |= FCF_TAPE_PRESENT; fcport->flags |= FCF_FCP2_DEVICE;
} }
} }
......
...@@ -1013,7 +1013,7 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1013,7 +1013,7 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
data[0] = MBS_COMMAND_COMPLETE; data[0] = MBS_COMMAND_COMPLETE;
if (lio->ctx.type == SRB_LOGIN_CMD && le16_to_cpu(mbx->mb1) & BIT_1) if (lio->ctx.type == SRB_LOGIN_CMD && le16_to_cpu(mbx->mb1) & BIT_1)
fcport->flags |= FCF_TAPE_PRESENT; fcport->flags |= FCF_FCP2_DEVICE;
goto done_post_logio_done_work; goto done_post_logio_done_work;
} }
...@@ -1112,7 +1112,7 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1112,7 +1112,7 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
if (iop[0] & BIT_4) { if (iop[0] & BIT_4) {
fcport->port_type = FCT_TARGET; fcport->port_type = FCT_TARGET;
if (iop[0] & BIT_8) if (iop[0] & BIT_8)
fcport->flags |= FCF_TAPE_PRESENT; fcport->flags |= FCF_FCP2_DEVICE;
} }
if (iop[0] & BIT_5) if (iop[0] & BIT_5)
fcport->port_type = FCT_INITIATOR; fcport->port_type = FCT_INITIATOR;
......
...@@ -1216,6 +1216,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev) ...@@ -1216,6 +1216,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
scsi_qla_host_t *vha = shost_priv(sdev->host); scsi_qla_host_t *vha = shost_priv(sdev->host);
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct fc_rport *rport = starget_to_rport(sdev->sdev_target); struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
struct req_que *req = vha->req; struct req_que *req = vha->req;
if (sdev->tagged_supported) if (sdev->tagged_supported)
...@@ -1224,6 +1225,8 @@ qla2xxx_slave_configure(struct scsi_device *sdev) ...@@ -1224,6 +1225,8 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
scsi_deactivate_tcq(sdev, req->max_q_depth); scsi_deactivate_tcq(sdev, req->max_q_depth);
rport->dev_loss_tmo = ha->port_down_retry_count; rport->dev_loss_tmo = ha->port_down_retry_count;
if (sdev->type == TYPE_TAPE)
fcport->flags |= FCF_TAPE_PRESENT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment