Added support for RHEL6.5
[compat-rdma/compat.git] / compat / main.c
1 #include <linux/module.h>
2 #include "compat-2.6.34.h"
3
4 MODULE_AUTHOR("Luis R. Rodriguez");
5 MODULE_DESCRIPTION("Kernel backport module");
6 MODULE_LICENSE("GPL");
7
8 #ifndef COMPAT_BASE
9 #error "You need a COMPAT_BASE"
10 #endif
11
12 #ifndef COMPAT_BASE_TREE
13 #error "You need a COMPAT_BASE_TREE"
14 #endif
15
16 #ifndef COMPAT_BASE_TREE_VERSION
17 #error "You need a COMPAT_BASE_TREE_VERSION"
18 #endif
19
20 #ifndef COMPAT_VERSION
21 #error "You need a COMPAT_VERSION"
22 #endif
23
24 static char *compat_base = COMPAT_BASE;
25 static char *compat_base_tree = COMPAT_BASE_TREE;
26 static char *compat_base_tree_version = COMPAT_BASE_TREE_VERSION;
27 static char *compat_version = COMPAT_VERSION;
28
29 module_param(compat_base, charp, 0400);
30 MODULE_PARM_DESC(compat_base_tree,
31                  "The upstream verion of compat.git used");
32
33 module_param(compat_base_tree, charp, 0400);
34 MODULE_PARM_DESC(compat_base_tree,
35                  "The upstream tree used as base for this backport");
36
37 module_param(compat_base_tree_version, charp, 0400);
38 MODULE_PARM_DESC(compat_base_tree_version,
39                  "The git-describe of the upstream base tree");
40
41 module_param(compat_version, charp, 0400);
42 MODULE_PARM_DESC(compat_version,
43                  "Version of the kernel compat backport work");
44
45 void backport_dependency_symbol(void)
46 {
47 }
48 EXPORT_SYMBOL_GPL(backport_dependency_symbol);
49
50
51 static int __init backport_init(void)
52 {
53         int err;
54
55         backport_pm_qos_power_init();
56         err = backport_system_workqueue_create();
57         if (err) {
58                 pr_warn("backport_system_workqueue_create() failed\n");
59                 return err;
60         }
61         backport_init_mmc_pm_flags();
62
63         printk(KERN_INFO
64                COMPAT_PROJECT " backport release: "
65                COMPAT_VERSION
66                "\n");
67         printk(KERN_INFO "Backport based on "
68                COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
69                "\n");
70         printk(KERN_INFO "compat.git: "
71                COMPAT_BASE_TREE "\n");
72
73         return 0;
74 }
75 module_init(backport_init);
76
77 static void __exit backport_exit(void)
78 {
79         backport_pm_qos_power_deinit();
80         backport_system_workqueue_destroy();
81
82         return;
83 }
84 module_exit(backport_exit);
85