]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
add iwarp extension include file
authorArlin Davis <arlin.r.davis@intel.com>
Wed, 16 May 2007 19:56:39 +0000 (12:56 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Wed, 16 May 2007 19:56:39 +0000 (12:56 -0700)
dat/include/dat/dat_iw_extensions.h [new file with mode: 0755]

diff --git a/dat/include/dat/dat_iw_extensions.h b/dat/include/dat/dat_iw_extensions.h
new file mode 100755 (executable)
index 0000000..0067605
--- /dev/null
@@ -0,0 +1,167 @@
+/*\r
+ * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved.\r
+ *\r
+ * This Software is licensed under one of the following licenses:\r
+ * \r
+ * 1) under the terms of the "Common Public License 1.0" a copy of which is\r
+ *    in the file LICENSE.txt in the root directory. The license is also\r
+ *    available from the Open Source Initiative, see \r
+ *    http://www.opensource.org/licenses/cpl.php.\r
+ * \r
+ * 2) under the terms of the "The BSD License" a copy of which is in the file\r
+ *    LICENSE2.txt in the root directory. The license is also available from\r
+ *    the Open Source Initiative, see\r
+ *    http://www.opensource.org/licenses/bsd-license.php.\r
+ * \r
+ * 3) under the terms of the "GNU General Public License (GPL) Version 2" a\r
+ *    copy of which is in the file LICENSE3.txt in the root directory. The\r
+ *    license is also available from the Open Source Initiative, see\r
+ *    http://www.opensource.org/licenses/gpl-license.php.\r
+ * \r
+ * Licensee has the right to choose one of the above licenses.\r
+ * \r
+ * Redistributions of source code must retain the above copyright\r
+ * notice and one of the license notices.\r
+ * \r
+ * Redistributions in binary form must reproduce both the above copyright\r
+ * notice, one of the license notices in the documentation\r
+ * and/or other materials provided with the distribution.\r
+ */\r
+/**********************************************************************\r
+ *\r
+ * HEADER: dat_iw_extensions.h\r
+ *\r
+ * PURPOSE: extensions to the DAT API for iWARP transport specific services \r
+ *         NOTE: \r
+ *             Applications MUST recompile with new dat.h definitions\r
+ *               and include this file.\r
+ *\r
+ * Description: Header file for "uDAPL: User Direct Access Programming\r
+ *             Library, Version: 2.0"\r
+ *\r
+ * Mapping rules:\r
+ *      All global symbols are prepended with "DAT_" or "dat_"\r
+ *      All DAT objects have an 'api' tag which, such as 'ep' or 'lmr'\r
+ *      The method table is in the provider definition structure.\r
+ *\r
+ *\r
+ **********************************************************************/\r
+#ifndef _DAT_IW_EXTENSIONS_H_\r
+#define _DAT_IW_EXTENSIONS_H_\r
+\r
+/* \r
+ * Provider specific attribute strings for extension support \r
+ *     returned with dat_ia_query() and \r
+ *     DAT_PROVIDER_ATTR_MASK == DAT_PROVIDER_FIELD_PROVIDER_SPECIFIC_ATTR\r
+ *\r
+ *     DAT_NAMED_ATTR  name == extended operations and version, \r
+ *                     version_value = version number of extension API\r
+ */\r
+#define DAT_EXTENSION_ATTR              "DAT_EXTENSION_INTERFACE"\r
+#define DAT_EXTENSION_ATTR_VERSION      "DAT_EXTENSION_VERSION"\r
+#define DAT_EXTENSION_ATTR_VERSION_VALUE "2.0.1"\r
+#define DAT_IW_ATTR_SSP                         "DAT_IW_ATTR_SSP"\r
+\r
+\r
+/*\r
+ * The iWARP extension supports Socket Service Points\r
+ * These enable establishing a TCP connection first, then converting\r
+ * it to RDMA usage.\r
+ */\r
+typedef enum dat_handle_iw_ext_type {\r
+       DAT_IW_HANDLE_TYPE_SSP = DAT_HANDLE_TYPE_EXTENSION_BASE,\r
+} DAT_HANDLE_IW_EXT_TYPE;\r
+typedef DAT_HANDLE DAT_IW_SSP_HANDLE;\r
+\r
+typedef enum dat_iw_ssp_state\r
+{\r
+       DAT_IW_SSP_STATE_OPERATIONAL,\r
+       DAT_IW_SSP_STATE_NON_OPERATIONAL\r
+} DAT_IW_SSP_STATE;\r
+\r
+/* The Socket ID is a local identifier for the socket. It is used for Socket\r
+  * based connection model. The format of the DAT_IW_SOCKET follows the native\r
+  * sockets programming practice of each target Operating System. The Consumer must\r
+  * follow normal sockets programming procedures provided by the host platform.\r
+  *\r
+  * This include assumes that a socket handle is an int unless we are in\r
+  * Linux Kernel code, in which case it is a struct socket pointer. This\r
+  * distinction could be moved either to a distinct file (for iWARP specific,\r
+  * platform specific types) or to dat_platform_specific.h (where the fact\r
+  * that it was iWARP specific would be awkward). The coin flip was heads,\r
+  * so the awkwardness of platform specific typing is in the iWARP specific\r
+  * file instead.\r
+ */\r
+#if defined(__linux__)  &&  defined(__KERNEL__)\r
+typyedef struct socket *DAT_IW_SOCKET;\r
+#else\r
+typedef int DAT_IW_SOCKET;\r
+#endif\r
+\r
+typedef struct dat_iw_ssp_param\r
+{\r
+       DAT_IA_HANDLE ia_handle;\r
+       DAT_IW_SOCKET socket_id;\r
+       DAT_EVD_HANDLE evd_handle;\r
+       DAT_EP_HANDLE ep_handle;\r
+       DAT_IW_SSP_STATE ssp_state;\r
+} DAT_IW_SSP_PARAM;\r
+\r
+typedef enum dat_iw_ssp_param_mask\r
+{\r
+       DAT_IW_SSP_FIELD_IA_HANDLE = 0x01,\r
+       DAT_IW_SSP_FIELD_SOCKET_ID = 0x02,\r
+       DAT_IW_SSP_FIELD_EVD_HANDLE = 0x04,\r
+       DAT_IW_SSP_FIELD_EP_HANDLE = 0x08,\r
+       DAT_IW_SSP_FIELD_SSP_STATE = 0x10,\r
+       DAT_IW_SSP_FIELD_ALL = 0x1F\r
+} DAT_IW_SSP_PARAM_MASK;\r
+\r
+\r
+/* \r
+ * Extension operations \r
+ */\r
+typedef enum dat_iw_op\r
+{\r
+       DAT_IW_SSP_CREATE_OP,\r
+       DAT_IW_SSP_FREE_OP,\r
+       DAT_IW_SSP_QUERY_OP,\r
+       DAT_IW_SOCKET_CONNECT_OP\r
+} DAT_IW_OP;\r
+\r
+/* \r
+ * Extended IW transport specific APIs\r
+ *  redirection via DAT extension function\r
+ */\r
+\r
+/* dat_iw_ssp_create creates an iWARP Socket Service Point given an\r
+ * already connected Socket\r
+ */\r
+\r
+#define dat_iw_ssp_create (ia,socket_id,ep_handle,evd_handle,\\r
+                           final_sm_msg,final_sm_msg_len,ssp_handle) \\r
+               dat_extension_op (ia,DAT_IW_SSP_CREATE_OP,ia,socket_id, \\r
+                                       ep_handle,evd_handle,final_sm_msg, \\r
+                                       final_sm_msg_len,ssp_handle)\r
+\r
+/* dat_iw_ssp_free destroys the specified instance of an SSP\r
+ */\r
+#define dat_iw_ssp_free (ssp_handle) \\r
+       dat_extension_op (ssp_handle,DAT_IW_SSP_FREE_OP)\r
+\r
+/* dat_iw_ssq_query obtains the SSP_PARAMs for an ssp\r
+ */\r
+#define dat_iw_ssp_query (ssp_handle,ssp_param_mask,ssp_param) \\r
+       dat_extension_op (ssp_handle,DAT_IW_SSP_QUERY_OP, \\r
+               ssp_param_maks,ssp_param)\r
+\r
+/* dat_iw_socket_connect initates a connection using an SSP\r
+ */\r
+#define dat_iw_socket_connect (ep_handle,socket_id,timeout, \\r
+                                      private_data_size,private_data) \\r
+       dat_extension_op (ep_handle,DAT_IW_SOCKET_CONNECT_OP,\\r
+                             socket_id,timeout,private_data_size,\\r
+                               private_data)\r
+\r
+#endif /* _DAT_IW_EXTENSIONS_H_ */\r
+\r