Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 160996
b: refs/heads/master
c: fac3cc4
h: refs/heads/master
v: v3
  • Loading branch information
Anil Veerabhadrappa authored and James Bottomley committed Aug 22, 2009
1 parent d750641 commit 0bbb4bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe5d20c818a8c5fe83d9f2223a051fb5bc50d180
refs/heads/master: fac3cc458fc2f8272bcc1ff1903474ff41715723
7 changes: 5 additions & 2 deletions trunk/drivers/scsi/bnx2i/bnx2i_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,17 @@ void bnx2i_stop(void *handle)
*/
void bnx2i_register_device(struct bnx2i_hba *hba)
{
int rc;

if (test_bit(ADAPTER_STATE_GOING_DOWN, &hba->adapter_state) ||
test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) {
return;
}

hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba);
rc = hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba);

set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic);
if (!rc)
set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic);
}


Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/scsi/bnx2i/bnx2i_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,15 +1653,18 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
struct iscsi_endpoint *ep;
int rc = 0;

if (shost)
if (shost) {
/* driver is given scsi host to work with */
hba = iscsi_host_priv(shost);
else
/* Register the device with cnic if not already done so */
bnx2i_register_device(hba);
} else
/*
* check if the given destination can be reached through
* a iscsi capable NetXtreme2 device
*/
hba = bnx2i_check_route(dst_addr);

if (!hba) {
rc = -ENOMEM;
goto check_busy;
Expand Down

0 comments on commit 0bbb4bf

Please sign in to comment.