aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2012-02-13 08:00:46 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 10:33:32 -0500
commita11e25459558421ec5c4adc3fc46fe320ab74bd3 (patch)
treef1112f31c65b28337b9b25082a1c5a8246ceb1ad /include/scsi
parent46801ba698b3366cf8d293d9f3d4253b6fd5210b (diff)
[SCSI] scsi_transport_iscsi: added support for host event
Added support to post kernel host event to application using netlink interface. Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h13
-rw-r--r--include/scsi/scsi_transport_iscsi.h6
2 files changed, 19 insertions, 0 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index e49b7c8dd217..3aac99155e80 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -72,6 +72,7 @@ enum iscsi_uevent_e {
72 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, 72 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
73 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, 73 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
74 ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, 74 ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
75 ISCSI_KEVENT_HOST_EVENT = KEVENT_BASE + 10,
75}; 76};
76 77
77enum iscsi_tgt_dscvr { 78enum iscsi_tgt_dscvr {
@@ -80,6 +81,13 @@ enum iscsi_tgt_dscvr {
80 ISCSI_TGT_DSCVR_SLP = 3, 81 ISCSI_TGT_DSCVR_SLP = 3,
81}; 82};
82 83
84enum iscsi_host_event_code {
85 ISCSI_EVENT_LINKUP = 1,
86 ISCSI_EVENT_LINKDOWN,
87 /* must always be last */
88 ISCSI_EVENT_MAX,
89};
90
83struct iscsi_uevent { 91struct iscsi_uevent {
84 uint32_t type; /* k/u events type */ 92 uint32_t type; /* k/u events type */
85 uint32_t iferror; /* carries interface or resource errors */ 93 uint32_t iferror; /* carries interface or resource errors */
@@ -222,6 +230,11 @@ struct iscsi_uevent {
222 struct msg_notify_if_down { 230 struct msg_notify_if_down {
223 uint32_t host_no; 231 uint32_t host_no;
224 } notify_if_down; 232 } notify_if_down;
233 struct msg_host_event {
234 uint32_t host_no;
235 uint32_t data_size;
236 enum iscsi_host_event_code code;
237 } host_event;
225 } r; 238 } r;
226} __attribute__ ((aligned (sizeof(uint64_t)))); 239} __attribute__ ((aligned (sizeof(uint64_t))));
227 240
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index fa7ca4e16020..7f047314281b 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -166,6 +166,12 @@ extern int iscsi_offload_mesg(struct Scsi_Host *shost,
166 struct iscsi_transport *transport, uint32_t type, 166 struct iscsi_transport *transport, uint32_t type,
167 char *data, uint16_t data_size); 167 char *data, uint16_t data_size);
168 168
169extern void iscsi_post_host_event(uint32_t host_no,
170 struct iscsi_transport *transport,
171 enum iscsi_host_event_code code,
172 uint32_t data_size,
173 uint8_t *data);
174
169struct iscsi_cls_conn { 175struct iscsi_cls_conn {
170 struct list_head conn_list; /* item in connlist */ 176 struct list_head conn_list; /* item in connlist */
171 void *dd_data; /* LLD private data */ 177 void *dd_data; /* LLD private data */