[ewg] [PATCH 7/9] [RFC] Add Xsigo core services module support
Hal Rosenstock
hrosenstock at xsigo.com
Fri Apr 4 06:21:08 PDT 2008
Add Xsigo core services module support
Signed-off-by: Hal Rosenstock <hal at xsigo.com>
---
drivers/infiniband/ulp/xsigo/xscore/xs_core.c | 100 +++++++++++++++++++++++++
drivers/infiniband/ulp/xsigo/xscore/xs_core.h | 42 ++++++++++
2 files changed, 142 insertions(+), 0 deletions(-)
create mode 100644 drivers/infiniband/ulp/xsigo/xscore/xs_core.c
create mode 100644 drivers/infiniband/ulp/xsigo/xscore/xs_core.h
diff --git a/drivers/infiniband/ulp/xsigo/xscore/xs_core.c b/drivers/infiniband/ulp/xsigo/xscore/xs_core.c
new file mode 100644
index 0000000..d79a245
--- /dev/null
+++ b/drivers/infiniband/ulp/xsigo/xscore/xs_core.c
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2007,2008 Xsigo Systems Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/version.h>
+#include <linux/init.h>
+#include <linux/device.h>
+
+#include "xs_core.h"
+
+#define XSCORE_VERSION "0.31"
+
+MODULE_AUTHOR("Xsigo Systems Inc. (linux-drivers at xsigo.com)");
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_DESCRIPTION("Xsigo core");
+MODULE_VERSION(XSCORE_VERSION);
+
+#define PFX "xscore: "
+
+struct completion xscore_class_released;
+
+static void xscore_release_class_dev(struct class_device *class_dev)
+{
+ complete(&xscore_class_released);
+}
+
+struct class xscore_class = {
+ .name = "xscore",
+ .release = xscore_release_class_dev
+};
+
+struct class_device xscore_class_dev;
+
+static int __init xscore_init(void)
+{
+ int ret = 0;
+
+ init_completion(&xscore_class_released);
+ ret = class_register(&xscore_class);
+ if (ret)
+ goto done;
+
+ ret = xsigoib_init();
+ if (ret)
+ goto fail1;
+
+ ret = xcpm_init();
+ if (!ret)
+ goto done;
+
+ xsigoib_exit();
+fail1:
+ class_unregister(&xscore_class);
+ wait_for_completion(&xscore_class_released);
+done:
+ return ret;
+}
+
+static void __exit xscore_exit(void)
+{
+ xcpm_exit();
+ xsigoib_exit();
+ class_unregister(&xscore_class);
+ wait_for_completion(&xscore_class_released);
+}
+
+module_init(xscore_init);
+module_exit(xscore_exit);
diff --git a/drivers/infiniband/ulp/xsigo/xscore/xs_core.h b/drivers/infiniband/ulp/xsigo/xscore/xs_core.h
new file mode 100644
index 0000000..5fa6dd7
--- /dev/null
+++ b/drivers/infiniband/ulp/xsigo/xscore/xs_core.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2007,2008 Xsigo Systems Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef __XSCORE_H__
+#define __XSCORE_H__
+
+int xsigoib_init(void);
+int xcpm_init(void);
+void xsigoib_exit(void);
+void xcpm_exit(void);
+
+#endif /* __XSCORE_H__ */
--
1.5.2
More information about the ewg
mailing list