file: slh.h
#include <linux/ioctl.h>
/*
* Macros to help debugging
*/
#undef PDEBUG /* undef it, just in case */
#ifdef SLH_DEBUG
/* This one if debugging is on, and kernel space */
# define SLHDEBUG(fmt, args...) printk( KERN_CRIT "SLH: " fmt, ## args)
# else
/* This one for user space */
# define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
# endif
#else
# define SLHDEBUG(fmt, args...) /* not debugging: nothing */
# define PDEBUG(fmt, args...) /* not debugging: nothing */
#endif
#undef PDEBUGG
#define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */
#define SLH_MAJOR 0 /* dynamic major by default */
/*
* Ioctl definitions
*/
#define SLH_IOC_MAGIC 'K'
#define SLH_IOCRESET _IO(SLH_IOC_MAGIC, 0)
#define SLH_IOCPUMP _IO(SLH_IOC_MAGIC, 1)
#define SLH_IOCPARAMS _IO(SLH_IOC_MAGIC, 2)
#define SLH_IOCREAD _IO(SLH_IOC_MAGIC, 3)
#define SLH_IOCSET _IO(SLH_IOC_MAGIC, 4)
#define NUM_DMX_CHANS 512
typedef struct {
unsigned long channel; /* DMX-512 channel */
unsigned long new_value; /* new channel value */
unsigned long transition; /* transition time to new value */
} CHAN_VALUE;
typedef struct {
unsigned long num_chan;
CHAN_VALUE chan_value[NUM_DMX_CHANS];
} DMX_CHANNELS;
#define CHAN_STRUCT_SZ( num ) \
( sizeof(DMX_CHANNELS) - (NUM_DMX_CHANS-(num))*sizeof(CHAN_VALUE) )
/* board.c */
extern int slh_board_mod_init();
extern void slh_board_mod_cleanup();
extern int slh_board_find();
extern int slh_board_pump( unsigned char *, unsigned long );
extern int slh_board_pump_parms();
extern int slh_board_start();
extern int slh_board_stop();
extern void slh_board_chan_set( unsigned long, unsigned long );
/* channel.c */
extern int slh_channel_mod_init();
extern void slh_channel_mod_cleanup();
extern void slh_channel_dim( unsigned long, unsigned long, unsigned long );
extern void slh_channel_timeout( unsigned long );
extern void slh_channel_timer_start();
extern void slh_channel_timer_stop();
extern int slh_channel_load();
extern void slh_channel_read( unsigned char * );
#endif
C++ to HTML Conversion by ctoohtml