aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/cxgb3i/cxgb3i_iscsi.c')
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_iscsi.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
index 2631bddd255e..7b686abaae64 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/inet.h> 14#include <linux/inet.h>
15#include <linux/slab.h>
15#include <linux/crypto.h> 16#include <linux/crypto.h>
16#include <linux/if_vlan.h> 17#include <linux/if_vlan.h>
17#include <net/dst.h> 18#include <net/dst.h>
@@ -591,8 +592,7 @@ static int cxgb3i_conn_bind(struct iscsi_cls_session *cls_session,
591 cxgb3i_conn_max_recv_dlength(conn); 592 cxgb3i_conn_max_recv_dlength(conn);
592 593
593 spin_lock_bh(&conn->session->lock); 594 spin_lock_bh(&conn->session->lock);
594 sprintf(conn->portal_address, NIPQUAD_FMT, 595 sprintf(conn->portal_address, "%pI4", &c3cn->daddr.sin_addr.s_addr);
595 NIPQUAD(c3cn->daddr.sin_addr.s_addr));
596 conn->portal_port = ntohs(c3cn->daddr.sin_port); 596 conn->portal_port = ntohs(c3cn->daddr.sin_port);
597 spin_unlock_bh(&conn->session->lock); 597 spin_unlock_bh(&conn->session->lock);
598 598
@@ -709,6 +709,12 @@ static int cxgb3i_host_set_param(struct Scsi_Host *shost,
709{ 709{
710 struct cxgb3i_hba *hba = iscsi_host_priv(shost); 710 struct cxgb3i_hba *hba = iscsi_host_priv(shost);
711 711
712 if (!hba->ndev) {
713 shost_printk(KERN_ERR, shost, "Could not set host param. "
714 "Netdev for host not set.\n");
715 return -ENODEV;
716 }
717
712 cxgb3i_api_debug("param %d, buf %s.\n", param, buf); 718 cxgb3i_api_debug("param %d, buf %s.\n", param, buf);
713 719
714 switch (param) { 720 switch (param) {
@@ -739,6 +745,12 @@ static int cxgb3i_host_get_param(struct Scsi_Host *shost,
739 struct cxgb3i_hba *hba = iscsi_host_priv(shost); 745 struct cxgb3i_hba *hba = iscsi_host_priv(shost);
740 int len = 0; 746 int len = 0;
741 747
748 if (!hba->ndev) {
749 shost_printk(KERN_ERR, shost, "Could not set host param. "
750 "Netdev for host not set.\n");
751 return -ENODEV;
752 }
753
742 cxgb3i_api_debug("hba %s, param %d.\n", hba->ndev->name, param); 754 cxgb3i_api_debug("hba %s, param %d.\n", hba->ndev->name, param);
743 755
744 switch (param) { 756 switch (param) {
@@ -753,7 +765,7 @@ static int cxgb3i_host_get_param(struct Scsi_Host *shost,
753 __be32 addr; 765 __be32 addr;
754 766
755 addr = cxgb3i_get_private_ipv4addr(hba->ndev); 767 addr = cxgb3i_get_private_ipv4addr(hba->ndev);
756 len = sprintf(buf, NIPQUAD_FMT, NIPQUAD(addr)); 768 len = sprintf(buf, "%pI4", &addr);
757 break; 769 break;
758 } 770 }
759 default: 771 default:
@@ -904,7 +916,7 @@ static struct scsi_host_template cxgb3i_host_template = {
904 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, 916 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
905 .eh_abort_handler = iscsi_eh_abort, 917 .eh_abort_handler = iscsi_eh_abort,
906 .eh_device_reset_handler = iscsi_eh_device_reset, 918 .eh_device_reset_handler = iscsi_eh_device_reset,
907 .eh_target_reset_handler = iscsi_eh_target_reset, 919 .eh_target_reset_handler = iscsi_eh_recover_target,
908 .target_alloc = iscsi_target_alloc, 920 .target_alloc = iscsi_target_alloc,
909 .use_clustering = DISABLE_CLUSTERING, 921 .use_clustering = DISABLE_CLUSTERING,
910 .this_id = -1, 922 .this_id = -1,
@@ -937,7 +949,7 @@ static struct iscsi_transport cxgb3i_iscsi_transport = {
937 ISCSI_USERNAME | ISCSI_PASSWORD | 949 ISCSI_USERNAME | ISCSI_PASSWORD |
938 ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | 950 ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN |
939 ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | 951 ISCSI_FAST_ABORT | ISCSI_ABORT_TMO |
940 ISCSI_LU_RESET_TMO | 952 ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO |
941 ISCSI_PING_TMO | ISCSI_RECV_TMO | 953 ISCSI_PING_TMO | ISCSI_RECV_TMO |
942 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, 954 ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME,
943 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | 955 .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS |