qla2xxx: Add async new target notification
authorQuinn Tran <quinn.tran@cavium.com>
Wed, 15 Mar 2017 16:48:51 +0000 (09:48 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 19 Mar 2017 00:28:37 +0000 (17:28 -0700)
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h

index 532004981dbd0a0e457cc83e407386cecfd67360..563116188c439b677d1822c70d57b596abde457f 100644 (file)
@@ -6005,13 +6005,13 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha)
        tgt->datasegs_per_cmd = QLA_TGT_DATASEGS_PER_CMD_24XX;
        tgt->datasegs_per_cont = QLA_TGT_DATASEGS_PER_CONT_24XX;
 
-       if (base_vha->fc_vport)
-               return 0;
-
        mutex_lock(&qla_tgt_mutex);
        list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist);
        mutex_unlock(&qla_tgt_mutex);
 
+       if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->add_target)
+               ha->tgt.tgt_ops->add_target(base_vha);
+
        return 0;
 }
 
index c35f889b94a6caf733f287290afcb040e4006c57..d64420251194eb5fa634a36699ecf07c69e09edd 100644 (file)
@@ -693,6 +693,7 @@ struct qla_tgt_func_tmpl {
        void (*shutdown_sess)(struct fc_port *);
        int (*get_dif_tags)(struct qla_tgt_cmd *cmd, uint16_t *pfw_prot_opts);
        int (*chk_dif_tags)(uint32_t tag);
+       void (*add_target)(struct scsi_qla_host *);
 };
 
 int qla2x00_wait_for_hba_online(struct scsi_qla_host *);