#include <linux/module.h>
#include <linux/comedi/comedidev.h>
#include <asm/div64.h>
#include <linux/timer.h>
#include <linux/ktime.h>
#include <linux/jiffies.h>
#include <linux/device.h>
#include <linux/kdev_t.h>
#define N_CHANS …
#define DEV_NAME …
#define CLASS_NAME …
static bool config_mode;
static unsigned int set_amplitude;
static unsigned int set_period;
static const struct class ctcls = …;
static struct device *ctdev;
module_param_named(noauto, config_mode, bool, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(amplitude, set_amplitude, uint, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(period, set_period, uint, 0444);
MODULE_PARM_DESC(…) …;
struct waveform_private { … };
static const struct comedi_lrange waveform_ai_ranges = …;
static unsigned short fake_sawtooth(struct comedi_device *dev,
unsigned int range_index,
unsigned int current_time)
{ … }
static unsigned short fake_squarewave(struct comedi_device *dev,
unsigned int range_index,
unsigned int current_time)
{ … }
static unsigned short fake_flatline(struct comedi_device *dev,
unsigned int range_index,
unsigned int current_time)
{ … }
static unsigned short fake_waveform(struct comedi_device *dev,
unsigned int channel, unsigned int range,
unsigned int current_time)
{ … }
static void waveform_ai_timer(struct timer_list *t)
{ … }
static int waveform_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static int waveform_ai_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int waveform_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int waveform_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{ … }
static void waveform_ao_timer(struct timer_list *t)
{ … }
static int waveform_ao_inttrig_start(struct comedi_device *dev,
struct comedi_subdevice *s,
unsigned int trig_num)
{ … }
static int waveform_ao_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static int waveform_ao_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int waveform_ao_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int waveform_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{ … }
static int waveform_ai_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int waveform_ao_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int waveform_common_attach(struct comedi_device *dev,
int amplitude, int period)
{ … }
static int waveform_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{ … }
static int waveform_auto_attach(struct comedi_device *dev,
unsigned long context_unused)
{ … }
static void waveform_detach(struct comedi_device *dev)
{ … }
static struct comedi_driver waveform_driver = …;
static int __init comedi_test_init(void)
{ … }
module_init(…) …;
static void __exit comedi_test_exit(void)
{ … }
module_exit(comedi_test_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;