]> err.no Git - linux-2.6/blobdiff - drivers/scsi/qla4xxx/ql4_init.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[linux-2.6] / drivers / scsi / qla4xxx / ql4_init.c
index d8c064c2afc3616778ee8c7ad07bf94ad50c794a..10b3b9a620f357f0bcf91a39546a9b594451f149 100644 (file)
@@ -5,6 +5,7 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
+#include <scsi/iscsi_if.h>
 #include "ql4_def.h"
 #include "ql4_glbl.h"
 #include "ql4_dbg.h"
@@ -883,11 +884,12 @@ static int qla4xxx_config_nvram(struct scsi_qla_host *ha)
 static void qla4x00_pci_config(struct scsi_qla_host *ha)
 {
        uint16_t w;
+       int status;
 
        dev_info(&ha->pdev->dev, "Configuring PCI space...\n");
 
        pci_set_master(ha->pdev);
-       pci_set_mwi(ha->pdev);
+       status = pci_set_mwi(ha->pdev);
        /*
         * We want to respect framework's setting of PCI configuration space
         * command register and also want to make sure that all bits of
@@ -1005,7 +1007,7 @@ int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a)
  * qla4xxx_start_firmware - starts qla4xxx firmware
  * @ha: Pointer to host adapter structure.
  *
- * This routine performs the neccessary steps to start the firmware for
+ * This routine performs the necessary steps to start the firmware for
  * the QLA4010 adapter.
  **/
 static int qla4xxx_start_firmware(struct scsi_qla_host *ha)
@@ -1096,7 +1098,7 @@ static int qla4xxx_start_firmware(struct scsi_qla_host *ha)
                }
                config_chip = 1;
 
-               /* Reset clears the semaphore, so aquire again */
+               /* Reset clears the semaphore, so acquire again */
                if (ql4xxx_lock_drvr_wait(ha) != QLA_SUCCESS)
                        return QLA_ERROR;
        }
@@ -1143,32 +1145,30 @@ int qla4xxx_initialize_adapter(struct scsi_qla_host *ha,
 
        /* Initialize the Host adapter request/response queues and firmware */
        if (qla4xxx_start_firmware(ha) == QLA_ERROR)
-               return status;
+               goto exit_init_hba;
 
        if (qla4xxx_validate_mac_address(ha) == QLA_ERROR)
-               return status;
+               goto exit_init_hba;
 
        if (qla4xxx_init_local_data(ha) == QLA_ERROR)
-               return status;
+               goto exit_init_hba;
 
        status = qla4xxx_init_firmware(ha);
        if (status == QLA_ERROR)
-               return status;
+               goto exit_init_hba;
 
        /*
         * FW is waiting to get an IP address from DHCP server: Skip building
         * the ddb_list and wait for DHCP lease acquired aen to come in
         * followed by 0x8014 aen" to trigger the tgt discovery process.
         */
-       if (ha->firmware_state & FW_STATE_DHCP_IN_PROGRESS){
-               set_bit(AF_ONLINE, &ha->flags);
-               return status;
-       }
+       if (ha->firmware_state & FW_STATE_DHCP_IN_PROGRESS)
+               goto exit_init_online;
 
        /* Skip device discovery if ip and subnet is zero */
        if (memcmp(ha->ip_address, ip_address, IP_ADDR_LEN) == 0 ||
            memcmp(ha->subnet_mask, ip_address, IP_ADDR_LEN) == 0)
-               return status;
+               goto exit_init_online;
 
        if (renew_ddb_list == PRESERVE_DDB_LIST) {
                /*
@@ -1197,10 +1197,10 @@ int qla4xxx_initialize_adapter(struct scsi_qla_host *ha,
                              ha->host_no));
        }
 
+exit_init_online:
        set_bit(AF_ONLINE, &ha->flags);
- exit_init_hba:
+exit_init_hba:
        return status;
-
 }
 
 /**
@@ -1306,7 +1306,9 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha,
                atomic_set(&ddb_entry->relogin_timer, 0);
                clear_bit(DF_RELOGIN, &ddb_entry->flags);
                clear_bit(DF_NO_RELOGIN, &ddb_entry->flags);
-               iscsi_if_create_session_done(ddb_entry->conn);
+               iscsi_unblock_session(ddb_entry->sess);
+               iscsi_session_event(ddb_entry->sess,
+                                   ISCSI_KEVENT_CREATE_SESSION);
                /*
                 * Change the lun state to READY in case the lun TIMEOUT before
                 * the device came back.