00001
00002
00003
00004
00005
00006
00007 #ifndef _NMF_SLOT
00008 #define _NMF_SLOT
00009 #include <pthread.h>
00010 #include <nmf/nmf_dev.h>
00011
00012 #ifdef __cplusplus
00013 NM_CDECL_BEGIN
00014 #endif
00015
00028 struct nmf_slot {
00029 int slot_id;
00030 int dev_slot_id;
00031 pthread_mutex_t lock;
00032 int ref;
00033 struct nmf_dev *dev;
00034
00035 };
00036
00040 #define NMF_MAX_SLOTS 256
00041
00042 struct nmf_slot *nmf_slot_alloc(int, struct nmf_dev *);
00043 void nmf_slot_remove(struct nmf_slot *);
00044 struct nmf_slot *nmf_slot_get(int slot_id);
00045 void nmf_slot_put(struct nmf_slot *);
00046 int nmf_slot_max();
00047 nmf_status_t nmf_slot_max_set(int mx);
00048 void nmf_slot_for_each(void (*cb)(struct nmf_slot *, void *), void *context);
00049
00050 #ifdef __cplusplus
00051 NM_CDECL_END
00052 #endif
00053
00054 #endif