00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RTDM_DEVICE_H
00021 #define _RTDM_DEVICE_H
00022
00023 #include <linux/sem.h>
00024
00025 #include <nucleus/pod.h>
00026 #include <rtdm/rtdm_driver.h>
00027
00028
00029 #define DEF_DEVNAME_HASHTAB_SIZE 256
00030 #define DEF_PROTO_HASHTAB_SIZE 256
00031
00032
00033 extern struct semaphore nrt_dev_lock;
00034 extern xnlock_t rt_dev_lock;
00035
00036 extern unsigned int devname_hashtab_size;
00037 extern unsigned int protocol_hashtab_size;
00038
00039 extern struct list_head *rtdm_named_devices;
00040 extern struct list_head *rtdm_protocol_devices;
00041
00042
00043 struct rtdm_device *get_named_device(const char *name);
00044 struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
00045
00046 static inline void rtdm_dereference_device(struct rtdm_device *device)
00047 {
00048 atomic_dec(&device->reserved.refcount);
00049 }
00050
00051 int __init rtdm_dev_init(void);
00052
00053 static inline void rtdm_dev_cleanup(void)
00054 {
00055 kfree(rtdm_named_devices);
00056 kfree(rtdm_protocol_devices);
00057 }
00058
00059 #endif