diff options
Diffstat (limited to 'include/scsi/iscsi_if.h')
| -rw-r--r-- | include/scsi/iscsi_if.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d0ed5226f8c4..4426f00da5ff 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -22,6 +22,11 @@ | |||
| 22 | #define ISCSI_IF_H | 22 | #define ISCSI_IF_H |
| 23 | 23 | ||
| 24 | #include <scsi/iscsi_proto.h> | 24 | #include <scsi/iscsi_proto.h> |
| 25 | #include <linux/in.h> | ||
| 26 | #include <linux/in6.h> | ||
| 27 | |||
| 28 | #define ISCSI_NL_GRP_ISCSID 1 | ||
| 29 | #define ISCSI_NL_GRP_UIP 2 | ||
| 25 | 30 | ||
| 26 | #define UEVENT_BASE 10 | 31 | #define UEVENT_BASE 10 |
| 27 | #define KEVENT_BASE 100 | 32 | #define KEVENT_BASE 100 |
| @@ -50,7 +55,10 @@ enum iscsi_uevent_e { | |||
| 50 | ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, | 55 | ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, |
| 51 | ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, | 56 | ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, |
| 52 | ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, | 57 | ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, |
| 53 | ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, | 58 | ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, |
| 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, | ||
| 60 | |||
| 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | ||
| 54 | 62 | ||
| 55 | /* up events */ | 63 | /* up events */ |
| 56 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 64 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
| @@ -59,6 +67,9 @@ enum iscsi_uevent_e { | |||
| 59 | ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, | 67 | ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, |
| 60 | ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, | 68 | ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, |
| 61 | ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, | 69 | ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, |
| 70 | |||
| 71 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, | ||
| 72 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, | ||
| 62 | }; | 73 | }; |
| 63 | 74 | ||
| 64 | enum iscsi_tgt_dscvr { | 75 | enum iscsi_tgt_dscvr { |
| @@ -131,6 +142,10 @@ struct iscsi_uevent { | |||
| 131 | struct msg_transport_connect { | 142 | struct msg_transport_connect { |
| 132 | uint32_t non_blocking; | 143 | uint32_t non_blocking; |
| 133 | } ep_connect; | 144 | } ep_connect; |
| 145 | struct msg_transport_connect_through_host { | ||
| 146 | uint32_t host_no; | ||
| 147 | uint32_t non_blocking; | ||
| 148 | } ep_connect_through_host; | ||
| 134 | struct msg_transport_poll { | 149 | struct msg_transport_poll { |
| 135 | uint64_t ep_handle; | 150 | uint64_t ep_handle; |
| 136 | uint32_t timeout_ms; | 151 | uint32_t timeout_ms; |
| @@ -154,6 +169,9 @@ struct iscsi_uevent { | |||
| 154 | uint32_t param; /* enum iscsi_host_param */ | 169 | uint32_t param; /* enum iscsi_host_param */ |
| 155 | uint32_t len; | 170 | uint32_t len; |
| 156 | } set_host_param; | 171 | } set_host_param; |
| 172 | struct msg_set_path { | ||
| 173 | uint32_t host_no; | ||
| 174 | } set_path; | ||
| 157 | } u; | 175 | } u; |
| 158 | union { | 176 | union { |
| 159 | /* messages k -> u */ | 177 | /* messages k -> u */ |
| @@ -187,10 +205,39 @@ struct iscsi_uevent { | |||
| 187 | struct msg_transport_connect_ret { | 205 | struct msg_transport_connect_ret { |
| 188 | uint64_t handle; | 206 | uint64_t handle; |
| 189 | } ep_connect_ret; | 207 | } ep_connect_ret; |
| 208 | struct msg_req_path { | ||
| 209 | uint32_t host_no; | ||
| 210 | } req_path; | ||
| 211 | struct msg_notify_if_down { | ||
| 212 | uint32_t host_no; | ||
| 213 | } notify_if_down; | ||
| 190 | } r; | 214 | } r; |
| 191 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 215 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
| 192 | 216 | ||
| 193 | /* | 217 | /* |
| 218 | * To keep the struct iscsi_uevent size the same for userspace code | ||
| 219 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and | ||
| 220 | * ISCSI_KEVENT_PATH_REQ is defined separately and comes after the | ||
| 221 | * struct iscsi_uevent in the NETLINK_ISCSI message. | ||
| 222 | */ | ||
| 223 | struct iscsi_path { | ||
| 224 | uint64_t handle; | ||
| 225 | uint8_t mac_addr[6]; | ||
| 226 | uint8_t mac_addr_old[6]; | ||
| 227 | uint32_t ip_addr_len; /* 4 or 16 */ | ||
| 228 | union { | ||
| 229 | struct in_addr v4_addr; | ||
| 230 | struct in6_addr v6_addr; | ||
| 231 | } src; | ||
| 232 | union { | ||
| 233 | struct in_addr v4_addr; | ||
| 234 | struct in6_addr v6_addr; | ||
| 235 | } dst; | ||
| 236 | uint16_t vlan_id; | ||
| 237 | uint16_t pmtu; | ||
| 238 | } __attribute__ ((aligned (sizeof(uint64_t)))); | ||
| 239 | |||
| 240 | /* | ||
| 194 | * Common error codes | 241 | * Common error codes |
| 195 | */ | 242 | */ |
| 196 | enum iscsi_err { | 243 | enum iscsi_err { |
