aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c21
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c8
-rw-r--r--include/scsi/scsi_transport_iscsi.h3
3 files changed, 13 insertions, 19 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index d39205c816d8..ce20dab75369 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -78,8 +78,8 @@ static int qla4xxx_conn_get_param(struct iscsi_cls_conn *conn,
78 enum iscsi_param param, char *buf); 78 enum iscsi_param param, char *buf);
79static int qla4xxx_host_get_param(struct Scsi_Host *shost, 79static int qla4xxx_host_get_param(struct Scsi_Host *shost,
80 enum iscsi_host_param param, char *buf); 80 enum iscsi_host_param param, char *buf);
81static int qla4xxx_iface_set_param(struct Scsi_Host *shost, char *data, 81static int qla4xxx_iface_set_param(struct Scsi_Host *shost, void *data,
82 int count); 82 uint32_t len);
83static int qla4xxx_get_iface_param(struct iscsi_iface *iface, 83static int qla4xxx_get_iface_param(struct iscsi_iface *iface,
84 enum iscsi_param_type param_type, 84 enum iscsi_param_type param_type,
85 int param, char *buf); 85 int param, char *buf);
@@ -842,7 +842,7 @@ qla4xxx_initcb_to_acb(struct addr_ctrl_blk *init_fw_cb)
842} 842}
843 843
844static int 844static int
845qla4xxx_iface_set_param(struct Scsi_Host *shost, char *data, int count) 845qla4xxx_iface_set_param(struct Scsi_Host *shost, void *data, uint32_t len)
846{ 846{
847 struct scsi_qla_host *ha = to_qla_host(shost); 847 struct scsi_qla_host *ha = to_qla_host(shost);
848 int rval = 0; 848 int rval = 0;
@@ -851,8 +851,8 @@ qla4xxx_iface_set_param(struct Scsi_Host *shost, char *data, int count)
851 dma_addr_t init_fw_cb_dma; 851 dma_addr_t init_fw_cb_dma;
852 uint32_t mbox_cmd[MBOX_REG_COUNT]; 852 uint32_t mbox_cmd[MBOX_REG_COUNT];
853 uint32_t mbox_sts[MBOX_REG_COUNT]; 853 uint32_t mbox_sts[MBOX_REG_COUNT];
854 uint32_t total_param_count; 854 uint32_t rem = len;
855 uint32_t length; 855 struct nlattr *attr;
856 856
857 init_fw_cb = dma_alloc_coherent(&ha->pdev->dev, 857 init_fw_cb = dma_alloc_coherent(&ha->pdev->dev,
858 sizeof(struct addr_ctrl_blk), 858 sizeof(struct addr_ctrl_blk),
@@ -873,11 +873,8 @@ qla4xxx_iface_set_param(struct Scsi_Host *shost, char *data, int count)
873 goto exit_init_fw_cb; 873 goto exit_init_fw_cb;
874 } 874 }
875 875
876 total_param_count = count; 876 nla_for_each_attr(attr, data, len, rem) {
877 iface_param = (struct iscsi_iface_param_info *)data; 877 iface_param = nla_data(attr);
878
879 for ( ; total_param_count != 0; total_param_count--) {
880 length = iface_param->len;
881 878
882 if (iface_param->param_type != ISCSI_NET_PARAM) 879 if (iface_param->param_type != ISCSI_NET_PARAM)
883 continue; 880 continue;
@@ -914,10 +911,6 @@ qla4xxx_iface_set_param(struct Scsi_Host *shost, char *data, int count)
914 ql4_printk(KERN_ERR, ha, "Invalid iface type\n"); 911 ql4_printk(KERN_ERR, ha, "Invalid iface type\n");
915 break; 912 break;
916 } 913 }
917
918 iface_param = (struct iscsi_iface_param_info *)
919 ((uint8_t *)iface_param +
920 sizeof(struct iscsi_iface_param_info) + length);
921 } 914 }
922 915
923 init_fw_cb->cookie = cpu_to_le32(0x11BEAD5A); 916 init_fw_cb->cookie = cpu_to_le32(0x11BEAD5A);
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 522423bdcb56..142a09a3afbf 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1890,7 +1890,7 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev)
1890 1890
1891static int 1891static int
1892iscsi_set_iface_params(struct iscsi_transport *transport, 1892iscsi_set_iface_params(struct iscsi_transport *transport,
1893 struct iscsi_uevent *ev) 1893 struct iscsi_uevent *ev, uint32_t len)
1894{ 1894{
1895 char *data = (char *)ev + sizeof(*ev); 1895 char *data = (char *)ev + sizeof(*ev);
1896 struct Scsi_Host *shost; 1896 struct Scsi_Host *shost;
@@ -1906,8 +1906,7 @@ iscsi_set_iface_params(struct iscsi_transport *transport,
1906 return -ENODEV; 1906 return -ENODEV;
1907 } 1907 }
1908 1908
1909 err = transport->set_iface_param(shost, data, 1909 err = transport->set_iface_param(shost, data, len);
1910 ev->u.set_iface_params.count);
1911 scsi_host_put(shost); 1910 scsi_host_put(shost);
1912 return err; 1911 return err;
1913} 1912}
@@ -2052,7 +2051,8 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
2052 err = iscsi_set_path(transport, ev); 2051 err = iscsi_set_path(transport, ev);
2053 break; 2052 break;
2054 case ISCSI_UEVENT_SET_IFACE_PARAMS: 2053 case ISCSI_UEVENT_SET_IFACE_PARAMS:
2055 err = iscsi_set_iface_params(transport, ev); 2054 err = iscsi_set_iface_params(transport, ev,
2055 nlmsg_attrlen(nlh, sizeof(*ev)));
2056 break; 2056 break;
2057 default: 2057 default:
2058 err = -ENOSYS; 2058 err = -ENOSYS;
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index a498ccecf6b1..5994bcc1b017 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -137,7 +137,8 @@ struct iscsi_transport {
137 int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, 137 int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
138 uint32_t enable, struct sockaddr *dst_addr); 138 uint32_t enable, struct sockaddr *dst_addr);
139 int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); 139 int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params);
140 int (*set_iface_param) (struct Scsi_Host *shost, char *data, int count); 140 int (*set_iface_param) (struct Scsi_Host *shost, void *data,
141 uint32_t len);
141 int (*get_iface_param) (struct iscsi_iface *iface, 142 int (*get_iface_param) (struct iscsi_iface *iface,
142 enum iscsi_param_type param_type, 143 enum iscsi_param_type param_type,
143 int param, char *buf); 144 int param, char *buf);