summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6>2005-03-26 07:28:34 +0000
committerdmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6>2005-03-26 07:28:34 +0000
commit982670d7aad4a650528bc17ea6fdefa884e64c8c (patch)
treeced0925bbc68ee34463ca43826323ab93576e8ad /include
parent3638f314458383530829cc769e5481561e0d0c84 (diff)
downloadopen-iscsi-982670d7aad4a650528bc17ea6fdefa884e64c8c.tar.gz
transport register/unregister path cleanup,
transport api vs. user/kernel definitions split, ndbm node and discovery records version check git-svn-id: svn://svn.berlios.de/open-iscsi@206 d7303112-9cec-0310-bdd2-e83a94d6c2b6
Diffstat (limited to 'include')
-rw-r--r--include/iscsi_if.h59
-rw-r--r--include/iscsi_ifev.h12
-rw-r--r--include/iscsi_iftrans.h79
3 files changed, 91 insertions, 59 deletions
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index c081f5c..2c621c1 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -1,5 +1,5 @@
/*
- * iSCSI User/Kernel Interface
+ * iSCSI User/Kernel Shares (Defines, Constants, Protocol definitions, etc)
*
* Copyright (C) 2005 Dmitry Yusupov, Alex Aizman
* maintained by open-iscsi@googlegroups.com
@@ -22,8 +22,8 @@
#include <iscsi_proto.h>
-#define ISCSI_TRANSPORT_NAME_MAXLEN 64
-#define ISCSI_TRANSPORT_MAX 16
+#define ISCSI_TRANSPORT_NAME_MAXLEN 16
+#define ISCSI_TRANSPORT_MAX 1
#define UEVENT_BASE 10
#define KEVENT_BASE 100
#define ISCSI_ERR_BASE 1000
@@ -100,57 +100,4 @@ typedef uint64_t iscsi_cnx_t; /* iSCSI Data-Path connection handle */
#define STOP_CNX_SUSPEND 0x2
#define STOP_CNX_RECOVER 0x3
-/**
- * struct iscsi_transport - down calls
- *
- * @name: transport name
- * @caps: iSCSI Data-Path capabilities
- * @create_snx: create new iSCSI session object
- * @destroy_snx: destroy existing iSCSI session object
- * @create_cnx: create new iSCSI connection
- * @bind_cnx: associate this connection with existing iSCSI session and
- * specified transport descriptor
- * @destroy_cnx: destroy inactive iSCSI connection
- * @set_param: set iSCSI Data-Path operational parameter
- * @start_cnx: set connection to be operational
- * @stop_cnx: suspend connection
- * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
- *
- * API provided by generic iSCSI Data Path module
- */
-struct iscsi_transport {
- char *name;
- unsigned int caps;
- struct scsi_host_template *host_template;
- int hostdata_size;
- int max_lun;
- unsigned int max_cnx;
- unsigned int max_cmd_len;
- iscsi_snx_t (*create_session) (iscsi_snx_t cp_snx,
- uint32_t initial_cmdsn, void *shost);
- void (*destroy_session) (iscsi_snx_t dp_snx);
- iscsi_cnx_t (*create_cnx) (iscsi_snx_t dp_snx, iscsi_cnx_t cp_cnx,
- uint32_t cid);
- int (*bind_cnx) (iscsi_snx_t dp_snx, iscsi_cnx_t dp_cnx,
- uint32_t transport_fd, int is_leading);
- int (*start_cnx) (iscsi_cnx_t dp_cnx);
- void (*stop_cnx) (iscsi_cnx_t dp_cnx, int flag);
- void (*destroy_cnx) (iscsi_cnx_t dp_cnx);
- int (*set_param) (iscsi_cnx_t dp_cnx, enum iscsi_param param,
- uint32_t value);
- int (*get_param) (iscsi_cnx_t dp_cnx, enum iscsi_param param,
- uint32_t *value);
- int (*send_pdu) (iscsi_cnx_t dp_cnx, struct iscsi_hdr *hdr,
- char *data, uint32_t data_size);
-};
-
-/*
- * up calls
- */
-int iscsi_register_transport(struct iscsi_transport *ops, int id);
-void iscsi_unregister_transport(int id);
-int iscsi_control_recv_pdu(iscsi_cnx_t cp_cnx, struct iscsi_hdr *hdr,
- char *data, uint32_t data_size);
-void iscsi_control_cnx_error(iscsi_cnx_t cp_cnx, enum iscsi_err error);
-
#endif
diff --git a/include/iscsi_ifev.h b/include/iscsi_ifev.h
index 2903845..f45b0f5 100644
--- a/include/iscsi_ifev.h
+++ b/include/iscsi_ifev.h
@@ -33,6 +33,7 @@ enum iscsi_uevent_e {
ISCSI_UEVENT_START_CNX = UEVENT_BASE + 7,
ISCSI_UEVENT_STOP_CNX = UEVENT_BASE + 8,
ISCSI_UEVENT_SEND_PDU = UEVENT_BASE + 9,
+ ISCSI_UEVENT_TRANS_LIST = UEVENT_BASE + 10,
/* up events */
ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -42,7 +43,8 @@ enum iscsi_uevent_e {
struct iscsi_uevent {
uint32_t type; /* k/u events type */
- uint32_t transport_id;
+ uint32_t iferror;
+ uint64_t transport_handle;
union {
/* messages u -> k */
@@ -105,9 +107,13 @@ struct iscsi_uevent {
uint32_t error; /* enum iscsi_err */
uint32_t resource_error; /* NOMEM, NOBUFS */
} cnxerror;
+ struct msg_trans_list {
+ struct {
+ uint64_t handle;
+ char name[ISCSI_TRANSPORT_NAME_MAXLEN];
+ } elements[ISCSI_TRANSPORT_MAX];
+ } t_list;
} r;
-
- uint32_t iferror;
};
#endif /* ISCSI_IFEV_H */
diff --git a/include/iscsi_iftrans.h b/include/iscsi_iftrans.h
new file mode 100644
index 0000000..fcea0c3
--- /dev/null
+++ b/include/iscsi_iftrans.h
@@ -0,0 +1,79 @@
+/*
+ * iSCSI Transport Interface
+ *
+ * Copyright (C) 2005 Dmitry Yusupov, Alex Aizman
+ * maintained by open-iscsi@googlegroups.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * See the file COPYING included with this distribution for more details.
+ */
+
+#ifndef ISCSI_IFTRANS_H
+#define ISCSI_IFTRANS_H
+
+#include <iscsi_if.h>
+
+/**
+ * struct iscsi_transport - down calls
+ *
+ * @name: transport name
+ * @caps: iSCSI Data-Path capabilities
+ * @create_snx: create new iSCSI session object
+ * @destroy_snx: destroy existing iSCSI session object
+ * @create_cnx: create new iSCSI connection
+ * @bind_cnx: associate this connection with existing iSCSI session and
+ * specified transport descriptor
+ * @destroy_cnx: destroy inactive iSCSI connection
+ * @set_param: set iSCSI Data-Path operational parameter
+ * @start_cnx: set connection to be operational
+ * @stop_cnx: suspend connection
+ * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text.
+ *
+ * API provided by generic iSCSI Data Path module
+ */
+struct iscsi_transport {
+ struct module *owner;
+ char *name;
+ unsigned int caps;
+ struct scsi_host_template *host_template;
+ int hostdata_size;
+ int max_lun;
+ unsigned int max_cnx;
+ unsigned int max_cmd_len;
+ iscsi_snx_t (*create_session) (iscsi_snx_t cp_snx,
+ uint32_t initial_cmdsn, struct Scsi_Host *shost);
+ void (*destroy_session) (iscsi_snx_t dp_snx);
+ iscsi_cnx_t (*create_cnx) (iscsi_snx_t dp_snx, iscsi_cnx_t cp_cnx,
+ uint32_t cid);
+ int (*bind_cnx) (iscsi_snx_t dp_snx, iscsi_cnx_t dp_cnx,
+ uint32_t transport_fd, int is_leading);
+ int (*start_cnx) (iscsi_cnx_t dp_cnx);
+ void (*stop_cnx) (iscsi_cnx_t dp_cnx, int flag);
+ void (*destroy_cnx) (iscsi_cnx_t dp_cnx);
+ int (*set_param) (iscsi_cnx_t dp_cnx, enum iscsi_param param,
+ uint32_t value);
+ int (*get_param) (iscsi_cnx_t dp_cnx, enum iscsi_param param,
+ uint32_t *value);
+ int (*send_pdu) (iscsi_cnx_t dp_cnx, struct iscsi_hdr *hdr,
+ char *data, uint32_t data_size);
+};
+
+/*
+ * up calls
+ */
+int iscsi_register_transport(struct iscsi_transport *t);
+int iscsi_unregister_transport(struct iscsi_transport *t);
+int iscsi_control_recv_pdu(iscsi_cnx_t cp_cnx, struct iscsi_hdr *hdr,
+ char *data, uint32_t data_size);
+void iscsi_control_cnx_error(iscsi_cnx_t cp_cnx, enum iscsi_err error);
+
+#endif /* ISCSI_IFTRANS_H */