ksrc/skins/rtdm/device.h

00001 /*
00002  * Copyright (C) 2005 Jan Kiszka <jan.kiszka@web.de>.
00003  * Copyright (C) 2005 Joerg Langenberg <joerg.langenberg@gmx.net>.
00004  *
00005  * Xenomai is free software; you can redistribute it and/or modify it
00006  * under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * Xenomai is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with Xenomai; if not, write to the Free Software Foundation,
00017  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifndef _RTDM_DEVICE_H
00021 #define _RTDM_DEVICE_H
00022 
00023 #include <nucleus/pod.h>
00024 #include <rtdm/rtdm_driver.h>
00025 #include <linux/sem.h>
00026 
00027 
00028 #define DEF_DEVNAME_HASHTAB_SIZE    256 /* entries in name hash table */
00029 #define DEF_PROTO_HASHTAB_SIZE      256 /* entries in protocol hash table */
00030 
00031 
00032 extern struct semaphore nrt_dev_lock;
00033 extern xnlock_t         rt_dev_lock;
00034 
00035 extern unsigned int     devname_hashtab_size;
00036 extern unsigned int     protocol_hashtab_size;
00037 
00038 extern struct list_head *rtdm_named_devices;
00039 extern struct list_head *rtdm_protocol_devices;
00040 
00041 #ifdef MODULE
00042 #define rtdm_initialised 1
00043 #else /* !MODULE */
00044 extern int              rtdm_initialised;
00045 #endif /* MODULE */
00046 
00047 
00048 int rtdm_no_support(void);
00049 
00050 struct rtdm_device *get_named_device(const char *name);
00051 struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
00052 
00053 static inline void rtdm_dereference_device(struct rtdm_device *device)
00054 {
00055     atomic_dec(&device->reserved.refcount);
00056 }
00057 
00058 int __init rtdm_dev_init(void);
00059 
00060 static inline void rtdm_dev_cleanup(void)
00061 {
00062     kfree(rtdm_named_devices);
00063     kfree(rtdm_protocol_devices);
00064 }
00065 
00066 #endif /* _RTDM_DEVICE_H */

Generated on Mon Dec 25 13:57:10 2006 for Xenomai API by  doxygen 1.4.6