]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/qla4xxx/ql4_os.c
Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / scsi / qla4xxx / ql4_os.c
index 31e605caf0f1ec70693950ef07f6d399ecb960fa..5822dd595826ddd8651078e8232a4461b5dda618 100644 (file)
@@ -113,9 +113,6 @@ static struct iscsi_transport qla4xxx_iscsi_transport = {
        .host_param_mask        = ISCSI_HOST_HWADDRESS |
                                  ISCSI_HOST_IPADDRESS |
                                  ISCSI_HOST_INITIATOR_NAME,
-       .sessiondata_size       = sizeof(struct ddb_entry),
-       .host_template          = &qla4xxx_driver_template,
-
        .tgt_dscvr              = qla4xxx_tgt_dscvr,
        .get_conn_param         = qla4xxx_conn_get_param,
        .get_session_param      = qla4xxx_sess_get_param,
@@ -275,7 +272,7 @@ int qla4xxx_add_sess(struct ddb_entry *ddb_entry)
                return err;
        }
 
-       ddb_entry->conn = iscsi_create_conn(ddb_entry->sess, 0);
+       ddb_entry->conn = iscsi_create_conn(ddb_entry->sess, 0, 0);
        if (!ddb_entry->conn) {
                iscsi_remove_session(ddb_entry->sess);
                DEBUG2(printk(KERN_ERR "Could not add connection.\n"));
@@ -292,7 +289,8 @@ struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha)
        struct ddb_entry *ddb_entry;
        struct iscsi_cls_session *sess;
 
-       sess = iscsi_alloc_session(ha->host, &qla4xxx_iscsi_transport);
+       sess = iscsi_alloc_session(ha->host, &qla4xxx_iscsi_transport,
+                                  sizeof(struct ddb_entry));
        if (!sess)
                return NULL;
 
@@ -1552,9 +1550,6 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
                goto eh_dev_reset_done;
        }
 
-       /* Send marker. */
-       ha->marker_needed = 1;
-
        if (qla4xxx_eh_wait_for_commands(ha, scsi_target(cmd->device),
                                         cmd->device)) {
                dev_info(&ha->pdev->dev,
@@ -1563,6 +1558,11 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)
                goto eh_dev_reset_done;
        }
 
+       /* Send marker. */
+       if (qla4xxx_send_marker_iocb(ha, ddb_entry, cmd->device->lun,
+               MM_LUN_RESET) != QLA_SUCCESS)
+               goto eh_dev_reset_done;
+
        dev_info(&ha->pdev->dev,
                   "scsi(%ld:%d:%d:%d): DEVICE RESET SUCCEEDED.\n",
                   ha->host_no, cmd->device->channel, cmd->device->id,
@@ -1606,9 +1606,6 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)
                return FAILED;
        }
 
-       /* Send marker. */
-       ha->marker_needed = 1;
-
        if (qla4xxx_eh_wait_for_commands(ha, scsi_target(cmd->device),
                                         NULL)) {
                starget_printk(KERN_INFO, scsi_target(cmd->device),
@@ -1617,6 +1614,15 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)
                return FAILED;
        }
 
+       /* Send marker. */
+       if (qla4xxx_send_marker_iocb(ha, ddb_entry, cmd->device->lun,
+               MM_TGT_WARM_RESET) != QLA_SUCCESS) {
+               starget_printk(KERN_INFO, scsi_target(cmd->device),
+                              "WARM TARGET DEVICE RESET FAILED - "
+                              "marker iocb failed.\n");
+               return FAILED;
+       }
+
        starget_printk(KERN_INFO, scsi_target(cmd->device),
                       "WARM TARGET RESET SUCCEEDED.\n");
        return SUCCESS;