>From 4b522723ab93b54504eeb738cc02f354635cec53 Mon Sep 17 00:00:00 2001 From: Rakesh Ranjan Date: Thu, 29 Oct 2009 17:41:42 +0530 Subject: [PATCH] added one new netlink message ISCSI_UEVENT_REQ_IPCONF in libiscsi to support dhcp functionality in cxgb3i Signed-off-by: Rakesh Ranjan --- drivers/scsi/scsi_transport_iscsi.c | 25 +++++++++++++++++++++++++ include/scsi/iscsi_if.h | 4 ++++ include/scsi/scsi_transport_iscsi.h | 1 + 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index ad897df..4897a3f 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1508,6 +1508,28 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev) } static int +iscsi_req_ipconf(struct iscsi_transport *transport, struct iscsi_uevent *ev) +{ + struct Scsi_Host *shost; + int err; + + if (!transport->req_ipconf) + return -ENOSYS; + + shost = scsi_host_lookup(ev->u.req_ipconf.host_no); + if (!shost) { + printk(KERN_ERR "ipconf req could not find host no %u\n", + ev->u.req_ipconf.host_no); + return -ENODEV; + } + + err = transport->req_ipconf(shost); + + 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; @@ -1627,6 +1649,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_REQ_IPCONF: + err = iscsi_req_ipconf(transport, ev); + break; default: err = -ENOSYS; break; diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d67dda2..939b1d6 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h @@ -59,6 +59,7 @@ enum iscsi_uevent_e { ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, + ISCSI_UEVENT_REQ_IPCONF = UEVENT_BASE + 21, /* up events */ ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, @@ -172,6 +173,9 @@ struct iscsi_uevent { struct msg_set_path { uint32_t host_no; } set_path; + struct msg_req_ipconf { + uint32_t host_no; + } req_ipconf; } u; union { /* messages k -> u */ diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 349c7f3..3e5fd96 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -134,6 +134,7 @@ struct iscsi_transport { int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, uint32_t enable, struct sockaddr *dst_addr); int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); + int (*req_ipconf) (struct Scsi_Host *shost); }; /* -- 1.6.0.6