diff options
author | Or Gerlitz <ogerlitz@voltaire.com> | 2006-05-02 20:46:36 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-05-10 11:11:38 -0400 |
commit | 264faaaa12544e7914928ad57ccba21907cad56b (patch) | |
tree | eb8a6993e43f3802b203b371b81fcfb89fc4f754 /include/scsi | |
parent | 169e1a2a8a789fa84254695ec6a56fc410bb19a9 (diff) |
[SCSI] iscsi: add transport end point callbacks
add transport end point callbacks so iscsi drivers that cannot connect
from userspace, like iscsi tcp, using sockets do not have to
implement their own socket infrastructure.
Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/iscsi_if.h | 19 | ||||
-rw-r--r-- | include/scsi/scsi_transport_iscsi.h | 6 |
2 files changed, 23 insertions, 2 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 47524c726ee8..feff74e544b7 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -43,6 +43,10 @@ enum iscsi_uevent_e { | |||
43 | ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10, | 43 | ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10, |
44 | ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11, | 44 | ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11, |
45 | 45 | ||
46 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT = UEVENT_BASE + 12, | ||
47 | ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13, | ||
48 | ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, | ||
49 | |||
46 | /* up events */ | 50 | /* up events */ |
47 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 51 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
48 | ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, | 52 | ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, |
@@ -69,7 +73,7 @@ struct iscsi_uevent { | |||
69 | struct msg_bind_conn { | 73 | struct msg_bind_conn { |
70 | uint32_t sid; | 74 | uint32_t sid; |
71 | uint32_t cid; | 75 | uint32_t cid; |
72 | uint32_t transport_fd; | 76 | uint64_t transport_eph; |
73 | uint32_t is_leading; | 77 | uint32_t is_leading; |
74 | } b_conn; | 78 | } b_conn; |
75 | struct msg_destroy_conn { | 79 | struct msg_destroy_conn { |
@@ -102,6 +106,16 @@ struct iscsi_uevent { | |||
102 | uint32_t sid; | 106 | uint32_t sid; |
103 | uint32_t cid; | 107 | uint32_t cid; |
104 | } get_stats; | 108 | } get_stats; |
109 | struct msg_transport_connect { | ||
110 | uint32_t non_blocking; | ||
111 | } ep_connect; | ||
112 | struct msg_transport_poll { | ||
113 | uint64_t ep_handle; | ||
114 | uint32_t timeout_ms; | ||
115 | } ep_poll; | ||
116 | struct msg_transport_disconnect { | ||
117 | uint64_t ep_handle; | ||
118 | } ep_disconnect; | ||
105 | } u; | 119 | } u; |
106 | union { | 120 | union { |
107 | /* messages k -> u */ | 121 | /* messages k -> u */ |
@@ -124,6 +138,9 @@ struct iscsi_uevent { | |||
124 | uint32_t cid; | 138 | uint32_t cid; |
125 | uint32_t error; /* enum iscsi_err */ | 139 | uint32_t error; /* enum iscsi_err */ |
126 | } connerror; | 140 | } connerror; |
141 | struct msg_transport_connect_ret { | ||
142 | uint64_t handle; | ||
143 | } ep_connect_ret; | ||
127 | } r; | 144 | } r; |
128 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 145 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
129 | 146 | ||
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index b332d6e839fe..c9e9475c6dff 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
@@ -88,7 +88,7 @@ struct iscsi_transport { | |||
88 | uint32_t cid); | 88 | uint32_t cid); |
89 | int (*bind_conn) (struct iscsi_cls_session *session, | 89 | int (*bind_conn) (struct iscsi_cls_session *session, |
90 | struct iscsi_cls_conn *cls_conn, | 90 | struct iscsi_cls_conn *cls_conn, |
91 | uint32_t transport_fd, int is_leading); | 91 | uint64_t transport_eph, int is_leading); |
92 | int (*start_conn) (struct iscsi_cls_conn *conn); | 92 | int (*start_conn) (struct iscsi_cls_conn *conn); |
93 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); | 93 | void (*stop_conn) (struct iscsi_cls_conn *conn, int flag); |
94 | void (*destroy_conn) (struct iscsi_cls_conn *conn); | 94 | void (*destroy_conn) (struct iscsi_cls_conn *conn); |
@@ -119,6 +119,10 @@ struct iscsi_transport { | |||
119 | int (*xmit_mgmt_task) (struct iscsi_conn *conn, | 119 | int (*xmit_mgmt_task) (struct iscsi_conn *conn, |
120 | struct iscsi_mgmt_task *mtask); | 120 | struct iscsi_mgmt_task *mtask); |
121 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); | 121 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); |
122 | int (*ep_connect) (struct sockaddr *dst_addr, int non_blocking, | ||
123 | uint64_t *ep_handle); | ||
124 | int (*ep_poll) (uint64_t ep_handle, int timeout_ms); | ||
125 | void (*ep_disconnect) (uint64_t ep_handle); | ||
122 | }; | 126 | }; |
123 | 127 | ||
124 | /* | 128 | /* |