diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2011-07-25 22:48:37 +0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 18:35:56 +0400 |
commit | 56c155b5ca427c9a6312bb0e31865f1c8ab10b2b (patch) | |
tree | 8734678dc7d24d30cc0e66f551ce03fe50c51bf4 /drivers/scsi/scsi_transport_iscsi.c | |
parent | 5d7c20b7fa5c6ca19e871b4050e321c99d32bd43 (diff) | |
download | linux-56c155b5ca427c9a6312bb0e31865f1c8ab10b2b.tar.xz |
[SCSI] iscsi_transport: add support for net settings
Allows user space (iscsiadm) to send down network configuration
parameters for LLD to set private network configuration on the iSCSI
adapters.
Based on patch from Lalit Chandivade.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 3fd16d7212de..212a8d846748 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1558,6 +1558,30 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev) } static int +iscsi_set_iface_params(struct iscsi_transport *transport, + struct iscsi_uevent *ev) +{ + char *data = (char *)ev + sizeof(*ev); + struct Scsi_Host *shost; + int err; + + if (!transport->set_iface_param) + return -ENOSYS; + + shost = scsi_host_lookup(ev->u.set_iface_params.host_no); + if (!shost) { + printk(KERN_ERR "set_iface_params could not find host no %u\n", + ev->u.set_iface_params.host_no); + return -ENODEV; + } + + err = transport->set_iface_param(shost, data, + ev->u.set_iface_params.count); + scsi_host_put(shost); + return err; +} + +static int iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group) { int err = 0; @@ -1696,6 +1720,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group) case ISCSI_UEVENT_PATH_UPDATE: err = iscsi_set_path(transport, ev); break; + case ISCSI_UEVENT_SET_IFACE_PARAMS: + err = iscsi_set_iface_params(transport, ev); + break; default: err = -ENOSYS; break; |