[SCSI] qla2xxx: Correctly set FCF_TAPE_PRESENT flag based on scsi-device.
authorSantosh Vernekar <santosh.vernekar@qlogic.com>
Tue, 25 Aug 2009 18:36:16 +0000 (11:36 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 12 Sep 2009 14:35:20 +0000 (09:35 -0500)
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: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_os.c

index efdfb1eb26baea7ef4d900449a695e22565de3af..21506186179435eca813a772b463526dde10aef9 100644 (file)
@@ -1590,6 +1590,7 @@ typedef struct fc_port {
 #define FCF_FABRIC_DEVICE      BIT_0
 #define FCF_LOGIN_NEEDED       BIT_1
 #define FCF_TAPE_PRESENT       BIT_2
+#define FCF_FCP2_DEVICE                BIT_3
 
 /* No loop ID flag. */
 #define FC_NO_LOOP_ID          0x1000
index 37c99a27874c78b316f579a366fcd3abcb812000..51f81b272776b4115799350a33d2c98318696d87 100644 (file)
@@ -3341,7 +3341,7 @@ qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
                        } else {
                                fcport->port_type = FCT_TARGET;
                                if (mb[1] & BIT_1) {
-                                       fcport->flags |= FCF_TAPE_PRESENT;
+                                       fcport->flags |= FCF_FCP2_DEVICE;
                                }
                        }
 
index c0fec6914b9601417f8dc076185081d470fe2181..27db6246ca3ec195ad6ce33a0845fea890249846 100644 (file)
@@ -1013,7 +1013,7 @@ qla2x00_mbx_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
 
                data[0] = MBS_COMMAND_COMPLETE;
                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;
        }
@@ -1112,7 +1112,7 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req,
                if (iop[0] & BIT_4) {
                        fcport->port_type = FCT_TARGET;
                        if (iop[0] & BIT_8)
-                               fcport->flags |= FCF_TAPE_PRESENT;
+                               fcport->flags |= FCF_FCP2_DEVICE;
                }
                if (iop[0] & BIT_5)
                        fcport->port_type = FCT_INITIATOR;
index 5fd7adbff30b17d31397ac9d039010b28438f5b2..649fd75d37b6a8b04e202569123d3b4bd1e79e82 100644 (file)
@@ -1216,6 +1216,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
        scsi_qla_host_t *vha = shost_priv(sdev->host);
        struct qla_hw_data *ha = vha->hw;
        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;
 
        if (sdev->tagged_supported)
@@ -1224,6 +1225,8 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
                scsi_deactivate_tcq(sdev, req->max_q_depth);
 
        rport->dev_loss_tmo = ha->port_down_retry_count;
+       if (sdev->type == TYPE_TAPE)
+               fcport->flags |= FCF_TAPE_PRESENT;
 
        return 0;
 }