summaryrefslogtreecommitdiff
path: root/usr/netlink.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-05-19 21:20:44 -0500
committerMike Christie <michaelc@cs.wisc.edu>2008-05-19 21:20:44 -0500
commit74489b2eb9f3c5d96c64f859de965cff10bb457f (patch)
treeb1adea6e5d1ae796fd79992a9e13faa46a02ea5d /usr/netlink.c
parentdc75ff01ee126dbde42d4f2fe975c17e25719cf9 (diff)
downloadopen-iscsi-74489b2eb9f3c5d96c64f859de965cff10bb457f.tar.gz
pass ep to session creation
bnx2i allocates a host per session and iser accesses the device so we need to pass them a the leading connection so they can find the hardware that is it bound to. This also has us call ep_disconnect before calling the stop conn callout, so these driver do not have to worry about stopping the receiving path.
Diffstat (limited to 'usr/netlink.c')
-rw-r--r--usr/netlink.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/usr/netlink.c b/usr/netlink.c
index c9598a5..50f3e61 100644
--- a/usr/netlink.c
+++ b/usr/netlink.c
@@ -340,9 +340,9 @@ ksendtargets(uint64_t transport_handle, uint32_t host_no, struct sockaddr *addr)
}
static int
-kcreate_session(uint64_t transport_handle, uint32_t initial_cmdsn,
- uint16_t cmds_max, uint16_t qdepth,
- uint32_t *out_sid, uint32_t *out_hostno)
+kcreate_session(uint64_t transport_handle, uint64_t ep_handle,
+ uint32_t initial_cmdsn, uint16_t cmds_max, uint16_t qdepth,
+ uint32_t *out_sid, uint32_t *hostno)
{
int rc;
struct iscsi_uevent ev;
@@ -351,17 +351,26 @@ kcreate_session(uint64_t transport_handle, uint32_t initial_cmdsn,
memset(&ev, 0, sizeof(struct iscsi_uevent));
- ev.type = ISCSI_UEVENT_CREATE_SESSION;
- ev.transport_handle = transport_handle;
- ev.u.c_session.initial_cmdsn = initial_cmdsn;
- ev.u.c_session.cmds_max = cmds_max;
- ev.u.c_session.queue_depth = qdepth;
+ if (ep_handle == 0) {
+ ev.type = ISCSI_UEVENT_CREATE_SESSION;
+ ev.transport_handle = transport_handle;
+ ev.u.c_session.initial_cmdsn = initial_cmdsn;
+ ev.u.c_session.cmds_max = cmds_max;
+ ev.u.c_session.queue_depth = qdepth;
+ } else {
+ ev.type = ISCSI_UEVENT_CREATE_BOUND_SESSION;
+ ev.transport_handle = transport_handle;
+ ev.u.c_bound_session.initial_cmdsn = initial_cmdsn;
+ ev.u.c_bound_session.cmds_max = cmds_max;
+ ev.u.c_bound_session.queue_depth = qdepth;
+ ev.u.c_bound_session.ep_handle = ep_handle;
+ }
if ((rc = __kipc_call(&ev, sizeof(ev))) < 0) {
return rc;
}
- *out_hostno = ev.r.c_session_ret.host_no;
+ *hostno = ev.r.c_session_ret.host_no;
*out_sid = ev.r.c_session_ret.sid;
return 0;