diff options
author | Eddie Wai <eddie.wai@broadcom.com> | 2011-02-16 16:04:27 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-24 12:38:52 -0500 |
commit | a977d2c9dc463ab080e0aa8ebe563bdc414ee44f (patch) | |
tree | c1139bface46084c980f90ce7b5df75435c98cdd | |
parent | ee15bd2da6a7c671e1b0095a3f128be9366b4db9 (diff) |
[SCSI] bnx2i: Added handling for unsupported iSCSI offload hba
The hba will now be unregistered and freed when iSCSI offload
is not supported by the NIC.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 72a7b2d4a439..6afaa34222af 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -161,6 +161,21 @@ void bnx2i_start(void *handle) | |||
161 | struct bnx2i_hba *hba = handle; | 161 | struct bnx2i_hba *hba = handle; |
162 | int i = HZ; | 162 | int i = HZ; |
163 | 163 | ||
164 | if (!hba->cnic->max_iscsi_conn) { | ||
165 | printk(KERN_ALERT "bnx2i: dev %s does not support " | ||
166 | "iSCSI\n", hba->netdev->name); | ||
167 | |||
168 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { | ||
169 | mutex_lock(&bnx2i_dev_lock); | ||
170 | list_del_init(&hba->link); | ||
171 | adapter_count--; | ||
172 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); | ||
173 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | ||
174 | mutex_unlock(&bnx2i_dev_lock); | ||
175 | bnx2i_free_hba(hba); | ||
176 | } | ||
177 | return; | ||
178 | } | ||
164 | bnx2i_send_fw_iscsi_init_msg(hba); | 179 | bnx2i_send_fw_iscsi_init_msg(hba); |
165 | while (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state) && i--) | 180 | while (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state) && i--) |
166 | msleep(BNX2I_INIT_POLL_TIME); | 181 | msleep(BNX2I_INIT_POLL_TIME); |