00001 #ifndef __QOS_KERNEL_DEP_H__
00002 #define __QOS_KERNEL_DEP_H__
00003
00004 #if ! (defined(QOS_KS) && defined(__KERNEL__))
00005 # error "Cannot include qos_kernel_dep.h in user-space"
00006 #endif
00007
00016
00017 #include <linux/kernel.h>
00018 #include <linux/version.h>
00019 #include <linux/types.h>
00020 #include <linux/kdev_t.h>
00021 #include <linux/fs.h>
00022
00023 #include <linux/aquosa/qos_debug.h>
00024
00025 #if LINUX_VERSION_CODE<KERNEL_VERSION(2,6,0)
00026
00027
00028
00030 # define KERN_INCREMENT MOD_INC_USE_COUNT
00031
00032 # define KERN_DECREMENT MOD_DEC_USE_COUNT
00033
00034 # define __user
00035
00036 #else
00037
00038
00039
00040 #include <linux/cdev.h>
00041 #include <linux/kobject.h>
00042
00044 # define KERN_INCREMENT try_module_get(THIS_MODULE)
00045
00046 # define KERN_DECREMENT module_put(THIS_MODULE)
00047
00048 #endif
00049
00051 typedef struct {
00052 dev_t dev_num;
00053 char *dev_name;
00054 #if LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,0)
00055 struct cdev cdev;
00056 #endif
00057 } qos_dev_info_t;
00058
00060 qos_rv qos_dev_register(
00061 qos_dev_info_t *dev_info,
00062 char *dev_name, int def_major,
00063 struct file_operations *Fops
00064 );
00065
00067 qos_rv qos_dev_unregister(qos_dev_info_t *dev_info);
00068
00069 #endif