32 #if !defined( DEBUG_SEM ) 34 #define DEBUG_SEM 0 // eventually change this to '1' 36 #define DEBUG_SEM 0 // always leave this '0' 44 void snprintf_pddev(
char *s,
size_t max_len,
const PCPS_DDEV *pddev )
61 const char *fnc_name,
const PCPS_DDEV *pddev )
65 snprintf_pddev( ws,
sizeof( ws ), pddev );
68 fnc_name, sem_name, ws );
78 const char *fnc_name,
const PCPS_DDEV *pddev )
83 snprintf_pddev( ws,
sizeof( ws ), pddev );
86 fnc_name, sem_name, ws );
88 retval = down_interruptible( ps );
92 fnc_name, sem_name, ws );
95 fnc_name, sem_name, ws );
104 void _up_pddev(
struct semaphore *ps,
const char *sem_name,
105 const char *fnc_name,
const PCPS_DDEV *pddev )
109 snprintf_pddev( ws,
sizeof( ws ), pddev );
112 fnc_name, sem_name, ws );
121 void _down(
struct semaphore *ps,
const char *sem_name,
122 const char *fnc_name,
void *p_id_struc )
125 p_id_struc, fnc_name, sem_name );
130 p_id_struc, fnc_name, sem_name );
137 const char *fnc_name,
void *p_id_struc )
142 p_id_struc, fnc_name, sem_name );
144 retval = down_interruptible( ps );
148 p_id_struc, fnc_name, sem_name );
151 p_id_struc, fnc_name, sem_name );
160 int _down_trylock(
struct semaphore *ps,
const char *sem_name,
161 const char *fnc_name,
void *p_id_struc )
166 p_id_struc, fnc_name, sem_name );
168 retval = down_trylock( ps );
172 p_id_struc, fnc_name, sem_name );
175 p_id_struc, fnc_name, sem_name );
184 void _up(
struct semaphore *ps,
const char *sem_name,
185 const char *fnc_name,
void *p_id_struc )
188 p_id_struc, fnc_name, sem_name );
196 #define _sema_init_pddev( _s, _n, _sn, _fn, _fp ) sema_init( _s, _n ) 197 #define _down_interruptible_pddev( _s, _sn, _fn, _fp ) down_interruptible( _s ) 198 #define _up_pddev( _s, _sn, _fn, _fp ) up( _s ) 199 #define _down( _s, _sn, _fn, _fp ) down( _s ) 200 #define _down_interruptible( _s, _sn, _fn, _fp ) down_interruptible( _s ) 201 #define _down_trylock( _s, _sn, _fn, _fp ) down_trylock( _s ) 202 #define _up( _s, _sn, _fn, _fp ) up( _s ) 236 ret_val = -ERESTARTSYS;
240 pddev = *( (
PCPS_DDEV **) filp->private_data );
246 goto out_up_sem_fops;
254 goto out_up_sem_fops;
#define _pcps_ddev_sernum(_p)
#define _up(_s, _sn, _fn, _fp)
int mbg_kdd_snprintf(char *buf, size_t size, const char *fmt,...)
#define _mbgddmsg_3(_f, _lvl, _fmt, _p1, _p2, _p3)
#define _down_interruptible_pddev(_s, _sn, _fn, _fp)
#define _sema_init_pddev(_s, _n, _sn, _fn, _fp)
#define MBG_DEV_NAME_FMT
A string format specifier for MBG_DEV_NAME.
static __mbg_inline int mbgdrvr_get_pddev(PCPS_DDEV **ppddev, struct file *filp, const char *info)
#define _up_pddev(_s, _sn, _fn, _fp)
static __mbg_inline void set_dev_connected(PCPS_DDEV *pddev, int state)
static __mbg_inline int get_dev_connected(PCPS_DDEV *pddev)
#define _mbgddmsg_4(_f, _lvl, _fmt, _p1, _p2, _p3, _p4)
#define _down_trylock(_s, _sn, _fn, _fp)
#define _mbgddmsg_2(_f, _lvl, _fmt, _p1, _p2)
atomic_t connected
Flag indicating if the device is "connected".
#define _pcps_ddev_type_name(_p)
#define _down_interruptible(_s, _sn, _fn, _fp)
#define _down(_s, _sn, _fn, _fp)
static struct semaphore sem_fops