diff options
author | Michael Chan <mchan@broadcom.com> | 2010-12-23 07:42:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-23 11:44:29 -0800 |
commit | 939b82e5bde56a98c72eccde2e3a88d32bffad4a (patch) | |
tree | e10e7ddaecef208d6fc0b11476a8943912663efc /drivers/scsi | |
parent | 8adc9240f98a816f7e9b3d93b9446a790110e062 (diff) | |
download | linux-939b82e5bde56a98c72eccde2e3a88d32bffad4a.tar.bz2 |
cnic: Improve ->iscsi_nl_msg_send()
1. Change first parameter from cnic_dev to ulp_handle which is the hba
pointer. All other similar upcalls are using hba pointer. The callee
can then directly reference the hba without conversion.
2. Change return value from void to int so that an error code can be
passed back. This allows the operation to be retried.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 8d9dbb33972f..2f9622ebbd84 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -2346,19 +2346,21 @@ static void bnx2i_cm_remote_abort(struct cnic_sock *cm_sk) } -static void bnx2i_send_nl_mesg(struct cnic_dev *dev, u32 msg_type, +static int bnx2i_send_nl_mesg(void *context, u32 msg_type, char *buf, u16 buflen) { - struct bnx2i_hba *hba; + struct bnx2i_hba *hba = context; + int rc; - hba = bnx2i_find_hba_for_cnic(dev); if (!hba) - return; + return -ENODEV; - if (iscsi_offload_mesg(hba->shost, &bnx2i_iscsi_transport, - msg_type, buf, buflen)) + rc = iscsi_offload_mesg(hba->shost, &bnx2i_iscsi_transport, + msg_type, buf, buflen); + if (rc) printk(KERN_ALERT "bnx2i: private nl message send error\n"); + return rc; } |