static struct comedi_device_file_info
*comedi_file_info_table[COMEDI_NUM_MINORS];
-static int do_devconfig_ioctl(comedi_device *dev, comedi_devconfig *arg);
-static int do_bufconfig_ioctl(comedi_device *dev, void *arg);
-static int do_devinfo_ioctl(comedi_device *dev, comedi_devinfo *arg,
+static int do_devconfig_ioctl(struct comedi_device *dev, comedi_devconfig *arg);
+static int do_bufconfig_ioctl(struct comedi_device *dev, void *arg);
+static int do_devinfo_ioctl(struct comedi_device *dev, comedi_devinfo *arg,
struct file *file);
-static int do_subdinfo_ioctl(comedi_device *dev, comedi_subdinfo *arg,
+static int do_subdinfo_ioctl(struct comedi_device *dev, comedi_subdinfo *arg,
void *file);
-static int do_chaninfo_ioctl(comedi_device *dev, comedi_chaninfo *arg);
-static int do_bufinfo_ioctl(comedi_device *dev, void *arg);
-static int do_cmd_ioctl(comedi_device *dev, void *arg, void *file);
-static int do_lock_ioctl(comedi_device *dev, unsigned int arg, void *file);
-static int do_unlock_ioctl(comedi_device *dev, unsigned int arg, void *file);
-static int do_cancel_ioctl(comedi_device *dev, unsigned int arg, void *file);
-static int do_cmdtest_ioctl(comedi_device *dev, void *arg, void *file);
-static int do_insnlist_ioctl(comedi_device *dev, void *arg, void *file);
-static int do_insn_ioctl(comedi_device *dev, void *arg, void *file);
-static int do_poll_ioctl(comedi_device *dev, unsigned int subd, void *file);
-
-extern void do_become_nonbusy(comedi_device *dev, comedi_subdevice *s);
-static int do_cancel(comedi_device *dev, comedi_subdevice *s);
+static int do_chaninfo_ioctl(struct comedi_device *dev, comedi_chaninfo *arg);
+static int do_bufinfo_ioctl(struct comedi_device *dev, void *arg);
+static int do_cmd_ioctl(struct comedi_device *dev, void *arg, void *file);
+static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, void *file);
+static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, void *file);
+static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, void *file);
+static int do_cmdtest_ioctl(struct comedi_device *dev, void *arg, void *file);
+static int do_insnlist_ioctl(struct comedi_device *dev, void *arg, void *file);
+static int do_insn_ioctl(struct comedi_device *dev, void *arg, void *file);
+static int do_poll_ioctl(struct comedi_device *dev, unsigned int subd, void *file);
+
+extern void do_become_nonbusy(struct comedi_device *dev, comedi_subdevice *s);
+static int do_cancel(struct comedi_device *dev, comedi_subdevice *s);
static int comedi_fasync(int fd, struct file *file, int on);
-static int is_device_busy(comedi_device *dev);
+static int is_device_busy(struct comedi_device *dev);
#ifdef HAVE_UNLOCKED_IOCTL
static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev;
+ struct comedi_device *dev;
int rc;
if (dev_file_info == NULL || dev_file_info->device == NULL)
writes:
none
*/
-static int do_devconfig_ioctl(comedi_device *dev, comedi_devconfig *arg)
+static int do_devconfig_ioctl(struct comedi_device *dev, comedi_devconfig *arg)
{
comedi_devconfig it;
int ret;
modified bufconfig at arg
*/
-static int do_bufconfig_ioctl(comedi_device *dev, void *arg)
+static int do_bufconfig_ioctl(struct comedi_device *dev, void *arg)
{
comedi_bufconfig bc;
comedi_async *async;
devinfo structure
*/
-static int do_devinfo_ioctl(comedi_device *dev, comedi_devinfo *arg,
+static int do_devinfo_ioctl(struct comedi_device *dev, comedi_devinfo *arg,
struct file *file)
{
comedi_devinfo devinfo;
array of subdevice info structures at arg
*/
-static int do_subdinfo_ioctl(comedi_device *dev, comedi_subdinfo *arg,
+static int do_subdinfo_ioctl(struct comedi_device *dev, comedi_subdinfo *arg,
void *file)
{
int ret, i;
arrays at elements of chaninfo structure
*/
-static int do_chaninfo_ioctl(comedi_device *dev, comedi_chaninfo *arg)
+static int do_chaninfo_ioctl(struct comedi_device *dev, comedi_chaninfo *arg)
{
comedi_subdevice *s;
comedi_chaninfo it;
modified bufinfo at arg
*/
-static int do_bufinfo_ioctl(comedi_device *dev, void *arg)
+static int do_bufinfo_ioctl(struct comedi_device *dev, void *arg)
{
comedi_bufinfo bi;
comedi_subdevice *s;
return 0;
}
-static int parse_insn(comedi_device *dev, comedi_insn *insn, unsigned int *data,
+static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int *data,
void *file);
/*
* COMEDI_INSNLIST
*/
/* arbitrary limits */
#define MAX_SAMPLES 256
-static int do_insnlist_ioctl(comedi_device *dev, void *arg, void *file)
+static int do_insnlist_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_insnlist insnlist;
comedi_insn *insns = NULL;
return -EINVAL;
}
-static int parse_insn(comedi_device *dev, comedi_insn *insn, unsigned int *data,
+static int parse_insn(struct comedi_device *dev, comedi_insn *insn, unsigned int *data,
void *file)
{
comedi_subdevice *s;
* writes:
* data (for reads)
*/
-static int do_insn_ioctl(comedi_device *dev, void *arg, void *file)
+static int do_insn_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_insn insn;
unsigned int *data = NULL;
modified cmd structure at arg
*/
-static int do_cmd_ioctl(comedi_device *dev, void *arg, void *file)
+static int do_cmd_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_cmd user_cmd;
comedi_subdevice *s;
modified cmd structure at arg
*/
-static int do_cmdtest_ioctl(comedi_device *dev, void *arg, void *file)
+static int do_cmdtest_ioctl(struct comedi_device *dev, void *arg, void *file)
{
comedi_cmd user_cmd;
comedi_subdevice *s;
*/
-static int do_lock_ioctl(comedi_device *dev, unsigned int arg, void *file)
+static int do_lock_ioctl(struct comedi_device *dev, unsigned int arg, void *file)
{
int ret = 0;
unsigned long flags;
This function isn't protected by the semaphore, since
we already own the lock.
*/
-static int do_unlock_ioctl(comedi_device *dev, unsigned int arg, void *file)
+static int do_unlock_ioctl(struct comedi_device *dev, unsigned int arg, void *file)
{
comedi_subdevice *s;
nothing
*/
-static int do_cancel_ioctl(comedi_device *dev, unsigned int arg, void *file)
+static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg, void *file)
{
comedi_subdevice *s;
nothing
*/
-static int do_poll_ioctl(comedi_device *dev, unsigned int arg, void *file)
+static int do_poll_ioctl(struct comedi_device *dev, unsigned int arg, void *file)
{
comedi_subdevice *s;
return -EINVAL;
}
-static int do_cancel(comedi_device *dev, comedi_subdevice *s)
+static int do_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
int ret = 0;
void comedi_unmap(struct vm_area_struct *area)
{
comedi_async *async;
- comedi_device *dev;
+ struct comedi_device *dev;
async = area->vm_private_data;
dev = async->subdevice->device;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
comedi_async *async = NULL;
unsigned long start = vma->vm_start;
unsigned long size;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
comedi_subdevice *read_subdev;
comedi_subdevice *write_subdev;
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
if (!dev->attached) {
DPRINTK("no driver configured on comedi%i\n", dev->minor);
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
if (!dev->attached) {
DPRINTK("no driver configured on comedi%i\n", dev->minor);
/*
This function restores a subdevice to an idle state.
*/
-void do_become_nonbusy(comedi_device *dev, comedi_subdevice *s)
+void do_become_nonbusy(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_async *async = s->async;
const unsigned minor = iminor(inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info ? dev_file_info->device : NULL;
+ struct comedi_device *dev = dev_file_info ? dev_file_info->device : NULL;
if (dev == NULL) {
DPRINTK("invalid minor number\n");
const unsigned minor = iminor(inode);
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
comedi_subdevice *s = NULL;
int i;
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
- comedi_device *dev = dev_file_info->device;
+ struct comedi_device *dev = dev_file_info->device;
return fasync_helper(fd, file, on, &dev->async_queue);
}
module_init(comedi_init);
module_exit(comedi_cleanup);
-void comedi_error(const comedi_device *dev, const char *s)
+void comedi_error(const struct comedi_device *dev, const char *s)
{
rt_printk("comedi%d: %s: %s\n", dev->minor, dev->driver->driver_name,
s);
}
-void comedi_event(comedi_device *dev, comedi_subdevice *s)
+void comedi_event(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_async *async = s->async;
unsigned runflags = 0;
return runflags;
}
-static int is_device_busy(comedi_device *dev)
+static int is_device_busy(struct comedi_device *dev)
{
comedi_subdevice *s;
int i;
return 0;
}
-void comedi_device_init(comedi_device *dev)
+void comedi_device_init(struct comedi_device *dev)
{
- memset(dev, 0, sizeof(comedi_device));
+ memset(dev, 0, sizeof(struct comedi_device));
spin_lock_init(&dev->spinlock);
mutex_init(&dev->mutex);
dev->minor = -1;
}
-void comedi_device_cleanup(comedi_device *dev)
+void comedi_device_cleanup(struct comedi_device *dev)
{
if (dev == NULL)
return;
info = kzalloc(sizeof(struct comedi_device_file_info), GFP_KERNEL);
if (info == NULL)
return -ENOMEM;
- info->device = kzalloc(sizeof(comedi_device), GFP_KERNEL);
+ info->device = kzalloc(sizeof(struct comedi_device), GFP_KERNEL);
if (info->device == NULL) {
kfree(info);
return -ENOMEM;
comedi_spin_unlock_irqrestore(&comedi_file_info_table_lock, flags);
if (info) {
- comedi_device *dev = info->device;
+ struct comedi_device *dev = info->device;
if (dev) {
if (dev->class_dev) {
device_destroy(comedi_class,
}
}
-int comedi_alloc_subdevice_minor(comedi_device *dev, comedi_subdevice *s)
+int comedi_alloc_subdevice_minor(struct comedi_device *dev, comedi_subdevice *s)
{
unsigned long flags;
struct comedi_device_file_info *info;
int comedi_request_irq(unsigned int irq, irqreturn_t(*handler) (int,
void *PT_REGS_ARG), unsigned long flags, const char *device,
- comedi_device *dev_id);
-void comedi_free_irq(unsigned int irq, comedi_device *dev_id);
+ struct comedi_device *dev_id);
+void comedi_free_irq(unsigned int irq, struct comedi_device *dev_id);
void comedi_rt_init(void);
void comedi_rt_cleanup(void);
-int comedi_switch_to_rt(comedi_device *dev);
-void comedi_switch_to_non_rt(comedi_device *dev);
+int comedi_switch_to_rt(struct comedi_device *dev);
+void comedi_switch_to_non_rt(struct comedi_device *dev);
void comedi_rt_pend_wakeup(wait_queue_head_t *q);
extern int rt_pend_call(void (*func) (int arg1, void *arg2), int arg1,
void *arg2);
#define COMEDI_NUM_BOARD_MINORS 0x30
#define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS
-typedef struct comedi_device_struct comedi_device;
typedef struct comedi_subdevice_struct comedi_subdevice;
typedef struct comedi_async_struct comedi_async;
typedef struct comedi_driver_struct comedi_driver;
device_create(cs, ((parent) ? (parent) : (device)), devt, drvdata, fmt)
struct comedi_subdevice_struct {
- comedi_device *device;
+ struct comedi_device *device;
int type;
int n_chan;
volatile int subdev_flags;
unsigned int *chanlist; /* driver-owned chanlist (not used) */
- int (*insn_read) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*insn_read) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*insn_write) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*insn_write) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*insn_bits) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*insn_bits) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*insn_config) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*insn_config) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*do_cmd) (comedi_device *, comedi_subdevice *);
- int (*do_cmdtest) (comedi_device *, comedi_subdevice *, comedi_cmd *);
- int (*poll) (comedi_device *, comedi_subdevice *);
- int (*cancel) (comedi_device *, comedi_subdevice *);
- /* int (*do_lock)(comedi_device *,comedi_subdevice *); */
- /* int (*do_unlock)(comedi_device *,comedi_subdevice *); */
+ int (*do_cmd) (struct comedi_device *, comedi_subdevice *);
+ int (*do_cmdtest) (struct comedi_device *, comedi_subdevice *, comedi_cmd *);
+ int (*poll) (struct comedi_device *, comedi_subdevice *);
+ int (*cancel) (struct comedi_device *, comedi_subdevice *);
+ /* int (*do_lock)(struct comedi_device *,comedi_subdevice *); */
+ /* int (*do_unlock)(struct comedi_device *,comedi_subdevice *); */
/* called when the buffer changes */
- int (*buf_change) (comedi_device *dev, comedi_subdevice *s,
+ int (*buf_change) (struct comedi_device *dev, comedi_subdevice *s,
unsigned long new_size);
- void (*munge) (comedi_device *dev, comedi_subdevice *s, void *data,
+ void (*munge) (struct comedi_device *dev, comedi_subdevice *s, void *data,
unsigned int num_bytes, unsigned int start_chan_index);
enum dma_data_direction async_dma_dir;
int (*cb_func) (unsigned int flags, void *);
void *cb_arg;
- int (*inttrig) (comedi_device *dev, comedi_subdevice *s,
+ int (*inttrig) (struct comedi_device *dev, comedi_subdevice *s,
unsigned int x);
};
const char *driver_name;
struct module *module;
- int (*attach) (comedi_device *, comedi_devconfig *);
- int (*detach) (comedi_device *);
+ int (*attach) (struct comedi_device *, comedi_devconfig *);
+ int (*detach) (struct comedi_device *);
/* number of elements in board_name and board_id arrays */
unsigned int num_names;
int offset;
};
-struct comedi_device_struct {
+struct comedi_device {
int use_count;
comedi_driver *driver;
void *private;
struct fasync_struct *async_queue;
- void (*open) (comedi_device *dev);
- void (*close) (comedi_device *dev);
+ void (*open) (struct comedi_device *dev);
+ void (*close) (struct comedi_device *dev);
};
struct comedi_device_file_info {
- comedi_device *device;
+ struct comedi_device *device;
comedi_subdevice *read_subdevice;
comedi_subdevice *write_subdevice;
};
* function prototypes
*/
-void comedi_event(comedi_device *dev, comedi_subdevice *s);
-void comedi_error(const comedi_device *dev, const char *s);
+void comedi_event(struct comedi_device *dev, comedi_subdevice *s);
+void comedi_error(const struct comedi_device *dev, const char *s);
/* we can expand the number of bits used to encode devices/subdevices into
the minor number soon, after more distros support > 8 bit minor numbers
return info->device->write_subdev;
}
-void comedi_device_detach(comedi_device *dev);
-int comedi_device_attach(comedi_device *dev, comedi_devconfig *it);
+void comedi_device_detach(struct comedi_device *dev);
+int comedi_device_attach(struct comedi_device *dev, comedi_devconfig *it);
int comedi_driver_register(comedi_driver *);
int comedi_driver_unregister(comedi_driver *);
void init_polling(void);
void cleanup_polling(void);
-void start_polling(comedi_device *);
-void stop_polling(comedi_device *);
+void start_polling(struct comedi_device *);
+void stop_polling(struct comedi_device *);
-int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s, unsigned long
+int comedi_buf_alloc(struct comedi_device *dev, comedi_subdevice *s, unsigned long
new_size);
#ifdef CONFIG_PROC_FS
various internal comedi functions
*/
-int do_rangeinfo_ioctl(comedi_device *dev, comedi_rangeinfo *arg);
+int do_rangeinfo_ioctl(struct comedi_device *dev, comedi_rangeinfo *arg);
int check_chanlist(comedi_subdevice *s, int n, unsigned int *chanlist);
void comedi_set_subdevice_runflags(comedi_subdevice *s, unsigned mask,
unsigned bits);
unsigned comedi_get_subdevice_runflags(comedi_subdevice *s);
-int insn_inval(comedi_device *dev, comedi_subdevice *s,
+int insn_inval(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/* range stuff */
/* some silly little inline functions */
-static inline int alloc_subdevices(comedi_device *dev,
+static inline int alloc_subdevices(struct comedi_device *dev,
unsigned int num_subdevices)
{
unsigned i;
return 0;
}
-static inline int alloc_private(comedi_device *dev, int size)
+static inline int alloc_private(struct comedi_device *dev, int size)
{
dev->private = kzalloc(size, GFP_KERNEL);
if (!dev->private)
/* must be used in attach to set dev->hw_dev if you wish to dma directly
into comedi's buffer */
-static inline void comedi_set_hw_dev(comedi_device *dev, struct device *hw_dev)
+static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev)
{
if (dev->hw_dev)
put_device(dev->hw_dev);
int comedi_alloc_board_minor(struct device *hardware_device);
void comedi_free_board_minor(unsigned minor);
-int comedi_alloc_subdevice_minor(comedi_device *dev, comedi_subdevice *s);
+int comedi_alloc_subdevice_minor(struct comedi_device *dev, comedi_subdevice *s);
void comedi_free_subdevice_minor(comedi_subdevice *s);
int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name);
void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
#include <asm/io.h>
#include <asm/system.h>
-static int postconfig(comedi_device *dev);
-static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
+static int postconfig(struct comedi_device *dev);
+static int insn_rw_emulate_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
static void *comedi_recognize(comedi_driver * driv, const char *name);
static void comedi_report_boards(comedi_driver *driv);
-static int poll_invalid(comedi_device *dev, comedi_subdevice *s);
-int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s,
+static int poll_invalid(struct comedi_device *dev, comedi_subdevice *s);
+int comedi_buf_alloc(struct comedi_device *dev, comedi_subdevice *s,
unsigned long new_size);
comedi_driver *comedi_drivers;
return -EINVAL;
}
-static void cleanup_device(comedi_device *dev)
+static void cleanup_device(struct comedi_device *dev)
{
int i;
comedi_subdevice *s;
comedi_set_hw_dev(dev, NULL);
}
-static void __comedi_device_detach(comedi_device *dev)
+static void __comedi_device_detach(struct comedi_device *dev)
{
dev->attached = 0;
if (dev->driver) {
cleanup_device(dev);
}
-void comedi_device_detach(comedi_device *dev)
+void comedi_device_detach(struct comedi_device *dev)
{
if (!dev->attached)
return;
__comedi_device_detach(dev);
}
-int comedi_device_attach(comedi_device *dev, comedi_devconfig *it)
+int comedi_device_attach(struct comedi_device *dev, comedi_devconfig *it)
{
comedi_driver *driv;
int ret;
/* check for devices using this driver */
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(i);
- comedi_device *dev;
+ struct comedi_device *dev;
if(dev_file_info == NULL) continue;
dev = dev_file_info->device;
return -EINVAL;
}
-static int postconfig(comedi_device *dev)
+static int postconfig(struct comedi_device *dev)
{
int i;
comedi_subdevice *s;
printk(" %s\n", driv->driver_name);
}
-static int poll_invalid(comedi_device *dev, comedi_subdevice *s)
+static int poll_invalid(struct comedi_device *dev, comedi_subdevice *s)
{
return -EINVAL;
}
-int insn_inval(comedi_device *dev, comedi_subdevice *s,
+int insn_inval(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}
-static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
+static int insn_rw_emulate_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
comedi_insn new_insn;
return kva;
}
-int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s,
+int comedi_buf_alloc(struct comedi_device *dev, comedi_subdevice *s,
unsigned long new_size)
{
comedi_async *async = s->async;
#define CALLBACK_FUNC (((struct subdev_8255_struct *)s->private)->cb_func)
#define subdevpriv ((struct subdev_8255_struct *)s->private)
-static int dev_8255_attach(comedi_device * dev, comedi_devconfig * it);
-static int dev_8255_detach(comedi_device * dev);
+static int dev_8255_attach(struct comedi_device *dev, comedi_devconfig * it);
+static int dev_8255_detach(struct comedi_device *dev);
static comedi_driver driver_8255 = {
driver_name:"8255",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_8255);
-static void do_config(comedi_device * dev, comedi_subdevice * s);
+static void do_config(struct comedi_device *dev, comedi_subdevice * s);
-void subdev_8255_interrupt(comedi_device * dev, comedi_subdevice * s)
+void subdev_8255_interrupt(struct comedi_device *dev, comedi_subdevice * s)
{
short d;
}
}
-static int subdev_8255_insn(comedi_device * dev, comedi_subdevice * s,
+static int subdev_8255_insn(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
return 2;
}
-static int subdev_8255_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int subdev_8255_insn_config(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
return 1;
}
-static void do_config(comedi_device * dev, comedi_subdevice * s)
+static void do_config(struct comedi_device *dev, comedi_subdevice * s)
{
int config;
CALLBACK_FUNC(1, _8255_CR, config, CALLBACK_ARG);
}
-static int subdev_8255_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int subdev_8255_cmdtest(struct comedi_device *dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int subdev_8255_cmd(comedi_device * dev, comedi_subdevice * s)
+static int subdev_8255_cmd(struct comedi_device *dev, comedi_subdevice * s)
{
/* FIXME */
return 0;
}
-static int subdev_8255_cancel(comedi_device * dev, comedi_subdevice * s)
+static int subdev_8255_cancel(struct comedi_device *dev, comedi_subdevice * s)
{
/* FIXME */
return 0;
}
-int subdev_8255_init(comedi_device * dev, comedi_subdevice * s, int (*cb) (int,
+int subdev_8255_init(struct comedi_device *dev, comedi_subdevice * s, int (*cb) (int,
int, int, unsigned long), unsigned long arg)
{
s->type = COMEDI_SUBD_DIO;
return 0;
}
-int subdev_8255_init_irq(comedi_device * dev, comedi_subdevice * s,
+int subdev_8255_init_irq(struct comedi_device *dev, comedi_subdevice * s,
int (*cb) (int, int, int, unsigned long), unsigned long arg)
{
int ret;
return 0;
}
-void subdev_8255_cleanup(comedi_device * dev, comedi_subdevice * s)
+void subdev_8255_cleanup(struct comedi_device *dev, comedi_subdevice * s)
{
if (s->private) {
if (subdevpriv->have_irq) {
*/
-static int dev_8255_attach(comedi_device * dev, comedi_devconfig * it)
+static int dev_8255_attach(struct comedi_device *dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
return 0;
}
-static int dev_8255_detach(comedi_device * dev)
+static int dev_8255_detach(struct comedi_device *dev)
{
int i;
unsigned long iobase;
#if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE)
-int subdev_8255_init(comedi_device * dev, comedi_subdevice * s,
+int subdev_8255_init(struct comedi_device * dev, comedi_subdevice * s,
int (*cb) (int, int, int, unsigned long), unsigned long arg);
-int subdev_8255_init_irq(comedi_device * dev, comedi_subdevice * s,
+int subdev_8255_init_irq(struct comedi_device * dev, comedi_subdevice * s,
int (*cb) (int, int, int, unsigned long), unsigned long arg);
-void subdev_8255_cleanup(comedi_device * dev, comedi_subdevice * s);
-void subdev_8255_interrupt(comedi_device * dev, comedi_subdevice * s);
+void subdev_8255_cleanup(struct comedi_device * dev, comedi_subdevice * s);
+void subdev_8255_interrupt(struct comedi_device * dev, comedi_subdevice * s);
#else
-static inline int subdev_8255_init(comedi_device * dev, comedi_subdevice * s,
+static inline int subdev_8255_init(struct comedi_device * dev, comedi_subdevice * s,
void *x, unsigned long y)
{
printk("8255 support not configured -- disabling subdevice\n");
return 0;
}
-static inline void subdev_8255_cleanup(comedi_device * dev,
+static inline void subdev_8255_cleanup(struct comedi_device * dev,
comedi_subdevice * s)
{
}
#define ACL7225_DI_LO 2 /* Digital input low byte (DI0-DI7) */
#define ACL7225_DI_HI 3 /* Digital input high byte (DI8-DI15) */
-static int acl7225b_attach(comedi_device * dev, comedi_devconfig * it);
-static int acl7225b_detach(comedi_device * dev);
+static int acl7225b_attach(struct comedi_device *dev, comedi_devconfig * it);
+static int acl7225b_detach(struct comedi_device *dev);
typedef struct {
const char *name; // driver name
COMEDI_INITCLEANUP(driver_acl7225b);
-static int acl7225b_do_insn(comedi_device * dev, comedi_subdevice * s,
+static int acl7225b_do_insn(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int acl7225b_di_insn(comedi_device * dev, comedi_subdevice * s,
+static int acl7225b_di_insn(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int acl7225b_attach(comedi_device * dev, comedi_devconfig * it)
+static int acl7225b_attach(struct comedi_device *dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int iobase, iorange;
return 0;
}
-static int acl7225b_detach(comedi_device * dev)
+static int acl7225b_detach(struct comedi_device *dev)
{
printk("comedi%d: acl7225b: remove\n", dev->minor);
| BYTE_ b_InputClockLevel, |
| BYTE_ b_OutputLevel, |
| BYTE_ b_HardwareGateLevel)
-INT i_InsnConfig_InitTimer(comedi_device *dev,comedi_subdevice *s,
+INT i_InsnConfig_InitTimer(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data)
|
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitTimer(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigInitTimer(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
| BYTE_ b_ModulNbr, |
| BYTE_ b_TimerNbr, |
| BYTE_ b_InterruptEnable)
-INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device *dev,comedi_subdevice *s,
+INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable OR Disable the Timer (b_TimerNbr) from selected module |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device * dev,
+INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device * dev,
comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
| (BYTE_ b_BoardHandle, |
| BYTE_ b_ModulNbr, |
| PULONG_ pul_TimerValueArray)
-INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev,comedi_subdevice *s,
+INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the all timer values from selected timer |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnBitsTimer(comedi_device *dev,
+| Function Name :INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read write functions for Timer |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsTimer(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnBitsTimer(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_BitsType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ReadTimerValue(comedi_device * dev,
+INT i_APCI1710_ReadTimerValue(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PULONG pul_TimerValue)
{
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetTimerOutputLevel(comedi_device * dev,
+INT i_APCI1710_GetTimerOutputLevel(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PBYTE pb_OutputLevel)
{
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetTimerProgressStatus(comedi_device *dev,
+INT i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PBYTE pb_TimerStatus)
{
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_WriteTimerValue(comedi_device * dev,
+INT i_APCI1710_WriteTimerValue(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
ULONG ul_WriteValue)
{
/*
* 82X54 TIMER INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigInitTimer(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device *dev,
+INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ FUNCTION
*/
-INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnBitsTimer(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ & WRITE FUNCTION
*/
-INT i_APCI1710_ReadTimerValue(comedi_device *dev,
+INT i_APCI1710_ReadTimerValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PULONG pul_TimerValue);
-INT i_APCI1710_GetTimerOutputLevel(comedi_device *dev,
+INT i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PBYTE pb_OutputLevel);
-INT i_APCI1710_GetTimerProgressStatus(comedi_device *dev,
+INT i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
PBYTE pb_TimerStatus);
/*
* 82X54 WRITE FUNCTION
*/
-INT i_APCI1710_WriteTimerValue(comedi_device *dev,
+INT i_APCI1710_WriteTimerValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr,
ULONG ul_WriteValue);
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitChrono(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
| BYTE_ b_ModulNbr, |
| BYTE_ b_CycleMode, |
| BYTE_ b_InterruptEnable)
-INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device *dev,
+INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable the chronometer from selected module |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device * dev,
+INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnReadChrono(comedi_device *dev,comedi_subdevice *s,
+| Function Name :INT i_APCI1710_InsnReadChrono(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read functions for Timer |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadChrono(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnReadChrono(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_ReadType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetChronoProgressStatus(comedi_device * dev,
+INT i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_ChronoStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ReadChronoValue(comedi_device * dev,
+INT i_APCI1710_ReadChronoValue(struct comedi_device * dev,
BYTE b_ModulNbr,
UINT ui_TimeOut, PBYTE pb_ChronoStatus, PULONG pul_ChronoValue)
{
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ConvertChronoValue(comedi_device * dev,
+INT i_APCI1710_ConvertChronoValue(struct comedi_device * dev,
BYTE b_ModulNbr,
ULONG ul_ChronoValue,
PULONG pul_Hour,
/*
+----------------------------------------------------------------------------+
-| Function Name : INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device *dev,comedi_subdevice *s,
+| Function Name : INT i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Sets the output witch has been passed with the |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device * dev,
+INT i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
* CHRONOMETER INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigInitChrono(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigInitChrono(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device *dev,
+INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/*
* CHRONOMETER READ FUNCTION
*/
-INT i_APCI1710_InsnReadChrono(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnReadChrono(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_GetChronoProgressStatus(comedi_device *dev,
+INT i_APCI1710_GetChronoProgressStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_ChronoStatus);
-INT i_APCI1710_ReadChronoValue(comedi_device *dev,
+INT i_APCI1710_ReadChronoValue(struct comedi_device *dev,
BYTE b_ModulNbr,
UINT ui_TimeOut, PBYTE pb_ChronoStatus,
PULONG pul_ChronoValue);
-INT i_APCI1710_ConvertChronoValue(comedi_device *dev,
+INT i_APCI1710_ConvertChronoValue(struct comedi_device *dev,
BYTE b_ModulNbr,
ULONG ul_ChronoValue,
PULONG pul_Hour,
/*
* CHRONOMETER DIGITAL INPUT OUTPUT FUNCTION
*/
-INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device *dev,
+INT i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
/*
+----------------------------------------------------------------------------+
-| Function Name : INT i_APCI1710_InsnConfigDigitalIO(comedi_device *dev, |
+| Function Name : INT i_APCI1710_InsnConfigDigitalIO(struct comedi_device *dev, |
| comedi_subdevice *s,comedi_insn *insn,unsigned int *data)|
+----------------------------------------------------------------------------+
| Task : Configure the digital I/O operating mode from selected |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigDigitalIO(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_ModulNbr, b_ChannelAMode, b_ChannelBMode;
/*
+----------------------------------------------------------------------------+
-|INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device *dev,comedi_subdevice
+|INT i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device *dev,comedi_subdevice
*s, comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
// BYTE_ b_InputChannel,
//
// PBYTE_ pb_ChannelStatus)
-INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device * dev,
+INT i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
//_INT_ i_APCI1710_SetDigitalIOChlOn (BYTE_ b_BoardHandle,
// BYTE_ b_ModulNbr,
// BYTE_ b_OutputChannel)
-INT i_APCI1710_InsnWriteDigitalIOChlOnOff(comedi_device * dev,
+INT i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
-|INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device *dev,comedi_subdevice
+|INT i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device *dev,comedi_subdevice
*s, comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
| Task : write:
//_INT_ i_APCI1710_SetDigitalIOPortOn (BYTE_ b_BoardHandle,
// BYTE_ b_ModulNbr,
// BYTE_ b_PortValue)
-INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device * dev,
+INT i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
* DIGITAL I/O INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigDigitalIO(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigDigitalIO(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* INPUT OUTPUT FUNCTIONS
*/
-INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device *dev,
+INT i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnWriteDigitalIOChlOnOff(comedi_device *dev,
+INT i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device *dev,
+INT i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
+----------------------------------------------------------------------------+
-| INT i_APCI1710_InsnConfigINCCPT(comedi_device *dev,comedi_subdevice *s,
+| INT i_APCI1710_InsnConfigINCCPT(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigINCCPT(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigINCCPT(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_ConfigType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitCounter(comedi_device * dev,
+INT i_APCI1710_InitCounter(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_CounterRange,
BYTE b_FirstCounterModus,
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_CounterAutoTest(comedi_device * dev, PBYTE pb_TestStatus)
+INT i_APCI1710_CounterAutoTest(struct comedi_device * dev, PBYTE pb_TestStatus)
{
BYTE b_ModulCpt = 0;
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitIndex(comedi_device * dev,
+INT i_APCI1710_InitIndex(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_ReferenceAction,
BYTE b_IndexOperation, BYTE b_AutoMode, BYTE b_InterruptEnable)
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitReference(comedi_device * dev,
+INT i_APCI1710_InitReference(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_ReferenceLevel)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitExternalStrobe(comedi_device * dev,
+INT i_APCI1710_InitExternalStrobe(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_ExternalStrobe, BYTE b_ExternalStrobeLevel)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitCompareLogic(comedi_device * dev,
+INT i_APCI1710_InitCompareLogic(struct comedi_device * dev,
BYTE b_ModulNbr, UINT ui_CompareValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitFrequencyMeasurement(comedi_device * dev,
+INT i_APCI1710_InitFrequencyMeasurement(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_PCIInputClock,
BYTE b_TimingUnity,
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnBitsINCCPT(comedi_device *dev,comedi_subdevice *s,
+| Function Name :INT i_APCI1710_InsnBitsINCCPT(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Set & Clear Functions for INC_CPT |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsINCCPT(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnBitsINCCPT(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_BitsType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ClearCounterValue(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_ClearCounterValue(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ClearAllCounterValue(comedi_device * dev)
+INT i_APCI1710_ClearAllCounterValue(struct comedi_device * dev)
{
BYTE b_ModulCpt = 0;
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_SetInputFilter(comedi_device * dev,
+INT i_APCI1710_SetInputFilter(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_PCIInputClock, BYTE b_Filter)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_LatchCounter(comedi_device * dev,
+INT i_APCI1710_LatchCounter(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_LatchReg)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_SetIndexAndReferenceSource(comedi_device * dev,
+INT i_APCI1710_SetIndexAndReferenceSource(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_SourceSelection)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_SetDigitalChlOn(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_SetDigitalChlOn(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_SetDigitalChlOff(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_SetDigitalChlOff(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev,comedi_subdevice *s,
+| Function Name :INT i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable Disable functions for INC_CPT |
| Return Value :
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteINCCPT(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnWriteINCCPT(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_WriteType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_EnableLatchInterrupt(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_EnableLatchInterrupt(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_DisableLatchInterrupt(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_DisableLatchInterrupt(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_Write16BitCounterValue(comedi_device * dev,
+INT i_APCI1710_Write16BitCounterValue(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_SelectedCounter, UINT ui_WriteValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_Write32BitCounterValue(comedi_device * dev,
+INT i_APCI1710_Write32BitCounterValue(struct comedi_device * dev,
BYTE b_ModulNbr, ULONG ul_WriteValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_EnableIndex(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_EnableIndex(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
ULONG ul_InterruptLatchReg;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_DisableIndex(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_DisableIndex(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_EnableCompareLogic(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_EnableCompareLogic(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_DisableCompareLogic(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_DisableCompareLogic(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_EnableFrequencyMeasurement(comedi_device * dev,
+INT i_APCI1710_EnableFrequencyMeasurement(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_InterruptEnable)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_DisableFrequencyMeasurement(comedi_device * dev, BYTE b_ModulNbr)
+INT i_APCI1710_DisableFrequencyMeasurement(struct comedi_device * dev, BYTE b_ModulNbr)
{
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev,comedi_subdevice *s,
+| Function Name :INT i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read and Get functions for INC_CPT |
| Return Value :
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadINCCPT(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnReadINCCPT(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_ReadType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ReadLatchRegisterStatus(comedi_device * dev,
+INT i_APCI1710_ReadLatchRegisterStatus(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_LatchReg, PBYTE pb_LatchStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ReadLatchRegisterValue(comedi_device * dev,
+INT i_APCI1710_ReadLatchRegisterValue(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_LatchReg, PULONG pul_LatchValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_Read16BitCounterValue(comedi_device * dev,
+INT i_APCI1710_Read16BitCounterValue(struct comedi_device * dev,
BYTE b_ModulNbr, BYTE b_SelectedCounter, PUINT pui_CounterValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_Read32BitCounterValue(comedi_device * dev,
+INT i_APCI1710_Read32BitCounterValue(struct comedi_device * dev,
BYTE b_ModulNbr, PULONG pul_CounterValue)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetIndexStatus(comedi_device * dev,
+INT i_APCI1710_GetIndexStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_IndexStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetReferenceStatus(comedi_device * dev,
+INT i_APCI1710_GetReferenceStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_ReferenceStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetUASStatus(comedi_device * dev,
+INT i_APCI1710_GetUASStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_UASStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetCBStatus(comedi_device * dev,
+INT i_APCI1710_GetCBStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_CBStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_Get16BitCBStatus(comedi_device * dev,
+INT i_APCI1710_Get16BitCBStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_CBStatusCounter0, PBYTE pb_CBStatusCounter1)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetUDStatus(comedi_device * dev,
+INT i_APCI1710_GetUDStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_UDStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetInterruptUDLatchedStatus(comedi_device * dev,
+INT i_APCI1710_GetInterruptUDLatchedStatus(struct comedi_device * dev,
BYTE b_ModulNbr, PBYTE pb_UDStatus)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_ReadFrequencyMeasurement(comedi_device * dev,
+INT i_APCI1710_ReadFrequencyMeasurement(struct comedi_device * dev,
BYTE b_ModulNbr,
PBYTE pb_Status, PBYTE pb_UDStatus, PULONG pul_ReadValue)
{
#define APCI1710_INCCPT_DISABLEFREQUENCYMEASUREMENT 409
/************ Main Functions *************/
-INT i_APCI1710_InsnConfigINCCPT(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigINCCPT(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int * data);
-INT i_APCI1710_InsnBitsINCCPT(comedi_device *dev, comedi_subdevice * s,
+INT i_APCI1710_InsnBitsINCCPT(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn *insn, unsigned int * data);
-INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev, comedi_subdevice * s,
+INT i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn *insn, unsigned int * data);
-INT i_APCI1710_InsnReadINCCPT(comedi_device *dev, comedi_subdevice * s,
+INT i_APCI1710_InsnReadINCCPT(struct comedi_device *dev, comedi_subdevice * s,
comedi_insn *insn, unsigned int * data);
/*********** Supplementary Functions********/
/* INSN CONFIG */
-INT i_APCI1710_InitCounter(comedi_device *dev,
+INT i_APCI1710_InitCounter(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_CounterRange,
BYTE b_FirstCounterModus,
BYTE b_SecondCounterModus,
BYTE b_SecondCounterOption);
-INT i_APCI1710_CounterAutoTest(comedi_device *dev, PBYTE pb_TestStatus);
+INT i_APCI1710_CounterAutoTest(struct comedi_device *dev, PBYTE pb_TestStatus);
-INT i_APCI1710_InitIndex(comedi_device *dev,
+INT i_APCI1710_InitIndex(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_ReferenceAction,
BYTE b_IndexOperation, BYTE b_AutoMode,
BYTE b_InterruptEnable);
-INT i_APCI1710_InitReference(comedi_device *dev,
+INT i_APCI1710_InitReference(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_ReferenceLevel);
-INT i_APCI1710_InitExternalStrobe(comedi_device *dev,
+INT i_APCI1710_InitExternalStrobe(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_ExternalStrobe,
BYTE b_ExternalStrobeLevel);
-INT i_APCI1710_InitCompareLogic(comedi_device *dev,
+INT i_APCI1710_InitCompareLogic(struct comedi_device *dev,
BYTE b_ModulNbr, UINT ui_CompareValue);
-INT i_APCI1710_InitFrequencyMeasurement(comedi_device *dev,
+INT i_APCI1710_InitFrequencyMeasurement(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_PCIInputClock,
BYTE b_TimingUnity,
PULONG pul_RealTimingInterval);
/* INSN BITS */
-INT i_APCI1710_ClearCounterValue(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_ClearCounterValue(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_ClearAllCounterValue(comedi_device *dev);
+INT i_APCI1710_ClearAllCounterValue(struct comedi_device *dev);
-INT i_APCI1710_SetInputFilter(comedi_device *dev,
+INT i_APCI1710_SetInputFilter(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_PCIInputClock,
BYTE b_Filter);
-INT i_APCI1710_LatchCounter(comedi_device *dev,
+INT i_APCI1710_LatchCounter(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_LatchReg);
-INT i_APCI1710_SetIndexAndReferenceSource(comedi_device *dev,
+INT i_APCI1710_SetIndexAndReferenceSource(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_SourceSelection);
-INT i_APCI1710_SetDigitalChlOn(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_SetDigitalChlOn(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_SetDigitalChlOff(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_SetDigitalChlOff(struct comedi_device *dev, BYTE b_ModulNbr);
/* INSN WRITE */
-INT i_APCI1710_EnableLatchInterrupt(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_EnableLatchInterrupt(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_DisableLatchInterrupt(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_DisableLatchInterrupt(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_Write16BitCounterValue(comedi_device *dev,
+INT i_APCI1710_Write16BitCounterValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_SelectedCounter,
UINT ui_WriteValue);
-INT i_APCI1710_Write32BitCounterValue(comedi_device *dev,
+INT i_APCI1710_Write32BitCounterValue(struct comedi_device *dev,
BYTE b_ModulNbr, ULONG ul_WriteValue);
-INT i_APCI1710_EnableIndex(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_EnableIndex(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_DisableIndex(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_DisableIndex(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_EnableCompareLogic(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_EnableCompareLogic(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_DisableCompareLogic(comedi_device *dev, BYTE b_ModulNbr);
+INT i_APCI1710_DisableCompareLogic(struct comedi_device *dev, BYTE b_ModulNbr);
-INT i_APCI1710_EnableFrequencyMeasurement(comedi_device *dev,
+INT i_APCI1710_EnableFrequencyMeasurement(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_InterruptEnable);
-INT i_APCI1710_DisableFrequencyMeasurement(comedi_device *dev,
+INT i_APCI1710_DisableFrequencyMeasurement(struct comedi_device *dev,
BYTE b_ModulNbr);
/* INSN READ */
-INT i_APCI1710_ReadLatchRegisterStatus(comedi_device *dev,
+INT i_APCI1710_ReadLatchRegisterStatus(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_LatchReg,
PBYTE pb_LatchStatus);
-INT i_APCI1710_ReadLatchRegisterValue(comedi_device *dev,
+INT i_APCI1710_ReadLatchRegisterValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_LatchReg,
PULONG pul_LatchValue);
-INT i_APCI1710_Read16BitCounterValue(comedi_device *dev,
+INT i_APCI1710_Read16BitCounterValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_SelectedCounter,
PUINT pui_CounterValue);
-INT i_APCI1710_Read32BitCounterValue(comedi_device *dev,
+INT i_APCI1710_Read32BitCounterValue(struct comedi_device *dev,
BYTE b_ModulNbr, PULONG pul_CounterValue);
-INT i_APCI1710_GetIndexStatus(comedi_device *dev,
+INT i_APCI1710_GetIndexStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_IndexStatus);
-INT i_APCI1710_GetReferenceStatus(comedi_device *dev,
+INT i_APCI1710_GetReferenceStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_ReferenceStatus);
-INT i_APCI1710_GetUASStatus(comedi_device *dev,
+INT i_APCI1710_GetUASStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_UASStatus);
-INT i_APCI1710_GetCBStatus(comedi_device *dev,
+INT i_APCI1710_GetCBStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_CBStatus);
-INT i_APCI1710_Get16BitCBStatus(comedi_device *dev,
+INT i_APCI1710_Get16BitCBStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_CBStatusCounter0,
PBYTE pb_CBStatusCounter1);
-INT i_APCI1710_GetUDStatus(comedi_device *dev,
+INT i_APCI1710_GetUDStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_UDStatus);
-INT i_APCI1710_GetInterruptUDLatchedStatus(comedi_device *dev,
+INT i_APCI1710_GetInterruptUDLatchedStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_UDStatus);
-INT i_APCI1710_ReadFrequencyMeasurement(comedi_device *dev,
+INT i_APCI1710_ReadFrequencyMeasurement(struct comedi_device *dev,
BYTE b_ModulNbr,
PBYTE pb_Status, PBYTE pb_UDStatus,
PULONG pul_ReadValue);
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitPulseEncoder(comedi_device * dev,
+INT i_APCI1710_InsnConfigInitPulseEncoder(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(comedi_device * dev,
+INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
PBYTE_ pb_Status)
*/
-INT i_APCI1710_InsnBitsReadWritePulseEncoder(comedi_device * dev,
+INT i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
return (i_ReturnValue);
}
-INT i_APCI1710_InsnReadInterruptPulseEncoder(comedi_device * dev,
+INT i_APCI1710_InsnReadInterruptPulseEncoder(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
#define APCI1710_PULSEENCODER_READ 0
#define APCI1710_PULSEENCODER_WRITE 1
-INT i_APCI1710_InsnConfigInitPulseEncoder(comedi_device *dev,
+INT i_APCI1710_InsnConfigInitPulseEncoder(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(comedi_device *dev,
+INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/*
* READ PULSE ENCODER FUNCTIONS
*/
-INT i_APCI1710_InsnReadInterruptPulseEncoder(comedi_device *dev,
+INT i_APCI1710_InsnReadInterruptPulseEncoder(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/*
* WRITE PULSE ENCODER FUNCTIONS
*/
-INT i_APCI1710_InsnBitsReadWritePulseEncoder(comedi_device *dev,
+INT i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnConfigPWM(comedi_device *dev,
+| Function Name :INT i_APCI1710_InsnConfigPWM(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Pwm Init and Get Pwm Initialisation |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigPWM(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigPWM(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_ConfigType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InitPWM(comedi_device * dev,
+INT i_APCI1710_InitPWM(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_PWM,
BYTE b_ClockSelection,
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_GetPWMInitialisation(comedi_device * dev,
+INT i_APCI1710_GetPWMInitialisation(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_PWM,
PBYTE pb_TimingUnit,
/*
+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnWritePWM(comedi_device *dev,
+| Function Name :INT i_APCI1710_InsnWritePWM(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Pwm Enable Disable and Set New Timing |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWritePWM(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnWritePWM(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_WriteType;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_EnablePWM(comedi_device * dev,
+INT i_APCI1710_EnablePWM(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_PWM,
BYTE b_StartLevel,
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_DisablePWM(comedi_device * dev, BYTE b_ModulNbr, BYTE b_PWM)
+INT i_APCI1710_DisablePWM(struct comedi_device * dev, BYTE b_ModulNbr, BYTE b_PWM)
{
INT i_ReturnValue = 0;
DWORD dw_Status;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_SetNewPWMTiming(comedi_device * dev,
+INT i_APCI1710_SetNewPWMTiming(struct comedi_device * dev,
BYTE b_ModulNbr,
BYTE b_PWM, BYTE b_TimingUnit, ULONG ul_LowTiming, ULONG ul_HighTiming)
{
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadGetPWMStatus(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnReadGetPWMStatus(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
return (i_ReturnValue);
}
-INT i_APCI1710_InsnBitsReadPWMInterrupt(comedi_device * dev,
+INT i_APCI1710_InsnBitsReadPWMInterrupt(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->s_InterruptParameters.
#define APCI1710_PWM_ENABLE 1
#define APCI1710_PWM_NEWTIMING 2
-INT i_APCI1710_InsnConfigPWM(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigPWM(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InitPWM(comedi_device *dev,
+INT i_APCI1710_InitPWM(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_PWM,
BYTE b_ClockSelection,
ULONG ul_HighTiming,
PULONG pul_RealLowTiming, PULONG pul_RealHighTiming);
-INT i_APCI1710_GetPWMInitialisation(comedi_device *dev,
+INT i_APCI1710_GetPWMInitialisation(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_PWM,
PBYTE pb_TimingUnit,
PBYTE pb_ExternGate,
PBYTE pb_InterruptEnable, PBYTE pb_Enable);
-INT i_APCI1710_InsnWritePWM(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnWritePWM(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_EnablePWM(comedi_device *dev,
+INT i_APCI1710_EnablePWM(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_PWM,
BYTE b_StartLevel,
BYTE b_StopLevel, BYTE b_ExternGate,
BYTE b_InterruptEnable);
-INT i_APCI1710_SetNewPWMTiming(comedi_device *dev,
+INT i_APCI1710_SetNewPWMTiming(struct comedi_device *dev,
BYTE b_ModulNbr,
BYTE b_PWM, BYTE b_TimingUnit,
ULONG ul_LowTiming, ULONG ul_HighTiming);
-INT i_APCI1710_DisablePWM(comedi_device *dev, BYTE b_ModulNbr, BYTE b_PWM);
+INT i_APCI1710_DisablePWM(struct comedi_device *dev, BYTE b_ModulNbr, BYTE b_PWM);
-INT i_APCI1710_InsnReadGetPWMStatus(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnReadGetPWMStatus(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnBitsReadPWMInterrupt(comedi_device *dev,
+INT i_APCI1710_InsnBitsReadPWMInterrupt(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitSSI(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigInitSSI(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
| BYTE_ b_SelectedSSI, |
| PULONG_ pul_Position, |
| PULONG_ pul_TurnCpt)
- INT i_APCI1710_ReadSSIValue(comedi_device *dev,comedi_subdevice *s,
+ INT i_APCI1710_ReadSSIValue(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadSSIValue(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsSSIDigitalIO(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
* SSI INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigInitSSI(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigInitSSI(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnReadSSIValue(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnReadSSIValue(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnBitsSSIDigitalIO(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitTorCounter(comedi_device * dev,
+INT i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteEnableDisableTorCounter(comedi_device * dev,
+INT i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadGetTorCounterInitialisation(comedi_device * dev,
+INT i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(comedi_device * dev,
+INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
* TOR_COUNTER INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigInitTorCounter(comedi_device *dev,
+INT i_APCI1710_InsnConfigInitTorCounter(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnWriteEnableDisableTorCounter(comedi_device *dev,
+INT i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-INT i_APCI1710_InsnReadGetTorCounterInitialisation(comedi_device *dev,
+INT i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/*
* TOR_COUNTER READ FUNCTION
*/
-INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(comedi_device *dev,
+INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnConfigInitTTLIO(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnConfigInitTTLIO(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnBitsReadTTLIO(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1710_InsnBitsReadTTLIO(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device * dev,
+INT i_APCI1710_InsnReadTTLIOAllPortValue(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
| (BYTE_ b_BoardHandle, |
| BYTE_ b_ModulNbr, |
| BYTE_ b_OutputChannel)
-INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device *dev,comedi_subdevice *s,
+INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Sets or resets the output witch has been passed with the |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device * dev,
+INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
/*
* TTL INISIALISATION FUNCTION
*/
-INT i_APCI1710_InsnConfigInitTTLIO(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnConfigInitTTLIO(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* TTL INPUT FUNCTION
*/
-INT i_APCI1710_InsnBitsReadTTLIO(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1710_InsnBitsReadTTLIO(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device *dev,
+INT i_APCI1710_InsnReadTTLIOAllPortValue(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* TTL OUTPUT FUNCTIONS
*/
-INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device *dev,
+INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
+----------------------------------------------------------------------------+
-| Function name :static int i_ADDI_Attach(comedi_device *dev, |
+| Function name :static int i_ADDI_Attach(struct comedi_device *dev, |
| comedi_devconfig *it) |
| |
+----------------------------------------------------------------------------+
| This function does all the initializations and memory |
| allocation of data structures for the driver. |
+----------------------------------------------------------------------------+
-| Input Parameters :comedi_device *dev |
+| Input Parameters :struct comedi_device *dev |
| comedi_devconfig *it |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-static int i_ADDI_Attach(comedi_device * dev, comedi_devconfig * it)
+static int i_ADDI_Attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret, pages, i, n_subdevices;
/*
+----------------------------------------------------------------------------+
-| Function name : static int i_ADDI_Detach(comedi_device *dev) |
+| Function name : static int i_ADDI_Detach(struct comedi_device *dev) |
| |
| |
+----------------------------------------------------------------------------+
| Free the DMA buffers, unregister irq. |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-static int i_ADDI_Detach(comedi_device * dev)
+static int i_ADDI_Detach(struct comedi_device * dev)
{
if (dev->private) {
/*
+----------------------------------------------------------------------------+
-| Function name : static int i_ADDI_Reset(comedi_device *dev) |
+| Function name : static int i_ADDI_Reset(struct comedi_device *dev) |
| |
+----------------------------------------------------------------------------+
| Task : Disables all interrupts, Resets digital output to low, |
| Set all analog output to low |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-static int i_ADDI_Reset(comedi_device * dev)
+static int i_ADDI_Reset(struct comedi_device * dev)
{
this_board->i_hwdrv_Reset(dev);
static irqreturn_t v_ADDI_Interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
this_board->v_hwdrv_Interrupt(irq, d);
return IRQ_RETVAL(1);
}
/*
+----------------------------------------------------------------------------+
| Function name : |
-|INT i_ADDIDATA_InsnReadEeprom(comedi_device *dev,comedi_subdevice *s,
+|INT i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data)
| |
+----------------------------------------------------------------------------+
| Task : Read 256 words from EEPROM |
| |
+----------------------------------------------------------------------------+
-| Input Parameters :(comedi_device *dev,comedi_subdevice *s,
+| Input Parameters :(struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data) |
| |
| |
+----------------------------------------------------------------------------+
*/
-static int i_ADDIDATA_InsnReadEeprom(comedi_device * dev, comedi_subdevice * s,
+static int i_ADDIDATA_InsnReadEeprom(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
WORD w_Data;
/* interrupt and reset */
void (*v_hwdrv_Interrupt)(int irq, void *d);
- int (*i_hwdrv_Reset)(comedi_device *dev);
+ int (*i_hwdrv_Reset)(struct comedi_device *dev);
/* Subdevice functions */
/* ANALOG INPUT */
- int (*i_hwdrv_InsnConfigAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_InsnConfigAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnReadAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_InsnReadAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnWriteAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_InsnWriteAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnBitsAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_InsnBitsAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_CommandTestAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_CommandTestAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd);
- int (*i_hwdrv_CommandAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_CommandAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s);
- int (*i_hwdrv_CancelAnalogInput)(comedi_device *dev,
+ int (*i_hwdrv_CancelAnalogInput)(struct comedi_device *dev,
comedi_subdevice *s);
/* Analog Output */
- int (*i_hwdrv_InsnConfigAnalogOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnConfigAnalogOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnWriteAnalogOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnWriteAnalogOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnBitsAnalogOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnBitsAnalogOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/* Digital Input */
- int (*i_hwdrv_InsnConfigDigitalInput) (comedi_device *dev,
+ int (*i_hwdrv_InsnConfigDigitalInput) (struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnReadDigitalInput) (comedi_device *dev,
+ int (*i_hwdrv_InsnReadDigitalInput) (struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnWriteDigitalInput) (comedi_device *dev,
+ int (*i_hwdrv_InsnWriteDigitalInput) (struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnBitsDigitalInput) (comedi_device *dev,
+ int (*i_hwdrv_InsnBitsDigitalInput) (struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/* Digital Output */
- int (*i_hwdrv_InsnConfigDigitalOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnConfigDigitalOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnWriteDigitalOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnWriteDigitalOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnBitsDigitalOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnBitsDigitalOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnReadDigitalOutput)(comedi_device *dev,
+ int (*i_hwdrv_InsnReadDigitalOutput)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
/* TIMER */
- int (*i_hwdrv_InsnConfigTimer)(comedi_device *dev,
+ int (*i_hwdrv_InsnConfigTimer)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
- int (*i_hwdrv_InsnWriteTimer)(comedi_device *dev,
+ int (*i_hwdrv_InsnWriteTimer)(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
- int (*i_hwdrv_InsnReadTimer)(comedi_device *dev, comedi_subdevice *s,
+ int (*i_hwdrv_InsnReadTimer)(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
- int (*i_hwdrv_InsnBitsTimer)(comedi_device *dev, comedi_subdevice *s,
+ int (*i_hwdrv_InsnBitsTimer)(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/* TTL IO */
- int (*i_hwdr_ConfigInitTTLIO)(comedi_device *dev,
+ int (*i_hwdr_ConfigInitTTLIO)(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
- int (*i_hwdr_ReadTTLIOBits)(comedi_device *dev, comedi_subdevice *s,
+ int (*i_hwdr_ReadTTLIOBits)(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
- int (*i_hwdr_ReadTTLIOAllPortValue)(comedi_device *dev,
+ int (*i_hwdr_ReadTTLIOAllPortValue)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
- int (*i_hwdr_WriteTTLIOChlOnOff)(comedi_device *dev,
+ int (*i_hwdr_WriteTTLIOChlOnOff)(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
} boardtype;
static unsigned short pci_list_builded; /* set to 1 when list of card is known */
/* Function declarations */
-static int i_ADDI_Attach(comedi_device *dev, comedi_devconfig *it);
-static int i_ADDI_Detach(comedi_device *dev);
-static int i_ADDI_Reset(comedi_device *dev);
+static int i_ADDI_Attach(struct comedi_device *dev, comedi_devconfig *it);
+static int i_ADDI_Detach(struct comedi_device *dev);
+static int i_ADDI_Reset(struct comedi_device *dev);
static irqreturn_t v_ADDI_Interrupt(int irq, void *d PT_REGS_ARG);
-static int i_ADDIDATA_InsnReadEeprom(comedi_device *dev, comedi_subdevice *s,
+static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*****************************************/
INT i_EepromReadMainHeader(WORD w_PCIBoardEepromAddress,
- PCHAR pc_PCIChipInformation, comedi_device * dev);
+ PCHAR pc_PCIChipInformation, struct comedi_device *dev);
INT i_EepromReadDigitalInputHeader(WORD w_PCIBoardEepromAddress,
PCHAR pc_PCIChipInformation, WORD w_Address,
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_EepromReadMainHeader(WORD w_PCIBoardEepromAddress, |
-| PCHAR pc_PCIChipInformation,comedi_device *dev) |
+| PCHAR pc_PCIChipInformation,struct comedi_device *dev) |
+----------------------------------------------------------------------------+
| Task : Read from eeprom Main Header |
+----------------------------------------------------------------------------+
| |
| PCHAR pc_PCIChipInformation : PCI Chip Type. |
| |
-| comedi_device *dev : comedi device structure |
+| struct comedi_device *dev : comedi device structure |
| pointer |
+----------------------------------------------------------------------------+
| Output Parameters : - |
*/
INT i_EepromReadMainHeader(WORD w_PCIBoardEepromAddress,
- PCHAR pc_PCIChipInformation, comedi_device * dev)
+ PCHAR pc_PCIChipInformation, struct comedi_device *dev)
{
WORD w_Temp, i, w_Count = 0;
UINT ui_Temp;
#include "APCI1710_Pwm.c"
#include "APCI1710_INCCPT.c"
-void i_ADDI_AttachPCI1710(comedi_device * dev)
+void i_ADDI_AttachPCI1710(struct comedi_device * dev)
{
comedi_subdevice *s;
int ret = 0;
s->insn_bits = i_APCI1710_InsnBitsINCCPT;
}
-int i_APCI1710_Reset(comedi_device * dev);
+int i_APCI1710_Reset(struct comedi_device * dev);
VOID v_APCI1710_Interrupt(int irq, void *d);
//for 1710
-int i_APCI1710_Reset(comedi_device * dev)
+int i_APCI1710_Reset(struct comedi_device * dev)
{
int ret;
DWORD dw_Dummy;
VOID v_APCI1710_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
BYTE b_ModuleCpt = 0;
BYTE b_InterruptFlag = 0;
BYTE b_PWMCpt = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ConfigTimerWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_ConfigTimerWatchdog(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Status = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_StartStopWriteTimerWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_StartStopWriteTimerWatchdog(comedi_device * dev,
+INT i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Command = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ReadTimerWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_ReadTimerWatchdog(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Status = 0; // Status register
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI035_ConfigAnalogInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Input Subdevice |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_ConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI035_ConfigAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
devpriv->tsk_Current = current;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ReadAnalogInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_ReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI035_ReadAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI035_Reset(comedi_device *dev) |
+| Function Name : int i_APCI035_Reset(struct comedi_device *dev) |
| |
+----------------------------------------------------------------------------+
| Task :Resets the registers of the card |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI035_Reset(comedi_device * dev)
+INT i_APCI035_Reset(struct comedi_device * dev)
{
INT i_Count = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) {
*/
static void v_APCI035_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_StatusRegister1 = 0;
UINT ui_StatusRegister2 = 0;
UINT ui_ReadCommand = 0;
/* TIMER */
/* timer value is passed as u seconds */
-INT i_APCI035_ConfigTimerWatchdog(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI035_ConfigTimerWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI035_StartStopWriteTimerWatchdog(comedi_device *dev,
+INT i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI035_ReadTimerWatchdog(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI035_ReadTimerWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/* Temperature Related Defines (Analog Input Subdevice) */
-INT i_APCI035_ConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI035_ConfigAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI035_ReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI035_ReadAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/* Interrupt */
static void v_APCI035_Interrupt(int irq, void *d);
/* Reset functions */
-INT i_APCI035_Reset(comedi_device *dev);
+INT i_APCI035_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_ConfigDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures the digital input Subdevice |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1032_ConfigDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_Read1DigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1032_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1032_Read1DigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To be Read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1032_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1032_ReadMoreDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
*/
static VOID v_APCI1032_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_Temp;
//disable the interrupt
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1032_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI1032_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1032_Reset(comedi_device * dev)
+INT i_APCI1032_Reset(struct comedi_device * dev)
{
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //disable the interrupts
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); //Reset the interrupt status register
//DI
// for di read
-INT i_APCI1032_ConfigDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1032_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1032_Read1DigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1032_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1032_ReadMoreDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
static VOID v_APCI1032_Interrupt(int irq, void *d);
//Reset
-INT i_APCI1032_Reset(comedi_device *dev);
+INT i_APCI1032_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigDigitalInputEvent |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : An event can be generated for each port. |
| (port 2). An interrupt is generated when one or both |
| events have occurred |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_ConfigDigitalInputEvent(comedi_device * dev,
+INT i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i_PatternPolarity = 0, i_PatternTransition = 0, i_PatternMask = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_StartStopInputEvent |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Allows or disallows a port event |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
| unsigned int *data : Data Pointer to read status |
data[0] :0 Start input event
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_StartStopInputEvent(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i_Event1InterruptStatus = 0, i_Event2InterruptStatus =
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_Initialisation |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_Initialisation(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1500_Initialisation(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i_DummyRead = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To be Read |
| UINT *data : Data Pointer
data[0] : 0 Read a single channel
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[1];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigDigitalOutputErrorInterrupt
- (comedi_device *dev,comedi_subdevice *s comedi_insn
+ (struct comedi_device *dev,comedi_subdevice *s comedi_insn
*insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures the digital output memory and the digital
output error interrupt |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigDigitalOutputErrorInterrupt(comedi_device * dev,
+int i_APCI1500_ConfigDigitalOutputErrorInterrupt(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To Write |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
static UINT ui_Temp = 0;
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status data[0] : 2 APCI1500_1_8_KHZ
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigCounterTimerWatchdog(comedi_device * dev,
+int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i_TimerCounterMode, i_MasterConfiguration;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_StartStopTriggerTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,
+| (struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop or trigger the timer counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_StartStopTriggerTimerCounterWatchdog(comedi_device * dev,
+int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i_CommandAndStatusValue;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadCounterTimerWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ReadCounterTimerWatchdog(comedi_device * dev,
+int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i_CommandAndStatusValue;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadInterruptMask |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read the interrupt mask |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ReadInterruptMask(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1500_ReadInterruptMask(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = i_InterruptMask;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigureInterrupt |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Configures the interrupt registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigureInterrupt(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1500_ConfigureInterrupt(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Status;
static VOID v_APCI1500_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_InterruptStatus = 0;
int i_RegValue = 0;
i_InterruptMask = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1500_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI1500_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_Reset(comedi_device * dev)
+INT i_APCI1500_Reset(struct comedi_device * dev)
{
int i_DummyRead = 0;
i_TimerCounter1Init = 0;
};
/*----------DIGITAL INPUT----------------*/
-static int i_APCI1500_Initialisation(comedi_device *dev, comedi_subdevice *s,
+static int i_APCI1500_Initialisation(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int i_APCI1500_ConfigDigitalInputEvent(comedi_device *dev,
+static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-static int i_APCI1500_StartStopInputEvent(comedi_device *dev,
+static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int i_APCI1500_ReadMoreDigitalInput(comedi_device *dev,
+static int i_APCI1500_ReadMoreDigitalInput(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*---------- DIGITAL OUTPUT------------*/
-static int i_APCI1500_ConfigDigitalOutputErrorInterrupt(comedi_device *dev,
+static int i_APCI1500_ConfigDigitalOutputErrorInterrupt(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-static int i_APCI1500_WriteDigitalOutput(comedi_device *dev,
+static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*----------TIMER----------------*/
-static int i_APCI1500_ConfigCounterTimerWatchdog(comedi_device *dev,
+static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-static int i_APCI1500_StartStopTriggerTimerCounterWatchdog(comedi_device *dev,
+static int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-static int i_APCI1500_ReadCounterTimerWatchdog(comedi_device *dev,
+static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-static int i_APCI1500_ReadInterruptMask(comedi_device *dev,
+static int i_APCI1500_ReadInterruptMask(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*----------INTERRUPT HANDLER------*/
static void v_APCI1500_Interrupt(int irq, void *d);
-static int i_APCI1500_ConfigureInterrupt(comedi_device *dev,
+static int i_APCI1500_ConfigureInterrupt(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*----------RESET---------------*/
-static int i_APCI1500_Reset(comedi_device *dev);
+static int i_APCI1500_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_Read1DigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1516_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1516_Read1DigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1516_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1516_ReadMoreDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1516_ConfigDigitalOutput (comedi_device *dev,
+| Function Name : int i_APCI1516_ConfigDigitalOutput (struct comedi_device *dev,
comedi_subdevice *s comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1516_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1516_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1516_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1516_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1516_ConfigWatchdog(comedi_device *dev,
+| Function Name : int i_APCI1516_ConfigWatchdog(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI1516_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_StartStopWriteWatchdog |
- | (comedi_device *dev,comedi_subdevice *s,
+ | (struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Watchdog |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI1516_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI1516_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1516_ReadWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = inw(devpriv->i_IobaseAddon + APCI1516_WATCHDOG_STATUS) & 0x1;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1516_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI1516_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1516_Reset(comedi_device * dev)
+INT i_APCI1516_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI1516_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE);
// Hardware Layer functions for Apci1516
//Digital Input
-INT i_APCI1516_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1516_ReadMoreDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1516_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1516_Read1DigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//Digital Output
-int i_APCI1516_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1516_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1516_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1516_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1516_ReadDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
-int i_APCI1516_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1516_ConfigWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI1516_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI1516_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1516_ReadWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//reset
-INT i_APCI1516_Reset(comedi_device *dev);
+INT i_APCI1516_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures the digital input Subdevice |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ConfigDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_ConfigDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
devpriv->tsk_Current = current;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_Read1DigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_Read1DigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To be Read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_ReadMoreDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To Write |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI1564_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ConfigTimerCounterWatchdog(comedi_device * dev,
+INT i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_StartStopWriteTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_StartStopWriteTimerCounterWatchdog(comedi_device * dev,
+INT i_APCI1564_StartStopWriteTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_ReadTimerCounterWatchdog(comedi_device * dev,
+INT i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadInterruptStatus |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :Reads the interrupt status register |
+----------------------------------------------------------------------------+
*/
-int i_APCI1564_ReadInterruptStatus(comedi_device * dev, comedi_subdevice * s,
+int i_APCI1564_ReadInterruptStatus(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
*data = ui_Type;
*/
static VOID v_APCI1564_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_DO, ui_DI;
UINT ui_Timer;
UINT ui_C1, ui_C2, ui_C3, ui_C4;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1564_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI1564_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1564_Reset(comedi_device * dev)
+INT i_APCI1564_Reset(struct comedi_device * dev)
{
outl(0x0, devpriv->i_IobaseAmcc + APCI1564_DIGITAL_IP_IRQ); //disable the interrupts
inl(devpriv->i_IobaseAmcc + APCI1564_DIGITAL_IP_INTERRUPT_STATUS); //Reset the interrupt status register
//DI
// for di read
-INT i_APCI1564_ConfigDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1564_ConfigDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1564_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1564_Read1DigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1564_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1564_ReadMoreDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//DO
-int i_APCI1564_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1564_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1564_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1564_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI1564_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI1564_ReadDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI1564_ReadInterruptStatus(comedi_device *dev, comedi_subdevice *s,
+int i_APCI1564_ReadInterruptStatus(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
-INT i_APCI1564_ConfigTimerCounterWatchdog(comedi_device *dev,
+INT i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI1564_StartStopWriteTimerCounterWatchdog(comedi_device *dev,
+int i_APCI1564_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-int i_APCI1564_ReadTimerCounterWatchdog(comedi_device *dev,
+int i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
static VOID v_APCI1564_Interrupt(int irq, void *d);
// RESET
-INT i_APCI1564_Reset(comedi_device *dev);
+INT i_APCI1564_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI16XX_InsnConfigInitTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnConfigInitTTLIO(comedi_device * dev,
+int i_APCI16XX_InsnConfigInitTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI16XX_InsnBitsReadTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnBitsReadTTLIO(comedi_device * dev,
+int i_APCI16XX_InsnBitsReadTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI16XX_InsnReadTTLIOAllPortValue |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnReadTTLIOAllPortValue(comedi_device * dev,
+int i_APCI16XX_InsnReadTTLIOAllPortValue(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Command = (BYTE) CR_AREF(insn->chanspec);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI16XX_InsnBitsWriteTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnBitsWriteTTLIO(comedi_device * dev,
+int i_APCI16XX_InsnBitsWriteTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2200_Reset(comedi_device *dev) | +----------------------------------------------------------------------------+
+| Function Name : int i_APCI2200_Reset(struct comedi_device *dev) | +----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
+----------------------------------------------------------------------------+
| Output Parameters : - |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_Reset(comedi_device * dev)
+int i_APCI16XX_Reset(struct comedi_device * dev)
{
return 0;
}
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnConfigInitTTLIO(comedi_device *dev,
+int i_APCI16XX_InsnConfigInitTTLIO(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnBitsReadTTLIO(comedi_device *dev,
+int i_APCI16XX_InsnBitsReadTTLIO(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
-int i_APCI16XX_InsnReadTTLIOAllPortValue(comedi_device *dev,
+int i_APCI16XX_InsnReadTTLIOAllPortValue(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
+----------------------------------------------------------------------------+
*/
-int i_APCI16XX_InsnBitsWriteTTLIO(comedi_device *dev,
+int i_APCI16XX_InsnBitsWriteTTLIO(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
-int i_APCI16XX_Reset(comedi_device *dev);
+int i_APCI16XX_Reset(struct comedi_device *dev);
#endif
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ConfigDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if ((data[0] != 0) && (data[0] != 1)) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To Write |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_NoOfChannel;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_BitsDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_BitsDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ConfigWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure |
| comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_ConfigWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_StartStopWriteWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure |
| comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ReadWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure |
| comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2016_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2016_ReadWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
udelay(5);
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2016_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI2016_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI2016_Reset(comedi_device * dev)
+INT i_APCI2016_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI2016_DIGITAL_OP); // Resets the digital output channels
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE);
// Hardware Layer functions for Apci2016
//DO
-int i_APCI2016_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2016_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2016_BitsDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_BitsDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
-int i_APCI2016_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_ConfigWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2016_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_StartStopWriteWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2016_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2016_ReadWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
//VOID v_APCI2016_Interrupt(int irq, void *d);
// RESET
-INT i_APCI2016_Reset(comedi_device *dev);
+INT i_APCI2016_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ConfigDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2032_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2032_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To Write |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI2032_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI2032_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI2032_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2032_ConfigWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_StartStopWriteWatchdog |
- | (comedi_device *dev,comedi_subdevice *s,
+ | (struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Watchdog |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2032_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2032_StartStopWriteWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2032_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2032_ReadWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
*/
void v_APCI2032_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned int ui_DO;
ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; //Check if VCC OR CC interrupt has occured.
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadInterruptStatus |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :Reads the interrupt status register |
+----------------------------------------------------------------------------+
*/
-int i_APCI2032_ReadInterruptStatus(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2032_ReadInterruptStatus(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
*data = ui_Type;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2032_Reset(comedi_device *dev) |
+| Function Name : int i_APCI2032_Reset(struct comedi_device *dev) |
| |
+----------------------------------------------------------------------------+
| Task :Resets the registers of the card |
+----------------------------------------------------------------------------+
*/
-int i_APCI2032_Reset(comedi_device * dev)
+int i_APCI2032_Reset(struct comedi_device * dev)
{
devpriv->b_DigitalOutputRegister = 0;
ui_Type = 0;
// Hardware Layer functions for Apci2032
//DO
-int i_APCI2032_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2032_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI2032_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2032_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI2032_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2032_ReadDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2032_ReadInterruptStatus(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2032_ReadInterruptStatus(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
-INT i_APCI2032_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2032_ConfigWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2032_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2032_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2032_ReadWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
void v_APCI2032_Interrupt(int irq, void *d);
//Reset functions
-int i_APCI2032_Reset(comedi_device *dev);
+int i_APCI2032_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_Read1DigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI2200_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2200_Read1DigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI2200_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2200_ReadMoreDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2200_ConfigDigitalOutput (comedi_device *dev,
+| Function Name : int i_APCI2200_ConfigDigitalOutput (struct comedi_device *dev,
comedi_subdevice *s comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI2200_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2200_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI2200_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-INT i_APCI2200_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2200_ConfigWatchdog(comedi_device *dev,
+| Function Name : int i_APCI2200_ConfigWatchdog(struct comedi_device *dev,
comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2200_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_StartStopWriteWatchdog |
- | (comedi_device *dev,comedi_subdevice *s,
+ | (struct comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Watchdog |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2200_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
+| (struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
*/
-int i_APCI2200_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
+int i_APCI2200_ReadWatchdog(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] =
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI2200_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI2200_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI2200_Reset(comedi_device * dev)
+INT i_APCI2200_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS
outw(0x0,
// Hardware Layer functions for Apci2200
//Digital Input
-INT i_APCI2200_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2200_ReadMoreDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI2200_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2200_Read1DigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//Digital Output
-int i_APCI2200_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2200_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI2200_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI2200_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI2200_ReadDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
-int i_APCI2200_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2200_ConfigWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2200_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI2200_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
+int i_APCI2200_ReadWatchdog(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//reset
-INT i_APCI2200_Reset(comedi_device *dev);
+INT i_APCI2200_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnConfigAnalogInput(comedi_device *dev,|
+| Function name :int i_APCI3120_InsnConfigAnalogInput(struct comedi_device *dev,|
| comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Calls card specific function |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnConfigAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT i;
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnReadAnalogInput(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnReadAnalogInput(struct comedi_device *dev, |
| comedi_subdevice *s,comedi_insn *insn, unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| time 10 microsec. |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnReadAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
USHORT us_ConvertTiming, us_TmpValue, i;
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_StopCyclicAcquisition(comedi_device *dev,|
+| Function name :int i_APCI3120_StopCyclicAcquisition(struct comedi_device *dev,|
| comedi_subdevice *s)|
| |
+----------------------------------------------------------------------------+
| Task : Stops Cyclic acquisition |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_StopCyclicAcquisition(comedi_device * dev, comedi_subdevice * s)
+int i_APCI3120_StopCyclicAcquisition(struct comedi_device * dev, comedi_subdevice * s)
{
// Disable A2P Fifo write and AMWEN signal
outw(0, devpriv->i_IobaseAddon + 4);
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_CommandTestAnalogInput(comedi_device *dev|
+| Function name :int i_APCI3120_CommandTestAnalogInput(struct comedi_device *dev|
| ,comedi_subdevice *s,comedi_cmd *cmd) |
| |
+----------------------------------------------------------------------------+
| acquisition |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_cmd *cmd |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_CommandTestAnalogInput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_CommandTestAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_CommandAnalogInput(comedi_device *dev, |
+| Function name : int i_APCI3120_CommandAnalogInput(struct comedi_device *dev, |
| comedi_subdevice *s) |
| |
+----------------------------------------------------------------------------+
| Determines the mode 1 or 2. |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_CommandAnalogInput(comedi_device * dev, comedi_subdevice * s)
+int i_APCI3120_CommandAnalogInput(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
/*
+----------------------------------------------------------------------------+
| Function name : int i_APCI3120_CyclicAnalogInput(int mode, |
-| comedi_device * dev,comedi_subdevice * s) |
+| struct comedi_device * dev,comedi_subdevice * s) |
+----------------------------------------------------------------------------+
| Task : This is used for analog input cyclic acquisition |
| Performs the command operations. |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_CyclicAnalogInput(int mode, comedi_device * dev,
+int i_APCI3120_CyclicAnalogInput(int mode, struct comedi_device * dev,
comedi_subdevice * s)
{
BYTE b_Tmp;
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_Reset(comedi_device *dev) |
+| Function name : int i_APCI3120_Reset(struct comedi_device *dev) |
| |
| |
+----------------------------------------------------------------------------+
| Task : Hardware reset function |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_Reset(comedi_device * dev)
+int i_APCI3120_Reset(struct comedi_device * dev)
{
unsigned int i;
unsigned short us_TmpValue;
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_SetupChannelList(comedi_device * dev, |
+| Function name : int i_APCI3120_SetupChannelList(struct comedi_device * dev, |
| comedi_subdevice * s, int n_chan,unsigned int *chanlist|
| ,char check) |
| |
|list is ok or not. |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device * dev |
+| Input Parameters : struct comedi_device * dev |
| comedi_subdevice * s |
| int n_chan |
unsigned int *chanlist
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_SetupChannelList(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_SetupChannelList(struct comedi_device * dev, comedi_subdevice * s,
int n_chan, unsigned int *chanlist, char check)
{
unsigned int i; //, differencial=0, bipolar=0;
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_ExttrigEnable(comedi_device * dev) |
+| Function name : int i_APCI3120_ExttrigEnable(struct comedi_device * dev) |
| |
| |
+----------------------------------------------------------------------------+
| Task : Enable the external trigger |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device * dev |
+| Input Parameters : struct comedi_device * dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_ExttrigEnable(comedi_device * dev)
+int i_APCI3120_ExttrigEnable(struct comedi_device * dev)
{
devpriv->us_OutputRegister |= APCI3120_ENABLE_EXT_TRIGGER;
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_ExttrigDisable(comedi_device * dev) |
+| Function name : int i_APCI3120_ExttrigDisable(struct comedi_device * dev) |
| |
+----------------------------------------------------------------------------+
| Task : Disables the external trigger |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device * dev |
+| Input Parameters : struct comedi_device * dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_ExttrigDisable(comedi_device * dev)
+int i_APCI3120_ExttrigDisable(struct comedi_device * dev)
{
devpriv->us_OutputRegister &= ~APCI3120_ENABLE_EXT_TRIGGER;
outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
void v_APCI3120_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
USHORT int_daq;
unsigned int int_amcc, ui_Check, i;
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InterruptHandleEos(comedi_device *dev) |
+| Function name :int i_APCI3120_InterruptHandleEos(struct comedi_device *dev) |
| |
| |
+----------------------------------------------------------------------------+
| to Comedi buffer. |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-/*int i_APCI3120_InterruptHandleEos(comedi_device *dev)
+/*int i_APCI3120_InterruptHandleEos(struct comedi_device *dev)
{
int n_chan,i;
short *data;
}
return 0;
}*/
-int i_APCI3120_InterruptHandleEos(comedi_device * dev)
+int i_APCI3120_InterruptHandleEos(struct comedi_device * dev)
{
int n_chan, i;
comedi_subdevice *s = dev->subdevices + 0;
void v_APCI3120_InterruptDma(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
unsigned int next_dma_buf, samplesinbuf;
unsigned long low_word, high_word, var;
| Comedi buffer |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| short *dma |
| short *data,int n |
+----------------------------------------------------------------------------+
*/
-/*void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n)
+/*void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n)
{
int i,j,m;
}
*/
-void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device * dev,
+void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device * dev,
comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
devpriv->ui_AiActualScan +=
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnConfigTimer(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnConfigTimer(struct comedi_device *dev, |
| comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task :Configure Timer 2 |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnConfigTimer(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnConfigTimer(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnWriteTimer(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnWriteTimer(struct comedi_device *dev, |
| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : To start and stop the timer |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnWriteTimer(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnWriteTimer(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function name : int i_APCI3120_InsnReadTimer(comedi_device *dev, |
+| Function name : int i_APCI3120_InsnReadTimer(struct comedi_device *dev, |
| comedi_subdevice *s,comedi_insn *insn, unsigned int *data) |
| |
| |
+----------------------------------------------------------------------------+
| Task : read the Timer value |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnReadTimer(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnReadTimer(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
BYTE b_Tmp;
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnReadDigitalInput(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnReadDigitalInput(struct comedi_device *dev, |
| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
| |
| Task : Reads the value of the specified Digital input channel|
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnReadDigitalInput(comedi_device * dev, comedi_subdevice
+int i_APCI3120_InsnReadDigitalInput(struct comedi_device * dev, comedi_subdevice
* s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Chan, ui_TmpValue;
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnBitsDigitalInput(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnBitsDigitalInput(struct comedi_device *dev, |
|comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| value is returned in data[0] |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnBitsDigitalInput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3120_InsnBitsDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue;
*/
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnConfigDigitalOutput(comedi_device |
+| Function name :int i_APCI3120_InsnConfigDigitalOutput(struct comedi_device |
| *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task :Configure the output memory ON or OFF |
| |
+----------------------------------------------------------------------------+
-| Input Parameters :comedi_device *dev |
+| Input Parameters :struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnConfigDigitalOutput(comedi_device * dev,
+int i_APCI3120_InsnConfigDigitalOutput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnBitsDigitalOutput(comedi_device *dev, |
+| Function name :int i_APCI3120_InsnBitsDigitalOutput(struct comedi_device *dev, |
| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : write diatal output port |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnBitsDigitalOutput(comedi_device * dev, comedi_subdevice
+int i_APCI3120_InsnBitsDigitalOutput(struct comedi_device * dev, comedi_subdevice
* s, comedi_insn * insn, unsigned int * data)
{
if ((data[0] > this_board->i_DoMaxdata) || (data[0] < 0)) {
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnWriteDigitalOutput(comedi_device *dev,|
+| Function name :int i_APCI3120_InsnWriteDigitalOutput(struct comedi_device *dev,|
|comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Write digiatl output |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnWriteDigitalOutput(comedi_device * dev, comedi_subdevice
+int i_APCI3120_InsnWriteDigitalOutput(struct comedi_device * dev, comedi_subdevice
* s, comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function name :int i_APCI3120_InsnWriteAnalogOutput(comedi_device *dev,|
+| Function name :int i_APCI3120_InsnWriteAnalogOutput(struct comedi_device *dev,|
|comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Write analog output |
| |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
| unsigned int *data |
+----------------------------------------------------------------------------+
*/
-int i_APCI3120_InsnWriteAnalogOutput(comedi_device * dev, comedi_subdevice
+int i_APCI3120_InsnWriteAnalogOutput(struct comedi_device * dev, comedi_subdevice
* s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Range, ui_Channel;
// Function Declaration For APCI-3120
// Internal functions
-int i_APCI3120_SetupChannelList(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_SetupChannelList(struct comedi_device *dev, comedi_subdevice *s,
int n_chan, unsigned int *chanlist, char check);
-int i_APCI3120_ExttrigEnable(comedi_device *dev);
-int i_APCI3120_ExttrigDisable(comedi_device *dev);
-int i_APCI3120_StopCyclicAcquisition(comedi_device *dev, comedi_subdevice *s);
-int i_APCI3120_Reset(comedi_device *dev);
-int i_APCI3120_CyclicAnalogInput(int mode, comedi_device *dev,
+int i_APCI3120_ExttrigEnable(struct comedi_device *dev);
+int i_APCI3120_ExttrigDisable(struct comedi_device *dev);
+int i_APCI3120_StopCyclicAcquisition(struct comedi_device *dev, comedi_subdevice *s);
+int i_APCI3120_Reset(struct comedi_device *dev);
+int i_APCI3120_CyclicAnalogInput(int mode, struct comedi_device *dev,
comedi_subdevice *s);
// Interrupt functions
void v_APCI3120_Interrupt(int irq, void *d);
-//UPDATE-0.7.57->0.7.68 void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n);
-void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,
+//UPDATE-0.7.57->0.7.68 void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n);
+void v_APCI3120_InterruptDmaMoveBlock16bit(struct comedi_device *dev,
comedi_subdevice *s,
short *dma_buffer,
unsigned int num_samples);
-int i_APCI3120_InterruptHandleEos(comedi_device *dev);
+int i_APCI3120_InterruptHandleEos(struct comedi_device *dev);
void v_APCI3120_InterruptDma(int irq, void *d);
// TIMER
-int i_APCI3120_InsnConfigTimer(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnConfigTimer(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_InsnWriteTimer(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnWriteTimer(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_InsnReadTimer(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnReadTimer(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//DI
// for di read
-int i_APCI3120_InsnBitsDigitalInput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnBitsDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_InsnReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnReadDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//DO
-//int i_APCI3120_WriteDigitalOutput(comedi_device *dev, BYTE data);
-int i_APCI3120_InsnConfigDigitalOutput(comedi_device *dev,
+//int i_APCI3120_WriteDigitalOutput(struct comedi_device *dev, BYTE data);
+int i_APCI3120_InsnConfigDigitalOutput(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
-int i_APCI3120_InsnBitsDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnBitsDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_InsnWriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnWriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//AO
-//int i_APCI3120_Write1AnalogValue(comedi_device *dev,UINT ui_Range,UINT ui_Channel,UINT data );
-int i_APCI3120_InsnWriteAnalogOutput(comedi_device *dev, comedi_subdevice *s,
+//int i_APCI3120_Write1AnalogValue(struct comedi_device *dev,UINT ui_Range,UINT ui_Channel,UINT data );
+int i_APCI3120_InsnWriteAnalogOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//AI HArdware layer
-int i_APCI3120_InsnConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnConfigAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_InsnReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_InsnReadAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3120_CommandTestAnalogInput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3120_CommandTestAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
-int i_APCI3120_CommandAnalogInput(comedi_device *dev, comedi_subdevice *s);
-//int i_APCI3120_CancelAnalogInput(comedi_device *dev, comedi_subdevice *s);
-int i_APCI3120_StopCyclicAcquisition(comedi_device *dev, comedi_subdevice *s);
+int i_APCI3120_CommandAnalogInput(struct comedi_device *dev, comedi_subdevice *s);
+//int i_APCI3120_CancelAnalogInput(struct comedi_device *dev, comedi_subdevice *s);
+int i_APCI3120_StopCyclicAcquisition(struct comedi_device *dev, comedi_subdevice *s);
}
}
-INT i_APCI3200_GetChannelCalibrationValue(comedi_device * dev,
+INT i_APCI3200_GetChannelCalibrationValue(struct comedi_device * dev,
unsigned int ui_Channel_num, unsigned int * CJCCurrentSource,
unsigned int * ChannelCurrentSource, unsigned int * ChannelGainFactor)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadDigitalInput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read for Port
Channel Numberfor single channel
| UINT data[0] : 0: Read single channel
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_ReadDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3200_ReadDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ConfigDigitalOutput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| data[0] :1 Memory enable
0 Memory Disable
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3200_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_WriteDigitalOutput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : writes To the digital Output Subdevice |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3200_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp = 0, ui_Temp1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadDigitalOutput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
data[0] :0 read single channel
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3200_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3200_ConfigAnalogInput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Input Subdevice |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_ConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3200_ConfigAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadAnalogInput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_ReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3200_ReadAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_DummyValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_Read1AnalogInputChannel |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannel : Channel No to read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_Read1AnalogInputChannel(comedi_device * dev,
+INT i_APCI3200_Read1AnalogInputChannel(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_EOC = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCalibrationOffsetValue |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read calibration offset value of the selected channel|
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCalibrationOffsetValue(comedi_device * dev, UINT * data)
+int i_APCI3200_ReadCalibrationOffsetValue(struct comedi_device * dev, UINT * data)
{
UINT ui_Temp = 0, ui_EOC = 0;
UINT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCalibrationGainValue |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read calibration gain value of the selected channel |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCalibrationGainValue(comedi_device * dev, UINT * data)
+int i_APCI3200_ReadCalibrationGainValue(struct comedi_device * dev, UINT * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCValue |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC value of the selected channel |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCValue(comedi_device * dev, unsigned int * data)
+int i_APCI3200_ReadCJCValue(struct comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCCalOffset |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC calibration offset value of the selected channel
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCCalOffset(comedi_device * dev, unsigned int * data)
+int i_APCI3200_ReadCJCCalOffset(struct comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCGainValue |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC calibration gain value
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCCalGain(comedi_device * dev, unsigned int * data)
+int i_APCI3200_ReadCJCCalGain(struct comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_InsnBits_AnalogInput_Test |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Tests the Selected Anlog Input Channel |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_InsnBits_AnalogInput_Test(comedi_device * dev,
+INT i_APCI3200_InsnBits_AnalogInput_Test(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Configuration = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_InsnWriteReleaseAnalogInput |
- | (comedi_device *dev,comedi_subdevice *s, |
+ | (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Resets the channels |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev : Driver handle |
+ | Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer
+----------------------------------------------------------------------------+
*/
-INT i_APCI3200_InsnWriteReleaseAnalogInput(comedi_device * dev,
+INT i_APCI3200_InsnWriteReleaseAnalogInput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
i_APCI3200_Reset(dev);
/*
+----------------------------------------------------------------------------+
- | Function name :int i_APCI3200_CommandTestAnalogInput(comedi_device *dev|
+ | Function name :int i_APCI3200_CommandTestAnalogInput(struct comedi_device *dev|
| ,comedi_subdevice *s,comedi_cmd *cmd) |
| |
+----------------------------------------------------------------------------+
| acquisition |
| |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev |
+ | Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| comedi_cmd *cmd |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_CommandTestAnalogInput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3200_CommandTestAnalogInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
/*
+----------------------------------------------------------------------------+
- | Function name :int i_APCI3200_StopCyclicAcquisition(comedi_device *dev,|
+ | Function name :int i_APCI3200_StopCyclicAcquisition(struct comedi_device *dev,|
| comedi_subdevice *s)|
| |
+----------------------------------------------------------------------------+
| Task : Stop the acquisition |
| |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev |
+ | Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_StopCyclicAcquisition(comedi_device * dev, comedi_subdevice * s)
+int i_APCI3200_StopCyclicAcquisition(struct comedi_device * dev, comedi_subdevice * s)
{
UINT ui_Configuration = 0;
//i_InterruptFlag=0;
/*
+----------------------------------------------------------------------------+
- | Function name : int i_APCI3200_CommandAnalogInput(comedi_device *dev, |
+ | Function name : int i_APCI3200_CommandAnalogInput(struct comedi_device *dev, |
| comedi_subdevice *s) |
| |
+----------------------------------------------------------------------------+
| Determines the mode 1 or 2. |
| |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev |
+ | Input Parameters : struct comedi_device *dev |
| comedi_subdevice *s |
| |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_CommandAnalogInput(comedi_device * dev, comedi_subdevice * s)
+int i_APCI3200_CommandAnalogInput(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
UINT ui_Configuration = 0;
/*
+----------------------------------------------------------------------------+
- | Function Name : int i_APCI3200_Reset(comedi_device *dev) |
+ | Function Name : int i_APCI3200_Reset(struct comedi_device *dev) |
| |
+----------------------------------------------------------------------------+
| Task :Resets the registers of the card |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_Reset(comedi_device * dev)
+int i_APCI3200_Reset(struct comedi_device * dev)
{
INT i_Temp;
DWORD dw_Dummy;
*/
void v_APCI3200_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_StatusRegister = 0;
UINT ui_ChannelNumber = 0;
INT i_CalibrationFlag = 0;
/*
+----------------------------------------------------------------------------+
- | Function name :int i_APCI3200_InterruptHandleEos(comedi_device *dev) |
+ | Function name :int i_APCI3200_InterruptHandleEos(struct comedi_device *dev) |
| |
| |
+----------------------------------------------------------------------------+
| to Comedi buffer. |
| |
+----------------------------------------------------------------------------+
- | Input Parameters : comedi_device *dev |
+ | Input Parameters : struct comedi_device *dev |
| |
| |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_InterruptHandleEos(comedi_device * dev)
+int i_APCI3200_InterruptHandleEos(struct comedi_device * dev)
{
UINT ui_StatusRegister = 0;
comedi_subdevice *s = dev->subdevices + 0;
//AI
-INT i_APCI3200_ConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3200_ConfigAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3200_ReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3200_ReadAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3200_InsnWriteReleaseAnalogInput(comedi_device *dev,
+INT i_APCI3200_InsnWriteReleaseAnalogInput(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3200_InsnBits_AnalogInput_Test(comedi_device *dev,
+INT i_APCI3200_InsnBits_AnalogInput_Test(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3200_StopCyclicAcquisition(comedi_device *dev, comedi_subdevice *s);
-INT i_APCI3200_InterruptHandleEos(comedi_device *dev);
-INT i_APCI3200_CommandTestAnalogInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3200_StopCyclicAcquisition(struct comedi_device *dev, comedi_subdevice *s);
+INT i_APCI3200_InterruptHandleEos(struct comedi_device *dev);
+INT i_APCI3200_CommandTestAnalogInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
-INT i_APCI3200_CommandAnalogInput(comedi_device *dev, comedi_subdevice *s);
-INT i_APCI3200_ReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3200_CommandAnalogInput(struct comedi_device *dev, comedi_subdevice *s);
+INT i_APCI3200_ReadDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//Interrupt
void v_APCI3200_Interrupt(int irq, void *d);
-int i_APCI3200_InterruptHandleEos(comedi_device *dev);
+int i_APCI3200_InterruptHandleEos(struct comedi_device *dev);
//Reset functions
-INT i_APCI3200_Reset(comedi_device *dev);
+INT i_APCI3200_Reset(struct comedi_device *dev);
-int i_APCI3200_ReadCJCCalOffset(comedi_device *dev, unsigned int *data);
-int i_APCI3200_ReadCJCValue(comedi_device *dev, unsigned int *data);
-int i_APCI3200_ReadCalibrationGainValue(comedi_device *dev, UINT *data);
-int i_APCI3200_ReadCalibrationOffsetValue(comedi_device *dev, UINT *data);
-int i_APCI3200_Read1AnalogInputChannel(comedi_device *dev,
+int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev, unsigned int *data);
+int i_APCI3200_ReadCJCValue(struct comedi_device *dev, unsigned int *data);
+int i_APCI3200_ReadCalibrationGainValue(struct comedi_device *dev, UINT *data);
+int i_APCI3200_ReadCalibrationOffsetValue(struct comedi_device *dev, UINT *data);
+int i_APCI3200_Read1AnalogInputChannel(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
unsigned int *data);
-int i_APCI3200_ReadCJCCalGain(comedi_device *dev, unsigned int *data);
+int i_APCI3200_ReadCJCCalGain(struct comedi_device *dev, unsigned int *data);
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_ReadDigitalInput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3501_ReadDigitalInput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3501_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+int i_APCI3501_ConfigDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : writes To the digital Output Subdevice |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3501_WriteDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To read |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3501_ReadDigitalOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigAnalogOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Output Subdevice |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_ConfigAnalogOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3501_ConfigAnalogOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
outl(data[0],
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_WriteAnalogOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes To the Selected Anlog Output Channel |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
| unsigned int *data : Data Pointer contains |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_WriteAnalogOutput(comedi_device * dev, comedi_subdevice * s,
+INT i_APCI3501_WriteAnalogOutput(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0, ul_Channel_no, ul_Polarity, ul_DAC_Ready = 0;;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI3501_ConfigTimerCounterWatchdog(comedi_device * dev,
+INT i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_StartStopWriteTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3501_StartStopWriteTimerCounterWatchdog(comedi_device * dev,
+int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s, |
+| (struct comedi_device *dev,comedi_subdevice *s, |
| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT *data : Data Pointer contains |
| configuration parameters as below |
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3501_ReadTimerCounterWatchdog(comedi_device * dev,
+int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI3501_Reset(comedi_device *dev) |
+| Function Name : int i_APCI3501_Reset(struct comedi_device *dev) |
| |
+----------------------------------------------------------------------------+
| Task :Resets the registers of the card |
+----------------------------------------------------------------------------+
*/
-int i_APCI3501_Reset(comedi_device * dev)
+int i_APCI3501_Reset(struct comedi_device * dev)
{
int i_Count = 0, i_temp = 0;
ULONG ul_Command1 = 0, ul_Polarity, ul_DAC_Ready = 0;
void v_APCI3501_Interrupt(int irq, void *d)
{
int i_temp;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned int ui_Timer_AOWatchdog;
unsigned long ul_Command1;
// Disable Interrupt
// Hardware Layer functions for Apci3501
//AO
-INT i_APCI3501_ConfigAnalogOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3501_ConfigAnalogOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3501_WriteAnalogOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3501_WriteAnalogOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//DI
// for di read
-//INT i_APCI3501_ReadDigitalInput(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
+//INT i_APCI3501_ReadDigitalInput(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
-INT i_APCI3501_ReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3501_ReadDigitalInput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//DO
-int i_APCI3501_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+int i_APCI3501_ConfigDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3501_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-INT i_APCI3501_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
+INT i_APCI3501_ReadDigitalOutput(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
-INT i_APCI3501_ConfigTimerCounterWatchdog(comedi_device *dev,
+INT i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-int i_APCI3501_StartStopWriteTimerCounterWatchdog(comedi_device *dev,
+int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
unsigned int *data);
-int i_APCI3501_ReadTimerCounterWatchdog(comedi_device *dev,
+int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
//Interrupt
void v_APCI3501_Interrupt(int irq, void *d);
//Reset functions
-int i_APCI3501_Reset(comedi_device *dev);
+int i_APCI3501_Reset(struct comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_TestConversionStarted |
-| (comedi_device *dev) |
+| (struct comedi_device *dev) |
+----------------------------------------------------------------------------+
| Task Test if any conversion started |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_TestConversionStarted(comedi_device * dev)
+int i_APCI3XXX_TestConversionStarted(struct comedi_device * dev)
{
if ((readl((void *)(devpriv->dw_AiBase + 8)) & 0x80000UL) == 0x80000UL) {
return (1);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_AnalogInputConfigOperatingMode |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_AnalogInputConfigOperatingMode(comedi_device * dev,
+int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnConfigAnalogInput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnConfigAnalogInput(comedi_device * dev,
+int i_APCI3XXX_InsnConfigAnalogInput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnReadAnalogInput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnReadAnalogInput(comedi_device * dev,
+int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
void v_APCI3XXX_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
BYTE b_CopyCpt = 0;
DWORD dw_Status = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnWriteAnalogOutput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnWriteAnalogOutput(comedi_device * dev,
+int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Range = (BYTE) CR_RANGE(insn->chanspec);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnConfigInitTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnConfigInitTTLIO(comedi_device * dev,
+int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnBitsTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnBitsTTLIO(comedi_device * dev,
+int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnReadTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnReadTTLIO(comedi_device * dev,
+int i_APCI3XXX_InsnReadTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3XXX_InsnWriteTTLIO |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnWriteTTLIO(comedi_device * dev,
+int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3XXX_InsnReadDigitalInput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnReadDigitalInput(comedi_device * dev,
+int i_APCI3XXX_InsnReadDigitalInput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3XXX_InsnBitsDigitalInput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
| -101 : Data size error |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnBitsDigitalInput(comedi_device * dev,
+int i_APCI3XXX_InsnBitsDigitalInput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3XXX_InsnBitsDigitalOutput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
| -101 : Data size error |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnBitsDigitalOutput(comedi_device * dev,
+int i_APCI3XXX_InsnBitsDigitalOutput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3XXX_InsnWriteDigitalOutput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnWriteDigitalOutput(comedi_device * dev,
+int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3XXX_InsnReadDigitalOutput |
-| (comedi_device *dev, |
+| (struct comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
| unsigned int *data) |
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_InsnReadDigitalOutput(comedi_device * dev,
+int i_APCI3XXX_InsnReadDigitalOutput(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI3XXX_Reset(comedi_device *dev) | +----------------------------------------------------------------------------+
+| Function Name : int i_APCI3XXX_Reset(struct comedi_device *dev) | +----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev |
+| Input Parameters : struct comedi_device *dev |
+----------------------------------------------------------------------------+
| Output Parameters : - |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3XXX_Reset(comedi_device * dev)
+int i_APCI3XXX_Reset(struct comedi_device * dev)
{
unsigned char b_Cpt = 0;
#define devpriv ((pci6208_private *)dev->private)
-static int pci6208_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci6208_detach(comedi_device * dev);
+static int pci6208_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci6208_detach(struct comedi_device * dev);
#define pci6208_board_nbr \
(sizeof(pci6208_boards) / sizeof(pci6208_board))
COMEDI_PCI_INITCLEANUP(driver_pci6208, pci6208_pci_table);
-static int pci6208_find_device(comedi_device * dev, int bus, int slot);
+static int pci6208_find_device(struct comedi_device * dev, int bus, int slot);
static int
pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr,
int dev_minor);
/*read/write functions*/
-static int pci6208_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int pci6208_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pci6208_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci6208_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-//static int pci6208_dio_insn_bits(comedi_device *dev,comedi_subdevice *s,
+//static int pci6208_dio_insn_bits(struct comedi_device *dev,comedi_subdevice *s,
// comedi_insn *insn,unsigned int *data);
-//static int pci6208_dio_insn_config(comedi_device *dev,comedi_subdevice *s,
+//static int pci6208_dio_insn_config(struct comedi_device *dev,comedi_subdevice *s,
// comedi_insn *insn,unsigned int *data);
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pci6208_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci6208_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int retval;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pci6208_detach(comedi_device * dev)
+static int pci6208_detach(struct comedi_device * dev)
{
printk("comedi%d: pci6208: remove\n", dev->minor);
return 0;
}
-static int pci6208_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int pci6208_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i = 0, Data_Read;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int pci6208_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci6208_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-//static int pci6208_dio_insn_bits(comedi_device *dev,comedi_subdevice *s,
+//static int pci6208_dio_insn_bits(struct comedi_device *dev,comedi_subdevice *s,
// comedi_insn *insn,unsigned int *data)
//{
// if(insn->n!=2)return -EINVAL;
// return 2;
//}
-//static int pci6208_dio_insn_config(comedi_device *dev,comedi_subdevice *s,
+//static int pci6208_dio_insn_config(struct comedi_device *dev,comedi_subdevice *s,
// comedi_insn *insn,unsigned int *data)
//{
// int chan=CR_CHAN(insn->chanspec);
// return 1;
//}
-static int pci6208_find_device(comedi_device * dev, int bus, int slot)
+static int pci6208_find_device(struct comedi_device * dev, int bus, int slot)
{
struct pci_dev *pci_dev;
int i;
#define devpriv ((adl_pci7296_private *)dev->private)
-static int adl_pci7296_attach(comedi_device * dev, comedi_devconfig * it);
-static int adl_pci7296_detach(comedi_device * dev);
+static int adl_pci7296_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int adl_pci7296_detach(struct comedi_device * dev);
static comedi_driver driver_adl_pci7296 = {
driver_name:"adl_pci7296",
module:THIS_MODULE,
detach:adl_pci7296_detach,
};
-static int adl_pci7296_attach(comedi_device * dev, comedi_devconfig * it)
+static int adl_pci7296_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
comedi_subdevice *s;
return -EIO;
}
-static int adl_pci7296_detach(comedi_device * dev)
+static int adl_pci7296_detach(struct comedi_device * dev)
{
printk("comedi%d: pci7432: remove\n", dev->minor);
#define devpriv ((adl_pci7432_private *)dev->private)
-static int adl_pci7432_attach(comedi_device * dev, comedi_devconfig * it);
-static int adl_pci7432_detach(comedi_device * dev);
+static int adl_pci7432_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int adl_pci7432_detach(struct comedi_device * dev);
static comedi_driver driver_adl_pci7432 = {
driver_name:"adl_pci7432",
module:THIS_MODULE,
/* Digital IO */
-static int adl_pci7432_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci7432_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci7432_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci7432_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/* */
-static int adl_pci7432_attach(comedi_device * dev, comedi_devconfig * it)
+static int adl_pci7432_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
comedi_subdevice *s;
return -EIO;
}
-static int adl_pci7432_detach(comedi_device * dev)
+static int adl_pci7432_detach(struct comedi_device * dev)
{
printk("comedi%d: pci7432: remove\n", dev->minor);
return 0;
}
-static int adl_pci7432_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci7432_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
printk("comedi: pci7432_do_insn_bits called\n");
return 2;
}
-static int adl_pci7432_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci7432_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
printk("comedi: pci7432_di_insn_bits called\n");
#define devpriv ((adl_pci8164_private *)dev->private)
-static int adl_pci8164_attach(comedi_device * dev, comedi_devconfig * it);
-static int adl_pci8164_detach(comedi_device * dev);
+static int adl_pci8164_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int adl_pci8164_detach(struct comedi_device * dev);
static comedi_driver driver_adl_pci8164 = {
driver_name:"adl_pci8164",
module:THIS_MODULE,
detach:adl_pci8164_detach,
};
-static int adl_pci8164_insn_read_msts(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_msts(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_read_ssts(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_ssts(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_read_buf0(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_buf0(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_read_buf1(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_buf1(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_write_cmd(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_write_cmd(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_write_otp(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_write_otp(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_write_buf0(comedi_device * dev,
+static int adl_pci8164_insn_write_buf0(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_insn_write_buf1(comedi_device * dev,
+static int adl_pci8164_insn_write_buf1(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int adl_pci8164_attach(comedi_device * dev, comedi_devconfig * it)
+static int adl_pci8164_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
comedi_subdevice *s;
return -EIO;
}
-static int adl_pci8164_detach(comedi_device * dev)
+static int adl_pci8164_detach(struct comedi_device * dev)
{
printk("comedi%d: pci8164: remove\n", dev->minor);
return 0;
}
-static int adl_pci8164_insn_read_msts(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_msts(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_read_ssts(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_ssts(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_read_buf0(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_buf0(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_read_buf1(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_read_buf1(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_write_cmd(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_write_cmd(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_write_otp(comedi_device * dev, comedi_subdevice * s,
+static int adl_pci8164_insn_write_otp(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_write_buf0(comedi_device * dev,
+static int adl_pci8164_insn_write_buf0(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
return 2;
}
-static int adl_pci8164_insn_write_buf1(comedi_device * dev,
+static int adl_pci8164_insn_write_buf1(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
// Function prototypes
//
-static int pci9111_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci9111_detach(comedi_device * dev);
-static void pci9111_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static int pci9111_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci9111_detach(struct comedi_device * dev);
+static void pci9111_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int start_chan_index);
static const comedi_lrange pci9111_hr_ai_range = {
// 8254 timer
//
-static void pci9111_timer_set(comedi_device * dev)
+static void pci9111_timer_set(struct comedi_device * dev)
{
pci9111_8254_control_set(PCI9111_8254_COUNTER_0 |
PCI9111_8254_READ_LOAD_LSB_MSB |
external
} pci9111_trigger_sources;
-static void pci9111_trigger_source_set(comedi_device * dev,
+static void pci9111_trigger_source_set(struct comedi_device * dev,
pci9111_trigger_sources source)
{
int flags;
pci9111_trigger_and_autoscan_set(flags);
}
-static void pci9111_pretrigger_set(comedi_device * dev, bool pretrigger)
+static void pci9111_pretrigger_set(struct comedi_device * dev, bool pretrigger)
{
int flags;
pci9111_trigger_and_autoscan_set(flags);
}
-static void pci9111_autoscan_set(comedi_device * dev, bool autoscan)
+static void pci9111_autoscan_set(struct comedi_device * dev, bool autoscan)
{
int flags;
irq_on_external_trigger
} pci9111_ISC1_sources;
-static void pci9111_interrupt_source_set(comedi_device * dev,
+static void pci9111_interrupt_source_set(struct comedi_device * dev,
pci9111_ISC0_sources irq_0_source, pci9111_ISC1_sources irq_1_source)
{
int flags;
#undef AI_DO_CMD_DEBUG
-static int pci9111_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci9111_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
// Disable interrupts
if (!src || tmp != src) error++
static int
-pci9111_ai_do_cmd_test(comedi_device * dev,
+pci9111_ai_do_cmd_test(struct comedi_device * dev,
comedi_subdevice * s, comedi_cmd * cmd)
{
int tmp;
// Analog input command
//
-static int pci9111_ai_do_cmd(comedi_device * dev, comedi_subdevice * subdevice)
+static int pci9111_ai_do_cmd(struct comedi_device * dev, comedi_subdevice * subdevice)
{
comedi_cmd *async_cmd = &subdevice->async->cmd;
return 0;
}
-static void pci9111_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static void pci9111_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int start_chan_index)
{
unsigned int i, num_samples = num_bytes / sizeof(short);
static irqreturn_t pci9111_interrupt(int irq, void *p_device PT_REGS_ARG)
{
- comedi_device *dev = p_device;
+ struct comedi_device *dev = p_device;
comedi_subdevice *subdevice = dev->read_subdev;
comedi_async *async;
unsigned long irq_flags;
#undef AI_INSN_DEBUG
-static int pci9111_ai_insn_read(comedi_device * dev,
+static int pci9111_ai_insn_read(struct comedi_device * dev,
comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
int resolution =
//
static int
-pci9111_ao_insn_write(comedi_device * dev,
+pci9111_ao_insn_write(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
// Analog output readback
//
-static int pci9111_ao_insn_read(comedi_device * dev,
+static int pci9111_ao_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
// Digital inputs
//
-static int pci9111_di_insn_bits(comedi_device * dev,
+static int pci9111_di_insn_bits(struct comedi_device * dev,
comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
// Digital outputs
//
-static int pci9111_do_insn_bits(comedi_device * dev,
+static int pci9111_do_insn_bits(struct comedi_device * dev,
comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
// Reset device
//
-static int pci9111_reset(comedi_device * dev)
+static int pci9111_reset(struct comedi_device * dev)
{
// Set trigger source to software
// - Declare device driver capability
//
-static int pci9111_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci9111_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *subdevice;
unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
// Detach
//
-static int pci9111_detach(comedi_device * dev)
+static int pci9111_detach(struct comedi_device * dev)
{
// Reset device
#define PCI9118_BIPOLAR_RANGES 4 /* used for test on mixture of BIP/UNI ranges */
-static int pci9118_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci9118_detach(comedi_device * dev);
+static int pci9118_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci9118_detach(struct comedi_device * dev);
typedef struct {
const char *name; // board name
unsigned char cnt0_users; // bit field of 8254 CNT0 users (0-unused, 1-AO, 2-DI, 3-DO)
unsigned char exttrg_users; // bit field of external trigger users (0-AI, 1-AO, 2-DI, 3-DO)
unsigned int cnt0_divisor; // actual CNT0 divisor
- void (*int_ai_func) (comedi_device *, comedi_subdevice *, unsigned short, unsigned int, unsigned short); // ptr to actual interrupt AI function
+ void (*int_ai_func) (struct comedi_device *, comedi_subdevice *, unsigned short, unsigned int, unsigned short); // ptr to actual interrupt AI function
unsigned char ai16bits; // =1 16 bit card
unsigned char usedma; // =1 use DMA transfer and not INT
unsigned char useeoshandle; // =1 change WAKE_EOS DMA transfer to fit on every second
==============================================================================
*/
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
int n_chan, unsigned int *chanlist, int frontadd, int backadd);
-static int setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
int n_chan, unsigned int *chanlist, int rot, int frontadd, int backadd,
int usedma, char eoshandle);
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
-static int pci9118_reset(comedi_device * dev);
-static int pci9118_exttrg_add(comedi_device * dev, unsigned char source);
-static int pci9118_exttrg_del(comedi_device * dev, unsigned char source);
-static int pci9118_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static void pci9118_calc_divisors(char mode, comedi_device * dev,
+static int pci9118_reset(struct comedi_device * dev);
+static int pci9118_exttrg_add(struct comedi_device * dev, unsigned char source);
+static int pci9118_exttrg_del(struct comedi_device * dev, unsigned char source);
+static int pci9118_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void pci9118_calc_divisors(char mode, struct comedi_device * dev,
comedi_subdevice * s, unsigned int *tim1, unsigned int *tim2,
unsigned int flags, int chans, unsigned int *div1, unsigned int *div2,
char usessh, unsigned int chnsshfront);
/*
==============================================================================
*/
-static int pci9118_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_insn_read_ai(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
/*
==============================================================================
*/
-static int pci9118_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_insn_write_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chanreg, ch;
/*
==============================================================================
*/
-static int pci9118_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_insn_read_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chan;
/*
==============================================================================
*/
-static int pci9118_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_insn_bits_di(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[1] = inl(dev->iobase + PCI9118_DI) & 0xf;
/*
==============================================================================
*/
-static int pci9118_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_insn_bits_do(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
/*
==============================================================================
*/
-static void interrupt_pci9118_ai_mode4_switch(comedi_device * dev)
+static void interrupt_pci9118_ai_mode4_switch(struct comedi_device * dev)
{
devpriv->AdFunctionReg =
AdFunction_PDTrg | AdFunction_PETrg | AdFunction_AM;
outl(devpriv->AdFunctionReg, dev->iobase + PCI9118_ADFUNC);
}
-static unsigned int defragment_dma_buffer(comedi_device * dev,
+static unsigned int defragment_dma_buffer(struct comedi_device * dev,
comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
unsigned int i = 0, j = 0;
/*
==============================================================================
*/
-static unsigned int move_block_from_dma(comedi_device * dev,
+static unsigned int move_block_from_dma(struct comedi_device * dev,
comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
unsigned int num_bytes;
/*
==============================================================================
*/
-static char pci9118_decode_error_status(comedi_device * dev,
+static char pci9118_decode_error_status(struct comedi_device * dev,
comedi_subdevice * s, unsigned char m)
{
if (m & 0x100) {
return 0;
}
-static void pci9118_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static void pci9118_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int start_chan_index)
{
unsigned int i, num_samples = num_bytes / sizeof(short);
/*
==============================================================================
*/
-static void interrupt_pci9118_ai_onesample(comedi_device * dev,
+static void interrupt_pci9118_ai_onesample(struct comedi_device * dev,
comedi_subdevice * s, unsigned short int_adstat, unsigned int int_amcc,
unsigned short int_daq)
{
/*
==============================================================================
*/
-static void interrupt_pci9118_ai_dma(comedi_device * dev, comedi_subdevice * s,
+static void interrupt_pci9118_ai_dma(struct comedi_device * dev, comedi_subdevice * s,
unsigned short int_adstat, unsigned int int_amcc,
unsigned short int_daq)
{
*/
static irqreturn_t interrupt_pci9118(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned int int_daq = 0, int_amcc, int_adstat;
if (!dev->attached)
/*
==============================================================================
*/
-static int pci9118_ai_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_ai_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
if (trignum != devpriv->ai_inttrig_start)
/*
==============================================================================
*/
-static int pci9118_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci9118_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
==============================================================================
*/
-static int Compute_and_setup_dma(comedi_device * dev)
+static int Compute_and_setup_dma(struct comedi_device * dev)
{
unsigned int dmalen0, dmalen1, i;
/*
==============================================================================
*/
-static int pci9118_ai_docmd_sampl(comedi_device * dev, comedi_subdevice * s)
+static int pci9118_ai_docmd_sampl(struct comedi_device * dev, comedi_subdevice * s)
{
DPRINTK("adl_pci9118 EDBG: BGN: pci9118_ai_docmd_sampl(%d,) [%d]\n",
dev->minor, devpriv->ai_do);
/*
==============================================================================
*/
-static int pci9118_ai_docmd_dma(comedi_device * dev, comedi_subdevice * s)
+static int pci9118_ai_docmd_dma(struct comedi_device * dev, comedi_subdevice * s)
{
DPRINTK("adl_pci9118 EDBG: BGN: pci9118_ai_docmd_dma(%d,) [%d,%d]\n",
dev->minor, devpriv->ai_do, devpriv->usedma);
/*
==============================================================================
*/
-static int pci9118_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pci9118_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int addchans = 0;
/*
==============================================================================
*/
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
int n_chan, unsigned int *chanlist, int frontadd, int backadd)
{
unsigned int i, differencial = 0, bipolar = 0;
/*
==============================================================================
*/
-static int setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
int n_chan, unsigned int *chanlist, int rot, int frontadd, int backadd,
int usedma, char useeos)
{
==============================================================================
calculate 8254 divisors if they are used for dual timing
*/
-static void pci9118_calc_divisors(char mode, comedi_device * dev,
+static void pci9118_calc_divisors(char mode, struct comedi_device * dev,
comedi_subdevice * s, unsigned int *tim1, unsigned int *tim2,
unsigned int flags, int chans, unsigned int *div1, unsigned int *div2,
char usessh, unsigned int chnsshfront)
/*
==============================================================================
*/
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2)
{
outl(0x74, dev->iobase + PCI9118_CNTCTRL);
/*
==============================================================================
*/
-static int pci9118_exttrg_add(comedi_device * dev, unsigned char source)
+static int pci9118_exttrg_add(struct comedi_device * dev, unsigned char source)
{
if (source > 3)
return -1; // incorrect source
/*
==============================================================================
*/
-static int pci9118_exttrg_del(comedi_device * dev, unsigned char source)
+static int pci9118_exttrg_del(struct comedi_device * dev, unsigned char source)
{
if (source > 3)
return -1; // incorrect source
/*
==============================================================================
*/
-static int pci9118_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci9118_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
if (devpriv->usedma)
outl(inl(devpriv->iobase_a + AMCC_OP_REG_MCSR) & (~EN_A2P_TRANSFERS), devpriv->iobase_a + AMCC_OP_REG_MCSR); // stop DMA
/*
==============================================================================
*/
-static int pci9118_reset(comedi_device * dev)
+static int pci9118_reset(struct comedi_device * dev)
{
devpriv->IntControlReg = 0;
devpriv->exttrg_users = 0;
/*
==============================================================================
*/
-static int pci9118_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci9118_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret, pages, i;
/*
==============================================================================
*/
-static int pci9118_detach(comedi_device * dev)
+static int pci9118_detach(struct comedi_device * dev)
{
if (dev->private) {
if (devpriv->valid)
* the board, and also about the kernel module that contains
* the device code.
*/
-static int adq12b_attach(comedi_device *dev,comedi_devconfig *it);
-static int adq12b_detach(comedi_device *dev);
+static int adq12b_attach(struct comedi_device *dev,comedi_devconfig *it);
+static int adq12b_detach(struct comedi_device *dev);
static comedi_driver driver_adq12b={
driver_name: "adq12b",
module: THIS_MODULE,
num_names: sizeof(adq12b_boards) / sizeof(adq12b_board),
};
-static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
-static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
-static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
+static int adq12b_ai_rinsn(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
+static int adq12b_di_insn_bits(struct comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
+static int adq12b_do_insn_bits(struct comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
/*
* Attach is called by the Comedi core to configure the driver
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int adq12b_attach(comedi_device *dev,comedi_devconfig *it)
+static int adq12b_attach(struct comedi_device *dev,comedi_devconfig *it)
{
comedi_subdevice *s;
unsigned long iobase;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int adq12b_detach(comedi_device *dev)
+static int adq12b_detach(struct comedi_device *dev)
{
if (dev->iobase)
release_region(dev->iobase, ADQ12B_SIZE);
* mode.
*/
-static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data)
+static int adq12b_ai_rinsn(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data)
{
int n, i;
int range, channel;
}
-static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
+static int adq12b_di_insn_bits(struct comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
{
/* only bits 0-4 have information about digital inputs */
}
-static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
+static int adq12b_do_insn_bits(struct comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
{
int channel;
}
};
-static int pci1710_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci1710_detach(comedi_device * dev);
+static int pci1710_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci1710_detach(struct comedi_device * dev);
typedef struct {
const char *name; // board name
==============================================================================
*/
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan);
-static void setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static void setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan, unsigned int seglen);
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
-static int pci1710_reset(comedi_device * dev);
-static int pci171x_ai_cancel(comedi_device * dev, comedi_subdevice * s);
+static int pci1710_reset(struct comedi_device * dev);
+static int pci171x_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
static const unsigned int muxonechan[] = { 0x0000, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505, 0x0606, 0x0707, // used for gain list programming
0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d, 0x0e0e, 0x0f0f,
/*
==============================================================================
*/
-static int pci171x_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_read_ai(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, timeout;
/*
==============================================================================
*/
-static int pci171x_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_write_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chan, range, ofs;
/*
==============================================================================
*/
-static int pci171x_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_read_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chan;
/*
==============================================================================
*/
-static int pci171x_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_bits_di(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[1] = inw(dev->iobase + PCI171x_DI);
/*
==============================================================================
*/
-static int pci171x_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_bits_do(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
/*
==============================================================================
*/
-static int pci171x_insn_counter_read(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_counter_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int msb, lsb, ccntrl;
/*
==============================================================================
*/
-static int pci171x_insn_counter_write(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_insn_counter_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
uint msb, lsb, ccntrl, status;
/*
==============================================================================
*/
-static int pci171x_insn_counter_config(comedi_device * dev,
+static int pci171x_insn_counter_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
#ifdef unused
/*
==============================================================================
*/
-static int pci1720_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci1720_insn_write_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, rangereg, chan;
*/
static void interrupt_pci1710_every_sample(void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int m;
#ifdef PCI171x_PARANOIDCHECK
/*
==============================================================================
*/
-static int move_block_from_fifo(comedi_device * dev, comedi_subdevice * s,
+static int move_block_from_fifo(struct comedi_device * dev, comedi_subdevice * s,
int n, int turn)
{
int i, j;
*/
static void interrupt_pci1710_half_fifo(void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int m, samplesinbuf;
*/
static irqreturn_t interrupt_service_pci1710(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
DPRINTK("adv_pci1710 EDBG: BGN: interrupt_service_pci1710(%d,...)\n",
irq);
/*
==============================================================================
*/
-static int pci171x_ai_docmd_and_mode(int mode, comedi_device * dev,
+static int pci171x_ai_docmd_and_mode(int mode, struct comedi_device * dev,
comedi_subdevice * s)
{
unsigned int divisor1, divisor2;
/*
==============================================================================
*/
-static int pci171x_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci171x_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
==============================================================================
*/
-static int pci171x_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pci171x_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
If it's ok, then program scan/gain logic.
This works for all cards.
*/
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan)
{
unsigned int chansegment[32];
return seglen;
}
-static void setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static void setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan, unsigned int seglen)
{
unsigned int i, range, chanprog;
/*
==============================================================================
*/
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2)
{
DPRINTK("adv_pci1710 EDBG: BGN: start_pacer(%d,%u,%u)\n", mode,
/*
==============================================================================
*/
-static int pci171x_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci171x_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
DPRINTK("adv_pci1710 EDBG: BGN: pci171x_ai_cancel(...)\n");
/*
==============================================================================
*/
-static int pci171x_reset(comedi_device * dev)
+static int pci171x_reset(struct comedi_device * dev)
{
DPRINTK("adv_pci1710 EDBG: BGN: pci171x_reset(...)\n");
outw(0x30, dev->iobase + PCI171x_CNTCTRL);
/*
==============================================================================
*/
-static int pci1720_reset(comedi_device * dev)
+static int pci1720_reset(struct comedi_device * dev)
{
DPRINTK("adv_pci1710 EDBG: BGN: pci1720_reset(...)\n");
outb(Syncont_SC0, dev->iobase + PCI1720_SYNCONT); // set synchronous output mode
/*
==============================================================================
*/
-static int pci1710_reset(comedi_device * dev)
+static int pci1710_reset(struct comedi_device * dev)
{
DPRINTK("adv_pci1710 EDBG: BGN: pci1710_reset(...)\n");
switch (this_board->cardtype) {
/*
==============================================================================
*/
-static int pci1710_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci1710_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret, subdev, n_subdevices;
/*
==============================================================================
*/
-static int pci1710_detach(comedi_device * dev)
+static int pci1710_detach(struct comedi_device * dev)
{
if (dev->private) {
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pci1723_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci1723_detach(comedi_device * dev);
+static int pci1723_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci1723_detach(struct comedi_device * dev);
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
/*
* the pci1723 card reset;
*/
-static int pci1723_reset(comedi_device * dev)
+static int pci1723_reset(struct comedi_device * dev)
{
int i;
DPRINTK("adv_pci1723 EDBG: BGN: pci1723_reset(...)\n");
return 0;
}
-static int pci1723_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
+static int pci1723_insn_read_ao(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chan;
/*
analog data output;
*/
-static int pci1723_ao_write_winsn(comedi_device * dev, comedi_subdevice * s,
+static int pci1723_ao_write_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, chan;
/*
digital i/o config/query
*/
-static int pci1723_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pci1723_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
/*
digital i/o bits read/write
*/
-static int pci1723_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pci1723_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
* Attach is called by the Comedi core to configure the driver
* for a pci1723 board.
*/
-static int pci1723_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci1723_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret, subdev, n_subdevices;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pci1723_detach(comedi_device * dev)
+static int pci1723_detach(struct comedi_device * dev)
{
printk("comedi%d: pci1723: remove\n", dev->minor);
#define OMBCMD_RETRY 0x03 /* 3 times try request before error */
-static int pci_dio_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci_dio_detach(comedi_device * dev);
+static int pci_dio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci_dio_detach(struct comedi_device * dev);
typedef struct {
int chans; // num of chans
/*
==============================================================================
*/
-static int pci_dio_insn_bits_di_b(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_insn_bits_di_b(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
/*
==============================================================================
*/
-static int pci_dio_insn_bits_di_w(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_insn_bits_di_w(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
/*
==============================================================================
*/
-static int pci_dio_insn_bits_do_b(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_insn_bits_do_b(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
/*
==============================================================================
*/
-static int pci_dio_insn_bits_do_w(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_insn_bits_do_w(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
/*
==============================================================================
*/
-static int pci1760_unchecked_mbxrequest(comedi_device * dev,
+static int pci1760_unchecked_mbxrequest(struct comedi_device * dev,
unsigned char *omb, unsigned char *imb, int repeats)
{
int cnt, tout, ok = 0;
return -ETIME;
}
-static int pci1760_clear_imb2(comedi_device * dev)
+static int pci1760_clear_imb2(struct comedi_device * dev)
{
unsigned char omb[4] = { 0x0, 0x0, CMD_ClearIMB2, 0x0 };
unsigned char imb[4];
return pci1760_unchecked_mbxrequest(dev, omb, imb, OMBCMD_RETRY);
}
-static int pci1760_mbxrequest(comedi_device * dev,
+static int pci1760_mbxrequest(struct comedi_device * dev,
unsigned char *omb, unsigned char *imb)
{
if (omb[2] == CMD_ClearIMB2) {
/*
==============================================================================
*/
-static int pci1760_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
+static int pci1760_insn_bits_di(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[1] = inb(dev->iobase + IMB3);
/*
==============================================================================
*/
-static int pci1760_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
+static int pci1760_insn_bits_do(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int ret;
/*
==============================================================================
*/
-static int pci1760_insn_cnt_read(comedi_device * dev, comedi_subdevice * s,
+static int pci1760_insn_cnt_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int ret, n;
/*
==============================================================================
*/
-static int pci1760_insn_cnt_write(comedi_device * dev, comedi_subdevice * s,
+static int pci1760_insn_cnt_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int ret;
/*
==============================================================================
*/
-static int pci1760_reset(comedi_device * dev)
+static int pci1760_reset(struct comedi_device * dev)
{
int i;
unsigned char omb[4] = { 0x00, 0x00, 0x00, 0x00 };
/*
==============================================================================
*/
-static int pci_dio_reset(comedi_device * dev)
+static int pci_dio_reset(struct comedi_device * dev)
{
DPRINTK("adv_pci_dio EDBG: BGN: pci171x_reset(...)\n");
/*
==============================================================================
*/
-static int pci1760_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci1760_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int subdev = 0;
/*
==============================================================================
*/
-static int pci_dio_add_di(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_add_di(struct comedi_device * dev, comedi_subdevice * s,
const diosubd_data * d, int subdev)
{
s->type = COMEDI_SUBD_DI;
/*
==============================================================================
*/
-static int pci_dio_add_do(comedi_device * dev, comedi_subdevice * s,
+static int pci_dio_add_do(struct comedi_device * dev, comedi_subdevice * s,
const diosubd_data * d, int subdev)
{
s->type = COMEDI_SUBD_DO;
/*
==============================================================================
*/
-static int CheckAndAllocCard(comedi_device * dev, comedi_devconfig * it,
+static int CheckAndAllocCard(struct comedi_device * dev, comedi_devconfig * it,
struct pci_dev *pcidev)
{
pci_dio_private *pr, *prev;
/*
==============================================================================
*/
-static int pci_dio_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci_dio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret, subdev, n_subdevices, i, j;
/*
==============================================================================
*/
-static int pci_dio_detach(comedi_device * dev)
+static int pci_dio_detach(struct comedi_device * dev)
{
int i, j;
comedi_subdevice *s;
#define devpriv ((aio12_8_private *) dev->private)
-static int aio_aio12_8_ai_read(comedi_device * dev, comedi_subdevice * s,
+static int aio_aio12_8_ai_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int aio_aio12_8_ao_read(comedi_device * dev, comedi_subdevice * s,
+static int aio_aio12_8_ao_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return insn->n;
}
-static int aio_aio12_8_ao_write(comedi_device * dev, comedi_subdevice * s,
+static int aio_aio12_8_ao_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
}
};
-static int aio_aio12_8_attach(comedi_device * dev, comedi_devconfig * it)
+static int aio_aio12_8_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int iobase;
comedi_subdevice *s;
return 0;
}
-static int aio_aio12_8_detach(comedi_device * dev)
+static int aio_aio12_8_detach(struct comedi_device * dev)
{
subdev_8255_cleanup(dev, &dev->subdevices[2]);
if (dev->iobase)
#define devpriv ((aio_iiro_16_private *) dev->private)
-static int aio_iiro_16_attach(comedi_device * dev, comedi_devconfig * it);
+static int aio_iiro_16_attach(struct comedi_device * dev, comedi_devconfig * it);
-static int aio_iiro_16_detach(comedi_device * dev);
+static int aio_iiro_16_detach(struct comedi_device * dev);
static comedi_driver driver_aio_iiro_16 = {
driver_name:"aio_iiro_16",
num_names:sizeof(aio_iiro_16_boards) / sizeof(aio_iiro_16_board),
};
-static int aio_iiro_16_dio_insn_bits_read(comedi_device * dev,
+static int aio_iiro_16_dio_insn_bits_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int aio_iiro_16_dio_insn_bits_write(comedi_device * dev,
+static int aio_iiro_16_dio_insn_bits_write(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int aio_iiro_16_attach(comedi_device * dev, comedi_devconfig * it)
+static int aio_iiro_16_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int iobase;
comedi_subdevice *s;
return 1;
}
-static int aio_iiro_16_detach(comedi_device * dev)
+static int aio_iiro_16_detach(struct comedi_device * dev)
{
printk("comedi%d: aio_iiro_16: remove\n", dev->minor);
return 0;
}
-static int aio_iiro_16_dio_insn_bits_write(comedi_device * dev,
+static int aio_iiro_16_dio_insn_bits_write(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int aio_iiro_16_dio_insn_bits_read(comedi_device * dev,
+static int aio_iiro_16_dio_insn_bits_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
#ifdef CONFIG_COMEDI_PCI
struct pci_dev *pci_dev; /* PCI device */
* the board, and also about the kernel module that contains
* the device code.
*/
-static int dio200_attach(comedi_device * dev, comedi_devconfig * it);
-static int dio200_detach(comedi_device * dev);
+static int dio200_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dio200_detach(struct comedi_device * dev);
static comedi_driver driver_amplc_dio200 = {
driver_name:DIO200_DRIVER_NAME,
module:THIS_MODULE,
*/
#ifdef CONFIG_COMEDI_PCI
static int
-dio200_find_pci(comedi_device * dev, int bus, int slot,
+dio200_find_pci(struct comedi_device * dev, int bus, int slot,
struct pci_dev **pci_dev_p)
{
struct pci_dev *pci_dev = NULL;
* 'insn_bits' function for an 'INTERRUPT' subdevice.
*/
static int
-dio200_subdev_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_intr_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
dio200_subdev_intr *subpriv = s->private;
/*
* Called to stop acquisition for an 'INTERRUPT' subdevice.
*/
-static void dio200_stop_intr(comedi_device * dev, comedi_subdevice * s)
+static void dio200_stop_intr(struct comedi_device * dev, comedi_subdevice * s)
{
dio200_subdev_intr *subpriv = s->private;
/*
* Called to start acquisition for an 'INTERRUPT' subdevice.
*/
-static int dio200_start_intr(comedi_device * dev, comedi_subdevice * s)
+static int dio200_start_intr(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned int n;
unsigned isn_bits;
* Internal trigger function to start acquisition for an 'INTERRUPT' subdevice.
*/
static int
-dio200_inttrig_start_intr(comedi_device * dev, comedi_subdevice * s,
+dio200_inttrig_start_intr(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
dio200_subdev_intr *subpriv;
* This is called from the interrupt service routine to handle a read
* scan on an 'INTERRUPT' subdevice.
*/
-static int dio200_handle_read_intr(comedi_device * dev, comedi_subdevice * s)
+static int dio200_handle_read_intr(struct comedi_device * dev, comedi_subdevice * s)
{
dio200_subdev_intr *subpriv = s->private;
unsigned triggered;
/*
* 'cancel' function for an 'INTERRUPT' subdevice.
*/
-static int dio200_subdev_intr_cancel(comedi_device * dev, comedi_subdevice * s)
+static int dio200_subdev_intr_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
dio200_subdev_intr *subpriv = s->private;
unsigned long flags;
* 'do_cmdtest' function for an 'INTERRUPT' subdevice.
*/
static int
-dio200_subdev_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_intr_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
* 'do_cmd' function for an 'INTERRUPT' subdevice.
*/
-static int dio200_subdev_intr_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dio200_subdev_intr_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
dio200_subdev_intr *subpriv = s->private;
* This function initializes an 'INTERRUPT' subdevice.
*/
static int
-dio200_subdev_intr_init(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_intr_init(struct comedi_device * dev, comedi_subdevice * s,
unsigned long iobase, unsigned valid_isns, int has_int_sce)
{
dio200_subdev_intr *subpriv;
* This function cleans up an 'INTERRUPT' subdevice.
*/
static void
-dio200_subdev_intr_cleanup(comedi_device * dev, comedi_subdevice * s)
+dio200_subdev_intr_cleanup(struct comedi_device * dev, comedi_subdevice * s)
{
dio200_subdev_intr *subpriv = s->private;
*/
static irqreturn_t dio200_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
int handled;
if (!dev->attached) {
* Handle 'insn_read' for an '8254' counter subdevice.
*/
static int
-dio200_subdev_8254_read(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_8254_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
* Handle 'insn_write' for an '8254' counter subdevice.
*/
static int
-dio200_subdev_8254_write(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_8254_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
* Handle 'insn_config' for an '8254' counter subdevice.
*/
static int
-dio200_subdev_8254_config(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_8254_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
* offset is the offset to the 8254 chip.
*/
static int
-dio200_subdev_8254_init(comedi_device * dev, comedi_subdevice * s,
+dio200_subdev_8254_init(struct comedi_device * dev, comedi_subdevice * s,
unsigned long iobase, unsigned offset, int has_clk_gat_sce)
{
dio200_subdev_8254 *subpriv;
* This function cleans up an '8254' counter subdevice.
*/
static void
-dio200_subdev_8254_cleanup(comedi_device * dev, comedi_subdevice * s)
+dio200_subdev_8254_cleanup(struct comedi_device * dev, comedi_subdevice * s)
{
dio200_subdev_intr *subpriv = s->private;
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int dio200_attach(comedi_device * dev, comedi_devconfig * it)
+static int dio200_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = 0;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int dio200_detach(comedi_device * dev)
+static int dio200_detach(struct comedi_device * dev)
{
const dio200_layout *layout;
unsigned n;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
#ifdef CONFIG_COMEDI_PCI
/* PCI device */
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pc236_attach(comedi_device * dev, comedi_devconfig * it);
-static int pc236_detach(comedi_device * dev);
+static int pc236_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pc236_detach(struct comedi_device * dev);
static comedi_driver driver_amplc_pc236 = {
driver_name:PC236_DRIVER_NAME,
module:THIS_MODULE,
static int pc236_request_region(unsigned minor, unsigned long from,
unsigned long extent);
-static void pc236_intr_disable(comedi_device * dev);
-static void pc236_intr_enable(comedi_device * dev);
-static int pc236_intr_check(comedi_device * dev);
-static int pc236_intr_insn(comedi_device * dev, comedi_subdevice * s,
+static void pc236_intr_disable(struct comedi_device * dev);
+static void pc236_intr_enable(struct comedi_device * dev);
+static int pc236_intr_check(struct comedi_device * dev);
+static int pc236_intr_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pc236_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pc236_intr_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int pc236_intr_cmd(comedi_device * dev, comedi_subdevice * s);
-static int pc236_intr_cancel(comedi_device * dev, comedi_subdevice * s);
+static int pc236_intr_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int pc236_intr_cancel(struct comedi_device * dev, comedi_subdevice * s);
static irqreturn_t pc236_interrupt(int irq, void *d PT_REGS_ARG);
/*
*/
#ifdef CONFIG_COMEDI_PCI
static int
-pc236_find_pci(comedi_device * dev, int bus, int slot,
+pc236_find_pci(struct comedi_device * dev, int bus, int slot,
struct pci_dev **pci_dev_p)
{
struct pci_dev *pci_dev = NULL;
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pc236_attach(comedi_device * dev, comedi_devconfig * it)
+static int pc236_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = 0;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pc236_detach(comedi_device * dev)
+static int pc236_detach(struct comedi_device * dev)
{
printk(KERN_DEBUG "comedi%d: %s: detach\n", dev->minor,
PC236_DRIVER_NAME);
* configured on subdevice 1) and to physically disable the interrupt
* (not possible on the PC36AT, except by removing the IRQ jumper!).
*/
-static void pc236_intr_disable(comedi_device * dev)
+static void pc236_intr_disable(struct comedi_device * dev)
{
unsigned long flags;
* configured on subdevice 1) and to physically enable the interrupt
* (not possible on the PC36AT, except by (re)connecting the IRQ jumper!).
*/
-static void pc236_intr_enable(comedi_device * dev)
+static void pc236_intr_enable(struct comedi_device * dev)
{
unsigned long flags;
* interrupt.
* Returns 0 if the interrupt should be ignored.
*/
-static int pc236_intr_check(comedi_device * dev)
+static int pc236_intr_check(struct comedi_device * dev)
{
int retval = 0;
unsigned long flags;
* Input from subdevice 1.
* Copied from the comedi_parport driver.
*/
-static int pc236_intr_insn(comedi_device * dev, comedi_subdevice * s,
+static int pc236_intr_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[1] = 0;
* Subdevice 1 command test.
* Copied from the comedi_parport driver.
*/
-static int pc236_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pc236_intr_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
* Subdevice 1 command.
*/
-static int pc236_intr_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pc236_intr_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
pc236_intr_enable(dev);
/*
* Subdevice 1 cancel command.
*/
-static int pc236_intr_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pc236_intr_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
pc236_intr_disable(dev);
*/
static irqreturn_t pc236_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 1;
int handled;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
#ifdef CONFIG_COMEDI_PCI
typedef struct {
/* PCI device. */
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pc263_attach(comedi_device * dev, comedi_devconfig * it);
-static int pc263_detach(comedi_device * dev);
+static int pc263_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pc263_detach(struct comedi_device * dev);
static comedi_driver driver_amplc_pc263 = {
driver_name:PC263_DRIVER_NAME,
module:THIS_MODULE,
static int pc263_request_region(unsigned minor, unsigned long from,
unsigned long extent);
-static int pc263_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pc263_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pc263_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pc263_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/*
*/
#ifdef CONFIG_COMEDI_PCI
static int
-pc263_find_pci(comedi_device * dev, int bus, int slot,
+pc263_find_pci(struct comedi_device * dev, int bus, int slot,
struct pci_dev **pci_dev_p)
{
struct pci_dev *pci_dev = NULL;
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pc263_attach(comedi_device * dev, comedi_devconfig * it)
+static int pc263_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = 0;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pc263_detach(comedi_device * dev)
+static int pc263_detach(struct comedi_device * dev)
{
printk(KERN_DEBUG "comedi%d: %s: detach\n", dev->minor,
PC263_DRIVER_NAME);
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int pc263_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pc263_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pc263_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pc263_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 1)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
struct pci_dev *pci_dev; /* PCI device */
const unsigned short *hwrange;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pci224_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci224_detach(comedi_device * dev);
+static int pci224_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci224_detach(struct comedi_device * dev);
static comedi_driver driver_amplc_pci224 = {
driver_name:DRIVER_NAME,
module:THIS_MODULE,
* Called from the 'insn_write' function to perform a single write.
*/
static void
-pci224_ao_set_data(comedi_device * dev, int chan, int range, unsigned int data)
+pci224_ao_set_data(struct comedi_device * dev, int chan, int range, unsigned int data)
{
unsigned short mangled;
* 'insn_write' function for AO subdevice.
*/
static int
-pci224_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+pci224_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* command.
*/
static int
-pci224_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+pci224_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/*
* Kills a command running on the AO subdevice.
*/
-static void pci224_ao_stop(comedi_device * dev, comedi_subdevice * s)
+static void pci224_ao_stop(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
/*
* Handles start of acquisition for the AO subdevice.
*/
-static void pci224_ao_start(comedi_device * dev, comedi_subdevice * s)
+static void pci224_ao_start(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned long flags;
/*
* Handles interrupts from the DAC FIFO.
*/
-static void pci224_ao_handle_fifo(comedi_device * dev, comedi_subdevice * s)
+static void pci224_ao_handle_fifo(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int num_scans;
* Internal trigger function to start acquisition on AO subdevice.
*/
static int
-pci224_ao_inttrig_start(comedi_device * dev, comedi_subdevice * s,
+pci224_ao_inttrig_start(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
if (trignum != 0)
* 'do_cmdtest' function for AO subdevice.
*/
static int
-pci224_ao_cmdtest(comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
+pci224_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
{
int err = 0;
unsigned int tmp;
/*
* 'do_cmd' function for AO subdevice.
*/
-static int pci224_ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pci224_ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int range;
/*
* 'cancel' function for AO subdevice.
*/
-static int pci224_ao_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci224_ao_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
pci224_ao_stop(dev, s);
return 0;
* 'munge' data for AO command.
*/
static void
-pci224_ao_munge(comedi_device * dev, comedi_subdevice * s, void *data,
+pci224_ao_munge(struct comedi_device * dev, comedi_subdevice * s, void *data,
unsigned int num_bytes, unsigned int chan_index)
{
comedi_async *async = s->async;
*/
static irqreturn_t pci224_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = &dev->subdevices[0];
comedi_cmd *cmd;
unsigned char intstat, valid_intstat;
* bus and slot.
*/
static int
-pci224_find_pci(comedi_device * dev, int bus, int slot,
+pci224_find_pci(struct comedi_device * dev, int bus, int slot,
struct pci_dev **pci_dev_p)
{
struct pci_dev *pci_dev = NULL;
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pci224_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci224_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
struct pci_dev *pci_dev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pci224_detach(comedi_device * dev)
+static int pci224_detach(struct comedi_device * dev)
{
printk(KERN_DEBUG "comedi%d: %s: detach\n", dev->minor, DRIVER_NAME);
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
struct pci230_private {
struct pci_dev *pci_dev;
spinlock_t isr_spinlock; /* Interrupt spin lock */
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pci230_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci230_detach(comedi_device * dev);
+static int pci230_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci230_detach(struct comedi_device * dev);
static comedi_driver driver_amplc_pci230 = {
driver_name:"amplc_pci230",
module:THIS_MODULE,
COMEDI_PCI_INITCLEANUP(driver_amplc_pci230, pci230_pci_table);
-static int pci230_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pci230_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pci230_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static void pci230_ct_setup_ns_mode(comedi_device * dev, unsigned int ct,
+static void pci230_ct_setup_ns_mode(struct comedi_device * dev, unsigned int ct,
unsigned int mode, uint64_t ns, unsigned int round);
static void pci230_ns_to_single_timer(unsigned int *ns, unsigned int round);
-static void pci230_cancel_ct(comedi_device * dev, unsigned int ct);
+static void pci230_cancel_ct(struct comedi_device * dev, unsigned int ct);
static irqreturn_t pci230_interrupt(int irq, void *d PT_REGS_ARG);
-static int pci230_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int pci230_ao_cmd(comedi_device * dev, comedi_subdevice * s);
-static int pci230_ao_cancel(comedi_device * dev, comedi_subdevice * s);
-static void pci230_ao_stop(comedi_device * dev, comedi_subdevice * s);
-static void pci230_handle_ao_nofifo(comedi_device * dev, comedi_subdevice * s);
-static int pci230_handle_ao_fifo(comedi_device * dev, comedi_subdevice * s);
-static int pci230_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int pci230_ao_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void pci230_ao_stop(struct comedi_device * dev, comedi_subdevice * s);
+static void pci230_handle_ao_nofifo(struct comedi_device * dev, comedi_subdevice * s);
+static int pci230_handle_ao_fifo(struct comedi_device * dev, comedi_subdevice * s);
+static int pci230_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int pci230_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int pci230_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static void pci230_ai_stop(comedi_device * dev, comedi_subdevice * s);
-static void pci230_handle_ai(comedi_device * dev, comedi_subdevice * s);
+static int pci230_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int pci230_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void pci230_ai_stop(struct comedi_device * dev, comedi_subdevice * s);
+static void pci230_handle_ai(struct comedi_device * dev, comedi_subdevice * s);
-static short pci230_ai_read(comedi_device * dev)
+static short pci230_ai_read(struct comedi_device * dev)
{
/* Read sample. */
short data = (short) inw(dev->iobase + PCI230_ADCDATA);
return data;
}
-static inline unsigned short pci230_ao_mangle_datum(comedi_device * dev,
+static inline unsigned short pci230_ao_mangle_datum(struct comedi_device * dev,
short datum)
{
/* If a bipolar range was specified, mangle it (straight binary->twos
return (unsigned short)datum;
}
-static inline void pci230_ao_write_nofifo(comedi_device * dev, short datum,
+static inline void pci230_ao_write_nofifo(struct comedi_device * dev, short datum,
unsigned int chan)
{
/* Store unmangled datum to be read back later. */
? PCI230_DACOUT1 : PCI230_DACOUT2));
}
-static inline void pci230_ao_write_fifo(comedi_device * dev, short datum,
+static inline void pci230_ao_write_fifo(struct comedi_device * dev, short datum,
unsigned int chan)
{
/* Store unmangled datum to be read back later. */
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pci230_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci230_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase1, iobase2;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pci230_detach(comedi_device * dev)
+static int pci230_detach(struct comedi_device * dev)
{
printk("comedi%d: amplc_pci230: remove\n", dev->minor);
return 0;
}
-static int get_resources(comedi_device * dev, unsigned int res_mask,
+static int get_resources(struct comedi_device * dev, unsigned int res_mask,
unsigned char owner)
{
int ok;
return ok;
}
-static inline int get_one_resource(comedi_device * dev, unsigned int resource,
+static inline int get_one_resource(struct comedi_device * dev, unsigned int resource,
unsigned char owner)
{
return get_resources(dev, (1U << resource), owner);
}
-static void put_resources(comedi_device * dev, unsigned int res_mask,
+static void put_resources(struct comedi_device * dev, unsigned int res_mask,
unsigned char owner)
{
unsigned int i;
comedi_spin_unlock_irqrestore(&devpriv->res_spinlock, irqflags);
}
-static inline void put_one_resource(comedi_device * dev, unsigned int resource,
+static inline void put_one_resource(struct comedi_device * dev, unsigned int resource,
unsigned char owner)
{
put_resources(dev, (1U << resource), owner);
}
-static inline void put_all_resources(comedi_device * dev, unsigned char owner)
+static inline void put_all_resources(struct comedi_device * dev, unsigned char owner)
{
put_resources(dev, (1U << NUM_RESOURCES) - 1, owner);
}
/*
* COMEDI_SUBD_AI instruction;
*/
-static int pci230_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int n, i;
/*
* COMEDI_SUBD_AO instructions;
*/
-static int pci230_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int pci230_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int pci230_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int pci230_ao_inttrig_scan_begin(comedi_device * dev,
+static int pci230_ao_inttrig_scan_begin(struct comedi_device * dev,
comedi_subdevice * s, unsigned int trig_num)
{
unsigned long irqflags;
return 1;
}
-static void pci230_ao_start(comedi_device * dev, comedi_subdevice * s)
+static void pci230_ao_start(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
}
}
-static int pci230_ao_inttrig_start(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ao_inttrig_start(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
if (trig_num != 0)
return 1;
}
-static int pci230_ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pci230_ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned short daccon;
unsigned int range;
return !err;
}
-static int pci230_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static void pci230_ai_update_fifo_trigger_level(comedi_device * dev,
+static void pci230_ai_update_fifo_trigger_level(struct comedi_device * dev,
comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
}
}
-static int pci230_ai_inttrig_convert(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ai_inttrig_convert(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
unsigned long irqflags;
return 1;
}
-static int pci230_ai_inttrig_scan_begin(comedi_device * dev,
+static int pci230_ai_inttrig_scan_begin(struct comedi_device * dev,
comedi_subdevice * s, unsigned int trig_num)
{
unsigned long irqflags;
return 1;
}
-static void pci230_ai_start(comedi_device * dev, comedi_subdevice * s)
+static void pci230_ai_start(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long irqflags;
unsigned short conv;
}
}
-static int pci230_ai_inttrig_start(comedi_device * dev, comedi_subdevice * s,
+static int pci230_ai_inttrig_start(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
if (trig_num != 0)
return 1;
}
-static int pci230_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pci230_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned int i, chan, range, diff;
unsigned int res_mask;
return;
}
-static void pci230_ct_setup_ns_mode(comedi_device * dev, unsigned int ct,
+static void pci230_ct_setup_ns_mode(struct comedi_device * dev, unsigned int ct,
unsigned int mode, uint64_t ns, unsigned int round)
{
unsigned int clk_src;
i8254_write(devpriv->iobase1 + PCI230_Z2_CT_BASE, 0, ct, count);
}
-static void pci230_cancel_ct(comedi_device * dev, unsigned int ct)
+static void pci230_cancel_ct(struct comedi_device * dev, unsigned int ct)
{
i8254_set_mode(devpriv->iobase1 + PCI230_Z2_CT_BASE, 0, ct,
I8254_MODE1);
static irqreturn_t pci230_interrupt(int irq, void *d PT_REGS_ARG)
{
unsigned char status_int, valid_status_int;
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
unsigned long irqflags;
return IRQ_HANDLED;
}
-static void pci230_handle_ao_nofifo(comedi_device * dev, comedi_subdevice * s)
+static void pci230_handle_ao_nofifo(struct comedi_device * dev, comedi_subdevice * s)
{
short data;
int i, ret;
/* Loads DAC FIFO (if using it) from buffer. */
/* Returns 0 if AO finished due to completion or error, 1 if still going. */
-static int pci230_handle_ao_fifo(comedi_device * dev, comedi_subdevice * s)
+static int pci230_handle_ao_fifo(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return running;
}
-static void pci230_handle_ai(comedi_device * dev, comedi_subdevice * s)
+static void pci230_handle_ai(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned int events = 0;
unsigned int status_fifo;
}
}
-static void pci230_ao_stop(comedi_device * dev, comedi_subdevice * s)
+static void pci230_ao_stop(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long irqflags;
unsigned char intsrc;
put_all_resources(dev, OWNER_AOCMD);
}
-static int pci230_ao_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci230_ao_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
pci230_ao_stop(dev, s);
return 0;
}
-static void pci230_ai_stop(comedi_device * dev, comedi_subdevice * s)
+static void pci230_ai_stop(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long irqflags;
comedi_cmd *cmd;
put_all_resources(dev, OWNER_AICMD);
}
-static int pci230_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pci230_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
pci230_ai_stop(dev, s);
return 0;
#define C6XDIGIO_TIME_OUT 20
-static int c6xdigio_attach(comedi_device * dev, comedi_devconfig * it);
-static int c6xdigio_detach(comedi_device * dev);
+static int c6xdigio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int c6xdigio_detach(struct comedi_device * dev);
comedi_driver driver_c6xdigio = {
driver_name:"c6xdigio",
module:THIS_MODULE,
}
}
-static int c6xdigio_pwmo_insn_read(comedi_device * dev,
+static int c6xdigio_pwmo_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
printk("c6xdigio_pwmo_insn_read %x\n", insn->n);
return insn->n;
}
-static int c6xdigio_pwmo_insn_write(comedi_device * dev,
+static int c6xdigio_pwmo_insn_write(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-//static int c6xdigio_ei_init_insn_read(comedi_device *dev,
+//static int c6xdigio_ei_init_insn_read(struct comedi_device *dev,
// comedi_subdevice *s,
// comedi_insn *insn,
// unsigned int *data)
// return insn->n;
//}
-//static int c6xdigio_ei_init_insn_write(comedi_device *dev,
+//static int c6xdigio_ei_init_insn_write(struct comedi_device *dev,
// comedi_subdevice *s,
// comedi_insn *insn,
// unsigned int *data)
// return insn->n;
//}
-static int c6xdigio_ei_insn_read(comedi_device * dev,
+static int c6xdigio_ei_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
// printk("c6xdigio_ei__insn_read %x\n", insn->n);
return n;
}
-static void board_init(comedi_device * dev)
+static void board_init(struct comedi_device * dev)
{
//printk("Inside board_init\n");
}
-//static void board_halt(comedi_device *dev) {
+//static void board_halt(struct comedi_device *dev) {
// C6X_pwmInit(dev->iobase);
//}
.id_table = c6xdigio_pnp_tbl,
};
-static int c6xdigio_attach(comedi_device * dev, comedi_devconfig * it)
+static int c6xdigio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
unsigned long iobase;
return 0;
}
-static int c6xdigio_detach(comedi_device * dev)
+static int c6xdigio_detach(struct comedi_device * dev)
{
// board_halt(dev); // may not need this
} das16cs_private;
#define devpriv ((das16cs_private *)dev->private)
-static int das16cs_attach(comedi_device * dev, comedi_devconfig * it);
-static int das16cs_detach(comedi_device * dev);
+static int das16cs_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das16cs_detach(struct comedi_device * dev);
static comedi_driver driver_das16cs = {
driver_name:"cb_das16_cs",
module:THIS_MODULE,
};
static irqreturn_t das16cs_interrupt(int irq, void *d PT_REGS_ARG);
-static int das16cs_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int das16cs_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int das16cs_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int das16cs_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_timer_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_timer_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16cs_timer_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_timer_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int get_prodid(comedi_device * dev, struct pcmcia_device *link)
+static int get_prodid(struct comedi_device * dev, struct pcmcia_device *link)
{
tuple_t tuple;
u_short buf[128];
return prodid;
}
-static const das16cs_board *das16cs_probe(comedi_device * dev,
+static const das16cs_board *das16cs_probe(struct comedi_device * dev,
struct pcmcia_device *link)
{
int id;
return NULL;
}
-static int das16cs_attach(comedi_device * dev, comedi_devconfig * it)
+static int das16cs_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pcmcia_device *link;
comedi_subdevice *s;
return 1;
}
-static int das16cs_detach(comedi_device * dev)
+static int das16cs_detach(struct comedi_device * dev)
{
printk("comedi%d: das16cs: remove\n", dev->minor);
static irqreturn_t das16cs_interrupt(int irq, void *d PT_REGS_ARG)
{
- //comedi_device *dev = d;
+ //struct comedi_device *dev = d;
return IRQ_HANDLED;
}
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
-static int das16cs_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int das16cs_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int das16cs_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
return -EINVAL;
}
-static int das16cs_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int das16cs_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int das16cs_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int das16cs_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int das16cs_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return insn->n;
}
-static int das16cs_timer_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_timer_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return -EINVAL;
}
-static int das16cs_timer_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int das16cs_timer_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return -EINVAL;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
/* would be useful for a PCI device */
struct pci_dev *pci_dev;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int cb_pcidas_attach(comedi_device * dev, comedi_devconfig * it);
-static int cb_pcidas_detach(comedi_device * dev);
+static int cb_pcidas_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int cb_pcidas_detach(struct comedi_device * dev);
static comedi_driver driver_cb_pcidas = {
driver_name:"cb_pcidas",
module:THIS_MODULE,
detach:cb_pcidas_detach,
};
-static int cb_pcidas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int ai_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcidas_ao_nofifo_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_nofifo_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcidas_ao_fifo_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_fifo_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcidas_ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcidas_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int cb_pcidas_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int cb_pcidas_ao_cmd(comedi_device * dev, comedi_subdevice * s);
-static int cb_pcidas_ao_inttrig(comedi_device * dev, comedi_subdevice * subdev,
+static int cb_pcidas_ao_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int cb_pcidas_ao_inttrig(struct comedi_device * dev, comedi_subdevice * subdev,
unsigned int trig_num);
-static int cb_pcidas_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG);
-static void handle_ao_interrupt(comedi_device * dev, unsigned int status);
-static int cb_pcidas_cancel(comedi_device * dev, comedi_subdevice * s);
-static int cb_pcidas_ao_cancel(comedi_device * dev, comedi_subdevice * s);
-static void cb_pcidas_load_counters(comedi_device * dev, unsigned int *ns,
+static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status);
+static int cb_pcidas_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static int cb_pcidas_ao_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void cb_pcidas_load_counters(struct comedi_device * dev, unsigned int *ns,
int round_flags);
-static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int caldac_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int caldac_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int caldac_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int caldac_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int trimpot_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int trimpot_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcidas_trimpot_write(comedi_device * dev, unsigned int channel,
+static int cb_pcidas_trimpot_write(struct comedi_device * dev, unsigned int channel,
unsigned int value);
-static int trimpot_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int trimpot_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dac08_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int dac08_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dac08_write(comedi_device * dev, unsigned int value);
-static int dac08_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int dac08_write(struct comedi_device * dev, unsigned int value);
+static int dac08_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int caldac_8800_write(comedi_device * dev, unsigned int address,
+static int caldac_8800_write(struct comedi_device * dev, unsigned int address,
uint8_t value);
-static int trimpot_7376_write(comedi_device * dev, uint8_t value);
-static int trimpot_8402_write(comedi_device * dev, unsigned int channel,
+static int trimpot_7376_write(struct comedi_device * dev, uint8_t value);
+static int trimpot_8402_write(struct comedi_device * dev, unsigned int channel,
uint8_t value);
-static int nvram_read(comedi_device * dev, unsigned int address,
+static int nvram_read(struct comedi_device * dev, unsigned int address,
uint8_t * data);
-static inline unsigned int cal_enable_bits(comedi_device * dev)
+static inline unsigned int cal_enable_bits(struct comedi_device * dev)
{
return CAL_EN_BIT | CAL_SRC_BITS(devpriv->calibration_source);
}
* Attach is called by the Comedi core to configure the driver
* for a particular board.
*/
-static int cb_pcidas_attach(comedi_device * dev, comedi_devconfig * it)
+static int cb_pcidas_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
struct pci_dev *pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int cb_pcidas_detach(comedi_device * dev)
+static int cb_pcidas_detach(struct comedi_device * dev)
{
printk("comedi%d: cb_pcidas: remove\n", dev->minor);
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
-static int cb_pcidas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
return n;
}
-static int ai_config_calibration_source(comedi_device * dev, unsigned int * data)
+static int ai_config_calibration_source(struct comedi_device * dev, unsigned int * data)
{
static const int num_calibration_sources = 8;
unsigned int source = data[1];
return 2;
}
-static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int ai_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int id = data[0];
}
// analog output insn for pcidas-1000 and 1200 series
-static int cb_pcidas_ao_nofifo_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_nofifo_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel;
}
// analog output insn for pcidas-1602 series
-static int cb_pcidas_ao_fifo_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_fifo_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel;
// analog output readback insn
// XXX loses track of analog output value back after an analog ouput command is executed
-static int cb_pcidas_ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_value[CR_CHAN(insn->chanspec)];
return 1;
}
-static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
uint8_t nvram_data;
return 1;
}
-static int caldac_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int caldac_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const unsigned int channel = CR_CHAN(insn->chanspec);
return caldac_8800_write(dev, channel, data[0]);
}
-static int caldac_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int caldac_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldac_value[CR_CHAN(insn->chanspec)];
}
/* 1602/16 pregain offset */
-static int dac08_write(comedi_device * dev, unsigned int value)
+static int dac08_write(struct comedi_device * dev, unsigned int value)
{
if (devpriv->dac08_value == value)
return 1;
return 1;
}
-static int dac08_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int dac08_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return dac08_write(dev, data[0]);
}
-static int dac08_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int dac08_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->dac08_value;
return 1;
}
-static int cb_pcidas_trimpot_write(comedi_device * dev,
+static int cb_pcidas_trimpot_write(struct comedi_device * dev,
unsigned int channel, unsigned int value)
{
if (devpriv->trimpot_value[channel] == value)
return 1;
}
-static int trimpot_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int trimpot_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
return cb_pcidas_trimpot_write(dev, channel, data[0]);
}
-static int trimpot_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int trimpot_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static int cb_pcidas_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int cb_pcidas_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int cb_pcidas_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int cb_pcidas_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int cb_pcidas_ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int cb_pcidas_ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int cb_pcidas_ao_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidas_ao_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
unsigned int num_bytes, num_points = thisboard->fifo_size;
static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->read_subdev;
comedi_async *async;
int status, s5933_status;
return IRQ_HANDLED;
}
-static void handle_ao_interrupt(comedi_device * dev, unsigned int status)
+static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status)
{
comedi_subdevice *s = dev->write_subdev;
comedi_async *async = s->async;
}
// cancel analog input command
-static int cb_pcidas_cancel(comedi_device * dev, comedi_subdevice * s)
+static int cb_pcidas_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
}
// cancel analog output command
-static int cb_pcidas_ao_cancel(comedi_device * dev, comedi_subdevice * s)
+static int cb_pcidas_ao_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
return 0;
}
-static void cb_pcidas_load_counters(comedi_device * dev, unsigned int *ns,
+static void cb_pcidas_load_counters(struct comedi_device * dev, unsigned int *ns,
int rounding_flags)
{
i8253_cascade_ns_to_timer_2div(TIMER_BASE, &(devpriv->divisor1),
devpriv->divisor2, 2);
}
-static void write_calibration_bitstream(comedi_device * dev,
+static void write_calibration_bitstream(struct comedi_device * dev,
unsigned int register_bits, unsigned int bitstream,
unsigned int bitstream_length)
{
}
}
-static int caldac_8800_write(comedi_device * dev, unsigned int address,
+static int caldac_8800_write(struct comedi_device * dev, unsigned int address,
uint8_t value)
{
static const int num_caldac_channels = 8;
return 1;
}
-static int trimpot_7376_write(comedi_device * dev, uint8_t value)
+static int trimpot_7376_write(struct comedi_device * dev, uint8_t value)
{
static const int bitstream_length = 7;
unsigned int bitstream = value & 0x7f;
/* For 1602/16 only
* ch 0 : adc gain
* ch 1 : adc postgain offset */
-static int trimpot_8402_write(comedi_device * dev, unsigned int channel,
+static int trimpot_8402_write(struct comedi_device * dev, unsigned int channel,
uint8_t value)
{
static const int bitstream_length = 10;
return -1;
}
-static int nvram_read(comedi_device * dev, unsigned int address, uint8_t * data)
+static int nvram_read(struct comedi_device * dev, unsigned int address, uint8_t * data)
{
unsigned long iobase = devpriv->s5933_config;
MODULE_DEVICE_TABLE(pci, pcidas64_pci_table);
-static inline pcidas64_board *board(const comedi_device * dev)
+static inline pcidas64_board *board(const struct comedi_device * dev)
{
return (pcidas64_board *) dev->board_ptr;
}
-static inline unsigned short se_diff_bit_6xxx(comedi_device * dev,
+static inline unsigned short se_diff_bit_6xxx(struct comedi_device * dev,
int use_differential)
{
if ((board(dev)->layout == LAYOUT_64XX && !use_differential) ||
/* inline function that makes it easier to
* access the private structure.
*/
-static inline pcidas64_private *priv(comedi_device * dev)
+static inline pcidas64_private *priv(struct comedi_device * dev)
{
return dev->private;
}
* the board, and also about the kernel module that contains
* the device code.
*/
-static int attach(comedi_device * dev, comedi_devconfig * it);
-static int detach(comedi_device * dev);
+static int attach(struct comedi_device * dev, comedi_devconfig * it);
+static int detach(struct comedi_device * dev);
static comedi_driver driver_cb_pcidas = {
driver_name:"cb_pcidas64",
module:THIS_MODULE,
detach:detach,
};
-static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int ai_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int ao_readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int ao_cmd(comedi_device * dev, comedi_subdevice * s);
-static int ao_inttrig(comedi_device * dev, comedi_subdevice * subdev,
+static int ao_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int ao_inttrig(struct comedi_device * dev, comedi_subdevice * subdev,
unsigned int trig_num);
-static int ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG);
-static int ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static int ao_cancel(comedi_device * dev, comedi_subdevice * s);
+static int ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static int ao_cancel(struct comedi_device * dev, comedi_subdevice * s);
static int dio_callback(int dir, int port, int data, unsigned long arg);
static int dio_callback_4020(int dir, int port, int data, unsigned long arg);
-static int di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dio_60xx_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int dio_60xx_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dio_60xx_wbits(comedi_device * dev, comedi_subdevice * s,
+static int dio_60xx_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int calib_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int calib_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int calib_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int calib_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ad8402_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int ad8402_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static void ad8402_write(comedi_device * dev, unsigned int channel,
+static void ad8402_write(struct comedi_device * dev, unsigned int channel,
unsigned int value);
-static int ad8402_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int ad8402_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static void check_adc_timing(comedi_device * dev, comedi_cmd * cmd);
+static void check_adc_timing(struct comedi_device * dev, comedi_cmd * cmd);
static unsigned int get_divisor(unsigned int ns, unsigned int flags);
-static void i2c_write(comedi_device * dev, unsigned int address,
+static void i2c_write(struct comedi_device * dev, unsigned int address,
const uint8_t * data, unsigned int length);
-static void caldac_write(comedi_device * dev, unsigned int channel,
+static void caldac_write(struct comedi_device * dev, unsigned int channel,
unsigned int value);
-static int caldac_8800_write(comedi_device * dev, unsigned int address,
+static int caldac_8800_write(struct comedi_device * dev, unsigned int address,
uint8_t value);
-//static int dac_1590_write(comedi_device *dev, unsigned int dac_a, unsigned int dac_b);
-static int caldac_i2c_write(comedi_device * dev, unsigned int caldac_channel,
+//static int dac_1590_write(struct comedi_device *dev, unsigned int dac_a, unsigned int dac_b);
+static int caldac_i2c_write(struct comedi_device * dev, unsigned int caldac_channel,
unsigned int value);
-static void abort_dma(comedi_device * dev, unsigned int channel);
-static void disable_plx_interrupts(comedi_device * dev);
-static int set_ai_fifo_size(comedi_device * dev, unsigned int num_samples);
-static unsigned int ai_fifo_size(comedi_device * dev);
-static int set_ai_fifo_segment_length(comedi_device * dev,
+static void abort_dma(struct comedi_device * dev, unsigned int channel);
+static void disable_plx_interrupts(struct comedi_device * dev);
+static int set_ai_fifo_size(struct comedi_device * dev, unsigned int num_samples);
+static unsigned int ai_fifo_size(struct comedi_device * dev);
+static int set_ai_fifo_segment_length(struct comedi_device * dev,
unsigned int num_entries);
-static void disable_ai_pacing(comedi_device * dev);
-static void disable_ai_interrupts(comedi_device * dev);
-static void enable_ai_interrupts(comedi_device * dev, const comedi_cmd * cmd);
+static void disable_ai_pacing(struct comedi_device * dev);
+static void disable_ai_interrupts(struct comedi_device * dev);
+static void enable_ai_interrupts(struct comedi_device * dev, const comedi_cmd * cmd);
static unsigned int get_ao_divisor(unsigned int ns, unsigned int flags);
-static void load_ao_dma(comedi_device * dev, const comedi_cmd * cmd);
+static void load_ao_dma(struct comedi_device * dev, const comedi_cmd * cmd);
COMEDI_PCI_INITCLEANUP(driver_cb_pcidas, pcidas64_pci_table);
-static unsigned int ai_range_bits_6xxx(const comedi_device * dev,
+static unsigned int ai_range_bits_6xxx(const struct comedi_device * dev,
unsigned int range_index)
{
const comedi_krange *range =
return bits;
}
-static unsigned int hw_revision(const comedi_device * dev,
+static unsigned int hw_revision(const struct comedi_device * dev,
uint16_t hw_status_bits)
{
if (board(dev)->layout == LAYOUT_4020)
return (hw_status_bits >> 12) & 0xf;
}
-static void set_dac_range_bits(comedi_device * dev, volatile uint16_t * bits,
+static void set_dac_range_bits(struct comedi_device * dev, volatile uint16_t * bits,
unsigned int channel, unsigned int range)
{
unsigned int code = board(dev)->ao_range_code[range];
}
// initialize plx9080 chip
-static void init_plx9080(comedi_device * dev)
+static void init_plx9080(struct comedi_device * dev)
{
uint32_t bits;
void *plx_iobase = priv(dev)->plx9080_iobase;
/* Allocate and initialize the subdevice structures.
*/
-static int setup_subdevices(comedi_device * dev)
+static int setup_subdevices(struct comedi_device * dev)
{
comedi_subdevice *s;
void *dio_8255_iobase;
return 0;
}
-static void disable_plx_interrupts(comedi_device * dev)
+static void disable_plx_interrupts(struct comedi_device * dev)
{
priv(dev)->plx_intcsr_bits = 0;
writel(priv(dev)->plx_intcsr_bits,
priv(dev)->plx9080_iobase + PLX_INTRCS_REG);
}
-static void init_stc_registers(comedi_device * dev)
+static void init_stc_registers(struct comedi_device * dev)
{
uint16_t bits;
unsigned long flags;
disable_ai_pacing(dev);
};
-int alloc_and_init_dma_members(comedi_device * dev)
+int alloc_and_init_dma_members(struct comedi_device * dev)
{
int i;
return 0;
}
-static inline void warn_external_queue(comedi_device * dev)
+static inline void warn_external_queue(struct comedi_device * dev)
{
comedi_error(dev,
"AO command and AI external channel queue cannot be used simultaneously.");
* Attach is called by the Comedi core to configure the driver
* for a particular board.
*/
-static int attach(comedi_device * dev, comedi_devconfig * it)
+static int attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
int index;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int detach(comedi_device * dev)
+static int detach(struct comedi_device * dev)
{
unsigned int i;
return 0;
}
-static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bits = 0, n, i;
return n;
}
-static int ai_config_calibration_source(comedi_device * dev, unsigned int * data)
+static int ai_config_calibration_source(struct comedi_device * dev, unsigned int * data)
{
unsigned int source = data[1];
int num_calibration_sources;
return 2;
}
-static int ai_config_block_size(comedi_device * dev, unsigned int * data)
+static int ai_config_block_size(struct comedi_device * dev, unsigned int * data)
{
int fifo_size;
const hw_fifo_info_t *const fifo = board(dev)->ai_fifo;
return 2;
}
-static int ai_config_master_clock_4020(comedi_device * dev, unsigned int * data)
+static int ai_config_master_clock_4020(struct comedi_device * dev, unsigned int * data)
{
unsigned int divisor = data[4];
int retval = 0;
}
// XXX could add support for 60xx series
-static int ai_config_master_clock(comedi_device * dev, unsigned int * data)
+static int ai_config_master_clock(struct comedi_device * dev, unsigned int * data)
{
switch (board(dev)->layout) {
return -EINVAL;
}
-static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int ai_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int id = data[0];
return -EINVAL;
}
-static int ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static void setup_sample_counters(comedi_device * dev, comedi_cmd * cmd)
+static void setup_sample_counters(struct comedi_device * dev, comedi_cmd * cmd)
{
if (cmd->stop_src == TRIG_COUNT) {
// set software count
}
}
-static inline unsigned int dma_transfer_size(comedi_device * dev)
+static inline unsigned int dma_transfer_size(struct comedi_device * dev)
{
unsigned int num_samples;
return num_samples;
}
-static void disable_ai_pacing(comedi_device * dev)
+static void disable_ai_pacing(struct comedi_device * dev)
{
unsigned long flags;
priv(dev)->main_iobase + ADC_CONTROL0_REG);
}
-static void disable_ai_interrupts(comedi_device * dev)
+static void disable_ai_interrupts(struct comedi_device * dev)
{
unsigned long flags;
DEBUG_PRINT("intr enable bits 0x%x\n", priv(dev)->intr_enable_bits);
}
-static void enable_ai_interrupts(comedi_device * dev, const comedi_cmd * cmd)
+static void enable_ai_interrupts(struct comedi_device * dev, const comedi_cmd * cmd)
{
uint32_t bits;
unsigned long flags;
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
-static uint32_t ai_convert_counter_6xxx(const comedi_device * dev,
+static uint32_t ai_convert_counter_6xxx(const struct comedi_device * dev,
const comedi_cmd * cmd)
{
// supposed to load counter with desired divisor minus 3
return cmd->convert_arg / TIMER_BASE - 3;
}
-static uint32_t ai_scan_counter_6xxx(comedi_device * dev, comedi_cmd * cmd)
+static uint32_t ai_scan_counter_6xxx(struct comedi_device * dev, comedi_cmd * cmd)
{
uint32_t count;
// figure out how long we need to delay at end of scan
return count - 3;
}
-static uint32_t ai_convert_counter_4020(comedi_device * dev, comedi_cmd * cmd)
+static uint32_t ai_convert_counter_4020(struct comedi_device * dev, comedi_cmd * cmd)
{
unsigned int divisor;
return divisor - 2;
}
-static void select_master_clock_4020(comedi_device * dev,
+static void select_master_clock_4020(struct comedi_device * dev,
const comedi_cmd * cmd)
{
// select internal/external master clock
priv(dev)->main_iobase + HW_CONFIG_REG);
}
-static void select_master_clock(comedi_device * dev, const comedi_cmd * cmd)
+static void select_master_clock(struct comedi_device * dev, const comedi_cmd * cmd)
{
switch (board(dev)->layout) {
case LAYOUT_4020:
}
}
-static inline void dma_start_sync(comedi_device * dev, unsigned int channel)
+static inline void dma_start_sync(struct comedi_device * dev, unsigned int channel)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
-static void set_ai_pacing(comedi_device * dev, comedi_cmd * cmd)
+static void set_ai_pacing(struct comedi_device * dev, comedi_cmd * cmd)
{
uint32_t convert_counter = 0, scan_counter = 0;
return 1;
}
-static int setup_channel_queue(comedi_device * dev, const comedi_cmd * cmd)
+static int setup_channel_queue(struct comedi_device * dev, const comedi_cmd * cmd)
{
unsigned short bits;
int i;
return 0;
}
-static inline void load_first_dma_descriptor(comedi_device * dev,
+static inline void load_first_dma_descriptor(struct comedi_device * dev,
unsigned int dma_channel, unsigned int descriptor_bits)
{
/* The transfer size, pci address, and local address registers
}
}
-static int ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
}
// read num_samples from 16 bit wide ai fifo
-static void pio_drain_ai_fifo_16(comedi_device * dev)
+static void pio_drain_ai_fifo_16(struct comedi_device * dev)
{
comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async;
* dma transfers (it only supports the use of pio for draining the last remaining
* points from the fifo when a data aquisition operation has completed).
*/
-static void pio_drain_ai_fifo_32(comedi_device * dev)
+static void pio_drain_ai_fifo_32(struct comedi_device * dev)
{
comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async;
}
// empty fifo
-static void pio_drain_ai_fifo(comedi_device * dev)
+static void pio_drain_ai_fifo(struct comedi_device * dev)
{
if (board(dev)->layout == LAYOUT_4020) {
pio_drain_ai_fifo_32(dev);
pio_drain_ai_fifo_16(dev);
}
-static void drain_dma_buffers(comedi_device * dev, unsigned int channel)
+static void drain_dma_buffers(struct comedi_device * dev, unsigned int channel)
{
comedi_async *async = dev->read_subdev->async;
uint32_t next_transfer_addr;
* unused buffer) */
}
-void handle_ai_interrupt(comedi_device * dev, unsigned short status,
+void handle_ai_interrupt(struct comedi_device * dev, unsigned short status,
unsigned int plx_status)
{
comedi_subdevice *s = dev->read_subdev;
cfc_handle_events(dev, s);
}
-static inline unsigned int prev_ao_dma_index(comedi_device * dev)
+static inline unsigned int prev_ao_dma_index(struct comedi_device * dev)
{
unsigned int buffer_index;
return buffer_index;
}
-static int last_ao_dma_load_completed(comedi_device * dev)
+static int last_ao_dma_load_completed(struct comedi_device * dev)
{
unsigned int buffer_index;
unsigned int transfer_address;
return 1;
}
-static int ao_stopped_by_error(comedi_device * dev, const comedi_cmd * cmd)
+static int ao_stopped_by_error(struct comedi_device * dev, const comedi_cmd * cmd)
{
if (cmd->stop_src == TRIG_NONE)
return 1;
return 0;
}
-static inline int ao_dma_needs_restart(comedi_device * dev,
+static inline int ao_dma_needs_restart(struct comedi_device * dev,
unsigned short dma_status)
{
if ((dma_status & PLX_DMA_DONE_BIT) == 0 ||
return 1;
}
-static void restart_ao_dma(comedi_device * dev)
+static void restart_ao_dma(struct comedi_device * dev)
{
unsigned int dma_desc_bits;
dma_start_sync(dev, 0);
}
-static void handle_ao_interrupt(comedi_device * dev, unsigned short status,
+static void handle_ao_interrupt(struct comedi_device * dev, unsigned short status,
unsigned int plx_status)
{
comedi_subdevice *s = dev->write_subdev;
static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned short status;
uint32_t plx_status;
uint32_t plx_bits;
return IRQ_HANDLED;
}
-void abort_dma(comedi_device * dev, unsigned int channel)
+void abort_dma(struct comedi_device * dev, unsigned int channel)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
-static int ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
return 0;
}
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return 1;
}
-static int ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int ao_readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = priv(dev)->ao_value[CR_CHAN(insn->chanspec)];
return 1;
}
-static void set_dac_control0_reg(comedi_device * dev, const comedi_cmd * cmd)
+static void set_dac_control0_reg(struct comedi_device * dev, const comedi_cmd * cmd)
{
unsigned int bits = DAC_ENABLE_BIT | WAVEFORM_GATE_LEVEL_BIT |
WAVEFORM_GATE_ENABLE_BIT | WAVEFORM_GATE_SELECT_BIT;
writew(bits, priv(dev)->main_iobase + DAC_CONTROL0_REG);
}
-static void set_dac_control1_reg(comedi_device * dev, const comedi_cmd * cmd)
+static void set_dac_control1_reg(struct comedi_device * dev, const comedi_cmd * cmd)
{
int i;
priv(dev)->main_iobase + DAC_CONTROL1_REG);
}
-static void set_dac_select_reg(comedi_device * dev, const comedi_cmd * cmd)
+static void set_dac_select_reg(struct comedi_device * dev, const comedi_cmd * cmd)
{
uint16_t bits;
unsigned int first_channel, last_channel;
writew(bits, priv(dev)->main_iobase + DAC_SELECT_REG);
}
-static void set_dac_interval_regs(comedi_device * dev, const comedi_cmd * cmd)
+static void set_dac_interval_regs(struct comedi_device * dev, const comedi_cmd * cmd)
{
unsigned int divisor;
priv(dev)->main_iobase + DAC_SAMPLE_INTERVAL_UPPER_REG);
}
-static unsigned int load_ao_dma_buffer(comedi_device * dev,
+static unsigned int load_ao_dma_buffer(struct comedi_device * dev,
const comedi_cmd * cmd)
{
unsigned int num_bytes, buffer_index, prev_buffer_index;
return num_bytes;
}
-static void load_ao_dma(comedi_device * dev, const comedi_cmd * cmd)
+static void load_ao_dma(struct comedi_device * dev, const comedi_cmd * cmd)
{
unsigned int num_bytes;
unsigned int next_transfer_addr;
} while (num_bytes >= DMA_BUFFER_SIZE);
}
-static int prep_ao_dma(comedi_device * dev, const comedi_cmd * cmd)
+static int prep_ao_dma(struct comedi_device * dev, const comedi_cmd * cmd)
{
unsigned int num_bytes;
int i;
return 0;
}
-static inline int external_ai_queue_in_use(comedi_device * dev)
+static inline int external_ai_queue_in_use(struct comedi_device * dev)
{
if (dev->read_subdev->busy)
return 0;
return 1;
}
-static int ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int ao_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ao_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ao_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ao_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
writew(0x0, priv(dev)->main_iobase + DAC_CONTROL0_REG);
abort_dma(dev, 0);
}
}
-static int di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
return 2;
}
-static int do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] &= 0xf;
return 2;
}
-static int dio_60xx_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int dio_60xx_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
return 1;
}
-static int dio_60xx_wbits(comedi_device * dev, comedi_subdevice * s,
+static int dio_60xx_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
return 2;
}
-static void caldac_write(comedi_device * dev, unsigned int channel,
+static void caldac_write(struct comedi_device * dev, unsigned int channel,
unsigned int value)
{
priv(dev)->caldac_state[channel] = value;
}
}
-static int calib_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int calib_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static int calib_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int calib_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static void ad8402_write(comedi_device * dev, unsigned int channel,
+static void ad8402_write(struct comedi_device * dev, unsigned int channel,
unsigned int value)
{
static const int bitstream_length = 10;
}
/* for pci-das6402/16, channel 0 is analog input gain and channel 1 is offset */
-static int ad8402_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int ad8402_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static int ad8402_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int ad8402_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static uint16_t read_eeprom(comedi_device * dev, uint8_t address)
+static uint16_t read_eeprom(struct comedi_device * dev, uint8_t address)
{
static const int bitstream_length = 11;
static const int read_command = 0x6;
return value;
}
-static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = read_eeprom(dev, CR_CHAN(insn->chanspec));
* sets cmd members appropriately.
* adc paces conversions from master clock by dividing by (x + 3) where x is 24 bit number
*/
-static void check_adc_timing(comedi_device * dev, comedi_cmd * cmd)
+static void check_adc_timing(struct comedi_device * dev, comedi_cmd * cmd)
{
unsigned int convert_divisor = 0, scan_divisor;
static const int min_convert_divisor = 3;
}
// adjusts the size of hardware fifo (which determines block size for dma xfers)
-static int set_ai_fifo_size(comedi_device * dev, unsigned int num_samples)
+static int set_ai_fifo_size(struct comedi_device * dev, unsigned int num_samples)
{
unsigned int num_fifo_entries;
int retval;
}
// query length of fifo
-static unsigned int ai_fifo_size(comedi_device * dev)
+static unsigned int ai_fifo_size(struct comedi_device * dev)
{
return priv(dev)->ai_fifo_segment_length *
board(dev)->ai_fifo->num_segments *
board(dev)->ai_fifo->sample_packing_ratio;
}
-static int set_ai_fifo_segment_length(comedi_device * dev,
+static int set_ai_fifo_segment_length(struct comedi_device * dev,
unsigned int num_entries)
{
static const int increment_size = 0x100;
* address 7 == dac channel 1 fine offset
*/
-static int caldac_8800_write(comedi_device * dev, unsigned int address,
+static int caldac_8800_write(struct comedi_device * dev, unsigned int address,
uint8_t value)
{
static const int num_caldac_channels = 8;
}
// 4020 caldacs
-static int caldac_i2c_write(comedi_device * dev, unsigned int caldac_channel,
+static int caldac_i2c_write(struct comedi_device * dev, unsigned int caldac_channel,
unsigned int value)
{
uint8_t serial_bytes[3];
static const int i2c_low_comedi_udelay = 10;
// set i2c data line high or low
-static void i2c_set_sda(comedi_device * dev, int state)
+static void i2c_set_sda(struct comedi_device * dev, int state)
{
static const int data_bit = CTL_EE_W;
void *plx_control_addr = priv(dev)->plx9080_iobase + PLX_CONTROL_REG;
}
// set i2c clock line high or low
-static void i2c_set_scl(comedi_device * dev, int state)
+static void i2c_set_scl(struct comedi_device * dev, int state)
{
static const int clock_bit = CTL_USERO;
void *plx_control_addr = priv(dev)->plx9080_iobase + PLX_CONTROL_REG;
}
}
-static void i2c_write_byte(comedi_device * dev, uint8_t byte)
+static void i2c_write_byte(struct comedi_device * dev, uint8_t byte)
{
uint8_t bit;
unsigned int num_bits = 8;
}
// we can't really read the lines, so fake it
-static int i2c_read_ack(comedi_device * dev)
+static int i2c_read_ack(struct comedi_device * dev)
{
i2c_set_scl(dev, 0);
i2c_set_sda(dev, 1);
}
// send start bit
-static void i2c_start(comedi_device * dev)
+static void i2c_start(struct comedi_device * dev)
{
i2c_set_scl(dev, 1);
i2c_set_sda(dev, 1);
}
// send stop bit
-static void i2c_stop(comedi_device * dev)
+static void i2c_stop(struct comedi_device * dev)
{
i2c_set_scl(dev, 0);
i2c_set_sda(dev, 0);
i2c_set_sda(dev, 1);
}
-static void i2c_write(comedi_device * dev, unsigned int address,
+static void i2c_write(struct comedi_device * dev, unsigned int address,
const uint8_t * data, unsigned int length)
{
unsigned int i;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
int data;
*/
#define devpriv ((cb_pcidda_private *)dev->private)
-static int cb_pcidda_attach(comedi_device * dev, comedi_devconfig * it);
-static int cb_pcidda_detach(comedi_device * dev);
-//static int cb_pcidda_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
-static int cb_pcidda_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidda_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int cb_pcidda_detach(struct comedi_device * dev);
+//static int cb_pcidda_ai_rinsn(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
+static int cb_pcidda_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-//static int cb_pcidda_ai_cmd(comedi_device *dev,comedi_subdevice *s);
-//static int cb_pcidda_ai_cmdtest(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd);
+//static int cb_pcidda_ai_cmd(struct comedi_device *dev,comedi_subdevice *s);
+//static int cb_pcidda_ai_cmdtest(struct comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd);
//static int cb_pcidda_ns_to_timer(unsigned int *ns,int round);
-static unsigned int cb_pcidda_serial_in(comedi_device * dev);
-static void cb_pcidda_serial_out(comedi_device * dev, unsigned int value,
+static unsigned int cb_pcidda_serial_in(struct comedi_device * dev);
+static void cb_pcidda_serial_out(struct comedi_device * dev, unsigned int value,
unsigned int num_bits);
-static unsigned int cb_pcidda_read_eeprom(comedi_device * dev,
+static unsigned int cb_pcidda_read_eeprom(struct comedi_device * dev,
unsigned int address);
-static void cb_pcidda_calibrate(comedi_device * dev, unsigned int channel,
+static void cb_pcidda_calibrate(struct comedi_device * dev, unsigned int channel,
unsigned int range);
/*
* Attach is called by the Comedi core to configure the driver
* for a particular board.
*/
-static int cb_pcidda_attach(comedi_device * dev, comedi_devconfig * it)
+static int cb_pcidda_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
struct pci_dev *pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int cb_pcidda_detach(comedi_device * dev)
+static int cb_pcidda_detach(struct comedi_device * dev)
{
/*
* Deallocate the I/O ports.
* I will program this later... ;-)
*/
#if 0
-static int cb_pcidda_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int cb_pcidda_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
printk("cb_pcidda_ai_cmd\n");
printk("subdev: %d\n", cmd->subdev);
#endif
#if 0
-static int cb_pcidda_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidda_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
}
#endif
-static int cb_pcidda_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcidda_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int command;
}
// lowlevel read from eeprom
-static unsigned int cb_pcidda_serial_in(comedi_device * dev)
+static unsigned int cb_pcidda_serial_in(struct comedi_device * dev)
{
unsigned int value = 0;
int i;
}
// lowlevel write to eeprom/dac
-static void cb_pcidda_serial_out(comedi_device * dev, unsigned int value,
+static void cb_pcidda_serial_out(struct comedi_device * dev, unsigned int value,
unsigned int num_bits)
{
int i;
}
// reads a 16 bit value from board's eeprom
-static unsigned int cb_pcidda_read_eeprom(comedi_device * dev,
+static unsigned int cb_pcidda_read_eeprom(struct comedi_device * dev,
unsigned int address)
{
unsigned int i;
}
// writes to 8 bit calibration dacs
-static void cb_pcidda_write_caldac(comedi_device * dev, unsigned int caldac,
+static void cb_pcidda_write_caldac(struct comedi_device * dev, unsigned int caldac,
unsigned int channel, unsigned int value)
{
unsigned int cal2_bits;
}
// set caldacs to eeprom values for given channel and range
-static void cb_pcidda_calibrate(comedi_device * dev, unsigned int channel,
+static void cb_pcidda_calibrate(struct comedi_device * dev, unsigned int channel,
unsigned int range)
{
unsigned int coarse_offset, fine_offset, coarse_gain, fine_gain;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
int data; // curently unused
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pcidio_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcidio_detach(comedi_device * dev);
+static int pcidio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcidio_detach(struct comedi_device * dev);
static comedi_driver driver_cb_pcidio = {
driver_name:"cb_pcidio",
module:THIS_MODULE,
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pcidio_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcidio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev = NULL;
int index;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pcidio_detach(comedi_device * dev)
+static int pcidio_detach(struct comedi_device * dev)
{
printk("comedi%d: cb_pcidio: remove\n", dev->minor);
if (devpriv) {
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
int data;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int cb_pcimdas_attach(comedi_device * dev, comedi_devconfig * it);
-static int cb_pcimdas_detach(comedi_device * dev);
+static int cb_pcimdas_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int cb_pcimdas_detach(struct comedi_device * dev);
static comedi_driver driver_cb_pcimdas = {
driver_name:"cb_pcimdas",
module:THIS_MODULE,
detach:cb_pcimdas_detach,
};
-static int cb_pcimdas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcimdas_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int cb_pcimdas_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int cb_pcimdas_attach(comedi_device * dev, comedi_devconfig * it)
+static int cb_pcimdas_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
struct pci_dev *pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int cb_pcimdas_detach(comedi_device * dev)
+static int cb_pcimdas_detach(struct comedi_device * dev)
{
#ifdef CBPCIMDAS_DEBUG
if (devpriv) {
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
-static int cb_pcimdas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
return n;
}
-static int cb_pcimdas_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int cb_pcimdas_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int cb_pcimdas_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
unsigned long registers; /* set by probe */
unsigned long dio_registers;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int attach(comedi_device * dev, comedi_devconfig * it);
-static int detach(comedi_device * dev);
+static int attach(struct comedi_device * dev, comedi_devconfig * it);
+static int detach(struct comedi_device * dev);
static comedi_driver cb_pcimdda_driver = {
driver_name:"cb_pcimdda",
module:THIS_MODULE,
MODULE_LICENSE("GPL");
COMEDI_PCI_INITCLEANUP_NOMODULE(cb_pcimdda_driver, pci_table);
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/*---------------------------------------------------------------------------
*
* Otherwise, returns a -errno on error
*/
-static int probe(comedi_device * dev, const comedi_devconfig * it);
+static int probe(struct comedi_device * dev, const comedi_devconfig * it);
/*---------------------------------------------------------------------------
FUNCTION DEFINITIONS
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int attach(comedi_device * dev, comedi_devconfig * it)
+static int attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int err;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int detach(comedi_device * dev)
+static int detach(struct comedi_device * dev)
{
if (devpriv) {
return 0;
}
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
all AO channels update simultaneously. This is useful for some control
applications, I would imagine.
*/
-static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
*
* Otherwise, returns a -errno on error
*/
-static int probe(comedi_device * dev, const comedi_devconfig * it)
+static int probe(struct comedi_device * dev, const comedi_devconfig * it)
{
struct pci_dev *pcidev;
int index;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
struct Private {
# define MAX_BOARD_NAME 256
char name[MAX_BOARD_NAME];
* the board, and also about the kernel module that contains
* the device code.
*/
-static int bonding_attach(comedi_device *dev, comedi_devconfig *it);
-static int bonding_detach(comedi_device *dev);
+static int bonding_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int bonding_detach(struct comedi_device *dev);
/** Build Private array of all devices.. */
-static int doDevConfig(comedi_device *dev, comedi_devconfig *it);
-static void doDevUnconfig(comedi_device *dev);
+static int doDevConfig(struct comedi_device *dev, comedi_devconfig *it);
+static void doDevUnconfig(struct comedi_device *dev);
/* Ugly implementation of realloc that always copies memory around -- I'm lazy,
* what can I say? I like to do wasteful memcopies.. :) */
static void *Realloc(const void *ptr, size_t len, size_t old_len);
.num_names = sizeof(bondingBoards) / sizeof(struct BondingBoard),
};
-static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int bonding_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int bonding_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int bonding_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int bonding_attach(comedi_device *dev, comedi_devconfig *it)
+static int bonding_attach(struct comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int bonding_detach(comedi_device *dev)
+static int bonding_detach(struct comedi_device *dev)
{
LOG_MSG("comedi%d: remove\n", dev->minor);
doDevUnconfig(dev);
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int bonding_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
#define LSAMPL_BITS (sizeof(unsigned int)*8)
return insn->n;
}
-static int bonding_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int bonding_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits;
return newmem;
}
-static int doDevConfig(comedi_device *dev, comedi_devconfig *it)
+static int doDevConfig(struct comedi_device *dev, comedi_devconfig *it)
{
int i;
void *devs_opened[COMEDI_NUM_BOARD_MINORS];
return 1;
}
-static void doDevUnconfig(comedi_device *dev)
+static void doDevUnconfig(struct comedi_device *dev)
{
unsigned long devs_closed = 0;
}
EXPORT_SYMBOL(cfc_read_array_from_buffer);
-unsigned int cfc_handle_events(comedi_device *dev, comedi_subdevice *subd)
+unsigned int cfc_handle_events(struct comedi_device *dev, comedi_subdevice *subd)
{
unsigned int events = subd->async->events;
void *data,
unsigned int num_bytes);
-extern unsigned int cfc_handle_events(comedi_device *dev,
+extern unsigned int cfc_handle_events(struct comedi_device *dev,
comedi_subdevice *subd);
static inline unsigned int cfc_bytes_per_scan(comedi_subdevice *subd)
#define PARPORT_B 1
#define PARPORT_C 2
-static int parport_attach(comedi_device *dev, comedi_devconfig *it);
-static int parport_detach(comedi_device *dev);
+static int parport_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int parport_detach(struct comedi_device *dev);
static comedi_driver driver_parport = {
.driver_name = "comedi_parport",
.module = THIS_MODULE,
};
#define devpriv ((struct parport_private *)(dev->private))
-static int parport_insn_a(comedi_device *dev, comedi_subdevice *s,
+static int parport_insn_a(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
return 2;
}
-static int parport_insn_config_a(comedi_device *dev, comedi_subdevice *s,
+static int parport_insn_config_a(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
return 1;
}
-static int parport_insn_b(comedi_device *dev, comedi_subdevice *s,
+static int parport_insn_b(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
return 2;
}
-static int parport_insn_c(comedi_device *dev, comedi_subdevice *s,
+static int parport_insn_c(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
data[0] &= 0x0f;
return 2;
}
-static int parport_intr_insn(comedi_device *dev, comedi_subdevice *s,
+static int parport_intr_insn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
if (insn->n < 1)
return 2;
}
-static int parport_intr_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int parport_intr_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
int err = 0;
return 0;
}
-static int parport_intr_cmd(comedi_device *dev, comedi_subdevice *s)
+static int parport_intr_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
devpriv->c_data |= 0x10;
outb(devpriv->c_data, dev->iobase + PARPORT_C);
return 0;
}
-static int parport_intr_cancel(comedi_device *dev, comedi_subdevice *s)
+static int parport_intr_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
printk(KERN_DEBUG "parport_intr_cancel()\n");
static irqreturn_t parport_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 3;
if (!devpriv->enable_irq) {
return IRQ_HANDLED;
}
-static int parport_attach(comedi_device *dev, comedi_devconfig *it)
+static int parport_attach(struct comedi_device *dev, comedi_devconfig *it)
{
int ret;
unsigned int irq;
return 1;
}
-static int parport_detach(comedi_device *dev)
+static int parport_detach(struct comedi_device *dev)
{
printk("comedi%d: parport: remove\n", dev->minor);
* task period because analog input tends to be slow. */
#define SPEED_LIMIT 100000 /* in nanoseconds */
-static int timer_attach(comedi_device * dev, comedi_devconfig * it);
-static int timer_detach(comedi_device * dev);
-static int timer_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int timer_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int timer_detach(struct comedi_device * dev);
+static int timer_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num);
-static int timer_start_cmd(comedi_device * dev, comedi_subdevice * s);
+static int timer_start_cmd(struct comedi_device * dev, comedi_subdevice * s);
static comedi_driver driver_timer = {
module:THIS_MODULE,
RT_TASK *scan_task; // rt task that controls conversion timing in a scan
/* io_function can point to either an input or output function
* depending on what kind of subdevice we are emulating for */
- int (*io_function) (comedi_device * dev, comedi_cmd * cmd,
+ int (*io_function) (struct comedi_device * dev, comedi_cmd * cmd,
unsigned int index);
// RTIME has units of 1 = 838 nanoseconds
// time at which first scan started, used to check scan timing
} timer_private;
#define devpriv ((timer_private *)dev->private)
-static int timer_cancel(comedi_device * dev, comedi_subdevice * s)
+static int timer_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
devpriv->stop = 1;
}
// checks for scan timing error
-inline static int check_scan_timing(comedi_device * dev,
+inline static int check_scan_timing(struct comedi_device * dev,
unsigned long long scan)
{
RTIME now, timing_error;
}
// checks for conversion timing error
-inline static int check_conversion_timing(comedi_device * dev,
+inline static int check_conversion_timing(struct comedi_device * dev,
RTIME scan_start, unsigned int conversion)
{
RTIME now, timing_error;
}
// devpriv->io_function for an input subdevice
-static int timer_data_read(comedi_device * dev, comedi_cmd * cmd,
+static int timer_data_read(struct comedi_device * dev, comedi_cmd * cmd,
unsigned int index)
{
comedi_subdevice *s = dev->read_subdev;
}
// devpriv->io_function for an output subdevice
-static int timer_data_write(comedi_device * dev, comedi_cmd * cmd,
+static int timer_data_write(struct comedi_device * dev, comedi_cmd * cmd,
unsigned int index)
{
comedi_subdevice *s = dev->write_subdev;
}
// devpriv->io_function for DIO subdevices
-static int timer_dio_read(comedi_device * dev, comedi_cmd * cmd,
+static int timer_dio_read(struct comedi_device * dev, comedi_cmd * cmd,
unsigned int index)
{
comedi_subdevice *s = dev->read_subdev;
// performs scans
static void scan_task_func(comedi_rt_task_context_t d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + 0;
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
static void timer_task_func(comedi_rt_task_context_t d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + 0;
comedi_cmd *cmd = &s->async->cmd;
int ret;
}
}
-static int timer_insn(comedi_device * dev, comedi_subdevice * s,
+static int timer_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
comedi_insn xinsn = *insn;
return err;
}
-static int timer_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int timer_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int timer_cmd(comedi_device * dev, comedi_subdevice * s)
+static int timer_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int ret;
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int timer_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int timer_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trig_num)
{
if (trig_num != 0)
return timer_start_cmd(dev, s);
}
-static int timer_start_cmd(comedi_device * dev, comedi_subdevice * s)
+static int timer_start_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int timer_attach(comedi_device * dev, comedi_devconfig * it)
+static int timer_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
comedi_subdevice *s, *emul_s;
- comedi_device *emul_dev;
+ struct comedi_device *emul_dev;
/* These should probably be devconfig options[] */
const int timer_priority = 4;
const int scan_priority = timer_priority + 1;
}
// free allocated resources
-static int timer_detach(comedi_device * dev)
+static int timer_detach(struct comedi_device * dev)
{
printk("comedi%d: timer: remove\n", dev->minor);
};
#define devpriv ((struct waveform_private *)dev->private)
-static int waveform_attach(comedi_device *dev, comedi_devconfig *it);
-static int waveform_detach(comedi_device *dev);
+static int waveform_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int waveform_detach(struct comedi_device *dev);
static comedi_driver driver_waveform = {
.driver_name = "comedi_test",
.module = THIS_MODULE,
COMEDI_INITCLEANUP(driver_waveform);
-static int waveform_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
-static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s);
-static int waveform_ai_cancel(comedi_device *dev, comedi_subdevice *s);
-static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_cmd(struct comedi_device *dev, comedi_subdevice *s);
+static int waveform_ai_cancel(struct comedi_device *dev, comedi_subdevice *s);
+static int waveform_ai_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ao_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static short fake_sawtooth(comedi_device *dev, unsigned int range,
+static short fake_sawtooth(struct comedi_device *dev, unsigned int range,
unsigned long current_time);
-static short fake_squarewave(comedi_device *dev, unsigned int range,
+static short fake_squarewave(struct comedi_device *dev, unsigned int range,
unsigned long current_time);
-static short fake_flatline(comedi_device *dev, unsigned int range,
+static short fake_flatline(struct comedi_device *dev, unsigned int range,
unsigned long current_time);
-static short fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(struct comedi_device *dev, unsigned int channel,
unsigned int range, unsigned long current_time);
/* 1000 nanosec in a microsec */
*/
static void waveform_ai_interrupt(unsigned long arg)
{
- comedi_device *dev = (comedi_device *) arg;
+ struct comedi_device *dev = (struct comedi_device *) arg;
comedi_async *async = dev->read_subdev->async;
comedi_cmd *cmd = &async->cmd;
unsigned int i, j;
comedi_event(dev, dev->read_subdev);
}
-static int waveform_attach(comedi_device *dev, comedi_devconfig *it)
+static int waveform_attach(struct comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
int amplitude = it->options[0];
return 1;
}
-static int waveform_detach(comedi_device *dev)
+static int waveform_detach(struct comedi_device *dev)
{
printk("comedi%d: comedi_test: remove\n", dev->minor);
return 0;
}
-static int waveform_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
int err = 0;
return 0;
}
-static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int waveform_ai_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int waveform_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int waveform_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
devpriv->timer_running = 0;
del_timer(&devpriv->timer);
return 0;
}
-static short fake_sawtooth(comedi_device *dev, unsigned int range_index,
+static short fake_sawtooth(struct comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
comedi_subdevice *s = dev->read_subdev;
return offset + value;
}
-static short fake_squarewave(comedi_device *dev, unsigned int range_index,
+static short fake_squarewave(struct comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
comedi_subdevice *s = dev->read_subdev;
return offset + value;
}
-static short fake_flatline(comedi_device *dev, unsigned int range_index,
+static short fake_flatline(struct comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
return dev->read_subdev->maxdata / 2;
}
/* generates a different waveform depending on what channel is read */
-static short fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(struct comedi_device *dev, unsigned int channel,
unsigned int range, unsigned long current_time)
{
enum {
return fake_flatline(dev, range, current_time);
}
-static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ai_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i, chan = CR_CHAN(insn->chanspec);
return insn->n;
}
-static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int waveform_ao_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i, chan = CR_CHAN(insn->chanspec);
#define devpriv ((contec_private *)dev->private)
-static int contec_attach(comedi_device * dev, comedi_devconfig * it);
-static int contec_detach(comedi_device * dev);
+static int contec_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int contec_detach(struct comedi_device * dev);
static comedi_driver driver_contec = {
driver_name:"contec_pci_dio",
module:THIS_MODULE,
};
/* Classic digital IO */
-static int contec_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int contec_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int contec_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int contec_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
#if 0
-static int contec_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int contec_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int contec_ns_to_timer(unsigned int *ns, int round);
#endif
-static int contec_attach(comedi_device * dev, comedi_devconfig * it)
+static int contec_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
comedi_subdevice *s;
return -EIO;
}
-static int contec_detach(comedi_device * dev)
+static int contec_detach(struct comedi_device * dev)
{
printk("comedi%d: contec: remove\n", dev->minor);
}
#if 0
-static int contec_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int contec_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
printk("contec_cmdtest called\n");
}
#endif
-static int contec_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int contec_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return 2;
}
-static int contec_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int contec_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
#define DAQBOARD2000_PosRefDacSelect 0x0100
#define DAQBOARD2000_NegRefDacSelect 0x0000
-static int daqboard2000_attach(comedi_device * dev, comedi_devconfig * it);
-static int daqboard2000_detach(comedi_device * dev);
+static int daqboard2000_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int daqboard2000_detach(struct comedi_device * dev);
static comedi_driver driver_daqboard2000 = {
driver_name:"daqboard2000",
#define devpriv ((daqboard2000_private*)dev->private)
-static void writeAcqScanListEntry(comedi_device * dev, u16 entry)
+static void writeAcqScanListEntry(struct comedi_device * dev, u16 entry)
{
daqboard2000_hw *fpga = devpriv->daq;
fpga->acqScanListFIFO = (entry >> 8) & 0x00ff;
}
-static void setup_sampling(comedi_device * dev, int chan, int gain)
+static void setup_sampling(struct comedi_device * dev, int chan, int gain)
{
u16 word0, word1, word2, word3;
writeAcqScanListEntry(dev, word3);
}
-static int daqboard2000_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int daqboard2000_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int daqboard2000_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int daqboard2000_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int daqboard2000_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int daqboard2000_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static void daqboard2000_resetLocalBus(comedi_device * dev)
+static void daqboard2000_resetLocalBus(struct comedi_device * dev)
{
printk("daqboard2000_resetLocalBus\n");
writel(DAQBOARD2000_SECRLocalBusHi, devpriv->plx + 0x6c);
comedi_udelay(10000);
}
-static void daqboard2000_reloadPLX(comedi_device * dev)
+static void daqboard2000_reloadPLX(struct comedi_device * dev)
{
printk("daqboard2000_reloadPLX\n");
writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c);
comedi_udelay(10000);
}
-static void daqboard2000_pulseProgPin(comedi_device * dev)
+static void daqboard2000_pulseProgPin(struct comedi_device * dev)
{
printk("daqboard2000_pulseProgPin 1\n");
writel(DAQBOARD2000_SECRProgPinHi, devpriv->plx + 0x6c);
comedi_udelay(10000); /* Not in the original code, but I like symmetry... */
}
-static int daqboard2000_pollCPLD(comedi_device * dev, int mask)
+static int daqboard2000_pollCPLD(struct comedi_device * dev, int mask)
{
int result = 0;
int i;
return result;
}
-static int daqboard2000_writeCPLD(comedi_device * dev, int data)
+static int daqboard2000_writeCPLD(struct comedi_device * dev, int data)
{
int result = 0;
return result;
}
-static int initialize_daqboard2000(comedi_device * dev,
+static int initialize_daqboard2000(struct comedi_device * dev,
unsigned char *cpld_array, int len)
{
int result = -EIO;
return result;
}
-static void daqboard2000_adcStopDmaTransfer(comedi_device * dev)
+static void daqboard2000_adcStopDmaTransfer(struct comedi_device * dev)
{
/* printk("Implement: daqboard2000_adcStopDmaTransfer\n");*/
}
-static void daqboard2000_adcDisarm(comedi_device * dev)
+static void daqboard2000_adcDisarm(struct comedi_device * dev)
{
daqboard2000_hw *fpga = devpriv->daq;
daqboard2000_adcStopDmaTransfer(dev);
}
-static void daqboard2000_activateReferenceDacs(comedi_device * dev)
+static void daqboard2000_activateReferenceDacs(struct comedi_device * dev)
{
daqboard2000_hw *fpga = devpriv->daq;
int timeout;
/* printk("DAQBOARD2000_NegRefDacSelect %d\n", timeout);*/
}
-static void daqboard2000_initializeCtrs(comedi_device * dev)
+static void daqboard2000_initializeCtrs(struct comedi_device * dev)
{
/* printk("Implement: daqboard2000_initializeCtrs\n");*/
}
-static void daqboard2000_initializeTmrs(comedi_device * dev)
+static void daqboard2000_initializeTmrs(struct comedi_device * dev)
{
/* printk("Implement: daqboard2000_initializeTmrs\n");*/
}
-static void daqboard2000_dacDisarm(comedi_device * dev)
+static void daqboard2000_dacDisarm(struct comedi_device * dev)
{
/* printk("Implement: daqboard2000_dacDisarm\n");*/
}
-static void daqboard2000_initializeAdc(comedi_device * dev)
+static void daqboard2000_initializeAdc(struct comedi_device * dev)
{
daqboard2000_adcDisarm(dev);
daqboard2000_activateReferenceDacs(dev);
daqboard2000_initializeTmrs(dev);
}
-static void daqboard2000_initializeDac(comedi_device * dev)
+static void daqboard2000_initializeDac(struct comedi_device * dev)
{
daqboard2000_dacDisarm(dev);
}
return result;
}
-static int daqboard2000_attach(comedi_device * dev, comedi_devconfig * it)
+static int daqboard2000_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
comedi_subdevice *s;
return result;
}
-static int daqboard2000_detach(comedi_device * dev)
+static int daqboard2000_detach(struct comedi_device * dev)
{
printk("comedi%d: daqboard2000: remove\n", dev->minor);
/* gainlist same as _pgx_ below */
-static int das08_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das08_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das08_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das08_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08jr_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08jr_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08jr_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das08ao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das08ao_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static void i8254_set_mode_low(unsigned int base, int channel,
unsigned int mode);
#define TIMEOUT 100000
-static int das08_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das08_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int das08_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das08_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = 0;
return 2;
}
-static int das08_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das08_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int wbits;
return 2;
}
-static int das08jr_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = 0;
return 2;
}
-static int das08jr_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
// null bits we are going to set
return 2;
}
-static int das08jr_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das08jr_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
* a different method to force an update.
*
*/
-static int das08ao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das08ao_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return i8254_read_status_low(st->iobase, chan);
}
-static int das08_counter_read(comedi_device * dev, comedi_subdevice * s,
+static int das08_counter_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
return 1;
}
-static int das08_counter_write(comedi_device * dev, comedi_subdevice * s,
+static int das08_counter_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
return 1;
}
-static int das08_counter_config(comedi_device * dev, comedi_subdevice * s,
+static int das08_counter_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
return 2;
}
-static int das08_attach(comedi_device * dev, comedi_devconfig * it);
+static int das08_attach(struct comedi_device * dev, comedi_devconfig * it);
static comedi_driver driver_das08 = {
driver_name: DRV_NAME,
offset:sizeof(struct das08_board_struct),
};
-int das08_common_attach(comedi_device * dev, unsigned long iobase)
+int das08_common_attach(struct comedi_device * dev, unsigned long iobase)
{
comedi_subdevice *s;
int ret;
return 0;
}
-static int das08_attach(comedi_device * dev, comedi_devconfig * it)
+static int das08_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
return das08_common_attach(dev, iobase);
}
-int das08_common_detach(comedi_device * dev)
+int das08_common_detach(struct comedi_device * dev)
{
printk(KERN_INFO "comedi%d: das08: remove\n", dev->minor);
#define NUM_DAS08_CS_BOARDS 2
extern struct das08_board_struct das08_cs_boards[NUM_DAS08_CS_BOARDS];
-int das08_common_attach(comedi_device * dev, unsigned long iobase);
-int das08_common_detach(comedi_device * dev);
+int das08_common_attach(struct comedi_device * dev, unsigned long iobase);
+int das08_common_detach(struct comedi_device * dev);
#endif /* _DAS08_H */
#define thisboard ((const struct das08_board_struct *)dev->board_ptr)
-static int das08_cs_attach(comedi_device * dev, comedi_devconfig * it);
+static int das08_cs_attach(struct comedi_device * dev, comedi_devconfig * it);
static comedi_driver driver_das08_cs = {
driver_name:"das08_cs",
offset:sizeof(struct das08_board_struct),
};
-static int das08_cs_attach(comedi_device * dev, comedi_devconfig * it)
+static int das08_cs_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
unsigned have_byte:1;
};
-static int das16_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das16_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das16_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das16_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int das16_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int das16_cmd_exec(comedi_device * dev, comedi_subdevice * s);
-static int das16_cancel(comedi_device * dev, comedi_subdevice * s);
-static void das16_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static int das16_cmd_exec(struct comedi_device * dev, comedi_subdevice * s);
+static int das16_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void das16_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *array, unsigned int num_bytes, unsigned int start_chan_index);
-static void das16_reset(comedi_device * dev);
+static void das16_reset(struct comedi_device * dev);
static irqreturn_t das16_dma_interrupt(int irq, void *d PT_REGS_ARG);
static void das16_timer_interrupt(unsigned long arg);
-static void das16_interrupt(comedi_device * dev);
+static void das16_interrupt(struct comedi_device * dev);
-static unsigned int das16_set_pacer(comedi_device * dev, unsigned int ns,
+static unsigned int das16_set_pacer(struct comedi_device * dev, unsigned int ns,
int flags);
-static int das1600_mode_detect(comedi_device * dev);
-static unsigned int das16_suggest_transfer_size(comedi_device * dev,
+static int das1600_mode_detect(struct comedi_device * dev);
+static unsigned int das16_suggest_transfer_size(struct comedi_device * dev,
comedi_cmd cmd);
-static void reg_dump(comedi_device * dev);
+static void reg_dump(struct comedi_device * dev);
typedef struct das16_board_struct {
const char *name;
#define n_das16_boards ((sizeof(das16_boards))/(sizeof(das16_board)))
-static int das16_attach(comedi_device * dev, comedi_devconfig * it);
-static int das16_detach(comedi_device * dev);
+static int das16_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das16_detach(struct comedi_device * dev);
static comedi_driver driver_das16 = {
driver_name:"das16",
module:THIS_MODULE,
#define devpriv ((struct das16_private_struct *)(dev->private))
#define thisboard ((struct das16_board_struct *)(dev->board_ptr))
-static int das16_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int das16_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0, tmp;
return 0;
}
-static int das16_cmd_exec(comedi_device * dev, comedi_subdevice * s)
+static int das16_cmd_exec(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int das16_cancel(comedi_device * dev, comedi_subdevice * s)
+static int das16_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
return 0;
}
-static void das16_reset(comedi_device * dev)
+static void das16_reset(struct comedi_device * dev)
{
outb(0, dev->iobase + DAS16_STATUS);
outb(0, dev->iobase + DAS16_CONTROL);
outb(0, dev->iobase + DAS16_CNTR_CONTROL);
}
-static int das16_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int das16_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das16_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
return 2;
}
-static int das16_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das16_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int wbits;
return 2;
}
-static int das16_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das16_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
static irqreturn_t das16_dma_interrupt(int irq, void *d PT_REGS_ARG)
{
int status;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
status = inb(dev->iobase + DAS16_STATUS);
static void das16_timer_interrupt(unsigned long arg)
{
- comedi_device *dev = (comedi_device *) arg;
+ struct comedi_device *dev = (struct comedi_device *) arg;
das16_interrupt(dev);
an even transfer count after disabling dma
channel.
*/
-static int disable_dma_on_even(comedi_device * dev)
+static int disable_dma_on_even(struct comedi_device * dev)
{
int residue;
int i;
return residue;
}
-static void das16_interrupt(comedi_device * dev)
+static void das16_interrupt(struct comedi_device * dev)
{
unsigned long dma_flags, spin_flags;
comedi_subdevice *s = dev->read_subdev;
cfc_handle_events(dev, s);
}
-static unsigned int das16_set_pacer(comedi_device * dev, unsigned int ns,
+static unsigned int das16_set_pacer(struct comedi_device * dev, unsigned int ns,
int rounding_flags)
{
i8253_cascade_ns_to_timer_2div(devpriv->clockbase, &(devpriv->divisor1),
return ns;
}
-static void reg_dump(comedi_device * dev)
+static void reg_dump(struct comedi_device * dev)
{
DEBUG_PRINT("********DAS1600 REGISTER DUMP********\n");
DEBUG_PRINT("DAS16_MUX: %x\n", inb(dev->iobase + DAS16_MUX));
inb(dev->iobase + DAS1600_STATUS_B));
}
-static int das16_probe(comedi_device * dev, comedi_devconfig * it)
+static int das16_probe(struct comedi_device * dev, comedi_devconfig * it)
{
int status;
int diobits;
return 0;
}
-static int das1600_mode_detect(comedi_device * dev)
+static int das1600_mode_detect(struct comedi_device * dev)
{
int status = 0;
* 3 Clock speed (in MHz)
*/
-static int das16_attach(comedi_device * dev, comedi_devconfig * it)
+static int das16_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret;
return 0;
}
-static int das16_detach(comedi_device * dev)
+static int das16_detach(struct comedi_device * dev)
{
printk("comedi%d: das16: remove\n", dev->minor);
COMEDI_INITCLEANUP(driver_das16);
// utility function that suggests a dma transfer size in bytes
-static unsigned int das16_suggest_transfer_size(comedi_device * dev,
+static unsigned int das16_suggest_transfer_size(struct comedi_device * dev,
comedi_cmd cmd)
{
unsigned int size;
return size;
}
-static void das16_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static void das16_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *array, unsigned int num_bytes, unsigned int start_chan_index)
{
unsigned int i, num_samples = num_bytes / sizeof(short);
}
};
-static int das16m1_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16m1_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16m1_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das16m1_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int das16m1_cmd_exec(comedi_device * dev, comedi_subdevice * s);
-static int das16m1_cancel(comedi_device * dev, comedi_subdevice * s);
+static int das16m1_cmd_exec(struct comedi_device * dev, comedi_subdevice * s);
+static int das16m1_cancel(struct comedi_device * dev, comedi_subdevice * s);
-static int das16m1_poll(comedi_device * dev, comedi_subdevice * s);
+static int das16m1_poll(struct comedi_device * dev, comedi_subdevice * s);
static irqreturn_t das16m1_interrupt(int irq, void *d PT_REGS_ARG);
-static void das16m1_handler(comedi_device * dev, unsigned int status);
+static void das16m1_handler(struct comedi_device * dev, unsigned int status);
-static unsigned int das16m1_set_pacer(comedi_device * dev, unsigned int ns,
+static unsigned int das16m1_set_pacer(struct comedi_device * dev, unsigned int ns,
int round_flag);
static int das16m1_irq_bits(unsigned int irq);
#define das16m1_num_boards ((sizeof(das16m1_boards)) / (sizeof(das16m1_boards[0])))
-static int das16m1_attach(comedi_device * dev, comedi_devconfig * it);
-static int das16m1_detach(comedi_device * dev);
+static int das16m1_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das16m1_detach(struct comedi_device * dev);
static comedi_driver driver_das16m1 = {
driver_name:"das16m1",
module:THIS_MODULE,
return (data >> 4) & 0xfff;
}
-static int das16m1_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
unsigned int err = 0, tmp, i;
return 0;
}
-static int das16m1_cmd_exec(comedi_device * dev, comedi_subdevice * s)
+static int das16m1_cmd_exec(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int das16m1_cancel(comedi_device * dev, comedi_subdevice * s)
+static int das16m1_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
devpriv->control_state &= ~INTE & ~PACER_MASK;
outb(devpriv->control_state, dev->iobase + DAS16M1_INTR_CONTROL);
return 0;
}
-static int das16m1_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int das16m1_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
return 2;
}
-static int das16m1_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das16m1_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int wbits;
return 2;
}
-static int das16m1_poll(comedi_device * dev, comedi_subdevice * s)
+static int das16m1_poll(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
unsigned int status;
static irqreturn_t das16m1_interrupt(int irq, void *d PT_REGS_ARG)
{
int status;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
if (dev->attached == 0) {
comedi_error(dev, "premature interrupt");
}
}
-static void das16m1_handler(comedi_device * dev, unsigned int status)
+static void das16m1_handler(struct comedi_device * dev, unsigned int status)
{
comedi_subdevice *s;
comedi_async *async;
/* This function takes a time in nanoseconds and sets the *
* 2 pacer clocks to the closest frequency possible. It also *
* returns the actual sampling period. */
-static unsigned int das16m1_set_pacer(comedi_device * dev, unsigned int ns,
+static unsigned int das16m1_set_pacer(struct comedi_device * dev, unsigned int ns,
int rounding_flags)
{
i8253_cascade_ns_to_timer_2div(DAS16M1_XTAL, &(devpriv->divisor1),
* 1 IRQ
*/
-static int das16m1_attach(comedi_device * dev, comedi_devconfig * it)
+static int das16m1_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret;
return 0;
}
-static int das16m1_detach(comedi_device * dev)
+static int das16m1_detach(struct comedi_device * dev)
{
printk("comedi%d: das16m1: remove\n", dev->minor);
das1802hr, das1802hr_da, das1801hc, das1802hc, das1801ao, das1802ao
};
-static int das1800_attach(comedi_device * dev, comedi_devconfig * it);
-static int das1800_detach(comedi_device * dev);
-static int das1800_probe(comedi_device * dev);
-static int das1800_cancel(comedi_device * dev, comedi_subdevice * s);
+static int das1800_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das1800_detach(struct comedi_device * dev);
+static int das1800_probe(struct comedi_device * dev);
+static int das1800_cancel(struct comedi_device * dev, comedi_subdevice * s);
static irqreturn_t das1800_interrupt(int irq, void *d PT_REGS_ARG);
-static int das1800_ai_poll(comedi_device * dev, comedi_subdevice * s);
-static void das1800_ai_handler(comedi_device * dev);
-static void das1800_handle_dma(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ai_poll(struct comedi_device * dev, comedi_subdevice * s);
+static void das1800_ai_handler(struct comedi_device * dev);
+static void das1800_handle_dma(struct comedi_device * dev, comedi_subdevice * s,
unsigned int status);
-static void das1800_flush_dma(comedi_device * dev, comedi_subdevice * s);
-static void das1800_flush_dma_channel(comedi_device * dev, comedi_subdevice * s,
+static void das1800_flush_dma(struct comedi_device * dev, comedi_subdevice * s);
+static void das1800_flush_dma_channel(struct comedi_device * dev, comedi_subdevice * s,
unsigned int channel, uint16_t * buffer);
-static void das1800_handle_fifo_half_full(comedi_device * dev,
+static void das1800_handle_fifo_half_full(struct comedi_device * dev,
comedi_subdevice * s);
-static void das1800_handle_fifo_not_empty(comedi_device * dev,
+static void das1800_handle_fifo_not_empty(struct comedi_device * dev,
comedi_subdevice * s);
-static int das1800_ai_do_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ai_do_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int das1800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s);
-static int das1800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ai_do_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int das1800_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das1800_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das1800_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das1800_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das1800_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das1800_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das1800_set_frequency(comedi_device * dev);
+static int das1800_set_frequency(struct comedi_device * dev);
static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode);
static unsigned int suggest_transfer_size(comedi_cmd * cmd);
*/
COMEDI_INITCLEANUP(driver_das1800);
-static int das1800_init_dma(comedi_device * dev, unsigned int dma0,
+static int das1800_init_dma(struct comedi_device * dev, unsigned int dma0,
unsigned int dma1)
{
unsigned long flags;
return 0;
}
-static int das1800_attach(comedi_device * dev, comedi_devconfig * it)
+static int das1800_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = it->options[0];
return 0;
};
-static int das1800_detach(comedi_device * dev)
+static int das1800_detach(struct comedi_device * dev)
{
/* only free stuff if it has been allocated by _attach */
if (dev->iobase)
/* probes and checks das-1800 series board type
*/
-static int das1800_probe(comedi_device * dev)
+static int das1800_probe(struct comedi_device * dev)
{
int id;
int board;
return -1;
}
-static int das1800_ai_poll(comedi_device * dev, comedi_subdevice * s)
+static int das1800_ai_poll(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
static irqreturn_t das1800_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned int status;
if (dev->attached == 0) {
}
// the guts of the interrupt handler, that is shared with das1800_ai_poll
-static void das1800_ai_handler(comedi_device * dev)
+static void das1800_ai_handler(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + 0; /* analog input subdevice */
comedi_async *async = s->async;
return;
}
-static void das1800_handle_dma(comedi_device * dev, comedi_subdevice * s,
+static void das1800_handle_dma(struct comedi_device * dev, comedi_subdevice * s,
unsigned int status)
{
unsigned long flags;
return;
}
-static inline uint16_t munge_bipolar_sample(const comedi_device * dev,
+static inline uint16_t munge_bipolar_sample(const struct comedi_device * dev,
uint16_t sample)
{
sample += 1 << (thisboard->resolution - 1);
return sample;
}
-static void munge_data(comedi_device * dev, uint16_t * array,
+static void munge_data(struct comedi_device * dev, uint16_t * array,
unsigned int num_elements)
{
unsigned int i;
/* Utility function used by das1800_flush_dma() and das1800_handle_dma().
* Assumes dma lock is held */
-static void das1800_flush_dma_channel(comedi_device * dev, comedi_subdevice * s,
+static void das1800_flush_dma_channel(struct comedi_device * dev, comedi_subdevice * s,
unsigned int channel, uint16_t * buffer)
{
unsigned int num_bytes, num_samples;
/* flushes remaining data from board when external trigger has stopped aquisition
* and we are using dma transfers */
-static void das1800_flush_dma(comedi_device * dev, comedi_subdevice * s)
+static void das1800_flush_dma(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
const int dual_dma = devpriv->irq_dma_bits & DMA_DUAL;
return;
}
-static void das1800_handle_fifo_half_full(comedi_device * dev,
+static void das1800_handle_fifo_half_full(struct comedi_device * dev,
comedi_subdevice * s)
{
int numPoints = 0; /* number of points to read */
return;
}
-static void das1800_handle_fifo_not_empty(comedi_device * dev,
+static void das1800_handle_fifo_not_empty(struct comedi_device * dev,
comedi_subdevice * s)
{
short dpnt;
return;
}
-static int das1800_cancel(comedi_device * dev, comedi_subdevice * s)
+static int das1800_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
outb(0x0, dev->iobase + DAS1800_STATUS); /* disable conversions */
outb(0x0, dev->iobase + DAS1800_CONTROL_B); /* disable interrupts and dma */
}
/* test analog input cmd */
-static int das1800_ai_do_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ai_do_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
}
// sets up counters
-static int setup_counters(comedi_device * dev, comedi_cmd cmd)
+static int setup_counters(struct comedi_device * dev, comedi_cmd cmd)
{
// setup cascaded counters for conversion/scan frequency
switch (cmd.scan_begin_src) {
}
// sets up dma
-static void setup_dma(comedi_device * dev, comedi_cmd cmd)
+static void setup_dma(struct comedi_device * dev, comedi_cmd cmd)
{
unsigned long lock_flags;
const int dual_dma = devpriv->irq_dma_bits & DMA_DUAL;
}
// programs channel/gain list into card
-static void program_chanlist(comedi_device * dev, comedi_cmd cmd)
+static void program_chanlist(struct comedi_device * dev, comedi_cmd cmd)
{
int i, n, chan_range;
unsigned long irq_flags;
}
// analog input do_cmd
-static int das1800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s)
+static int das1800_ai_do_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int ret;
int control_a, control_c;
}
/* read analog input */
-static int das1800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
}
/* writes to an analog output channel */
-static int das1800_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int das1800_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
}
/* reads from digital input channels */
-static int das1800_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das1800_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
}
/* writes to digital output channels */
-static int das1800_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das1800_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int wbits;
}
/* loads counters with divisor1, divisor2 from private structure */
-static int das1800_set_frequency(comedi_device * dev)
+static int das1800_set_frequency(struct comedi_device * dev)
{
int err = 0;
#define C2 0x80
#define RWLH 0x30
-static int das6402_attach(comedi_device * dev, comedi_devconfig * it);
-static int das6402_detach(comedi_device * dev);
+static int das6402_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das6402_detach(struct comedi_device * dev);
static comedi_driver driver_das6402 = {
driver_name:"das6402",
module:THIS_MODULE,
} das6402_private;
#define devpriv ((das6402_private *)dev->private)
-static void das6402_ai_fifo_dregs(comedi_device * dev, comedi_subdevice * s);
+static void das6402_ai_fifo_dregs(struct comedi_device * dev, comedi_subdevice * s);
-static void das6402_setcounter(comedi_device * dev)
+static void das6402_setcounter(struct comedi_device * dev)
{
BYTE p;
unsigned short ctrlwrd;
static irqreturn_t intr_handler(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices;
if (!dev->attached || devpriv->das6402_ignoreirq) {
}
#if 0
-static void das6402_ai_fifo_read(comedi_device * dev, short * data, int n)
+static void das6402_ai_fifo_read(struct comedi_device * dev, short * data, int n)
{
int i;
}
#endif
-static void das6402_ai_fifo_dregs(comedi_device * dev, comedi_subdevice * s)
+static void das6402_ai_fifo_dregs(struct comedi_device * dev, comedi_subdevice * s)
{
while (1) {
if (!(inb(dev->iobase + 8) & 0x01))
}
}
-static int das6402_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int das6402_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
/*
* This function should reset the board from whatever condition it
}
#ifdef unused
-static int das6402_ai_mode2(comedi_device * dev, comedi_subdevice * s,
+static int das6402_ai_mode2(struct comedi_device * dev, comedi_subdevice * s,
comedi_trig * it)
{
devpriv->das6402_ignoreirq = 1;
}
#endif
-static int board_init(comedi_device * dev)
+static int board_init(struct comedi_device * dev)
{
BYTE b;
return 0;
}
-static int das6402_detach(comedi_device * dev)
+static int das6402_detach(struct comedi_device * dev)
{
if (dev->irq)
comedi_free_irq(dev->irq, dev);
return 0;
}
-static int das6402_attach(comedi_device * dev, comedi_devconfig * it)
+static int das6402_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned int irq;
unsigned long iobase;
#define devpriv ((das800_private *)dev->private)
-static int das800_attach(comedi_device * dev, comedi_devconfig * it);
-static int das800_detach(comedi_device * dev);
-static int das800_cancel(comedi_device * dev, comedi_subdevice * s);
+static int das800_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int das800_detach(struct comedi_device * dev);
+static int das800_cancel(struct comedi_device * dev, comedi_subdevice * s);
static comedi_driver driver_das800 = {
driver_name:"das800",
};
static irqreturn_t das800_interrupt(int irq, void *d PT_REGS_ARG);
-static void enable_das800(comedi_device * dev);
-static void disable_das800(comedi_device * dev);
-static int das800_ai_do_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static void enable_das800(struct comedi_device * dev);
+static void disable_das800(struct comedi_device * dev);
+static int das800_ai_do_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int das800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s);
-static int das800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das800_ai_do_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int das800_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das800_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das800_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das800_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das800_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int das800_probe(comedi_device * dev);
-static int das800_set_frequency(comedi_device * dev);
+static int das800_probe(struct comedi_device * dev);
+static int das800_set_frequency(struct comedi_device * dev);
/* checks and probes das-800 series board type */
-static int das800_probe(comedi_device * dev)
+static int das800_probe(struct comedi_device * dev)
{
int id_bits;
unsigned long irq_flags;
{
short i; /* loop index */
short dataPoint = 0;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->read_subdev; /* analog input subdevice */
comedi_async *async;
int status;
return IRQ_HANDLED;
}
-static int das800_attach(comedi_device * dev, comedi_devconfig * it)
+static int das800_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = it->options[0];
return 0;
};
-static int das800_detach(comedi_device * dev)
+static int das800_detach(struct comedi_device * dev)
{
printk("comedi%d: das800: remove\n", dev->minor);
return 0;
};
-static int das800_cancel(comedi_device * dev, comedi_subdevice * s)
+static int das800_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
devpriv->forever = 0;
devpriv->count = 0;
}
/* enable_das800 makes the card start taking hardware triggered conversions */
-static void enable_das800(comedi_device * dev)
+static void enable_das800(struct comedi_device * dev)
{
unsigned long irq_flags;
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
}
/* disable_das800 stops hardware triggered conversions */
-static void disable_das800(comedi_device * dev)
+static void disable_das800(struct comedi_device * dev)
{
unsigned long irq_flags;
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
}
-static int das800_ai_do_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int das800_ai_do_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int das800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s)
+static int das800_ai_do_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int startChan, endChan, scan, gain;
int conv_bits;
return 0;
}
-static int das800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int das800_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int das800_di_rbits(comedi_device * dev, comedi_subdevice * s,
+static int das800_di_rbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bits;
return 2;
}
-static int das800_do_wbits(comedi_device * dev, comedi_subdevice * s,
+static int das800_do_wbits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int wbits;
}
/* loads counters with divisor1, divisor2 from private structure */
-static int das800_set_frequency(comedi_device * dev)
+static int das800_set_frequency(struct comedi_device * dev)
{
int err = 0;
/* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
- * feel free to suggest moving the variable to the comedi_device struct.
+ * feel free to suggest moving the variable to the struct comedi_device struct.
*/
typedef struct {
* the board, and also about the kernel module that contains
* the device code.
*/
-static int dmm32at_attach(comedi_device * dev, comedi_devconfig * it);
-static int dmm32at_detach(comedi_device * dev);
+static int dmm32at_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dmm32at_detach(struct comedi_device * dev);
static comedi_driver driver_dmm32at = {
driver_name:"dmm32at",
module:THIS_MODULE,
};
/* prototypes for driver functions below */
-static int dmm32at_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dmm32at_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dmm32at_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dmm32at_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dmm32at_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dmm32at_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int dmm32at_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int dmm32at_ai_cancel(comedi_device * dev, comedi_subdevice * s);
+static int dmm32at_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int dmm32at_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
static int dmm32at_ns_to_timer(unsigned int *ns, int round);
static irqreturn_t dmm32at_isr(int irq, void *d PT_REGS_ARG);
-void dmm32at_setaitimer(comedi_device * dev, unsigned int nansec);
+void dmm32at_setaitimer(struct comedi_device * dev, unsigned int nansec);
/*
* Attach is called by the Comedi core to configure the driver
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int dmm32at_attach(comedi_device * dev, comedi_devconfig * it)
+static int dmm32at_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
comedi_subdevice *s;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int dmm32at_detach(comedi_device * dev)
+static int dmm32at_detach(struct comedi_device * dev)
{
printk("comedi%d: dmm32at: remove\n", dev->minor);
if (dev->irq)
* mode.
*/
-static int dmm32at_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
return n;
}
-static int dmm32at_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int dmm32at_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dmm32at_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int i, range;
}
-static int dmm32at_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int dmm32at_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
devpriv->ai_scans_left = 1;
return 0;
unsigned int samp;
unsigned short msb, lsb;
int i;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
if (!dev->attached) {
comedi_error(dev, "spurious interrupt");
return *ns;
}
-static int dmm32at_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int dmm32at_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int dmm32at_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned char diobits;
return 2;
}
-static int dmm32at_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dmm32at_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned char chanbit;
return 1;
}
-void dmm32at_setaitimer(comedi_device * dev, unsigned int nansec)
+void dmm32at_setaitimer(struct comedi_device * dev, unsigned int nansec)
{
unsigned char lo1, lo2, hi2;
unsigned short both2;
#define DT2801_STATUS 1
#define DT2801_CMD 1
-static int dt2801_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt2801_detach(comedi_device * dev);
+static int dt2801_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt2801_detach(struct comedi_device * dev);
static comedi_driver driver_dt2801 = {
driver_name:"dt2801",
module:THIS_MODULE,
} dt2801_private;
#define devpriv ((dt2801_private *)dev->private)
-static int dt2801_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2801_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2801_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2801_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2801_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/* These are the low-level routines:
/* Only checks DataOutReady-flag, not the Ready-flag as it is done
in the examples of the manual. I don't see why this should be
necessary. */
-static int dt2801_readdata(comedi_device * dev, int *data)
+static int dt2801_readdata(struct comedi_device * dev, int *data)
{
int stat = 0;
int timeout = DT2801_TIMEOUT;
return -ETIME;
}
-static int dt2801_readdata2(comedi_device * dev, int *data)
+static int dt2801_readdata2(struct comedi_device * dev, int *data)
{
int lb, hb;
int ret;
return 0;
}
-static int dt2801_writedata(comedi_device * dev, unsigned int data)
+static int dt2801_writedata(struct comedi_device * dev, unsigned int data)
{
int stat = 0;
int timeout = DT2801_TIMEOUT;
return -ETIME;
}
-static int dt2801_writedata2(comedi_device * dev, unsigned int data)
+static int dt2801_writedata2(struct comedi_device * dev, unsigned int data)
{
int ret;
return 0;
}
-static int dt2801_wait_for_ready(comedi_device * dev)
+static int dt2801_wait_for_ready(struct comedi_device * dev)
{
int timeout = DT2801_TIMEOUT;
int stat;
return -ETIME;
}
-static int dt2801_writecmd(comedi_device * dev, int command)
+static int dt2801_writecmd(struct comedi_device * dev, int command)
{
int stat;
return 0;
}
-static int dt2801_reset(comedi_device * dev)
+static int dt2801_reset(struct comedi_device * dev)
{
int board_code = 0;
unsigned int stat;
return board_code;
}
-static int probe_number_of_ai_chans(comedi_device * dev)
+static int probe_number_of_ai_chans(struct comedi_device * dev)
{
int n_chans;
int stat;
[4] - dac0 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
[5] - dac1 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
*/
-static int dt2801_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt2801_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return ret;
}
-static int dt2801_detach(comedi_device * dev)
+static int dt2801_detach(struct comedi_device * dev)
{
if (dev->iobase)
release_region(dev->iobase, DT2801_IOSIZE);
return 0;
}
-static int dt2801_error(comedi_device * dev, int stat)
+static int dt2801_error(struct comedi_device * dev, int stat)
{
if (stat < 0) {
if (stat == -ETIME) {
return -EIO;
}
-static int dt2801_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int d;
return i;
}
-static int dt2801_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_readback[CR_CHAN(insn->chanspec)];
return 1;
}
-static int dt2801_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
dt2801_writecmd(dev, DT_C_WRITE_DAIM);
return 1;
}
-static int dt2801_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int which = 0;
return 2;
}
-static int dt2801_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dt2801_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int which = 0;
#define this_board ((const boardtype *)dev->board_ptr)
-static int dt2811_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt2811_detach(comedi_device * dev);
+static int dt2811_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt2811_detach(struct comedi_device * dev);
static comedi_driver driver_dt2811 = {
driver_name:"dt2811",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_dt2811);
-static int dt2811_ai_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ai_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2811_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2811_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2811_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dt2811_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
enum { card_2811_pgh, card_2811_pgl };
{
int lo, hi;
int data;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
if (!dev->attached) {
comedi_error(dev, "spurious interrupt");
2 == unipolar 5V (0V -- +5V)
*/
-static int dt2811_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt2811_attach(struct comedi_device * dev, comedi_devconfig * it)
{
//int i, irq;
//unsigned long irqs;
return 0;
}
-static int dt2811_detach(comedi_device * dev)
+static int dt2811_detach(struct comedi_device * dev)
{
printk("comedi%d: dt2811: remove\n", dev->minor);
return 0;
}
-static int dt2811_ai_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ai_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
* replaced, so I'll let it stay. */
int dt2811_adtrig(kdev_t minor, comedi_adtrig * adtrig)
{
- comedi_device *dev = comedi_devices + minor;
+ struct comedi_device *dev = comedi_devices + minor;
if (adtrig->n < 1)
return 0;
}
#endif
-static int dt2811_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt2811_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt2811_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int dt2811_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2811_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
#define DT2814_ENB 0x10
#define DT2814_CHANMASK 0x0f
-static int dt2814_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt2814_detach(comedi_device * dev);
+static int dt2814_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt2814_detach(struct comedi_device * dev);
static comedi_driver driver_dt2814 = {
driver_name:"dt2814",
module:THIS_MODULE,
#define DT2814_TIMEOUT 10
#define DT2814_MAX_SPEED 100000 /* Arbitrary 10 khz limit */
-static int dt2814_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2814_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i, hi, lo;
return i;
}
-static int dt2814_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dt2814_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int dt2814_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dt2814_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int chan;
}
-static int dt2814_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt2814_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int i, irq;
int ret;
return 0;
}
-static int dt2814_detach(comedi_device * dev)
+static int dt2814_detach(struct comedi_device * dev)
{
printk("comedi%d: dt2814: remove\n", dev->minor);
static irqreturn_t dt2814_interrupt(int irq, void *d PT_REGS_ARG)
{
int lo, hi;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s;
int data;
#define DT2815_DATA 0
#define DT2815_STATUS 1
-static int dt2815_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt2815_detach(comedi_device * dev);
+static int dt2815_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt2815_detach(struct comedi_device * dev);
static comedi_driver driver_dt2815 = {
driver_name:"dt2815",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_dt2815);
-static void dt2815_free_resources(comedi_device * dev);
+static void dt2815_free_resources(struct comedi_device * dev);
typedef struct {
const comedi_lrange *range_type_list[8];
#define devpriv ((dt2815_private *)dev->private)
-static int dt2815_wait_for_status(comedi_device * dev, int status)
+static int dt2815_wait_for_status(struct comedi_device * dev, int status)
{
int i;
return status;
}
-static int dt2815_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt2815_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt2815_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt2815_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
1 == current
*/
-static int dt2815_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt2815_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int i;
return 0;
}
-static void dt2815_free_resources(comedi_device * dev)
+static void dt2815_free_resources(struct comedi_device * dev)
{
if (dev->iobase)
release_region(dev->iobase, DT2815_SIZE);
}
-static int dt2815_detach(comedi_device * dev)
+static int dt2815_detach(struct comedi_device * dev)
{
printk("comedi%d: dt2815: remove\n", dev->minor);
#define DT2817_CR 0
#define DT2817_DATA 1
-static int dt2817_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt2817_detach(comedi_device * dev);
+static int dt2817_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt2817_detach(struct comedi_device * dev);
static comedi_driver driver_dt2817 = {
driver_name:"dt2817",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_dt2817);
-static int dt2817_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dt2817_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int mask;
return 1;
}
-static int dt2817_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt2817_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int changed;
return 2;
}
-static int dt2817_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt2817_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
comedi_subdevice *s;
return 0;
}
-static int dt2817_detach(comedi_device * dev)
+static int dt2817_detach(struct comedi_device * dev)
{
printk("comedi%d: dt2817: remove\n", dev->minor);
if(_i){b} \
}while(0)
-static int dt282x_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt282x_detach(comedi_device * dev);
+static int dt282x_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt282x_detach(struct comedi_device * dev);
static comedi_driver driver_dt282x = {
driver_name:"dt282x",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_dt282x);
-static void free_resources(comedi_device * dev);
-static int prep_ai_dma(comedi_device * dev, int chan, int size);
-static int prep_ao_dma(comedi_device * dev, int chan, int size);
-static int dt282x_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static int dt282x_ao_cancel(comedi_device * dev, comedi_subdevice * s);
+static void free_resources(struct comedi_device * dev);
+static int prep_ai_dma(struct comedi_device * dev, int chan, int size);
+static int prep_ao_dma(struct comedi_device * dev, int chan, int size);
+static int dt282x_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static int dt282x_ao_cancel(struct comedi_device * dev, comedi_subdevice * s);
static int dt282x_ns_to_timer(int *nanosec, int round_mode);
-static void dt282x_disable_dma(comedi_device * dev);
+static void dt282x_disable_dma(struct comedi_device * dev);
-static int dt282x_grab_dma(comedi_device * dev, int dma1, int dma2);
+static int dt282x_grab_dma(struct comedi_device * dev, int dma1, int dma2);
-static void dt282x_munge(comedi_device * dev, short * buf,
+static void dt282x_munge(struct comedi_device * dev, short * buf,
unsigned int nbytes)
{
unsigned int i;
}
}
-static void dt282x_ao_dma_interrupt(comedi_device * dev)
+static void dt282x_ao_dma_interrupt(struct comedi_device * dev)
{
void *ptr;
int size;
return;
}
-static void dt282x_ai_dma_interrupt(comedi_device * dev)
+static void dt282x_ai_dma_interrupt(struct comedi_device * dev)
{
void *ptr;
int size;
prep_ai_dma(dev, i, 0);
}
-static int prep_ai_dma(comedi_device * dev, int dma_index, int n)
+static int prep_ai_dma(struct comedi_device * dev, int dma_index, int n)
{
int dma_chan;
unsigned long dma_ptr;
return n;
}
-static int prep_ao_dma(comedi_device * dev, int dma_index, int n)
+static int prep_ao_dma(struct comedi_device * dev, int dma_index, int n)
{
int dma_chan;
unsigned long dma_ptr;
static irqreturn_t dt282x_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s;
comedi_subdevice *s_ao;
unsigned int supcsr, adcsr, dacsr;
return IRQ_RETVAL(handled);
}
-static void dt282x_load_changain(comedi_device * dev, int n,
+static void dt282x_load_changain(struct comedi_device * dev, int n,
unsigned int *chanlist)
{
unsigned int i;
* - preload multiplexer
* - trigger conversion and wait for it to finish
*/
-static int dt282x_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt282x_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int dt282x_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dt282x_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int timer;
return 0;
}
-static void dt282x_disable_dma(comedi_device * dev)
+static void dt282x_disable_dma(struct comedi_device * dev)
{
if (devpriv->usedma) {
disable_dma(devpriv->dma[0].chan);
}
}
-static int dt282x_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int dt282x_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
dt282x_disable_dma(dev);
* offset binary if necessary, loads the data into the DAC
* data register, and performs the conversion.
*/
-static int dt282x_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
return 1;
}
-static int dt282x_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
short d;
return 1;
}
-static int dt282x_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
}
-static int dt282x_ao_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_ao_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int x)
{
int size;
return 1;
}
-static int dt282x_ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dt282x_ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int timer;
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int dt282x_ao_cancel(comedi_device * dev, comedi_subdevice * s)
+static int dt282x_ao_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
dt282x_disable_dma(dev);
return 0;
}
-static int dt282x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
return 2;
}
-static int dt282x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dt282x_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int mask;
9 ao0 0=±10 V, 1=0-10 V, 2=±5 V, 3=0-5 V, 4=±2.5 V
10 ao1 0=±10 V, 1=0-10 V, 2=±5 V, 3=0-5 V, 4=±2.5 V
*/
-static int dt282x_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt282x_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int i, irq;
int ret;
return 0;
}
-static void free_resources(comedi_device * dev)
+static void free_resources(struct comedi_device * dev)
{
if (dev->irq) {
comedi_free_irq(dev->irq, dev);
}
}
-static int dt282x_detach(comedi_device * dev)
+static int dt282x_detach(struct comedi_device * dev)
{
printk("comedi%d: dt282x: remove\n", dev->minor);
return 0;
}
-static int dt282x_grab_dma(comedi_device * dev, int dma1, int dma2)
+static int dt282x_grab_dma(struct comedi_device * dev, int dma1, int dma2)
{
int ret;
} dt3k_private;
#define devpriv ((dt3k_private *)dev->private)
-static int dt3000_attach(comedi_device * dev, comedi_devconfig * it);
-static int dt3000_detach(comedi_device * dev);
+static int dt3000_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dt3000_detach(struct comedi_device * dev);
static comedi_driver driver_dt3000 = {
driver_name:"dt3000",
module:THIS_MODULE,
COMEDI_PCI_INITCLEANUP(driver_dt3000, dt3k_pci_table);
-static void dt3k_ai_empty_fifo(comedi_device * dev, comedi_subdevice * s);
+static void dt3k_ai_empty_fifo(struct comedi_device * dev, comedi_subdevice * s);
static int dt3k_ns_to_timer(unsigned int timer_base, unsigned int *arg,
unsigned int round_mode);
-static int dt3k_ai_cancel(comedi_device * dev, comedi_subdevice * s);
+static int dt3k_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
#ifdef DEBUG
static void debug_intr_flags(unsigned int flags);
#endif
#define TIMEOUT 100
-static int dt3k_send_cmd(comedi_device * dev, unsigned int cmd)
+static int dt3k_send_cmd(struct comedi_device * dev, unsigned int cmd)
{
int i;
unsigned int status = 0;
return -ETIME;
}
-static unsigned int dt3k_readsingle(comedi_device * dev, unsigned int subsys,
+static unsigned int dt3k_readsingle(struct comedi_device * dev, unsigned int subsys,
unsigned int chan, unsigned int gain)
{
writew(subsys, devpriv->io_addr + DPR_SubSys);
return readw(devpriv->io_addr + DPR_Params(2));
}
-static void dt3k_writesingle(comedi_device * dev, unsigned int subsys,
+static void dt3k_writesingle(struct comedi_device * dev, unsigned int subsys,
unsigned int chan, unsigned int data)
{
writew(subsys, devpriv->io_addr + DPR_SubSys);
// What's this debug_n_ints stuff? Obviously needs some work...
static irqreturn_t dt3k_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s;
unsigned int status;
}
#endif
-static void dt3k_ai_empty_fifo(comedi_device * dev, comedi_subdevice * s)
+static void dt3k_ai_empty_fifo(struct comedi_device * dev, comedi_subdevice * s)
{
int front;
int rear;
writew(rear, devpriv->io_addr + DPR_AD_Buf_Rear);
}
-static int dt3k_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return (prescale << 16) | (divider);
}
-static int dt3k_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int dt3k_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int i;
return 0;
}
-static int dt3k_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int dt3k_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
int ret;
return 0;
}
-static int dt3k_ai_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_ai_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt3k_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int dt3k_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static void dt3k_dio_config(comedi_device * dev, int bits)
+static void dt3k_dio_config(struct comedi_device * dev, int bits)
{
/* XXX */
writew(SUBS_DOUT, devpriv->io_addr + DPR_SubSys);
dt3k_send_cmd(dev, CMD_CONFIG);
}
-static int dt3k_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int mask;
return insn->n;
}
-static int dt3k_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int dt3k_mem_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int dt3k_mem_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int addr = CR_CHAN(insn->chanspec);
return i;
}
-static int dt_pci_probe(comedi_device * dev, int bus, int slot);
+static int dt_pci_probe(struct comedi_device * dev, int bus, int slot);
-static int dt3000_attach(comedi_device * dev, comedi_devconfig * it)
+static int dt3000_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int bus, slot;
return 0;
}
-static int dt3000_detach(comedi_device * dev)
+static int dt3000_detach(struct comedi_device * dev)
{
if (dev->irq)
comedi_free_irq(dev->irq, dev);
}
static struct pci_dev *dt_pci_find_device(struct pci_dev *from, int *board);
-static int setup_pci(comedi_device * dev);
+static int setup_pci(struct comedi_device * dev);
-static int dt_pci_probe(comedi_device * dev, int bus, int slot)
+static int dt_pci_probe(struct comedi_device * dev, int bus, int slot)
{
int board;
int ret;
return 1;
}
-static int setup_pci(comedi_device * dev)
+static int setup_pci(struct comedi_device * dev)
{
resource_size_t addr;
int ret;
* Comedi functions
*/
-static void dt9812_comedi_open(comedi_device *dev)
+static void dt9812_comedi_open(struct comedi_device *dev)
{
down(&devpriv->slot->mutex);
if (devpriv->slot->usb) {
up(&devpriv->slot->mutex);
}
-static int dt9812_di_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int dt9812_di_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n;
return n;
}
-static int dt9812_do_winsn(comedi_device *dev, comedi_subdevice *s,
+static int dt9812_do_winsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n;
return n;
}
-static int dt9812_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int dt9812_ai_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n;
return n;
}
-static int dt9812_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int dt9812_ao_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n;
return n;
}
-static int dt9812_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+static int dt9812_ao_winsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n;
return n;
}
-static int dt9812_attach(comedi_device *dev, comedi_devconfig *it)
+static int dt9812_attach(struct comedi_device *dev, comedi_devconfig *it)
{
int i;
comedi_subdevice *s;
return 0;
}
-static int dt9812_detach(comedi_device *dev)
+static int dt9812_detach(struct comedi_device *dev)
{
return 0;
}
}
};
-static int fl512_attach(comedi_device * dev, comedi_devconfig * it);
-static int fl512_detach(comedi_device * dev);
+static int fl512_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int fl512_detach(struct comedi_device * dev);
static comedi_driver driver_fl512 = {
driver_name:"fl512",
COMEDI_INITCLEANUP(driver_fl512);
-static int fl512_ai_insn(comedi_device * dev,
+static int fl512_ai_insn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int fl512_ao_insn(comedi_device * dev,
+static int fl512_ao_insn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int fl512_ao_insn_readback(comedi_device * dev,
+static int fl512_ao_insn_readback(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/*
* fl512_ai_insn : this is the analog input function
*/
-static int fl512_ai_insn(comedi_device * dev,
+static int fl512_ai_insn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
/*
* fl512_ao_insn : used to write to a DA port n times
*/
-static int fl512_ao_insn(comedi_device * dev,
+static int fl512_ao_insn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
* fl512_ao_insn_readback : used to read previous values written to
* DA port
*/
-static int fl512_ao_insn_readback(comedi_device * dev,
+static int fl512_ao_insn_readback(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
/*
* start attach
*/
-static int fl512_attach(comedi_device * dev, comedi_devconfig * it)
+static int fl512_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned long iobase;
comedi_subdevice *s; /* pointer to the subdevice:
return 1;
}
-static int fl512_detach(comedi_device * dev)
+static int fl512_detach(struct comedi_device * dev)
{
if (dev->iobase)
release_region(dev->iobase, FL512_SIZE);
#include "plx9080.h"
#include "comedi_fc.h"
-static int hpdi_attach(comedi_device * dev, comedi_devconfig * it);
-static int hpdi_detach(comedi_device * dev);
-void abort_dma(comedi_device * dev, unsigned int channel);
-static int hpdi_cmd(comedi_device * dev, comedi_subdevice * s);
-static int hpdi_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int hpdi_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int hpdi_detach(struct comedi_device * dev);
+void abort_dma(struct comedi_device * dev, unsigned int channel);
+static int hpdi_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int hpdi_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int hpdi_cancel(comedi_device * dev, comedi_subdevice * s);
+static int hpdi_cancel(struct comedi_device * dev, comedi_subdevice * s);
static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG);
-static int dio_config_block_size(comedi_device * dev, unsigned int * data);
+static int dio_config_block_size(struct comedi_device * dev, unsigned int * data);
#undef HPDI_DEBUG // disable debugging messages
//#define HPDI_DEBUG // enable debugging code
MODULE_DEVICE_TABLE(pci, hpdi_pci_table);
-static inline hpdi_board *board(const comedi_device * dev)
+static inline hpdi_board *board(const struct comedi_device * dev)
{
return (hpdi_board *) dev->board_ptr;
}
unsigned dio_config_output:1;
} hpdi_private;
-static inline hpdi_private *priv(comedi_device * dev)
+static inline hpdi_private *priv(struct comedi_device * dev)
{
return dev->private;
}
COMEDI_PCI_INITCLEANUP(driver_hpdi, hpdi_pci_table);
-static int dio_config_insn(comedi_device * dev, comedi_subdevice * s,
+static int dio_config_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
return -EINVAL;
}
-static void disable_plx_interrupts(comedi_device * dev)
+static void disable_plx_interrupts(struct comedi_device * dev)
{
writel(0, priv(dev)->plx9080_iobase + PLX_INTRCS_REG);
}
// initialize plx9080 chip
-static void init_plx9080(comedi_device * dev)
+static void init_plx9080(struct comedi_device * dev)
{
uint32_t bits;
void *plx_iobase = priv(dev)->plx9080_iobase;
/* Allocate and initialize the subdevice structures.
*/
-static int setup_subdevices(comedi_device * dev)
+static int setup_subdevices(struct comedi_device * dev)
{
comedi_subdevice *s;
return 0;
}
-static int init_hpdi(comedi_device * dev)
+static int init_hpdi(struct comedi_device * dev)
{
uint32_t plx_intcsr_bits;
}
// setup dma descriptors so a link completes every 'transfer_size' bytes
-static int setup_dma_descriptors(comedi_device * dev,
+static int setup_dma_descriptors(struct comedi_device * dev,
unsigned int transfer_size)
{
unsigned int buffer_index, buffer_offset;
return transfer_size;
}
-static int hpdi_attach(comedi_device * dev, comedi_devconfig * it)
+static int hpdi_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pci_dev *pcidev;
int i;
return init_hpdi(dev);
}
-static int hpdi_detach(comedi_device * dev)
+static int hpdi_detach(struct comedi_device * dev)
{
unsigned int i;
return 0;
}
-static int dio_config_block_size(comedi_device * dev, unsigned int * data)
+static int dio_config_block_size(struct comedi_device * dev, unsigned int * data)
{
unsigned int requested_block_size;
int retval;
return 2;
}
-static int di_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int di_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int hpdi_cmd_test(comedi_device * dev, comedi_subdevice * s,
+static int hpdi_cmd_test(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
if (priv(dev)->dio_config_output) {
return di_cmd_test(dev, s, cmd);
}
-static inline void hpdi_writel(comedi_device * dev, uint32_t bits,
+static inline void hpdi_writel(struct comedi_device * dev, uint32_t bits,
unsigned int offset)
{
writel(bits | priv(dev)->bits[offset / sizeof(uint32_t)],
priv(dev)->hpdi_iobase + offset);
}
-static int di_cmd(comedi_device * dev, comedi_subdevice * s)
+static int di_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
uint32_t bits;
unsigned long flags;
return 0;
}
-static int hpdi_cmd(comedi_device * dev, comedi_subdevice * s)
+static int hpdi_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
if (priv(dev)->dio_config_output) {
return -EINVAL;
return di_cmd(dev, s);
}
-static void drain_dma_buffers(comedi_device * dev, unsigned int channel)
+static void drain_dma_buffers(struct comedi_device * dev, unsigned int channel)
{
comedi_async *async = dev->read_subdev->async;
uint32_t next_transfer_addr;
static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async;
uint32_t hpdi_intr_status, hpdi_board_status;
return IRQ_HANDLED;
}
-void abort_dma(comedi_device * dev, unsigned int channel)
+void abort_dma(struct comedi_device * dev, unsigned int channel)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
-static int hpdi_cancel(comedi_device * dev, comedi_subdevice * s)
+static int hpdi_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
hpdi_writel(dev, 0, BOARD_CONTROL_REG);
Forward declarations
==============================================================================
*/
-static int icp_multi_attach(comedi_device *dev, comedi_devconfig *it);
-static int icp_multi_detach(comedi_device *dev);
+static int icp_multi_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int icp_multi_detach(struct comedi_device *dev);
/*
==============================================================================
*/
#if 0
-static int check_channel_list(comedi_device *dev, comedi_subdevice *s,
+static int check_channel_list(struct comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan);
#endif
-static void setup_channel_list(comedi_device *dev, comedi_subdevice *s,
+static void setup_channel_list(struct comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan);
-static int icp_multi_reset(comedi_device *dev);
+static int icp_multi_reset(struct comedi_device *dev);
/*
==============================================================================
This function reads a single analogue input.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to analogue input data
==============================================================================
*/
-static int icp_multi_insn_read_ai(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_read_ai(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n, timeout;
This function writes a single analogue output.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to analogue output data
==============================================================================
*/
-static int icp_multi_insn_write_ao(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_write_ao(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n, chan, range, timeout;
This function reads a single analogue output.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to analogue output data
==============================================================================
*/
-static int icp_multi_insn_read_ao(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_read_ao(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int n, chan;
This function reads the digital inputs.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to analogue output data
==============================================================================
*/
-static int icp_multi_insn_bits_di(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_bits_di(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
data[1] = readw(devpriv->io_addr + ICP_MULTI_DI);
This function writes the appropriate digital outputs.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to analogue output data
==============================================================================
*/
-static int icp_multi_insn_bits_do(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_bits_do(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
#ifdef ICP_MULTI_EXTDEBUG
This function reads the specified counter.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to counter data
==============================================================================
*/
-static int icp_multi_insn_read_ctr(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_read_ctr(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return 0;
This function write to the specified counter.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
unsigned int *data Pointer to counter data
==============================================================================
*/
-static int icp_multi_insn_write_ctr(comedi_device *dev, comedi_subdevice *s,
+static int icp_multi_insn_write_ctr(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return 0;
*/
static irqreturn_t interrupt_service_icp_multi(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
int int_no;
#ifdef ICP_MULTI_EXTDEBUG
is built correctly
Parameters:
- comedi_device *dev Pointer to current sevice structure
+ struct comedi_device *dev Pointer to current sevice structure
comedi_subdevice *s Pointer to current subdevice structure
unsigned int *chanlist Pointer to packed channel list
unsigned int n_chan Number of channels to scan
==============================================================================
*/
-static int check_channel_list(comedi_device *dev, comedi_subdevice *s,
+static int check_channel_list(struct comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan)
{
unsigned int i;
Status register.
Parameters:
- comedi_device *dev Pointer to current sevice structure
+ struct comedi_device *dev Pointer to current sevice structure
comedi_subdevice *s Pointer to current subdevice structure
unsigned int *chanlist Pointer to packed channel list
unsigned int n_chan Number of channels to scan
==============================================================================
*/
-static void setup_channel_list(comedi_device *dev, comedi_subdevice *s,
+static void setup_channel_list(struct comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan)
{
unsigned int i, range, chanprog;
This function resets the icp multi device to a 'safe' state
Parameters:
- comedi_device *dev Pointer to current sevice structure
+ struct comedi_device *dev Pointer to current sevice structure
Returns:int 0 = success
==============================================================================
*/
-static int icp_multi_reset(comedi_device *dev)
+static int icp_multi_reset(struct comedi_device *dev)
{
unsigned int i;
device.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
comedi_devconfig *it Pointer to current device configuration
Returns:int 0 = success
==============================================================================
*/
-static int icp_multi_attach(comedi_device *dev, comedi_devconfig *it)
+static int icp_multi_attach(struct comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
int ret, subdev, n_subdevices;
device.
Parameters:
- comedi_device *dev Pointer to current device structure
+ struct comedi_device *dev Pointer to current device structure
Returns:int 0 = success
==============================================================================
*/
-static int icp_multi_detach(comedi_device *dev)
+static int icp_multi_detach(struct comedi_device *dev)
{
if (dev->private)
#define devpriv ((pci20xxx_private *)dev->private)
#define CHAN (CR_CHAN(it->chanlist[0]))
-static int pci20xxx_attach(comedi_device * dev, comedi_devconfig * it);
-static int pci20xxx_detach(comedi_device * dev);
+static int pci20xxx_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pci20xxx_detach(struct comedi_device * dev);
static comedi_driver driver_pci20xxx = {
driver_name:"ii_pci20kc",
detach:pci20xxx_detach,
};
-static int pci20006_init(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_init(struct comedi_device * dev, comedi_subdevice * s,
int opt0, int opt1);
-static int pci20341_init(comedi_device * dev, comedi_subdevice * s,
+static int pci20341_init(struct comedi_device * dev, comedi_subdevice * s,
int opt0, int opt1);
-static int pci20xxx_dio_init(comedi_device * dev, comedi_subdevice * s);
+static int pci20xxx_dio_init(struct comedi_device * dev, comedi_subdevice * s);
/*
options[0] Board base address
1 == unipolar 10V (0V -- +10V)
2 == bipolar 5V (-5V -- +5V)
*/
-static int pci20xxx_attach(comedi_device * dev, comedi_devconfig * it)
+static int pci20xxx_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned char i;
int ret;
return 1;
}
-static int pci20xxx_detach(comedi_device * dev)
+static int pci20xxx_detach(struct comedi_device * dev)
{
printk("comedi%d: pci20xxx: remove\n", dev->minor);
/* pci20006m */
-static int pci20006_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pci20006_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static const comedi_lrange *pci20006_range_list[] = {
&range_bipolar5,
};
-static int pci20006_init(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_init(struct comedi_device * dev, comedi_subdevice * s,
int opt0, int opt1)
{
pci20xxx_subdev_private *sdp = s->private;
return 0;
}
-static int pci20006_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
return 1;
}
-static int pci20006_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int pci20006_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
/* PCI20341M */
-static int pci20341_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pci20341_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static const int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 };
&range_bipolar0_025,
};
-static int pci20341_init(comedi_device * dev, comedi_subdevice * s,
+static int pci20341_init(struct comedi_device * dev, comedi_subdevice * s,
int opt0, int opt1)
{
pci20xxx_subdev_private *sdp = s->private;
return 0;
}
-static int pci20341_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pci20341_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
/* native DIO */
-static void pci20xxx_dio_config(comedi_device * dev, comedi_subdevice * s);
-static int pci20xxx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static void pci20xxx_dio_config(struct comedi_device * dev, comedi_subdevice * s);
+static int pci20xxx_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pci20xxx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pci20xxx_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/* initialize pci20xxx_private */
-static int pci20xxx_dio_init(comedi_device * dev, comedi_subdevice * s)
+static int pci20xxx_dio_init(struct comedi_device * dev, comedi_subdevice * s)
{
s->type = COMEDI_SUBD_DIO;
return 0;
}
-static int pci20xxx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pci20xxx_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int mask, bits;
return 1;
}
-static int pci20xxx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pci20xxx_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int mask = data[0];
return 2;
}
-static void pci20xxx_dio_config(comedi_device * dev, comedi_subdevice * s)
+static void pci20xxx_dio_config(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned char control_01;
unsigned char control_23;
}
#if 0
-static void pci20xxx_do(comedi_device * dev, comedi_subdevice * s)
+static void pci20xxx_do(struct comedi_device * dev, comedi_subdevice * s)
{
/* XXX if the channel is configured for input, does this
do bad things? */
writeb((s->state >> 24) & 0xff, devpriv->ioaddr + PCI20000_DIO_3);
}
-static unsigned int pci20xxx_di(comedi_device * dev, comedi_subdevice * s)
+static unsigned int pci20xxx_di(struct comedi_device * dev, comedi_subdevice * s)
{
/* XXX same note as above */
unsigned int bits;
.release = comedi_fw_release
};
-typedef int comedi_firmware_callback(comedi_device * dev,
+typedef int comedi_firmware_callback(struct comedi_device * dev,
const u8 * data, size_t size);
-static int comedi_load_firmware(comedi_device * dev,
+static int comedi_load_firmware(struct comedi_device * dev,
char *name, comedi_firmware_callback cb)
{
int result = 0;
#define PCI_DEVICE_ID_JR3_3_CHANNEL 0x3113
#define PCI_DEVICE_ID_JR3_4_CHANNEL 0x3114
-static int jr3_pci_attach(comedi_device * dev, comedi_devconfig * it);
-static int jr3_pci_detach(comedi_device * dev);
+static int jr3_pci_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int jr3_pci_detach(struct comedi_device * dev);
static comedi_driver driver_jr3_pci = {
driver_name:"jr3_pci",
return result;
}
-static int jr3_pci_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int jr3_pci_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int result;
return result;
}
-static void jr3_pci_open(comedi_device * dev)
+static void jr3_pci_open(struct comedi_device * dev)
{
int i;
jr3_pci_dev_private *devpriv = dev->private;
return result;
}
-static int jr3_download_firmware(comedi_device * dev, const u8 * data,
+static int jr3_download_firmware(struct comedi_device * dev, const u8 * data,
size_t size)
{
/*
static void jr3_pci_poll_dev(unsigned long data)
{
unsigned long flags;
- comedi_device *dev = (comedi_device *) data;
+ struct comedi_device *dev = (struct comedi_device *) data;
jr3_pci_dev_private *devpriv = dev->private;
unsigned long now;
int delay;
add_timer(&devpriv->timer);
}
-static int jr3_pci_attach(comedi_device * dev, comedi_devconfig * it)
+static int jr3_pci_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
struct pci_dev *card = NULL;
return result;
}
-static int jr3_pci_detach(comedi_device * dev)
+static int jr3_pci_detach(struct comedi_device * dev)
{
int i;
jr3_pci_dev_private *devpriv = dev->private;
/*-- function prototypes ----------------------------------------------------*/
-static int cnt_attach(comedi_device * dev, comedi_devconfig * it);
-static int cnt_detach(comedi_device * dev);
+static int cnt_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int cnt_detach(struct comedi_device * dev);
static DEFINE_PCI_DEVICE_TABLE(cnt_pci_table) = {
{PCI_VENDOR_ID_KOLTER, CNT_CARD_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
/* This should be used only for resetting the counters; maybe it is better
to make a special command 'reset'. */
-static int cnt_winsn(comedi_device * dev,
+static int cnt_winsn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
/*-- counter read -----------------------------------------------------------*/
-static int cnt_rinsn(comedi_device * dev,
+static int cnt_rinsn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
unsigned char a0, a1, a2, a3, a4;
/*-- attach -----------------------------------------------------------------*/
-static int cnt_attach(comedi_device * dev, comedi_devconfig * it)
+static int cnt_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *subdevice;
struct pci_dev *pci_device;
/*-- detach -----------------------------------------------------------------*/
-static int cnt_detach(comedi_device * dev)
+static int cnt_detach(struct comedi_device * dev)
{
if (devpriv && devpriv->pcidev) {
if (dev->iobase) {
/*-----------------------------------------------------------------------------
Comedi function prototypes
---------------------------------------------------------------------------*/
-static int me4000_attach(comedi_device *dev, comedi_devconfig *it);
-static int me4000_detach(comedi_device *dev);
+static int me4000_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int me4000_detach(struct comedi_device *dev);
static comedi_driver driver_me4000 = {
driver_name:"me4000",
module : THIS_MODULE,
/*-----------------------------------------------------------------------------
Meilhaus function prototypes
---------------------------------------------------------------------------*/
-static int me4000_probe(comedi_device *dev, comedi_devconfig *it);
-static int get_registers(comedi_device *dev, struct pci_dev *pci_dev_p);
-static int init_board_info(comedi_device *dev, struct pci_dev *pci_dev_p);
-static int init_ao_context(comedi_device *dev);
-static int init_ai_context(comedi_device *dev);
-static int init_dio_context(comedi_device *dev);
-static int init_cnt_context(comedi_device *dev);
-static int xilinx_download(comedi_device *dev);
-static int reset_board(comedi_device *dev);
-
-static int me4000_dio_insn_bits(comedi_device *dev,
+static int me4000_probe(struct comedi_device *dev, comedi_devconfig *it);
+static int get_registers(struct comedi_device *dev, struct pci_dev *pci_dev_p);
+static int init_board_info(struct comedi_device *dev, struct pci_dev *pci_dev_p);
+static int init_ao_context(struct comedi_device *dev);
+static int init_ai_context(struct comedi_device *dev);
+static int init_dio_context(struct comedi_device *dev);
+static int init_cnt_context(struct comedi_device *dev);
+static int xilinx_download(struct comedi_device *dev);
+static int reset_board(struct comedi_device *dev);
+
+static int me4000_dio_insn_bits(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int me4000_dio_insn_config(comedi_device *dev,
+static int me4000_dio_insn_config(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int cnt_reset(comedi_device *dev, unsigned int channel);
+static int cnt_reset(struct comedi_device *dev, unsigned int channel);
-static int cnt_config(comedi_device *dev,
+static int cnt_config(struct comedi_device *dev,
unsigned int channel, unsigned int mode);
-static int me4000_cnt_insn_config(comedi_device *dev,
+static int me4000_cnt_insn_config(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int me4000_cnt_insn_write(comedi_device *dev,
+static int me4000_cnt_insn_write(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int me4000_cnt_insn_read(comedi_device *dev,
+static int me4000_cnt_insn_read(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int me4000_ai_insn_read(comedi_device *dev,
+static int me4000_ai_insn_read(struct comedi_device *dev,
comedi_subdevice *subdevice, comedi_insn *insn, unsigned int *data);
-static int me4000_ai_cancel(comedi_device *dev, comedi_subdevice *s);
+static int me4000_ai_cancel(struct comedi_device *dev, comedi_subdevice *s);
-static int ai_check_chanlist(comedi_device *dev,
+static int ai_check_chanlist(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd);
-static int ai_round_cmd_args(comedi_device *dev,
+static int ai_round_cmd_args(struct comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd,
unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks);
-static int ai_prepare(comedi_device *dev,
+static int ai_prepare(struct comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd,
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks);
-static int ai_write_chanlist(comedi_device *dev,
+static int ai_write_chanlist(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd);
static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG);
-static int me4000_ai_do_cmd_test(comedi_device *dev,
+static int me4000_ai_do_cmd_test(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd);
-static int me4000_ai_do_cmd(comedi_device *dev, comedi_subdevice *s);
+static int me4000_ai_do_cmd(struct comedi_device *dev, comedi_subdevice *s);
-static int me4000_ao_insn_write(comedi_device *dev,
+static int me4000_ao_insn_write(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
-static int me4000_ao_insn_read(comedi_device *dev,
+static int me4000_ao_insn_read(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
/*-----------------------------------------------------------------------------
Meilhaus inline functions
---------------------------------------------------------------------------*/
-static inline void me4000_outb(comedi_device *dev, unsigned char value,
+static inline void me4000_outb(struct comedi_device *dev, unsigned char value,
unsigned long port)
{
PORT_PDEBUG("--> 0x%02X port 0x%04lX\n", value, port);
outb(value, port);
}
-static inline void me4000_outl(comedi_device *dev, unsigned long value,
+static inline void me4000_outl(struct comedi_device *dev, unsigned long value,
unsigned long port)
{
PORT_PDEBUG("--> 0x%08lX port 0x%04lX\n", value, port);
outl(value, port);
}
-static inline unsigned long me4000_inl(comedi_device *dev, unsigned long port)
+static inline unsigned long me4000_inl(struct comedi_device *dev, unsigned long port)
{
unsigned long value;
value = inl(port);
return value;
}
-static inline unsigned char me4000_inb(comedi_device *dev, unsigned long port)
+static inline unsigned char me4000_inb(struct comedi_device *dev, unsigned long port)
{
unsigned char value;
value = inb(port);
}
};
-static int me4000_attach(comedi_device *dev, comedi_devconfig *it)
+static int me4000_attach(struct comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
int result;
return 0;
}
-static int me4000_probe(comedi_device *dev, comedi_devconfig *it)
+static int me4000_probe(struct comedi_device *dev, comedi_devconfig *it)
{
struct pci_dev *pci_device;
int result, i;
return 0;
}
-static int get_registers(comedi_device *dev, struct pci_dev *pci_dev_p)
+static int get_registers(struct comedi_device *dev, struct pci_dev *pci_dev_p)
{
CALL_PDEBUG("In get_registers()\n");
return 0;
}
-static int init_board_info(comedi_device *dev, struct pci_dev *pci_dev_p)
+static int init_board_info(struct comedi_device *dev, struct pci_dev *pci_dev_p)
{
int result;
return 0;
}
-static int init_ao_context(comedi_device *dev)
+static int init_ao_context(struct comedi_device *dev)
{
int i;
return 0;
}
-static int init_ai_context(comedi_device *dev)
+static int init_ai_context(struct comedi_device *dev)
{
CALL_PDEBUG("In init_ai_context()\n");
return 0;
}
-static int init_dio_context(comedi_device *dev)
+static int init_dio_context(struct comedi_device *dev)
{
CALL_PDEBUG("In init_dio_context()\n");
return 0;
}
-static int init_cnt_context(comedi_device *dev)
+static int init_cnt_context(struct comedi_device *dev)
{
CALL_PDEBUG("In init_cnt_context()\n");
extern unsigned char *xilinx_firm;
#endif
-static int xilinx_download(comedi_device *dev)
+static int xilinx_download(struct comedi_device *dev)
{
u32 value = 0;
wait_queue_head_t queue;
return 0;
}
-static int reset_board(comedi_device *dev)
+static int reset_board(struct comedi_device *dev)
{
unsigned long icr;
return 0;
}
-static int me4000_detach(comedi_device *dev)
+static int me4000_detach(struct comedi_device *dev)
{
CALL_PDEBUG("In me4000_detach()\n");
Analog input section
===========================================================================*/
-static int me4000_ai_insn_read(comedi_device *dev,
+static int me4000_ai_insn_read(struct comedi_device *dev,
comedi_subdevice *subdevice, comedi_insn *insn, unsigned int *data)
{
return 1;
}
-static int me4000_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int me4000_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
unsigned long tmp;
return 0;
}
-static int ai_check_chanlist(comedi_device *dev,
+static int ai_check_chanlist(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd)
{
int aref;
return 0;
}
-static int ai_round_cmd_args(comedi_device *dev,
+static int ai_round_cmd_args(struct comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd,
unsigned int *init_ticks,
return 0;
}
-static void ai_write_timer(comedi_device *dev,
+static void ai_write_timer(struct comedi_device *dev,
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks)
{
me4000_outl(dev, chan_ticks - 1, info->ai_context.chan_timer_reg);
}
-static int ai_prepare(comedi_device *dev,
+static int ai_prepare(struct comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd,
unsigned int init_ticks,
return 0;
}
-static int ai_write_chanlist(comedi_device *dev,
+static int ai_write_chanlist(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd)
{
unsigned int entry;
return 0;
}
-static int me4000_ai_do_cmd(comedi_device *dev, comedi_subdevice *s)
+static int me4000_ai_do_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
int err;
unsigned int init_ticks = 0;
* - invalid chanlist
* So I tried to adopt this scheme.
*/
-static int me4000_ai_do_cmd_test(comedi_device *dev,
+static int me4000_ai_do_cmd_test(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd)
{
static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG)
{
unsigned int tmp;
- comedi_device *dev = dev_id;
+ struct comedi_device *dev = dev_id;
comedi_subdevice *s = dev->subdevices;
me4000_ai_context_t *ai_context = &info->ai_context;
int i;
Analog output section
===========================================================================*/
-static int me4000_ao_insn_write(comedi_device *dev,
+static int me4000_ao_insn_write(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
return 1;
}
-static int me4000_ao_insn_read(comedi_device *dev,
+static int me4000_ao_insn_read(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
Digital I/O section
===========================================================================*/
-static int me4000_dio_insn_bits(comedi_device *dev,
+static int me4000_dio_insn_bits(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
return 2;
}
-static int me4000_dio_insn_config(comedi_device *dev,
+static int me4000_dio_insn_config(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
unsigned long tmp;
Counter section
===========================================================================*/
-static int cnt_reset(comedi_device *dev, unsigned int channel)
+static int cnt_reset(struct comedi_device *dev, unsigned int channel)
{
CALL_PDEBUG("In cnt_reset()\n");
return 0;
}
-static int cnt_config(comedi_device *dev, unsigned int channel,
+static int cnt_config(struct comedi_device *dev, unsigned int channel,
unsigned int mode)
{
int tmp = 0;
return 0;
}
-static int me4000_cnt_insn_config(comedi_device *dev,
+static int me4000_cnt_insn_config(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
return 2;
}
-static int me4000_cnt_insn_read(comedi_device *dev,
+static int me4000_cnt_insn_read(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
return 1;
}
-static int me4000_cnt_insn_write(comedi_device *dev,
+static int me4000_cnt_insn_write(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
#define ME_COUNTER_VALUE_B 0x0022 /* R | - */
/* Function prototypes */
-static int me_attach(comedi_device *dev, comedi_devconfig *it);
-static int me_detach(comedi_device *dev);
+static int me_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int me_detach(struct comedi_device *dev);
static const comedi_lrange me2000_ai_range = {
8,
*
* ------------------------------------------------------------------
*/
-static int me_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int me_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int bits;
}
/* Digital instant input/outputs */
-static int me_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int me_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
unsigned int mask = data[0];
*/
/* Analog instant input */
-static int me_ai_insn_read(comedi_device *dev, comedi_subdevice *subdevice,
+static int me_ai_insn_read(struct comedi_device *dev, comedi_subdevice *subdevice,
comedi_insn *insn, unsigned int *data)
{
unsigned short value;
*/
/* Cancel analog input autoscan */
-static int me_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int me_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
/* disable interrupts */
}
/* Test analog input command */
-static int me_ai_do_cmd_test(comedi_device *dev, comedi_subdevice *s,
+static int me_ai_do_cmd_test(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
return 0;
}
/* Analog input command */
-static int me_ai_do_cmd(comedi_device *dev, comedi_subdevice *subdevice)
+static int me_ai_do_cmd(struct comedi_device *dev, comedi_subdevice *subdevice)
{
return 0;
}
*/
/* Analog instant output */
-static int me_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int me_ao_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int chan;
}
/* Analog output readback */
-static int me_ao_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int me_ao_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i;
*/
/* Xilinx firmware download for card: ME-2600i */
-static int me2600_xilinx_download(comedi_device *dev,
+static int me2600_xilinx_download(struct comedi_device *dev,
unsigned char *me2600_firmware,
unsigned int length)
{
}
/* Reset device */
-static int me_reset(comedi_device *dev)
+static int me_reset(struct comedi_device *dev)
{
/* Reset board */
writew(0x00, dev_private->me_regbase + ME_CONTROL_1);
* - Register PCI device
* - Declare device driver capability
*/
-static int me_attach(comedi_device *dev, comedi_devconfig *it)
+static int me_attach(struct comedi_device *dev, comedi_devconfig *it)
{
struct pci_dev *pci_device;
comedi_subdevice *subdevice;
}
/* Detach */
-static int me_detach(comedi_device *dev)
+static int me_detach(struct comedi_device *dev)
{
if (dev_private) {
if (dev_private->me_regbase) {
};
//----------------------------------------------------------------------------
-static int mpc624_attach(comedi_device * dev, comedi_devconfig * it);
-static int mpc624_detach(comedi_device * dev);
+static int mpc624_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int mpc624_detach(struct comedi_device * dev);
//----------------------------------------------------------------------------
static comedi_driver driver_mpc624 = {
driver_name:"mpc624",
};
//----------------------------------------------------------------------------
-static int mpc624_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int mpc624_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
//----------------------------------------------------------------------------
-static int mpc624_attach(comedi_device * dev, comedi_devconfig * it)
+static int mpc624_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 1;
}
-static int mpc624_detach(comedi_device * dev)
+static int mpc624_detach(struct comedi_device * dev)
{
rt_printk("comedi%d: mpc624: remove\n", dev->minor);
// Timeout 200ms
#define TIMEOUT 200
-static int mpc624_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int mpc624_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
} mpc8260cpm_private;
#define devpriv ((mpc8260cpm_private *)dev->private)
-static int mpc8260cpm_attach(comedi_device * dev, comedi_devconfig * it);
-static int mpc8260cpm_detach(comedi_device * dev);
+static int mpc8260cpm_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int mpc8260cpm_detach(struct comedi_device * dev);
static comedi_driver driver_mpc8260cpm = {
driver_name:"mpc8260cpm",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_mpc8260cpm);
-static int mpc8260cpm_dio_config(comedi_device * dev, comedi_subdevice * s,
+static int mpc8260cpm_dio_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int mpc8260cpm_dio_bits(comedi_device * dev, comedi_subdevice * s,
+static int mpc8260cpm_dio_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int mpc8260cpm_attach(comedi_device * dev, comedi_devconfig * it)
+static int mpc8260cpm_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int i;
return 1;
}
-static int mpc8260cpm_detach(comedi_device * dev)
+static int mpc8260cpm_detach(struct comedi_device * dev)
{
printk("comedi%d: mpc8260cpm: remove\n", dev->minor);
}
}
-static int mpc8260cpm_dio_config(comedi_device * dev, comedi_subdevice * s,
+static int mpc8260cpm_dio_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return 1;
}
-static int mpc8260cpm_dio_bits(comedi_device * dev, comedi_subdevice * s,
+static int mpc8260cpm_dio_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int port;
#define MULTIQ3_TIMEOUT 30
-static int multiq3_attach(comedi_device * dev, comedi_devconfig * it);
-static int multiq3_detach(comedi_device * dev);
+static int multiq3_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int multiq3_detach(struct comedi_device * dev);
static comedi_driver driver_multiq3 = {
driver_name:"multiq3",
module:THIS_MODULE,
};
#define devpriv ((struct multiq3_private *)dev->private)
-static int multiq3_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int multiq3_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int multiq3_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int multiq3_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int multiq3_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int multiq3_encoder_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int multiq3_encoder_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static void encoder_reset(comedi_device * dev)
+static void encoder_reset(struct comedi_device * dev)
{
int chan;
for (chan = 0; chan < dev->subdevices[4].n_chan; chan++) {
options[2] - number of encoder chips installed
*/
-static int multiq3_attach(comedi_device * dev, comedi_devconfig * it)
+static int multiq3_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int result = 0;
unsigned long iobase;
return 0;
}
-static int multiq3_detach(comedi_device * dev)
+static int multiq3_detach(struct comedi_device * dev)
{
printk("comedi%d: multiq3: remove\n", dev->minor);
#define Rising_Edge_Detection_Enable(x) (0x018+(x))
#define Falling_Edge_Detection_Enable(x) (0x020+(x))
-static int ni6527_attach(comedi_device * dev, comedi_devconfig * it);
-static int ni6527_detach(comedi_device * dev);
+static int ni6527_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int ni6527_detach(struct comedi_device * dev);
static comedi_driver driver_ni6527 = {
driver_name:"ni6527",
module:THIS_MODULE,
} ni6527_private;
#define devpriv ((ni6527_private *)dev->private)
-static int ni6527_find_device(comedi_device * dev, int bus, int slot);
+static int ni6527_find_device(struct comedi_device * dev, int bus, int slot);
-static int ni6527_di_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_di_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return 2;
}
-static int ni6527_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int ni6527_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
static irqreturn_t ni6527_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 2;
unsigned int status;
return IRQ_HANDLED;
}
-static int ni6527_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_intr_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ni6527_intr_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni6527_intr_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
//comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int ni6527_intr_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni6527_intr_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
writeb(0x00, devpriv->mite->daq_io_addr + Master_Interrupt_Control);
return 0;
}
-static int ni6527_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_intr_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return 2;
}
-static int ni6527_intr_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni6527_intr_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return 2;
}
-static int ni6527_attach(comedi_device * dev, comedi_devconfig * it)
+static int ni6527_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret;
return 0;
}
-static int ni6527_detach(comedi_device * dev)
+static int ni6527_detach(struct comedi_device * dev)
{
if (devpriv && devpriv->mite && devpriv->mite->daq_io_addr) {
writeb(0x00,
return 0;
}
-static int ni6527_find_device(comedi_device * dev, int bus, int slot)
+static int ni6527_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
#define OverflowIntEnable 0x02
#define EdgeIntEnable 0x01
-static int ni_65xx_attach(comedi_device * dev, comedi_devconfig * it);
-static int ni_65xx_detach(comedi_device * dev);
+static int ni_65xx_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int ni_65xx_detach(struct comedi_device * dev);
static comedi_driver driver_ni_65xx = {
driver_name:"ni_65xx",
module:THIS_MODULE,
};
#define n_ni_65xx_boards (sizeof(ni_65xx_boards)/sizeof(ni_65xx_boards[0]))
-static inline const ni_65xx_board *board(comedi_device * dev)
+static inline const ni_65xx_board *board(struct comedi_device * dev)
{
return dev->board_ptr;
}
unsigned short output_bits[NI_65XX_MAX_NUM_PORTS];
unsigned short dio_direction[NI_65XX_MAX_NUM_PORTS];
} ni_65xx_private;
-static inline ni_65xx_private *private(comedi_device * dev)
+static inline ni_65xx_private *private(struct comedi_device * dev)
{
return dev->private;
}
return subdev_private;
}
-static int ni_65xx_find_device(comedi_device * dev, int bus, int slot);
+static int ni_65xx_find_device(struct comedi_device * dev, int bus, int slot);
-static int ni_65xx_config_filter(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_config_filter(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
const unsigned chan = CR_CHAN(insn->chanspec);
return 2;
}
-static int ni_65xx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned port;
return -EINVAL;
}
-static int ni_65xx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned base_bitfield_channel;
static irqreturn_t ni_65xx_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 2;
unsigned int status;
return IRQ_HANDLED;
}
-static int ni_65xx_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_intr_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ni_65xx_intr_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_65xx_intr_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
//comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int ni_65xx_intr_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni_65xx_intr_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
writeb(0x00,
private(dev)->mite->daq_io_addr + Master_Interrupt_Control);
return 0;
}
-static int ni_65xx_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_intr_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return 2;
}
-static int ni_65xx_intr_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_65xx_intr_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return 2;
}
-static int ni_65xx_attach(comedi_device * dev, comedi_devconfig * it)
+static int ni_65xx_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned i;
return 0;
}
-static int ni_65xx_detach(comedi_device * dev)
+static int ni_65xx_detach(struct comedi_device * dev)
{
if (private(dev) && private(dev)->mite
&& private(dev)->mite->daq_io_addr) {
return 0;
}
-static int ni_65xx_find_device(comedi_device * dev, int bus, int slot)
+static int ni_65xx_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
unsigned short pfi_output_selects[NUM_PFI_CHANNELS];
} ni_660x_private;
-static inline ni_660x_private *private(comedi_device * dev)
+static inline ni_660x_private *private(struct comedi_device * dev)
{
return dev->private;
}
/* initialized in ni_660x_find_device() */
-static inline const ni_660x_board *board(comedi_device * dev)
+static inline const ni_660x_board *board(struct comedi_device * dev)
{
return dev->board_ptr;
}
#define n_ni_660x_boards (sizeof(ni_660x_boards)/sizeof(ni_660x_boards[0]))
-static int ni_660x_attach(comedi_device * dev, comedi_devconfig * it);
-static int ni_660x_detach(comedi_device * dev);
-static void init_tio_chip(comedi_device * dev, int chipset);
-static void ni_660x_select_pfi_output(comedi_device * dev, unsigned pfi_channel,
+static int ni_660x_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int ni_660x_detach(struct comedi_device * dev);
+static void init_tio_chip(struct comedi_device * dev, int chipset);
+static void ni_660x_select_pfi_output(struct comedi_device * dev, unsigned pfi_channel,
unsigned output_select);
static comedi_driver driver_ni_660x = {
COMEDI_PCI_INITCLEANUP(driver_ni_660x, ni_660x_pci_table);
-static int ni_660x_find_device(comedi_device * dev, int bus, int slot);
-static int ni_660x_set_pfi_routing(comedi_device * dev, unsigned chan,
+static int ni_660x_find_device(struct comedi_device * dev, int bus, int slot);
+static int ni_660x_set_pfi_routing(struct comedi_device * dev, unsigned chan,
unsigned source);
/* Possible instructions for a GPCT */
-static int ni_660x_GPCT_rinsn(comedi_device * dev,
+static int ni_660x_GPCT_rinsn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int ni_660x_GPCT_insn_config(comedi_device * dev,
+static int ni_660x_GPCT_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int ni_660x_GPCT_winsn(comedi_device * dev,
+static int ni_660x_GPCT_winsn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/* Possible instructions for Digital IO */
-static int ni_660x_dio_insn_config(comedi_device * dev,
+static int ni_660x_dio_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int ni_660x_dio_insn_bits(comedi_device * dev,
+static int ni_660x_dio_insn_bits(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static inline unsigned ni_660x_num_counters(comedi_device * dev)
+static inline unsigned ni_660x_num_counters(struct comedi_device * dev)
{
return board(dev)->n_chips * counters_per_chip;
}
return ni_660x_register;
}
-static inline void ni_660x_write_register(comedi_device * dev,
+static inline void ni_660x_write_register(struct comedi_device * dev,
unsigned chip_index, unsigned bits, NI_660x_Register reg)
{
void *const write_address =
}
}
-static inline unsigned ni_660x_read_register(comedi_device * dev,
+static inline unsigned ni_660x_read_register(struct comedi_device * dev,
unsigned chip_index, NI_660x_Register reg)
{
void *const read_address =
static void ni_gpct_write_register(struct ni_gpct *counter, unsigned bits,
enum ni_gpct_register reg)
{
- comedi_device *dev = counter->counter_dev->dev;
+ struct comedi_device *dev = counter->counter_dev->dev;
NI_660x_Register ni_660x_register = ni_gpct_to_660x_register(reg);
ni_660x_write_register(dev, counter->chip_index, bits,
ni_660x_register);
static unsigned ni_gpct_read_register(struct ni_gpct *counter,
enum ni_gpct_register reg)
{
- comedi_device *dev = counter->counter_dev->dev;
+ struct comedi_device *dev = counter->counter_dev->dev;
NI_660x_Register ni_660x_register = ni_gpct_to_660x_register(reg);
return ni_660x_read_register(dev, counter->chip_index,
ni_660x_register);
return priv->mite_rings[counter->chip_index][counter->counter_index];
}
-static inline void ni_660x_set_dma_channel(comedi_device * dev,
+static inline void ni_660x_set_dma_channel(struct comedi_device * dev,
unsigned mite_channel, struct ni_gpct *counter)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&private(dev)->soft_reg_copy_lock, flags);
}
-static inline void ni_660x_unset_dma_channel(comedi_device * dev,
+static inline void ni_660x_unset_dma_channel(struct comedi_device * dev,
unsigned mite_channel, struct ni_gpct *counter)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&private(dev)->soft_reg_copy_lock, flags);
}
-static int ni_660x_request_mite_channel(comedi_device * dev,
+static int ni_660x_request_mite_channel(struct comedi_device * dev,
struct ni_gpct *counter, enum comedi_io_direction direction)
{
unsigned long flags;
return 0;
}
-void ni_660x_release_mite_channel(comedi_device * dev, struct ni_gpct *counter)
+void ni_660x_release_mite_channel(struct comedi_device * dev, struct ni_gpct *counter)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&private(dev)->mite_channel_lock, flags);
}
-static int ni_660x_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_660x_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int retval;
return retval;
}
-static int ni_660x_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_660x_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
struct ni_gpct *counter = subdev_to_counter(s);
return ni_tio_cmdtest(counter, cmd);
}
-static int ni_660x_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni_660x_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
struct ni_gpct *counter = subdev_to_counter(s);
int retval;
return retval;
}
-static void set_tio_counterswap(comedi_device * dev, int chipset)
+static void set_tio_counterswap(struct comedi_device * dev, int chipset)
{
/* See P. 3.5 of the Register-Level Programming manual. The
CounterSwap bit has to be set on the second chip, otherwise
ni_660x_write_register(dev, chipset, 0, ClockConfigRegister);
}
-static void ni_660x_handle_gpct_interrupt(comedi_device * dev,
+static void ni_660x_handle_gpct_interrupt(struct comedi_device * dev,
comedi_subdevice * s)
{
ni_tio_handle_interrupt(subdev_to_counter(s), s);
static irqreturn_t ni_660x_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s;
unsigned i;
return IRQ_HANDLED;
}
-static int ni_660x_buf_change(comedi_device * dev, comedi_subdevice * s,
+static int ni_660x_buf_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int ni_660x_allocate_private(comedi_device * dev)
+static int ni_660x_allocate_private(struct comedi_device * dev)
{
int retval;
unsigned i;
return 0;
}
-static int ni_660x_alloc_mite_rings(comedi_device * dev)
+static int ni_660x_alloc_mite_rings(struct comedi_device * dev)
{
unsigned i;
unsigned j;
return 0;
}
-static void ni_660x_free_mite_rings(comedi_device * dev)
+static void ni_660x_free_mite_rings(struct comedi_device * dev)
{
unsigned i;
unsigned j;
}
}
-static int ni_660x_attach(comedi_device * dev, comedi_devconfig * it)
+static int ni_660x_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret;
return 0;
}
-static int ni_660x_detach(comedi_device * dev)
+static int ni_660x_detach(struct comedi_device * dev)
{
printk("comedi%d: ni_660x: remove\n", dev->minor);
}
static int
-ni_660x_GPCT_rinsn(comedi_device * dev, comedi_subdevice * s,
+ni_660x_GPCT_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return ni_tio_rinsn(subdev_to_counter(s), insn, data);
}
-static void init_tio_chip(comedi_device * dev, int chipset)
+static void init_tio_chip(struct comedi_device * dev, int chipset)
{
unsigned i;
}
static int
-ni_660x_GPCT_insn_config(comedi_device * dev, comedi_subdevice * s,
+ni_660x_GPCT_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return ni_tio_insn_config(subdev_to_counter(s), insn, data);
}
-static int ni_660x_GPCT_winsn(comedi_device * dev,
+static int ni_660x_GPCT_winsn(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
return ni_tio_winsn(subdev_to_counter(s), insn, data);
}
-static int ni_660x_find_device(comedi_device * dev, int bus, int slot)
+static int ni_660x_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
return -EIO;
}
-static int ni_660x_dio_insn_bits(comedi_device * dev,
+static int ni_660x_dio_insn_bits(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
unsigned base_bitfield_channel = CR_CHAN(insn->chanspec);
return 2;
}
-static void ni_660x_select_pfi_output(comedi_device * dev, unsigned pfi_channel,
+static void ni_660x_select_pfi_output(struct comedi_device * dev, unsigned pfi_channel,
unsigned output_select)
{
static const unsigned counter_4_7_first_pfi = 8;
ni_660x_write_register(dev, active_chipset, active_bits, IOConfigReg(pfi_channel));
}
-static int ni_660x_set_pfi_routing(comedi_device * dev, unsigned chan,
+static int ni_660x_set_pfi_routing(struct comedi_device * dev, unsigned chan,
unsigned source)
{
if (source > num_pfi_output_selects)
return 0;
}
-static unsigned ni_660x_get_pfi_routing(comedi_device * dev, unsigned chan)
+static unsigned ni_660x_get_pfi_routing(struct comedi_device * dev, unsigned chan)
{
BUG_ON(chan >= NUM_PFI_CHANNELS);
return private(dev)->pfi_output_selects[chan];
}
-static void ni660x_config_filter(comedi_device * dev, unsigned pfi_channel,
+static void ni660x_config_filter(struct comedi_device * dev, unsigned pfi_channel,
enum ni_gpct_filter_select filter)
{
unsigned bits = ni_660x_read_register(dev, 0, IOConfigReg(pfi_channel));
ni_660x_write_register(dev, 0, bits, IOConfigReg(pfi_channel));
}
-static int ni_660x_dio_insn_config(comedi_device * dev,
+static int ni_660x_dio_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
#define devpriv ((ni_670x_private *)dev->private)
#define n_ni_670x_boards (sizeof(ni_670x_boards)/sizeof(ni_670x_boards[0]))
-static int ni_670x_attach(comedi_device * dev, comedi_devconfig * it);
-static int ni_670x_detach(comedi_device * dev);
+static int ni_670x_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int ni_670x_detach(struct comedi_device * dev);
static comedi_driver driver_ni_670x = {
driver_name:"ni_670x",
static comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
-static int ni_670x_find_device(comedi_device * dev, int bus, int slot);
+static int ni_670x_find_device(struct comedi_device * dev, int bus, int slot);
-static int ni_670x_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_670x_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_670x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_670x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_670x_attach(comedi_device * dev, comedi_devconfig * it)
+static int ni_670x_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int ret;
return 1;
}
-static int ni_670x_detach(comedi_device * dev)
+static int ni_670x_detach(struct comedi_device * dev)
{
printk("comedi%d: ni_670x: remove\n", dev->minor);
return 0;
}
-static int ni_670x_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int ni_670x_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int ni_670x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int ni_670x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_670x_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return insn->n;
}
-static int ni_670x_find_device(comedi_device * dev, int bus, int slot)
+static int ni_670x_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
#define devpriv ((a2150_private *)dev->private)
-static int a2150_attach(comedi_device * dev, comedi_devconfig * it);
-static int a2150_detach(comedi_device * dev);
-static int a2150_cancel(comedi_device * dev, comedi_subdevice * s);
+static int a2150_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int a2150_detach(struct comedi_device * dev);
+static int a2150_cancel(struct comedi_device * dev, comedi_subdevice * s);
static comedi_driver driver_a2150 = {
driver_name:"ni_at_a2150",
};
static irqreturn_t a2150_interrupt(int irq, void *d PT_REGS_ARG);
-static int a2150_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int a2150_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int a2150_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int a2150_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int a2150_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int a2150_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int a2150_get_timing(comedi_device * dev, unsigned int *period,
+static int a2150_get_timing(struct comedi_device * dev, unsigned int *period,
int flags);
-static int a2150_probe(comedi_device * dev);
-static int a2150_set_chanlist(comedi_device * dev, unsigned int start_channel,
+static int a2150_probe(struct comedi_device * dev);
+static int a2150_set_chanlist(struct comedi_device * dev, unsigned int start_channel,
unsigned int num_channels);
/*
* A convenient macro that defines init_module() and cleanup_module(),
#ifdef A2150_DEBUG
-static void ni_dump_regs(comedi_device * dev)
+static void ni_dump_regs(struct comedi_device * dev)
{
rt_printk("config bits 0x%x\n", devpriv->config_bits);
rt_printk("irq dma bits 0x%x\n", devpriv->irq_dma_bits);
int i;
int status;
unsigned long flags;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->read_subdev;
comedi_async *async;
comedi_cmd *cmd;
}
// probes board type, returns offset
-static int a2150_probe(comedi_device * dev)
+static int a2150_probe(struct comedi_device * dev)
{
int status = inw(dev->iobase + STATUS_REG);
return ID_BITS(status);
}
-static int a2150_attach(comedi_device * dev, comedi_devconfig * it)
+static int a2150_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = it->options[0];
return 0;
};
-static int a2150_detach(comedi_device * dev)
+static int a2150_detach(struct comedi_device * dev)
{
printk("comedi%d: %s: remove\n", dev->minor, driver_a2150.driver_name);
return 0;
};
-static int a2150_cancel(comedi_device * dev, comedi_subdevice * s)
+static int a2150_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
// disable dma on card
devpriv->irq_dma_bits &= ~DMA_INTR_EN_BIT & ~DMA_EN_BIT;
return 0;
}
-static int a2150_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int a2150_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int a2150_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int a2150_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
return 0;
}
-static int a2150_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int a2150_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int i, n;
/* sets bits in devpriv->clock_bits to nearest approximation of requested period,
* adjusts requested period to actual timing. */
-static int a2150_get_timing(comedi_device * dev, unsigned int *period,
+static int a2150_get_timing(struct comedi_device * dev, unsigned int *period,
int flags)
{
int lub, glb, temp;
return 0;
}
-static int a2150_set_chanlist(comedi_device * dev, unsigned int start_channel,
+static int a2150_set_chanlist(struct comedi_device * dev, unsigned int start_channel,
unsigned int num_channels)
{
if (start_channel + num_channels > 4)
} atao_private;
#define devpriv ((atao_private *)dev->private)
-static int atao_attach(comedi_device * dev, comedi_devconfig * it);
-static int atao_detach(comedi_device * dev);
+static int atao_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int atao_detach(struct comedi_device * dev);
static comedi_driver driver_atao = {
driver_name:"ni_at_ao",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_atao);
-static void atao_reset(comedi_device * dev);
+static void atao_reset(struct comedi_device * dev);
-static int atao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int atao_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int atao_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int atao_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int atao_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int atao_calib_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int atao_calib_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int atao_attach(comedi_device * dev, comedi_devconfig * it)
+static int atao_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int atao_detach(comedi_device * dev)
+static int atao_detach(struct comedi_device * dev)
{
printk("comedi%d: atao: remove\n", dev->minor);
return 0;
}
-static void atao_reset(comedi_device * dev)
+static void atao_reset(struct comedi_device * dev)
{
/* This is the reset sequence described in the manual */
outw(devpriv->cfg1, dev->iobase + ATAO_CFG1);
}
-static int atao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int atao_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int atao_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int atao_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int atao_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int atao_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int atao_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int atao_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
* DACs. It is not explicitly stated in the manual how to access
* the caldacs, but we can guess.
*/
-static int atao_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int atao_calib_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return insn->n;
}
-static int atao_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int atao_calib_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int bitstring, bit;
* read/written directly in the I/O space of the board. The
* AT-MIO devices map the low 8 STC registers to iobase+addr*2. */
-static void ni_atmio_win_out(comedi_device * dev, uint16_t data, int addr)
+static void ni_atmio_win_out(struct comedi_device * dev, uint16_t data, int addr)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->window_lock, flags);
}
-static uint16_t ni_atmio_win_in(comedi_device * dev, int addr)
+static uint16_t ni_atmio_win_in(struct comedi_device * dev, int addr)
{
unsigned long flags;
uint16_t ret;
MODULE_DEVICE_TABLE(pnp, device_ids);
-static int ni_atmio_attach(comedi_device * dev, comedi_devconfig * it);
-static int ni_atmio_detach(comedi_device * dev);
+static int ni_atmio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int ni_atmio_detach(struct comedi_device * dev);
static comedi_driver driver_atmio = {
driver_name:"ni_atmio",
module:THIS_MODULE,
#include "ni_mio_common.c"
-static int ni_getboardtype(comedi_device * dev);
+static int ni_getboardtype(struct comedi_device * dev);
/* clean up allocated resources */
-static int ni_atmio_detach(comedi_device * dev)
+static int ni_atmio_detach(struct comedi_device * dev)
{
mio_common_detach(dev);
return 0;
}
-static int ni_atmio_attach(comedi_device * dev, comedi_devconfig * it)
+static int ni_atmio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pnp_dev *isapnp_dev;
int ret;
return 0;
}
-static int ni_getboardtype(comedi_device * dev)
+static int ni_getboardtype(struct comedi_device * dev)
{
int device_id = ni_read_eeprom(dev, 511);
int i;
#define boardtype ((const atmio16_board_t *)dev->board_ptr)
/* function prototypes */
-static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it);
-static int atmio16d_detach(comedi_device * dev);
+static int atmio16d_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int atmio16d_detach(struct comedi_device * dev);
static irqreturn_t atmio16d_interrupt(int irq, void *d PT_REGS_ARG);
-static int atmio16d_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int atmio16d_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int atmio16d_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static void reset_counters(comedi_device * dev);
-static void reset_atmio16d(comedi_device * dev);
+static int atmio16d_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int atmio16d_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void reset_counters(struct comedi_device * dev);
+static void reset_atmio16d(struct comedi_device * dev);
/* main driver struct */
static comedi_driver driver_atmio16d = {
unsigned int com_reg_2_state; /* current state of command register 2 */
} atmio16d_private;
-static void reset_counters(comedi_device * dev)
+static void reset_counters(struct comedi_device * dev)
{
/* Counter 2 */
outw(0xFFC2, dev->iobase + AM9513A_COM_REG);
outw(0, dev->iobase + AD_CLEAR_REG);
}
-static void reset_atmio16d(comedi_device * dev)
+static void reset_atmio16d(struct comedi_device * dev)
{
int i;
static irqreturn_t atmio16d_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
// printk("atmio16d_interrupt!\n");
return IRQ_HANDLED;
}
-static int atmio16d_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0, tmp;
return 0;
}
-static int atmio16d_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int atmio16d_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int timer, base_clock;
}
/* This will cancel a running acquisition operation */
-static int atmio16d_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int atmio16d_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
reset_atmio16d(dev);
}
/* Mode 0 is used to get a single conversion on demand */
-static int atmio16d_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, t;
return i;
}
-static int atmio16d_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int atmio16d_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int atmio16d_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int atmio16d_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int atmio16d_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
options[12] - dac1 coding
*/
-static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it)
+static int atmio16d_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned int irq;
unsigned long iobase;
return 0;
}
-static int atmio16d_detach(comedi_device * dev)
+static int atmio16d_detach(struct comedi_device * dev)
{
printk("comedi%d: atmio16d: remove\n", dev->minor);
#define DIO700_SIZE 8 // size of io region used by board
-static int dio700_attach(comedi_device * dev, comedi_devconfig * it);
-static int dio700_detach(comedi_device * dev);
+static int dio700_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dio700_detach(struct comedi_device * dev);
enum dio700_bustype { pcmcia_bustype };
#define CALLBACK_FUNC (((struct subdev_700_struct *)s->private)->cb_func)
#define subdevpriv ((struct subdev_700_struct *)s->private)
-static void do_config(comedi_device * dev, comedi_subdevice * s);
+static void do_config(struct comedi_device * dev, comedi_subdevice * s);
-void subdev_700_interrupt(comedi_device * dev, comedi_subdevice * s)
+void subdev_700_interrupt(struct comedi_device * dev, comedi_subdevice * s)
{
short d;
}
}
-static int subdev_700_insn(comedi_device * dev, comedi_subdevice * s,
+static int subdev_700_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
return 2;
}
-static int subdev_700_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int subdev_700_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
return 1;
}
-static void do_config(comedi_device * dev, comedi_subdevice * s)
+static void do_config(struct comedi_device * dev, comedi_subdevice * s)
{ /* use powerup defaults */
return;
}
-static int subdev_700_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int subdev_700_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int subdev_700_cmd(comedi_device * dev, comedi_subdevice * s)
+static int subdev_700_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
/* FIXME */
return 0;
}
-static int subdev_700_cancel(comedi_device * dev, comedi_subdevice * s)
+static int subdev_700_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
/* FIXME */
return 0;
}
-int subdev_700_init(comedi_device * dev, comedi_subdevice * s, int (*cb) (int,
+int subdev_700_init(struct comedi_device * dev, comedi_subdevice * s, int (*cb) (int,
int, int, unsigned long), unsigned long arg)
{
s->type = COMEDI_SUBD_DIO;
return 0;
}
-int subdev_700_init_irq(comedi_device * dev, comedi_subdevice * s,
+int subdev_700_init_irq(struct comedi_device * dev, comedi_subdevice * s,
int (*cb) (int, int, int, unsigned long), unsigned long arg)
{
int ret;
return 0;
}
-void subdev_700_cleanup(comedi_device * dev, comedi_subdevice * s)
+void subdev_700_cleanup(struct comedi_device * dev, comedi_subdevice * s)
{
if (s->private) {
if (subdevpriv->have_irq) {
EXPORT_SYMBOL(subdev_700_cleanup);
EXPORT_SYMBOL(subdev_700_interrupt);
-static int dio700_attach(comedi_device * dev, comedi_devconfig * it)
+static int dio700_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = 0;
return 0;
};
-static int dio700_detach(comedi_device * dev)
+static int dio700_detach(struct comedi_device * dev)
{
printk("comedi%d: ni_daq_700: cs-remove\n", dev->minor);
#define DIO24_SIZE 4 // size of io region used by board
-static int dio24_attach(comedi_device * dev, comedi_devconfig * it);
-static int dio24_detach(comedi_device * dev);
+static int dio24_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dio24_detach(struct comedi_device * dev);
enum dio24_bustype { pcmcia_bustype };
offset:sizeof(dio24_board),
};
-static int dio24_attach(comedi_device * dev, comedi_devconfig * it)
+static int dio24_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase = 0;
return 0;
};
-static int dio24_detach(comedi_device * dev)
+static int dio24_detach(struct comedi_device * dev)
{
printk("comedi%d: ni_daq_dio24: remove\n", dev->minor);
#define INIT_A1_BITS 0x70 // put hardware conversion counter output in harmless state (a1 mode 0)
#define COUNTER_B_BASE_REG 0x18
-static int labpc_attach(comedi_device * dev, comedi_devconfig * it);
-static int labpc_cancel(comedi_device * dev, comedi_subdevice * s);
+static int labpc_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int labpc_cancel(struct comedi_device * dev, comedi_subdevice * s);
static irqreturn_t labpc_interrupt(int irq, void *d PT_REGS_ARG);
-static int labpc_drain_fifo(comedi_device * dev);
-static void labpc_drain_dma(comedi_device * dev);
-static void handle_isa_dma(comedi_device * dev);
-static void labpc_drain_dregs(comedi_device * dev);
-static int labpc_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int labpc_drain_fifo(struct comedi_device * dev);
+static void labpc_drain_dma(struct comedi_device * dev);
+static void handle_isa_dma(struct comedi_device * dev);
+static void labpc_drain_dregs(struct comedi_device * dev);
+static int labpc_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int labpc_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int labpc_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int labpc_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_calib_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_calib_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_calib_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_calib_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int labpc_eeprom_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_eeprom_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static unsigned int labpc_suggest_transfer_size(comedi_cmd cmd);
-static void labpc_adc_timing(comedi_device * dev, comedi_cmd * cmd);
+static void labpc_adc_timing(struct comedi_device * dev, comedi_cmd * cmd);
#ifdef CONFIG_COMEDI_PCI
-static int labpc_find_device(comedi_device *dev, int bus, int slot);
+static int labpc_find_device(struct comedi_device *dev, int bus, int slot);
#endif
static int labpc_dio_mem_callback(int dir, int port, int data,
unsigned long arg);
-static void labpc_serial_out(comedi_device * dev, unsigned int value,
+static void labpc_serial_out(struct comedi_device * dev, unsigned int value,
unsigned int num_bits);
-static unsigned int labpc_serial_in(comedi_device * dev);
-static unsigned int labpc_eeprom_read(comedi_device * dev,
+static unsigned int labpc_serial_in(struct comedi_device * dev);
+static unsigned int labpc_eeprom_read(struct comedi_device * dev,
unsigned int address);
-static unsigned int labpc_eeprom_read_status(comedi_device * dev);
-static unsigned int labpc_eeprom_write(comedi_device * dev,
+static unsigned int labpc_eeprom_read_status(struct comedi_device * dev);
+static unsigned int labpc_eeprom_write(struct comedi_device * dev,
unsigned int address, unsigned int value);
-static void write_caldac(comedi_device * dev, unsigned int channel,
+static void write_caldac(struct comedi_device * dev, unsigned int channel,
unsigned int value);
enum scan_mode {
MODULE_DEVICE_TABLE(pci, labpc_pci_table);
#endif /* CONFIG_COMEDI_PCI */
-static inline int labpc_counter_load(comedi_device * dev,
+static inline int labpc_counter_load(struct comedi_device * dev,
unsigned long base_address, unsigned int counter_number,
unsigned int count, unsigned int mode)
{
return i8254_load(base_address, 0, counter_number, count, mode);
}
-int labpc_common_attach(comedi_device * dev, unsigned long iobase,
+int labpc_common_attach(struct comedi_device * dev, unsigned long iobase,
unsigned int irq, unsigned int dma_chan)
{
comedi_subdevice *s;
return 0;
}
-static int labpc_attach(comedi_device * dev, comedi_devconfig * it)
+static int labpc_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned long iobase = 0;
unsigned int irq = 0;
// adapted from ni_pcimio for finding mite based boards (pc-1200)
#ifdef CONFIG_COMEDI_PCI
-static int labpc_find_device(comedi_device *dev, int bus, int slot)
+static int labpc_find_device(struct comedi_device *dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
}
#endif
-int labpc_common_detach(comedi_device * dev)
+int labpc_common_detach(struct comedi_device * dev)
{
printk("comedi%d: ni_labpc: detach\n", dev->minor);
return 0;
};
-static void labpc_clear_adc_fifo(const comedi_device * dev)
+static void labpc_clear_adc_fifo(const struct comedi_device * dev)
{
devpriv->write_byte(0x1, dev->iobase + ADC_CLEAR_REG);
devpriv->read_byte(dev->iobase + ADC_FIFO_REG);
devpriv->read_byte(dev->iobase + ADC_FIFO_REG);
}
-static int labpc_cancel(comedi_device * dev, comedi_subdevice * s)
+static int labpc_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
return 0;
}
-static int labpc_ai_chanlist_invalid(const comedi_device * dev,
+static int labpc_ai_chanlist_invalid(const struct comedi_device * dev,
const comedi_cmd * cmd)
{
int mode, channel, range, aref, i;
cmd->scan_begin_arg = ns;
}
-static int labpc_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int labpc_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int labpc_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int channel, range, aref;
unsigned long irq_flags;
/* interrupt service routine */
static irqreturn_t labpc_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->read_subdev;
comedi_async *async;
comedi_cmd *cmd;
}
// read all available samples from ai fifo
-static int labpc_drain_fifo(comedi_device * dev)
+static int labpc_drain_fifo(struct comedi_device * dev)
{
unsigned int lsb, msb;
short data;
return 0;
}
-static void labpc_drain_dma(comedi_device * dev)
+static void labpc_drain_dma(struct comedi_device * dev)
{
comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async;
async->events |= COMEDI_CB_BLOCK;
}
-static void handle_isa_dma(comedi_device * dev)
+static void handle_isa_dma(struct comedi_device * dev)
{
labpc_drain_dma(dev);
/* makes sure all data aquired by board is transfered to comedi (used
* when aquisition is terminated by stop_src == TRIG_EXT). */
-static void labpc_drain_dregs(comedi_device * dev)
+static void labpc_drain_dregs(struct comedi_device * dev)
{
if (devpriv->current_transfer == isa_dma_transfer)
labpc_drain_dma(dev);
labpc_drain_fifo(dev);
}
-static int labpc_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
}
// analog output insn
-static int labpc_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel, range;
}
// analog output readback insn
-static int labpc_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_value[CR_CHAN(insn->chanspec)];
return 1;
}
-static int labpc_calib_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_calib_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldac[CR_CHAN(insn->chanspec)];
return 1;
}
-static int labpc_calib_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_calib_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
return 1;
}
-static int labpc_eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_eeprom_read_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->eeprom_data[CR_CHAN(insn->chanspec)];
return 1;
}
-static int labpc_eeprom_write_insn(comedi_device * dev, comedi_subdevice * s,
+static int labpc_eeprom_write_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
}
// figures out what counter values to use based on command
-static void labpc_adc_timing(comedi_device * dev, comedi_cmd * cmd)
+static void labpc_adc_timing(struct comedi_device * dev, comedi_cmd * cmd)
{
const int max_counter_value = 0x10000; // max value for 16 bit counter in mode 2
const int min_counter_value = 2; // min value for 16 bit counter in mode 2
}
// lowlevel write to eeprom/dac
-static void labpc_serial_out(comedi_device * dev, unsigned int value,
+static void labpc_serial_out(struct comedi_device * dev, unsigned int value,
unsigned int value_width)
{
int i;
}
// lowlevel read from eeprom
-static unsigned int labpc_serial_in(comedi_device * dev)
+static unsigned int labpc_serial_in(struct comedi_device * dev)
{
unsigned int value = 0;
int i;
return value;
}
-static unsigned int labpc_eeprom_read(comedi_device * dev, unsigned int address)
+static unsigned int labpc_eeprom_read(struct comedi_device * dev, unsigned int address)
{
unsigned int value;
const int read_instruction = 0x3; // bits to tell eeprom to expect a read
return value;
}
-static unsigned int labpc_eeprom_write(comedi_device * dev,
+static unsigned int labpc_eeprom_write(struct comedi_device * dev,
unsigned int address, unsigned int value)
{
const int write_enable_instruction = 0x6;
return 0;
}
-static unsigned int labpc_eeprom_read_status(comedi_device * dev)
+static unsigned int labpc_eeprom_read_status(struct comedi_device * dev)
{
unsigned int value;
const int read_status_instruction = 0x5;
}
// writes to 8 bit calibration dacs
-static void write_caldac(comedi_device * dev, unsigned int channel,
+static void write_caldac(struct comedi_device * dev, unsigned int channel,
unsigned int value)
{
if (value == devpriv->caldac[channel])
void (*write_byte) (unsigned int byte, unsigned long address);
} labpc_private;
-int labpc_common_attach(comedi_device * dev, unsigned long iobase,
+int labpc_common_attach(struct comedi_device * dev, unsigned long iobase,
unsigned int irq, unsigned int dma);
-int labpc_common_detach(comedi_device * dev);
+int labpc_common_detach(struct comedi_device * dev);
extern const int labpc_1200_is_unipolar[];
extern const int labpc_1200_ai_gain_bits[];
static struct pcmcia_device *pcmcia_cur_dev = NULL;
-static int labpc_attach(comedi_device * dev, comedi_devconfig * it);
+static int labpc_attach(struct comedi_device * dev, comedi_devconfig * it);
static const labpc_board labpc_cs_boards[] = {
{
.offset = sizeof(labpc_board),
};
-static int labpc_attach(comedi_device * dev, comedi_devconfig * it)
+static int labpc_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned long iobase = 0;
unsigned int irq = 0;
[ai_gain_6143] = &range_ni_S_ai_6143
};
-static int ni_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_cdio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_cdio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int ni_cdio_cmd(comedi_device * dev, comedi_subdevice * s);
-static int ni_cdio_cancel(comedi_device * dev, comedi_subdevice * s);
-static void handle_cdio_interrupt(comedi_device * dev);
-static int ni_cdo_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_cdio_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int ni_cdio_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void handle_cdio_interrupt(struct comedi_device * dev);
+static int ni_cdo_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum);
-static int ni_serial_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_serial_hw_readwrite8(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_hw_readwrite8(struct comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in);
-static int ni_serial_sw_readwrite8(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_sw_readwrite8(struct comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in);
-static int ni_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_calib_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int ni_calib_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_eeprom_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_eeprom_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_m_series_eeprom_insn_read(comedi_device * dev,
+static int ni_m_series_eeprom_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int ni_pfi_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_pfi_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_pfi_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_pfi_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static unsigned ni_old_get_pfi_routing(comedi_device * dev, unsigned chan);
+static unsigned ni_old_get_pfi_routing(struct comedi_device * dev, unsigned chan);
-static void ni_rtsi_init(comedi_device * dev);
-static int ni_rtsi_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static void ni_rtsi_init(struct comedi_device * dev);
+static int ni_rtsi_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_rtsi_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_rtsi_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static void caldac_setup(comedi_device * dev, comedi_subdevice * s);
-static int ni_read_eeprom(comedi_device * dev, int addr);
+static void caldac_setup(struct comedi_device * dev, comedi_subdevice * s);
+static int ni_read_eeprom(struct comedi_device * dev, int addr);
#ifdef DEBUG_STATUS_A
static void ni_mio_print_status_a(int status);
#define ni_mio_print_status_b(a)
#endif
-static int ni_ai_reset(comedi_device * dev, comedi_subdevice * s);
+static int ni_ai_reset(struct comedi_device * dev, comedi_subdevice * s);
#ifndef PCIDMA
-static void ni_handle_fifo_half_full(comedi_device * dev);
-static int ni_ao_fifo_half_empty(comedi_device * dev, comedi_subdevice * s);
+static void ni_handle_fifo_half_full(struct comedi_device * dev);
+static int ni_ao_fifo_half_empty(struct comedi_device * dev, comedi_subdevice * s);
#endif
-static void ni_handle_fifo_dregs(comedi_device * dev);
-static int ni_ai_inttrig(comedi_device * dev, comedi_subdevice * s,
+static void ni_handle_fifo_dregs(struct comedi_device * dev);
+static int ni_ai_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum);
-static void ni_load_channelgain_list(comedi_device * dev, unsigned int n_chan,
+static void ni_load_channelgain_list(struct comedi_device * dev, unsigned int n_chan,
unsigned int *list);
-static void shutdown_ai_command(comedi_device * dev);
+static void shutdown_ai_command(struct comedi_device * dev);
-static int ni_ao_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum);
-static int ni_ao_reset(comedi_device * dev, comedi_subdevice * s);
+static int ni_ao_reset(struct comedi_device * dev, comedi_subdevice * s);
static int ni_8255_callback(int dir, int port, int data, unsigned long arg);
-static int ni_gpct_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_gpct_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_gpct_cmd(comedi_device * dev, comedi_subdevice * s);
-static int ni_gpct_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int ni_gpct_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int ni_gpct_cancel(comedi_device * dev, comedi_subdevice * s);
-static void handle_gpct_interrupt(comedi_device * dev,
+static int ni_gpct_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void handle_gpct_interrupt(struct comedi_device * dev,
unsigned short counter_index);
-static int init_cs5529(comedi_device * dev);
-static int cs5529_do_conversion(comedi_device * dev, unsigned short *data);
-static int cs5529_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int init_cs5529(struct comedi_device * dev);
+static int cs5529_do_conversion(struct comedi_device * dev, unsigned short *data);
+static int cs5529_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
#ifdef NI_CS5529_DEBUG
-static unsigned int cs5529_config_read(comedi_device * dev,
+static unsigned int cs5529_config_read(struct comedi_device * dev,
unsigned int reg_select_bits);
#endif
-static void cs5529_config_write(comedi_device * dev, unsigned int value,
+static void cs5529_config_write(struct comedi_device * dev, unsigned int value,
unsigned int reg_select_bits);
-static int ni_m_series_pwm_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_m_series_pwm_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_6143_pwm_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_6143_pwm_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_set_master_clock(comedi_device * dev, unsigned source,
+static int ni_set_master_clock(struct comedi_device * dev, unsigned source,
unsigned period_ns);
-static void ack_a_interrupt(comedi_device * dev, unsigned short a_status);
-static void ack_b_interrupt(comedi_device * dev, unsigned short b_status);
+static void ack_a_interrupt(struct comedi_device * dev, unsigned short a_status);
+static void ack_b_interrupt(struct comedi_device * dev, unsigned short b_status);
enum aimodes {
AIMODE_NONE = 0,
static const int num_adc_stages_611x = 3;
-static void handle_a_interrupt(comedi_device * dev, unsigned short status,
+static void handle_a_interrupt(struct comedi_device * dev, unsigned short status,
unsigned ai_mite_status);
-static void handle_b_interrupt(comedi_device * dev, unsigned short status,
+static void handle_b_interrupt(struct comedi_device * dev, unsigned short status,
unsigned ao_mite_status);
-static void get_last_sample_611x(comedi_device * dev);
-static void get_last_sample_6143(comedi_device * dev);
+static void get_last_sample_611x(struct comedi_device * dev);
+static void get_last_sample_6143(struct comedi_device * dev);
-static inline void ni_set_bitfield(comedi_device * dev, int reg,
+static inline void ni_set_bitfield(struct comedi_device * dev, int reg,
unsigned bit_mask, unsigned bit_values)
{
unsigned long flags;
}
#ifdef PCIDMA
-static int ni_ai_drain_dma(comedi_device * dev);
+static int ni_ai_drain_dma(struct comedi_device * dev);
/* DMA channel setup */
// negative channel means no channel
-static inline void ni_set_ai_dma_channel(comedi_device * dev, int channel)
+static inline void ni_set_ai_dma_channel(struct comedi_device * dev, int channel)
{
unsigned bitfield;
}
// negative channel means no channel
-static inline void ni_set_ao_dma_channel(comedi_device * dev, int channel)
+static inline void ni_set_ao_dma_channel(struct comedi_device * dev, int channel)
{
unsigned bitfield;
}
// negative mite_channel means no channel
-static inline void ni_set_gpct_dma_channel(comedi_device * dev,
+static inline void ni_set_gpct_dma_channel(struct comedi_device * dev,
unsigned gpct_index, int mite_channel)
{
unsigned bitfield;
}
// negative mite_channel means no channel
-static inline void ni_set_cdo_dma_channel(comedi_device * dev, int mite_channel)
+static inline void ni_set_cdo_dma_channel(struct comedi_device * dev, int mite_channel)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->soft_reg_copy_lock, flags);
}
-static int ni_request_ai_mite_channel(comedi_device * dev)
+static int ni_request_ai_mite_channel(struct comedi_device * dev)
{
unsigned long flags;
return 0;
}
-static int ni_request_ao_mite_channel(comedi_device * dev)
+static int ni_request_ao_mite_channel(struct comedi_device * dev)
{
unsigned long flags;
return 0;
}
-static int ni_request_gpct_mite_channel(comedi_device * dev,
+static int ni_request_gpct_mite_channel(struct comedi_device * dev,
unsigned gpct_index, enum comedi_io_direction direction)
{
unsigned long flags;
#endif // PCIDMA
-static int ni_request_cdo_mite_channel(comedi_device * dev)
+static int ni_request_cdo_mite_channel(struct comedi_device * dev)
{
#ifdef PCIDMA
unsigned long flags;
return 0;
}
-static void ni_release_ai_mite_channel(comedi_device * dev)
+static void ni_release_ai_mite_channel(struct comedi_device * dev)
{
#ifdef PCIDMA
unsigned long flags;
#endif // PCIDMA
}
-static void ni_release_ao_mite_channel(comedi_device * dev)
+static void ni_release_ao_mite_channel(struct comedi_device * dev)
{
#ifdef PCIDMA
unsigned long flags;
#endif // PCIDMA
}
-void ni_release_gpct_mite_channel(comedi_device * dev, unsigned gpct_index)
+void ni_release_gpct_mite_channel(struct comedi_device * dev, unsigned gpct_index)
{
#ifdef PCIDMA
unsigned long flags;
#endif // PCIDMA
}
-static void ni_release_cdo_mite_channel(comedi_device * dev)
+static void ni_release_cdo_mite_channel(struct comedi_device * dev)
{
#ifdef PCIDMA
unsigned long flags;
// e-series boards use the second irq signals to generate dma requests for their counters
#ifdef PCIDMA
-static void ni_e_series_enable_second_irq(comedi_device * dev,
+static void ni_e_series_enable_second_irq(struct comedi_device * dev,
unsigned gpct_index, short enable)
{
if (boardtype.reg_type & ni_reg_m_series_mask)
}
#endif // PCIDMA
-static void ni_clear_ai_fifo(comedi_device * dev)
+static void ni_clear_ai_fifo(struct comedi_device * dev)
{
if (boardtype.reg_type == ni_reg_6143) {
// Flush the 6143 data FIFO
}
}
-static void win_out2(comedi_device * dev, uint32_t data, int reg)
+static void win_out2(struct comedi_device * dev, uint32_t data, int reg)
{
devpriv->stc_writew(dev, data >> 16, reg);
devpriv->stc_writew(dev, data & 0xffff, reg + 1);
}
-static uint32_t win_in2(comedi_device * dev, int reg)
+static uint32_t win_in2(struct comedi_device * dev, int reg)
{
uint32_t bits;
bits = devpriv->stc_readw(dev, reg) << 16;
}
#define ao_win_out(data,addr) ni_ao_win_outw(dev,data,addr)
-static inline void ni_ao_win_outw(comedi_device * dev, uint16_t data, int addr)
+static inline void ni_ao_win_outw(struct comedi_device * dev, uint16_t data, int addr)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->window_lock, flags);
}
-static inline void ni_ao_win_outl(comedi_device * dev, uint32_t data, int addr)
+static inline void ni_ao_win_outl(struct comedi_device * dev, uint32_t data, int addr)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->window_lock, flags);
}
-static inline unsigned short ni_ao_win_inw(comedi_device * dev, int addr)
+static inline unsigned short ni_ao_win_inw(struct comedi_device * dev, int addr)
{
unsigned long flags;
unsigned short data;
*
* value should only be 1 or 0.
*/
-static inline void ni_set_bits(comedi_device * dev, int reg, unsigned bits,
+static inline void ni_set_bits(struct comedi_device * dev, int reg, unsigned bits,
unsigned value)
{
unsigned bit_values;
static irqreturn_t ni_E_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
unsigned short a_status;
unsigned short b_status;
unsigned int ai_mite_status = 0;
}
#ifdef PCIDMA
-static void ni_sync_ai_dma(comedi_device * dev)
+static void ni_sync_ai_dma(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
}
-static void mite_handle_b_linkc(struct mite_struct *mite, comedi_device * dev)
+static void mite_handle_b_linkc(struct mite_struct *mite, struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AO_SUBDEV;
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
}
-static int ni_ao_wait_for_dma_load(comedi_device * dev)
+static int ni_ao_wait_for_dma_load(struct comedi_device * dev)
{
static const int timeout = 10000;
int i;
}
#endif //PCIDMA
-static void ni_handle_eos(comedi_device * dev, comedi_subdevice * s)
+static void ni_handle_eos(struct comedi_device * dev, comedi_subdevice * s)
{
if (devpriv->aimode == AIMODE_SCAN) {
#ifdef PCIDMA
}
}
-static void shutdown_ai_command(comedi_device * dev)
+static void shutdown_ai_command(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
s->async->events |= COMEDI_CB_EOA;
}
-static void ni_event(comedi_device * dev, comedi_subdevice * s)
+static void ni_event(struct comedi_device * dev, comedi_subdevice * s)
{
if (s->async->
events & (COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW | COMEDI_CB_EOA))
comedi_event(dev, s);
}
-static void handle_gpct_interrupt(comedi_device * dev,
+static void handle_gpct_interrupt(struct comedi_device * dev,
unsigned short counter_index)
{
#ifdef PCIDMA
#endif
}
-static void ack_a_interrupt(comedi_device * dev, unsigned short a_status)
+static void ack_a_interrupt(struct comedi_device * dev, unsigned short a_status)
{
unsigned short ack = 0;
devpriv->stc_writew(dev, ack, Interrupt_A_Ack_Register);
}
-static void handle_a_interrupt(comedi_device * dev, unsigned short status,
+static void handle_a_interrupt(struct comedi_device * dev, unsigned short status,
unsigned ai_mite_status)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
#endif
}
-static void ack_b_interrupt(comedi_device * dev, unsigned short b_status)
+static void ack_b_interrupt(struct comedi_device * dev, unsigned short b_status)
{
unsigned short ack = 0;
if (b_status & AO_BC_TC_St) {
devpriv->stc_writew(dev, ack, Interrupt_B_Ack_Register);
}
-static void handle_b_interrupt(comedi_device * dev, unsigned short b_status,
+static void handle_b_interrupt(struct comedi_device * dev, unsigned short b_status,
unsigned ao_mite_status)
{
comedi_subdevice *s = dev->subdevices + NI_AO_SUBDEV;
#ifndef PCIDMA
-static void ni_ao_fifo_load(comedi_device * dev, comedi_subdevice * s, int n)
+static void ni_ao_fifo_load(struct comedi_device * dev, comedi_subdevice * s, int n)
{
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
* RT code, as RT code might purposely be running close to the
* metal. Needs to be fixed eventually.
*/
-static int ni_ao_fifo_half_empty(comedi_device * dev, comedi_subdevice * s)
+static int ni_ao_fifo_half_empty(struct comedi_device * dev, comedi_subdevice * s)
{
int n;
return 1;
}
-static int ni_ao_prep_fifo(comedi_device * dev, comedi_subdevice * s)
+static int ni_ao_prep_fifo(struct comedi_device * dev, comedi_subdevice * s)
{
int n;
return n;
}
-static void ni_ai_fifo_read(comedi_device * dev, comedi_subdevice * s, int n)
+static void ni_ai_fifo_read(struct comedi_device * dev, comedi_subdevice * s, int n)
{
comedi_async *async = s->async;
int i;
}
}
-static void ni_handle_fifo_half_full(comedi_device * dev)
+static void ni_handle_fifo_half_full(struct comedi_device * dev)
{
int n;
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
#endif
#ifdef PCIDMA
-static int ni_ai_drain_dma(comedi_device * dev)
+static int ni_ai_drain_dma(struct comedi_device * dev)
{
int i;
static const int timeout = 10000;
/*
Empties the AI fifo
*/
-static void ni_handle_fifo_dregs(comedi_device * dev)
+static void ni_handle_fifo_dregs(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
short data[2];
}
}
-static void get_last_sample_611x(comedi_device * dev)
+static void get_last_sample_611x(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
short data;
}
}
-static void get_last_sample_6143(comedi_device * dev)
+static void get_last_sample_6143(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
short data;
}
}
-static void ni_ai_munge(comedi_device * dev, comedi_subdevice * s,
+static void ni_ai_munge(struct comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int chan_index)
{
comedi_async *async = s->async;
#ifdef PCIDMA
-static int ni_ai_setup_MITE_dma(comedi_device * dev)
+static int ni_ai_setup_MITE_dma(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
int retval;
return 0;
}
-static int ni_ao_setup_MITE_dma(comedi_device * dev)
+static int ni_ao_setup_MITE_dma(struct comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AO_SUBDEV;
int retval;
this is pretty harsh for a cancel, but it works...
*/
-static int ni_ai_reset(comedi_device * dev, comedi_subdevice * s)
+static int ni_ai_reset(struct comedi_device * dev, comedi_subdevice * s)
{
ni_release_ai_mite_channel(dev);
/* ai configuration */
return 0;
}
-static int ni_ai_poll(comedi_device * dev, comedi_subdevice * s)
+static int ni_ai_poll(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags = 0;
int count;
return count;
}
-static int ni_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return insn->n;
}
-void ni_prime_channelgain_list(comedi_device * dev)
+void ni_prime_channelgain_list(struct comedi_device * dev)
{
int i;
devpriv->stc_writew(dev, AI_CONVERT_Pulse, AI_Command_1_Register);
rt_printk("ni_mio_common: timeout loading channel/gain list\n");
}
-static void ni_m_series_load_channelgain_list(comedi_device * dev,
+static void ni_m_series_load_channelgain_list(struct comedi_device * dev,
unsigned int n_chan, unsigned int *list)
{
unsigned int chan, range, aref;
* bits 0-2: channel
* valid channels are 0-3
*/
-static void ni_load_channelgain_list(comedi_device * dev, unsigned int n_chan,
+static void ni_load_channelgain_list(struct comedi_device * dev, unsigned int n_chan,
unsigned int *list)
{
unsigned int chan, range, aref;
}
}
-static int ni_ns_to_timer(const comedi_device * dev, unsigned nanosec,
+static int ni_ns_to_timer(const struct comedi_device * dev, unsigned nanosec,
int round_mode)
{
int divider;
return divider - 1;
}
-static unsigned ni_timer_to_ns(const comedi_device * dev, int timer)
+static unsigned ni_timer_to_ns(const struct comedi_device * dev, int timer)
{
return devpriv->clock_ns * (timer + 1);
}
-static unsigned ni_min_ai_scan_period_ns(comedi_device * dev,
+static unsigned ni_min_ai_scan_period_ns(struct comedi_device * dev,
unsigned num_channels)
{
switch (boardtype.reg_type) {
return boardtype.ai_speed * num_channels;
}
-static int ni_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ni_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
const comedi_cmd *cmd = &s->async->cmd;
int timer;
return 0;
}
-static int ni_ai_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
if (trignum != 0)
return 1;
}
-static int ni_ai_config_analog_trig(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_config_analog_trig(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ni_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
}
-static int ni_ai_config_analog_trig(comedi_device * dev, comedi_subdevice * s,
+static int ni_ai_config_analog_trig(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int a, b, modebits;
}
/* munge data from unsigned to 2's complement for analog output bipolar modes */
-static void ni_ao_munge(comedi_device * dev, comedi_subdevice * s,
+static void ni_ao_munge(struct comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int chan_index)
{
comedi_async *async = s->async;
}
}
-static int ni_m_series_ao_config_chanlist(comedi_device * dev,
+static int ni_m_series_ao_config_chanlist(struct comedi_device * dev,
comedi_subdevice * s, unsigned int chanspec[], unsigned int n_chans,
int timed)
{
return invert;
}
-static int ni_old_ao_config_chanlist(comedi_device * dev, comedi_subdevice * s,
+static int ni_old_ao_config_chanlist(struct comedi_device * dev, comedi_subdevice * s,
unsigned int chanspec[], unsigned int n_chans)
{
unsigned int range;
return invert;
}
-static int ni_ao_config_chanlist(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_config_chanlist(struct comedi_device * dev, comedi_subdevice * s,
unsigned int chanspec[], unsigned int n_chans, int timed)
{
if (boardtype.reg_type & ni_reg_m_series_mask)
else
return ni_old_ao_config_chanlist(dev, s, chanspec, n_chans);
}
-static int ni_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
return 1;
}
-static int ni_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
return 1;
}
-static int ni_ao_insn_write_671x(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_insn_write_671x(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
return 1;
}
-static int ni_ao_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
return -EINVAL;
}
-static int ni_ao_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
int ret;
return 0;
}
-static int ni_ao_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_ao_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
const comedi_cmd *cmd = &s->async->cmd;
int bits;
return 0;
}
-static int ni_ao_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_ao_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ni_ao_reset(comedi_device * dev, comedi_subdevice * s)
+static int ni_ao_reset(struct comedi_device * dev, comedi_subdevice * s)
{
//devpriv->ao0p=0x0000;
//ni_writew(devpriv->ao0p,AO_Configuration);
// digital io
-static int ni_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
return 1;
}
-static int ni_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
return 2;
}
-static int ni_m_series_dio_insn_config(comedi_device * dev,
+static int ni_m_series_dio_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
return 1;
}
-static int ni_m_series_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_m_series_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
return 2;
}
-static int ni_cdio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_cdio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int ni_cdio_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_cdio_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
const comedi_cmd *cmd = &s->async->cmd;
unsigned cdo_mode_bits = CDO_FIFO_Mode_Bit | CDO_Halt_On_Error_Bit;
return 0;
}
-static int ni_cdo_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_cdo_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
#ifdef PCIDMA
return retval;
}
-static int ni_cdio_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni_cdio_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
ni_writel(CDO_Disarm_Bit | CDO_Error_Interrupt_Enable_Clear_Bit |
CDO_Empty_FIFO_Interrupt_Enable_Clear_Bit |
return 0;
}
-static void handle_cdio_interrupt(comedi_device * dev)
+static void handle_cdio_interrupt(struct comedi_device * dev)
{
unsigned cdio_status;
comedi_subdevice *s = dev->subdevices + NI_DIO_SUBDEV;
ni_event(dev, s);
}
-static int ni_serial_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int err = insn->n;
}
-static int ni_serial_hw_readwrite8(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_hw_readwrite8(struct comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in)
{
unsigned int status1;
return err;
}
-static int ni_serial_sw_readwrite8(comedi_device * dev, comedi_subdevice * s,
+static int ni_serial_sw_readwrite8(struct comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in)
{
unsigned char mask, input = 0;
return 0;
}
-static void mio_common_detach(comedi_device * dev)
+static void mio_common_detach(struct comedi_device * dev)
{
if (dev->private) {
if (devpriv->counter_dev) {
subdev_8255_cleanup(dev, dev->subdevices + NI_8255_DIO_SUBDEV);
}
-static void init_ao_67xx(comedi_device * dev, comedi_subdevice * s)
+static void init_ao_67xx(struct comedi_device * dev, comedi_subdevice * s)
{
int i;
static void ni_gpct_write_register(struct ni_gpct *counter, unsigned bits,
enum ni_gpct_register reg)
{
- comedi_device *dev = counter->counter_dev->dev;
+ struct comedi_device *dev = counter->counter_dev->dev;
unsigned stc_register;
/* bits in the join reset register which are relevant to counters */
static const unsigned gpct_joint_reset_mask = G0_Reset | G1_Reset;
static unsigned ni_gpct_read_register(struct ni_gpct *counter,
enum ni_gpct_register reg)
{
- comedi_device *dev = counter->counter_dev->dev;
+ struct comedi_device *dev = counter->counter_dev->dev;
unsigned stc_register;
switch (reg) {
/* m-series only registers */
return 0;
}
-static int ni_freq_out_insn_read(comedi_device * dev,
+static int ni_freq_out_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->clock_and_fout & FOUT_Divider_mask;
return 1;
}
-static int ni_freq_out_insn_write(comedi_device * dev,
+static int ni_freq_out_insn_write(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
devpriv->clock_and_fout &= ~FOUT_Enable;
return insn->n;
}
-static int ni_set_freq_out_clock(comedi_device * dev, unsigned int clock_source)
+static int ni_set_freq_out_clock(struct comedi_device * dev, unsigned int clock_source)
{
switch (clock_source) {
case NI_FREQ_OUT_TIMEBASE_1_DIV_2_CLOCK_SRC:
return 3;
}
-static void ni_get_freq_out_clock(comedi_device * dev, unsigned int * clock_source,
+static void ni_get_freq_out_clock(struct comedi_device * dev, unsigned int * clock_source,
unsigned int * clock_period_ns)
{
if (devpriv->clock_and_fout & FOUT_Timebase_Select) {
}
}
-static int ni_freq_out_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_freq_out_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
return -EINVAL;
}
-static int ni_alloc_private(comedi_device * dev)
+static int ni_alloc_private(struct comedi_device * dev)
{
int ret;
return 0;
};
-static int ni_E_init(comedi_device * dev, comedi_devconfig * it)
+static int ni_E_init(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned j;
static int ni_8255_callback(int dir, int port, int data, unsigned long arg)
{
- comedi_device *dev = (comedi_device *) arg;
+ struct comedi_device *dev = (struct comedi_device *) arg;
if (dir) {
ni_writeb(data, Port_A + 2 * port);
presents the EEPROM as a subdevice
*/
-static int ni_eeprom_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_eeprom_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = ni_read_eeprom(dev, CR_CHAN(insn->chanspec));
reads bytes out of eeprom
*/
-static int ni_read_eeprom(comedi_device * dev, int addr)
+static int ni_read_eeprom(struct comedi_device * dev, int addr)
{
int bit;
int bitstring;
return bitstring;
}
-static int ni_m_series_eeprom_insn_read(comedi_device * dev,
+static int ni_m_series_eeprom_insn_read(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->eeprom_buffer[CR_CHAN(insn->chanspec)];
return 1;
}
-static int ni_get_pwm_config(comedi_device * dev, unsigned int * data)
+static int ni_get_pwm_config(struct comedi_device * dev, unsigned int * data)
{
data[1] = devpriv->pwm_up_count * devpriv->clock_ns;
data[2] = devpriv->pwm_down_count * devpriv->clock_ns;
return 3;
}
-static int ni_m_series_pwm_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_m_series_pwm_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned up_count, down_count;
return 0;
}
-static int ni_6143_pwm_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_6143_pwm_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned up_count, down_count;
return 0;
}
-static void ni_write_caldac(comedi_device * dev, int addr, int val);
+static void ni_write_caldac(struct comedi_device * dev, int addr, int val);
/*
calibration subdevice
*/
-static int ni_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int ni_calib_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
ni_write_caldac(dev, CR_CHAN(insn->chanspec), data[0]);
return 1;
}
-static int ni_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_calib_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldacs[CR_CHAN(insn->chanspec)];
[ad8804_debug] = {16, 8, pack_ad8804},
};
-static void caldac_setup(comedi_device * dev, comedi_subdevice * s)
+static void caldac_setup(struct comedi_device * dev, comedi_subdevice * s)
{
int i, j;
int n_dacs;
}
}
-static void ni_write_caldac(comedi_device * dev, int addr, int val)
+static void ni_write_caldac(struct comedi_device * dev, int addr, int val)
{
unsigned int loadbit = 0, bits = 0, bit, bitstring = 0;
int i;
/*
* Read the GPCTs current value.
*/
-static int GPCT_G_Watch(comedi_device * dev, int chan)
+static int GPCT_G_Watch(struct comedi_device * dev, int chan)
{
unsigned int hi1, hi2, lo;
return (hi1 << 16) | lo;
}
-static void GPCT_Reset(comedi_device * dev, int chan)
+static void GPCT_Reset(struct comedi_device * dev, int chan)
{
int temp_ack_reg = 0;
#endif
-static int ni_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_insn_config(counter, insn, data);
}
-static int ni_gpct_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_rinsn(counter, insn, data);
}
-static int ni_gpct_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_winsn(counter, insn, data);
}
-static int ni_gpct_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_gpct_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int retval;
#ifdef PCIDMA
return retval;
}
-static int ni_gpct_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_gpct_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
#ifdef PCIDMA
#endif
}
-static int ni_gpct_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni_gpct_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
#ifdef PCIDMA
struct ni_gpct *counter = s->private;
*
*/
-static int ni_m_series_set_pfi_routing(comedi_device * dev, unsigned chan,
+static int ni_m_series_set_pfi_routing(struct comedi_device * dev, unsigned chan,
unsigned source)
{
unsigned pfi_reg_index;
return 2;
}
-static int ni_old_set_pfi_routing(comedi_device * dev, unsigned chan,
+static int ni_old_set_pfi_routing(struct comedi_device * dev, unsigned chan,
unsigned source)
{
// pre-m-series boards have fixed signals on pfi pins
return 2;
}
-static int ni_set_pfi_routing(comedi_device * dev, unsigned chan,
+static int ni_set_pfi_routing(struct comedi_device * dev, unsigned chan,
unsigned source)
{
if (boardtype.reg_type & ni_reg_m_series_mask)
return ni_old_set_pfi_routing(dev, chan, source);
}
-static unsigned ni_m_series_get_pfi_routing(comedi_device * dev, unsigned chan)
+static unsigned ni_m_series_get_pfi_routing(struct comedi_device * dev, unsigned chan)
{
const unsigned array_offset = chan / 3;
return MSeries_PFI_Output_Select_Source(chan,
devpriv->pfi_output_select_reg[array_offset]);
}
-static unsigned ni_old_get_pfi_routing(comedi_device * dev, unsigned chan)
+static unsigned ni_old_get_pfi_routing(struct comedi_device * dev, unsigned chan)
{
// pre-m-series boards have fixed signals on pfi pins
switch (chan) {
return 0;
}
-static unsigned ni_get_pfi_routing(comedi_device * dev, unsigned chan)
+static unsigned ni_get_pfi_routing(struct comedi_device * dev, unsigned chan)
{
if (boardtype.reg_type & ni_reg_m_series_mask)
return ni_m_series_get_pfi_routing(dev, chan);
return ni_old_get_pfi_routing(dev, chan);
}
-static int ni_config_filter(comedi_device * dev, unsigned pfi_channel,
+static int ni_config_filter(struct comedi_device * dev, unsigned pfi_channel,
enum ni_pfi_filter_select filter)
{
unsigned bits;
return 0;
}
-static int ni_pfi_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_pfi_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if ((boardtype.reg_type & ni_reg_m_series_mask) == 0) {
return 2;
}
-static int ni_pfi_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_pfi_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int chan;
* NI RTSI Bus Functions
*
*/
-static void ni_rtsi_init(comedi_device * dev)
+static void ni_rtsi_init(struct comedi_device * dev)
{
// Initialises the RTSI bus signal switch to a default state
// devpriv->stc_writew(dev, 0x0000, RTSI_Board_Register);
}
-static int ni_rtsi_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_rtsi_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 0;
}
-static inline unsigned num_configurable_rtsi_channels(comedi_device * dev)
+static inline unsigned num_configurable_rtsi_channels(struct comedi_device * dev)
{
if (boardtype.reg_type & ni_reg_m_series_mask)
return 8;
return 7;
}
-static int ni_mseries_set_pll_master_clock(comedi_device * dev, unsigned source,
+static int ni_mseries_set_pll_master_clock(struct comedi_device * dev, unsigned source,
unsigned period_ns)
{
static const unsigned min_period_ns = 50;
return 3;
}
-static int ni_set_master_clock(comedi_device * dev, unsigned source,
+static int ni_set_master_clock(struct comedi_device * dev, unsigned source,
unsigned period_ns)
{
if (source == NI_MIO_INTERNAL_CLOCK) {
return 3;
}
-static int ni_valid_rtsi_output_source(comedi_device * dev, unsigned chan,
+static int ni_valid_rtsi_output_source(struct comedi_device * dev, unsigned chan,
unsigned source)
{
if (chan >= num_configurable_rtsi_channels(dev)) {
}
}
-static int ni_set_rtsi_routing(comedi_device * dev, unsigned chan,
+static int ni_set_rtsi_routing(struct comedi_device * dev, unsigned chan,
unsigned source)
{
if (ni_valid_rtsi_output_source(dev, chan, source) == 0)
return 2;
}
-static unsigned ni_get_rtsi_routing(comedi_device * dev, unsigned chan)
+static unsigned ni_get_rtsi_routing(struct comedi_device * dev, unsigned chan)
{
if (chan < 4) {
return RTSI_Trig_Output_Source(chan,
}
}
-static int ni_rtsi_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_rtsi_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
return 1;
}
-static int cs5529_wait_for_idle(comedi_device * dev)
+static int cs5529_wait_for_idle(struct comedi_device * dev)
{
unsigned short status;
const int timeout = HZ;
return 0;
}
-static void cs5529_command(comedi_device * dev, unsigned short value)
+static void cs5529_command(struct comedi_device * dev, unsigned short value)
{
static const int timeout = 100;
int i;
}
/* write to cs5529 register */
-static void cs5529_config_write(comedi_device * dev, unsigned int value,
+static void cs5529_config_write(struct comedi_device * dev, unsigned int value,
unsigned int reg_select_bits)
{
ni_ao_win_outw(dev, ((value >> 16) & 0xff),
#ifdef NI_CS5529_DEBUG
/* read from cs5529 register */
-static unsigned int cs5529_config_read(comedi_device * dev,
+static unsigned int cs5529_config_read(struct comedi_device * dev,
unsigned int reg_select_bits)
{
unsigned int value;
}
#endif
-static int cs5529_do_conversion(comedi_device * dev, unsigned short *data)
+static int cs5529_do_conversion(struct comedi_device * dev, unsigned short *data)
{
int retval;
unsigned short status;
return 0;
}
-static int cs5529_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int cs5529_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, retval;
return insn->n;
}
-static int init_cs5529(comedi_device * dev)
+static int init_cs5529(struct comedi_device * dev)
{
unsigned int config_bits =
CSCFG_PORT_MODE | CSCFG_WORD_RATE_2180_CYCLES;
* read/written directly in the I/O space of the board. The
* DAQCard devices map the low 8 STC registers to iobase+addr*2. */
-static void mio_cs_win_out(comedi_device * dev, uint16_t data, int addr)
+static void mio_cs_win_out(struct comedi_device * dev, uint16_t data, int addr)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->window_lock, flags);
}
-static uint16_t mio_cs_win_in(comedi_device * dev, int addr)
+static uint16_t mio_cs_win_in(struct comedi_device * dev, int addr)
{
unsigned long flags;
uint16_t ret;
return ret;
}
-static int mio_cs_attach(comedi_device * dev, comedi_devconfig * it);
-static int mio_cs_detach(comedi_device * dev);
+static int mio_cs_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int mio_cs_detach(struct comedi_device * dev);
static comedi_driver driver_ni_mio_cs = {
driver_name:"ni_mio_cs",
module:THIS_MODULE,
#include "ni_mio_common.c"
-static int ni_getboardtype(comedi_device * dev, struct pcmcia_device *link);
+static int ni_getboardtype(struct comedi_device * dev, struct pcmcia_device *link);
/* clean up allocated resources */
/* called when driver is removed */
-static int mio_cs_detach(comedi_device * dev)
+static int mio_cs_detach(struct comedi_device * dev)
{
mio_common_detach(dev);
link->dev_node = &dev_node;
}
-static int mio_cs_attach(comedi_device * dev, comedi_devconfig * it)
+static int mio_cs_attach(struct comedi_device * dev, comedi_devconfig * it)
{
struct pcmcia_device *link;
unsigned int irq;
return 0;
}
-static int get_prodid(comedi_device * dev, struct pcmcia_device *link)
+static int get_prodid(struct comedi_device * dev, struct pcmcia_device *link)
{
tuple_t tuple;
u_short buf[128];
return prodid;
}
-static int ni_getboardtype(comedi_device * dev, struct pcmcia_device *link)
+static int ni_getboardtype(struct comedi_device * dev, struct pcmcia_device *link)
{
int id;
int i;
#define IntEn (TransferReady|CountExpired|Waited|PrimaryTC|SecondaryTC)
#endif
-static int nidio_attach(comedi_device * dev, comedi_devconfig * it);
-static int nidio_detach(comedi_device * dev);
-static int ni_pcidio_cancel(comedi_device * dev, comedi_subdevice * s);
+static int nidio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int nidio_detach(struct comedi_device * dev);
+static int ni_pcidio_cancel(struct comedi_device * dev, comedi_subdevice * s);
static comedi_driver driver_pcidio = {
driver_name:"ni_pcidio",
} nidio96_private;
#define devpriv ((nidio96_private *)dev->private)
-static int ni_pcidio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int ni_pcidio_cmd(comedi_device * dev, comedi_subdevice * s);
-static int ni_pcidio_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int ni_pcidio_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum);
-static int nidio_find_device(comedi_device * dev, int bus, int slot);
+static int nidio_find_device(struct comedi_device * dev, int bus, int slot);
static int ni_pcidio_ns_to_timer(int *nanosec, int round_mode);
-static int setup_mite_dma(comedi_device * dev, comedi_subdevice * s);
+static int setup_mite_dma(struct comedi_device * dev, comedi_subdevice * s);
#ifdef DEBUG_FLAGS
static void ni_pcidio_print_flags(unsigned int flags);
#define ni_pcidio_print_status(x)
#endif
-static int ni_pcidio_request_di_mite_channel(comedi_device * dev)
+static int ni_pcidio_request_di_mite_channel(struct comedi_device * dev)
{
unsigned long flags;
return 0;
}
-static void ni_pcidio_release_di_mite_channel(comedi_device * dev)
+static void ni_pcidio_release_di_mite_channel(struct comedi_device * dev)
{
unsigned long flags;
}
}
-void ni_pcidio_event(comedi_device * dev, comedi_subdevice * s)
+void ni_pcidio_event(struct comedi_device * dev, comedi_subdevice * s)
{
if (s->async->
events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
static irqreturn_t nidio_interrupt(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices;
comedi_async *async = s->async;
struct mite_struct *mite = devpriv->mite;
#endif
#ifdef unused
-static void debug_int(comedi_device * dev)
+static void debug_int(struct comedi_device * dev)
{
int a, b;
static int n_int = 0;
}
#endif
-static int ni_pcidio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 1)
return 1;
}
-static int ni_pcidio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int ni_pcidio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return divider;
}
-static int ni_pcidio_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ni_pcidio_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int setup_mite_dma(comedi_device * dev, comedi_subdevice * s)
+static int setup_mite_dma(struct comedi_device * dev, comedi_subdevice * s)
{
int retval;
return 0;
}
-static int ni_pcidio_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
if (trignum != 0)
return 1;
}
-static int ni_pcidio_cancel(comedi_device * dev, comedi_subdevice * s)
+static int ni_pcidio_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
writeb(0x00,
devpriv->mite->daq_io_addr + Master_DMA_And_Interrupt_Control);
return 0;
}
-static int ni_pcidio_change(comedi_device * dev, comedi_subdevice * s,
+static int ni_pcidio_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int pci_6534_load_fpga(comedi_device * dev, int fpga_index, u8 * data,
+static int pci_6534_load_fpga(struct comedi_device * dev, int fpga_index, u8 * data,
int data_len)
{
static const int timeout = 1000;
return 0;
}
-static int pci_6534_reset_fpga(comedi_device * dev, int fpga_index)
+static int pci_6534_reset_fpga(struct comedi_device * dev, int fpga_index)
{
return pci_6534_load_fpga(dev, fpga_index, NULL, 0);
}
-static int pci_6534_reset_fpgas(comedi_device * dev)
+static int pci_6534_reset_fpgas(struct comedi_device * dev)
{
int ret;
int i;
return ret;
}
-static void pci_6534_init_main_fpga(comedi_device * dev)
+static void pci_6534_init_main_fpga(struct comedi_device * dev)
{
writel(0, devpriv->mite->daq_io_addr + FPGA_Control1_Register);
writel(0, devpriv->mite->daq_io_addr + FPGA_Control2_Register);
writel(0, devpriv->mite->daq_io_addr + FPGA_SCBMS_Counter_Register);
}
-static int pci_6534_upload_firmware(comedi_device * dev, int options[])
+static int pci_6534_upload_firmware(struct comedi_device * dev, int options[])
{
int ret;
void *main_fpga_data, *scarab_a_data, *scarab_b_data;
return 0;
}
-static int nidio_attach(comedi_device * dev, comedi_devconfig * it)
+static int nidio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int i;
return 0;
}
-static int nidio_detach(comedi_device * dev)
+static int nidio_detach(struct comedi_device * dev)
{
int i;
return 0;
}
-static int nidio_find_device(comedi_device * dev, int bus, int slot)
+static int nidio_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
#define n_pcimio_boards ((sizeof(ni_boards)/sizeof(ni_boards[0])))
-static int pcimio_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcimio_detach(comedi_device * dev);
+static int pcimio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcimio_detach(struct comedi_device * dev);
static comedi_driver driver_pcimio = {
driver_name: DRV_NAME,
module:THIS_MODULE,
/* However, the 611x boards still aren't working, so I'm disabling
* non-windowed STC access temporarily */
-static void e_series_win_out(comedi_device * dev, uint16_t data, int reg)
+static void e_series_win_out(struct comedi_device * dev, uint16_t data, int reg)
{
unsigned long flags;
comedi_spin_unlock_irqrestore(&devpriv->window_lock, flags);
}
-static uint16_t e_series_win_in(comedi_device * dev, int reg)
+static uint16_t e_series_win_in(struct comedi_device * dev, int reg)
{
unsigned long flags;
uint16_t ret;
return ret;
}
-static void m_series_stc_writew(comedi_device * dev, uint16_t data, int reg)
+static void m_series_stc_writew(struct comedi_device * dev, uint16_t data, int reg)
{
unsigned offset;
switch (reg) {
ni_writew(data, offset);
}
-static uint16_t m_series_stc_readw(comedi_device * dev, int reg)
+static uint16_t m_series_stc_readw(struct comedi_device * dev, int reg)
{
unsigned offset;
switch (reg) {
return ni_readw(offset);
}
-static void m_series_stc_writel(comedi_device * dev, uint32_t data, int reg)
+static void m_series_stc_writel(struct comedi_device * dev, uint32_t data, int reg)
{
unsigned offset;
switch (reg) {
ni_writel(data, offset);
}
-static uint32_t m_series_stc_readl(comedi_device * dev, int reg)
+static uint32_t m_series_stc_readl(struct comedi_device * dev, int reg)
{
unsigned offset;
switch (reg) {
#include "ni_mio_common.c"
-static int pcimio_find_device(comedi_device * dev, int bus, int slot);
-static int pcimio_ai_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_find_device(struct comedi_device * dev, int bus, int slot);
+static int pcimio_ai_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size);
-static int pcimio_ao_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_ao_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size);
-static int pcimio_gpct0_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_gpct0_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size);
-static int pcimio_gpct1_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_gpct1_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size);
-static int pcimio_dio_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_dio_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size);
-static void m_series_init_eeprom_buffer(comedi_device * dev)
+static void m_series_init_eeprom_buffer(struct comedi_device * dev)
{
static const int Start_Cal_EEPROM = 0x400;
static const unsigned window_size = 10;
writel(0x0, devpriv->mite->mite_io_addr + 0x30);
}
-static void init_6143(comedi_device * dev)
+static void init_6143(struct comedi_device * dev)
{
// Disable interrupts
devpriv->stc_writew(dev, 0, Interrupt_Control_Register);
}
/* cleans up allocated resources */
-static int pcimio_detach(comedi_device * dev)
+static int pcimio_detach(struct comedi_device * dev)
{
mio_common_detach(dev);
if (dev->irq) {
return 0;
}
-static int pcimio_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcimio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
return ret;
}
-static int pcimio_find_device(comedi_device * dev, int bus, int slot)
+static int pcimio_find_device(struct comedi_device * dev, int bus, int slot)
{
struct mite_struct *mite;
int i;
return -EIO;
}
-static int pcimio_ai_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_ai_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int pcimio_ao_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_ao_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int pcimio_gpct0_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_gpct0_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int pcimio_gpct1_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_gpct1_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
return 0;
}
-static int pcimio_dio_change(comedi_device * dev, comedi_subdevice * s,
+static int pcimio_dio_change(struct comedi_device * dev, comedi_subdevice * s,
unsigned long new_size)
{
int ret;
#define NUM_GPCT 2
#define NI_PRIVATE_COMMON \
- uint16_t (*stc_readw)(comedi_device *dev, int register); \
- uint32_t (*stc_readl)(comedi_device *dev, int register); \
- void (*stc_writew)(comedi_device *dev, uint16_t value, int register); \
- void (*stc_writel)(comedi_device *dev, uint32_t value, int register); \
+ uint16_t (*stc_readw)(struct comedi_device *dev, int register); \
+ uint32_t (*stc_readl)(struct comedi_device *dev, int register); \
+ void (*stc_writew)(struct comedi_device *dev, uint16_t value, int register); \
+ void (*stc_writel)(struct comedi_device *dev, uint32_t value, int register); \
\
unsigned short dio_output; \
unsigned short dio_control; \
module_exit(ni_tio_cleanup_module);
-struct ni_gpct_device *ni_gpct_device_construct(comedi_device * dev,
+struct ni_gpct_device *ni_gpct_device_construct(struct comedi_device * dev,
void (*write_register) (struct ni_gpct * counter, unsigned bits,
enum ni_gpct_register reg),
unsigned (*read_register) (struct ni_gpct * counter,
};
struct ni_gpct_device {
- comedi_device *dev;
+ struct comedi_device *dev;
void (*write_register) (struct ni_gpct * counter, unsigned bits,
enum ni_gpct_register reg);
unsigned (*read_register) (struct ni_gpct * counter,
spinlock_t regs_lock;
};
-extern struct ni_gpct_device *ni_gpct_device_construct(comedi_device * dev,
+extern struct ni_gpct_device *ni_gpct_device_construct(struct comedi_device * dev,
void (*write_register) (struct ni_gpct * counter, unsigned bits,
enum ni_gpct_register reg),
unsigned (*read_register) (struct ni_gpct * counter,
}
}
-static int ni_tio_input_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int ni_tio_input_inttrig(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
unsigned long flags;
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
#define this_board ((const boardtype *)dev->board_ptr)
-static int pcl711_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl711_detach(comedi_device * dev);
+static int pcl711_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl711_detach(struct comedi_device * dev);
static comedi_driver driver_pcl711 = {
driver_name:"pcl711",
module:THIS_MODULE,
{
int lo, hi;
int data;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
if (!dev->attached) {
return IRQ_HANDLED;
}
-static void pcl711_set_changain(comedi_device * dev, int chan)
+static void pcl711_set_changain(struct comedi_device * dev, int chan)
{
int chan_register;
}
}
-static int pcl711_ai_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_ai_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, n;
return n;
}
-static int pcl711_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int tmp;
return 0;
}
-static int pcl711_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcl711_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
int timer1, timer2;
comedi_cmd *cmd = &s->async->cmd;
/*
analog output
*/
-static int pcl711_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int pcl711_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
}
/* Digital port read - Untested on 8112 */
-static int pcl711_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
}
/* Digital port write - Untested on 8112 */
-static int pcl711_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl711_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
}
/* Free any resources that we have claimed */
-static int pcl711_detach(comedi_device * dev)
+static int pcl711_detach(struct comedi_device * dev)
{
printk("comedi%d: pcl711: remove\n", dev->minor);
}
/* Initialization */
-static int pcl711_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl711_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
// #define PCL724_IRQ 1 /* no IRQ support now */
-static int pcl724_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl724_detach(comedi_device * dev);
+static int pcl724_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl724_detach(struct comedi_device * dev);
typedef struct {
const char *name; // board name
}
}
-static int pcl724_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl724_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned long iobase;
unsigned int iorange;
return 0;
}
-static int pcl724_detach(comedi_device * dev)
+static int pcl724_detach(struct comedi_device * dev)
{
int i;
#define PCL725_DO 0
#define PCL725_DI 1
-static int pcl725_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl725_detach(comedi_device * dev);
+static int pcl725_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl725_detach(struct comedi_device * dev);
static comedi_driver driver_pcl725 = {
driver_name:"pcl725",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_pcl725);
-static int pcl725_do_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl725_do_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl725_di_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl725_di_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl725_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl725_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int pcl725_detach(comedi_device * dev)
+static int pcl725_detach(struct comedi_device * dev)
{
printk("comedi%d: pcl725: remove\n", dev->minor);
&range_4_20mA, &range_0_20mA
};
-static int pcl726_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl726_detach(comedi_device * dev);
+static int pcl726_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl726_detach(struct comedi_device * dev);
typedef struct {
const char *name; // driver name
} pcl726_private;
#define devpriv ((pcl726_private *)dev->private)
-static int pcl726_ao_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl726_ao_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int hi, lo;
return n;
}
-static int pcl726_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl726_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return n;
}
-static int pcl726_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl726_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl726_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl726_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl726_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl726_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int pcl726_detach(comedi_device * dev)
+static int pcl726_detach(struct comedi_device * dev)
{
// printk("comedi%d: pcl726: remove\n",dev->minor);
#define PCL730_DIO_LO 2 /* TTL Digital I/O low byte (D0-D7) */
#define PCL730_DIO_HI 3 /* TTL Digital I/O high byte (D8-D15) */
-static int pcl730_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl730_detach(comedi_device * dev);
+static int pcl730_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl730_detach(struct comedi_device * dev);
typedef struct {
const char *name; // board name
COMEDI_INITCLEANUP(driver_pcl730);
-static int pcl730_do_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl730_do_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl730_di_insn(comedi_device * dev, comedi_subdevice * s,
+static int pcl730_di_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl730_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl730_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int pcl730_detach(comedi_device * dev)
+static int pcl730_detach(struct comedi_device * dev)
{
printk("comedi%d: pcl730: remove\n", dev->minor);
}
};
-static int pcl812_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl812_detach(comedi_device * dev);
+static int pcl812_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl812_detach(struct comedi_device * dev);
typedef struct {
const char *name; // board name
/*
==============================================================================
*/
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
-static void setup_range_channel(comedi_device * dev, comedi_subdevice * s,
+static void setup_range_channel(struct comedi_device * dev, comedi_subdevice * s,
unsigned int rangechan, char wait);
-static int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s);
+static int pcl812_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
/*
==============================================================================
*/
-static int pcl812_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
/*
==============================================================================
*/
-static int acl8216_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int acl8216_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
/*
==============================================================================
*/
-static int pcl812_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
/*
==============================================================================
*/
-static int pcl812_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
/*
==============================================================================
*/
-static int pcl812_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
/*
==============================================================================
*/
-static int pcl812_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
/*
==============================================================================
*/
-static int pcl812_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pcl812_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
==============================================================================
*/
-static int pcl812_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcl812_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned int divisor1 = 0, divisor2 = 0, i, dma_flags, bytes;
comedi_cmd *cmd = &s->async->cmd;
{
char err = 1;
unsigned int mask, timeout;
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
s->async->events = 0;
/*
==============================================================================
*/
-static void transfer_from_dma_buf(comedi_device * dev, comedi_subdevice * s,
+static void transfer_from_dma_buf(struct comedi_device * dev, comedi_subdevice * s,
short * ptr, unsigned int bufptr, unsigned int len)
{
unsigned int i;
*/
static irqreturn_t interrupt_pcl812_ai_dma(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
unsigned long dma_flags;
int len, bufptr;
*/
static irqreturn_t interrupt_pcl812(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
if (!dev->attached) {
comedi_error(dev, "spurious interrupt");
/*
==============================================================================
*/
-static int pcl812_ai_poll(comedi_device * dev, comedi_subdevice * s)
+static int pcl812_ai_poll(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
unsigned int top1, top2, i;
/*
==============================================================================
*/
-static void setup_range_channel(comedi_device * dev, comedi_subdevice * s,
+static void setup_range_channel(struct comedi_device * dev, comedi_subdevice * s,
unsigned int rangechan, char wait)
{
unsigned char chan_reg = CR_CHAN(rangechan); // normal board
/*
==============================================================================
*/
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2)
{
#ifdef PCL812_EXTDEBUG
/*
==============================================================================
*/
-static void free_resources(comedi_device * dev)
+static void free_resources(struct comedi_device * dev)
{
if (dev->private) {
/*
==============================================================================
*/
-static int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pcl812_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
#ifdef PCL812_EXTDEBUG
rt_printk("pcl812 EDBG: BGN: pcl812_ai_cancel(...)\n");
/*
==============================================================================
*/
-static void pcl812_reset(comedi_device * dev)
+static void pcl812_reset(struct comedi_device * dev)
{
#ifdef PCL812_EXTDEBUG
rt_printk("pcl812 EDBG: BGN: pcl812_reset(...)\n");
/*
==============================================================================
*/
-static int pcl812_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl812_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret, subdev;
unsigned long iobase;
/*
==============================================================================
*/
-static int pcl812_detach(comedi_device * dev)
+static int pcl812_detach(struct comedi_device * dev)
{
#ifdef PCL812_EXTDEBUG
#define devpriv ((pcl816_private *)dev->private)
#define this_board ((const boardtype *)dev->board_ptr)
-static int pcl816_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl816_detach(comedi_device * dev);
+static int pcl816_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl816_detach(struct comedi_device * dev);
#ifdef unused
static int RTC_lock = 0; /* RTC lock */
/*
==============================================================================
*/
-static int check_and_setup_channel_list(comedi_device * dev,
+static int check_and_setup_channel_list(struct comedi_device * dev,
comedi_subdevice * s, unsigned int *chanlist, int chanlen);
-static int pcl816_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static int pcl816_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
#ifdef unused
static int set_rtc_irq_bit(unsigned char bit);
#endif
-static int pcl816_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pcl816_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
-static int pcl816_ai_cmd(comedi_device * dev, comedi_subdevice * s);
+static int pcl816_ai_cmd(struct comedi_device * dev, comedi_subdevice * s);
/*
==============================================================================
ANALOG INPUT MODE0, 816 cards, slow version
*/
-static int pcl816_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl816_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
*/
static irqreturn_t interrupt_pcl816_ai_mode13_int(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int low, hi;
int timeout = 50; /* wait max 50us */
==============================================================================
analog input dma mode 1 & 3, 816 cards
*/
-static void transfer_from_dma_buf(comedi_device * dev, comedi_subdevice * s,
+static void transfer_from_dma_buf(struct comedi_device * dev, comedi_subdevice * s,
short * ptr, unsigned int bufptr, unsigned int len)
{
int i;
static irqreturn_t interrupt_pcl816_ai_mode13_dma(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int len, bufptr, this_dma_buf;
unsigned long dma_flags;
*/
static irqreturn_t interrupt_pcl816(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
DPRINTK("<I>");
if (!dev->attached) {
/*
==============================================================================
*/
-static int pcl816_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int pcl816_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int pcl816_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcl816_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned int divisor1 = 0, divisor2 = 0, dma_flags, bytes, dmairq;
comedi_cmd *cmd = &s->async->cmd;
return 0;
}
-static int pcl816_ai_poll(comedi_device * dev, comedi_subdevice * s)
+static int pcl816_ai_poll(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
unsigned int top1, top2, i;
==============================================================================
cancel any mode 1-4 AI
*/
-static int pcl816_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pcl816_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
// DEBUG(rt_printk("pcl816_ai_cancel()\n");)
==============================================================================
reset whole PCL-816 cards
*/
-static void pcl816_reset(comedi_device * dev)
+static void pcl816_reset(struct comedi_device * dev)
{
// outb (0, dev->iobase + PCL818_DA_LO); // DAC=0V
// outb (0, dev->iobase + PCL818_DA_HI);
Start/stop pacer onboard pacer
*/
static void
-start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2)
{
outb(0x32, dev->iobase + PCL816_CTRCTL);
If it's ok, then program scan/gain logic
*/
static int
-check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+check_and_setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, int chanlen)
{
unsigned int chansegment[16];
==============================================================================
Free any resources that we have claimed
*/
-static void free_resources(comedi_device * dev)
+static void free_resources(struct comedi_device * dev)
{
//rt_printk("free_resource()\n");
if (dev->private) {
Initialization
*/
-static int pcl816_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl816_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
==============================================================================
Removes device
*/
-static int pcl816_detach(comedi_device * dev)
+static int pcl816_detach(struct comedi_device * dev)
{
DEBUG(rt_printk("comedi%d: pcl816: remove\n", dev->minor);
)
static const comedi_lrange range718_unipolar2 = { 1, {UNI_RANGE(2),} };
static const comedi_lrange range718_unipolar1 = { 1, {BIP_RANGE(1),} };
-static int pcl818_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcl818_detach(comedi_device * dev);
+static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcl818_detach(struct comedi_device * dev);
#ifdef unused
static int RTC_lock = 0; /* RTC lock */
/*
==============================================================================
*/
-static void setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static void setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan, unsigned int seglen);
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan);
-static int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static int pcl818_ai_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
#ifdef unused
==============================================================================
ANALOG INPUT MODE0, 818 cards, slow version
*/
-static int pcl818_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
ANALOG OUTPUT MODE0, 818 cards
only one sample per call is supported
*/
-static int pcl818_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int pcl818_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
only one sample per call is supported
*/
-static int pcl818_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
only one sample per call is supported
*/
-static int pcl818_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
*/
static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int low;
int timeout = 50; /* wait max 50us */
*/
static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int i, len, bufptr;
unsigned long flags;
*/
static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
unsigned long tmp;
unsigned int top1, top2, i, bufptr;
*/
static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s = dev->subdevices + 0;
int i, len, lo;
*/
static irqreturn_t interrupt_pcl818(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
if (!dev->attached) {
comedi_error(dev, "premature interrupt");
==============================================================================
ANALOG INPUT MODE 1 or 3 DMA , 818 cards
*/
-static void pcl818_ai_mode13dma_int(int mode, comedi_device * dev,
+static void pcl818_ai_mode13dma_int(int mode, struct comedi_device * dev,
comedi_subdevice * s)
{
unsigned int flags;
==============================================================================
ANALOG INPUT MODE 1 or 3 DMA rtc, 818 cards
*/
-static void pcl818_ai_mode13dma_rtc(int mode, comedi_device * dev,
+static void pcl818_ai_mode13dma_rtc(int mode, struct comedi_device * dev,
comedi_subdevice * s)
{
unsigned int flags;
==============================================================================
ANALOG INPUT MODE 1 or 3, 818 cards
*/
-static int pcl818_ai_cmd_mode(int mode, comedi_device * dev,
+static int pcl818_ai_cmd_mode(int mode, struct comedi_device * dev,
comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
ANALOG OUTPUT MODE 1 or 3, 818 cards
*/
#ifdef PCL818_MODE13_AO
-static int pcl818_ao_mode13(int mode, comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ao_mode13(int mode, struct comedi_device * dev, comedi_subdevice * s,
comedi_trig * it)
{
int divisor1, divisor2;
==============================================================================
ANALOG OUTPUT MODE 1, 818 cards
*/
-static int pcl818_ao_mode1(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ao_mode1(struct comedi_device * dev, comedi_subdevice * s,
comedi_trig * it)
{
return pcl818_ao_mode13(1, dev, s, it);
==============================================================================
ANALOG OUTPUT MODE 3, 818 cards
*/
-static int pcl818_ao_mode3(comedi_device * dev, comedi_subdevice * s,
+static int pcl818_ao_mode3(struct comedi_device * dev, comedi_subdevice * s,
comedi_trig * it)
{
return pcl818_ao_mode13(3, dev, s, it);
==============================================================================
Start/stop pacer onboard pacer
*/
-static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1,
+static void start_pacer(struct comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2)
{
outb(0xb4, dev->iobase + PCL818_CTRCTL);
Check if channel list from user is builded correctly
If it's ok, then program scan/gain logic
*/
-static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
+static int check_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan)
{
unsigned int chansegment[16];
return seglen;
}
-static void setup_channel_list(comedi_device * dev, comedi_subdevice * s,
+static void setup_channel_list(struct comedi_device * dev, comedi_subdevice * s,
unsigned int *chanlist, unsigned int n_chan, unsigned int seglen)
{
int i;
/*
==============================================================================
*/
-static int ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
/*
==============================================================================
*/
-static int ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
int retval;
==============================================================================
cancel any mode 1-4 AI
*/
-static int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pcl818_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
if (devpriv->irq_blocked > 0) {
rt_printk("pcl818_ai_cancel()\n");
==============================================================================
reset whole PCL-818 cards
*/
-static void pcl818_reset(comedi_device * dev)
+static void pcl818_reset(struct comedi_device * dev)
{
if (devpriv->usefifo) { // FIFO shutdown
outb(0, dev->iobase + PCL818_FI_INTCLR);
*/
static void rtc_dropped_irq(unsigned long data)
{
- comedi_device *dev = (void *)data;
+ struct comedi_device *dev = (void *)data;
unsigned long flags, tmp;
switch (devpriv->int818_mode) {
==============================================================================
Free any resources that we have claimed
*/
-static void free_resources(comedi_device * dev)
+static void free_resources(struct comedi_device * dev)
{
//rt_printk("free_resource()\n");
if (dev->private) {
Initialization
*/
-static int pcl818_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcl818_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
unsigned long iobase;
==============================================================================
Removes device
*/
-static int pcl818_detach(comedi_device * dev)
+static int pcl818_detach(struct comedi_device * dev)
{
// rt_printk("comedi%d: pcl818: remove\n", dev->minor);
free_resources(dev);
#define CR_A_MODE(a) ((a)<<5)
#define CR_CW 0x80
-static int pcm3724_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcm3724_detach(comedi_device * dev);
+static int pcm3724_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcm3724_detach(struct comedi_device * dev);
typedef struct {
const char *name; // driver name
return config;
}
-static void do_3724_config(comedi_device * dev, comedi_subdevice * s,
+static void do_3724_config(struct comedi_device * dev, comedi_subdevice * s,
int chanspec)
{
int config;
outb(config, port_8255_cfg);
}
-static void enable_chan(comedi_device * dev, comedi_subdevice * s, int chanspec)
+static void enable_chan(struct comedi_device * dev, comedi_subdevice * s, int chanspec)
{
unsigned int mask;
int gatecfg;
}
/* overriding the 8255 insn config */
-static int subdev_3724_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int subdev_3724_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
return 1;
}
-static int pcm3724_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcm3724_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned long iobase;
unsigned int iorange;
return 0;
}
-static int pcm3724_detach(comedi_device * dev)
+static int pcm3724_detach(struct comedi_device * dev)
{
int i;
#define PCM3730_DIB 2
#define PCM3730_DIC 3
-static int pcm3730_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcm3730_detach(comedi_device * dev);
+static int pcm3730_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcm3730_detach(struct comedi_device * dev);
static comedi_driver driver_pcm3730 = {
driver_name:"pcm3730",
module:THIS_MODULE,
COMEDI_INITCLEANUP(driver_pcm3730);
-static int pcm3730_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcm3730_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcm3730_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcm3730_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcm3730_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcm3730_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int pcm3730_detach(comedi_device * dev)
+static int pcm3730_detach(struct comedi_device * dev)
{
printk("comedi%d: pcm3730: remove\n", dev->minor);
};
#define devpriv ((struct pcmad_priv_struct *)dev->private)
-static int pcmad_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcmad_detach(comedi_device * dev);
+static int pcmad_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcmad_detach(struct comedi_device * dev);
static comedi_driver driver_pcmad = {
driver_name:"pcmad",
module:THIS_MODULE,
#define TIMEOUT 100
-static int pcmad_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int pcmad_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* 2 0=single ended 1=differential
* 3 0=straight binary 1=two's comp
*/
-static int pcmad_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcmad_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
comedi_subdevice *s;
return 0;
}
-static int pcmad_detach(comedi_device * dev)
+static int pcmad_detach(struct comedi_device * dev)
{
printk("comedi%d: pcmad: remove\n", dev->minor);
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pcmda12_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcmda12_detach(comedi_device * dev);
+static int pcmda12_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcmda12_detach(struct comedi_device * dev);
-static void zero_chans(comedi_device * dev);
+static void zero_chans(struct comedi_device * dev);
static comedi_driver driver = {
driver_name:"pcmda12",
num_names:sizeof(pcmda12_boards) / sizeof(pcmda12_board),
};
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pcmda12_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcmda12_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pcmda12_detach(comedi_device * dev)
+static int pcmda12_detach(struct comedi_device * dev)
{
printk("comedi%d: %s: remove\n", dev->minor, driver.driver_name);
if (dev->iobase)
return 0;
}
-static void zero_chans(comedi_device * dev)
+static void zero_chans(struct comedi_device * dev)
{ /* sets up an
ASIC chip to defaults */
int i;
inb(LSB_PORT(0)); /* update chans. */
}
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
DAC outputs, which makes all AO channels update simultaneously.
This is useful for some control applications, I would imagine.
*/
-static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
#define PAGE_ENAB 2
#define PAGE_INT_ID 3
-typedef int (*comedi_insn_fn_t) (comedi_device *, comedi_subdevice *,
+typedef int (*comedi_insn_fn_t) (struct comedi_device *, comedi_subdevice *,
comedi_insn *, unsigned int *);
-static int ai_rinsn(comedi_device *, comedi_subdevice *, comedi_insn *,
+static int ai_rinsn(struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
-static int ao_rinsn(comedi_device *, comedi_subdevice *, comedi_insn *,
+static int ao_rinsn(struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
-static int ao_winsn(comedi_device *, comedi_subdevice *, comedi_insn *,
+static int ao_winsn(struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
/*
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
/* stuff for DIO */
struct {
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pcmmio_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcmmio_detach(comedi_device * dev);
+static int pcmmio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcmmio_detach(struct comedi_device * dev);
static comedi_driver driver = {
driver_name:"pcmmio",
num_names:sizeof(pcmmio_boards) / sizeof(pcmmio_board),
};
-static int pcmmio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcmmio_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pcmmio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pcmmio_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static irqreturn_t interrupt_pcmmio(int irq, void *d PT_REGS_ARG);
-static void pcmmio_stop_intr(comedi_device *, comedi_subdevice *);
-static int pcmmio_cancel(comedi_device * dev, comedi_subdevice * s);
-static int pcmmio_cmd(comedi_device * dev, comedi_subdevice * s);
-static int pcmmio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static void pcmmio_stop_intr(struct comedi_device *, comedi_subdevice *);
+static int pcmmio_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static int pcmmio_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int pcmmio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
/* some helper functions to deal with specifics of this device's registers */
-static void init_asics(comedi_device * dev); /* sets up/clears ASIC chips to defaults */
-static void switch_page(comedi_device * dev, int asic, int page);
+static void init_asics(struct comedi_device * dev); /* sets up/clears ASIC chips to defaults */
+static void switch_page(struct comedi_device * dev, int asic, int page);
#ifdef notused
-static void lock_port(comedi_device * dev, int asic, int port);
-static void unlock_port(comedi_device * dev, int asic, int port);
+static void lock_port(struct comedi_device * dev, int asic, int port);
+static void unlock_port(struct comedi_device * dev, int asic, int port);
#endif
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pcmmio_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcmmio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic,
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pcmmio_detach(comedi_device * dev)
+static int pcmmio_detach(struct comedi_device * dev)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int pcmmio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcmmio_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int byte_no;
* configured by a special insn_config instruction. chanspec
* contains the channel to be changed, and data[0] contains the
* value COMEDI_INPUT or COMEDI_OUTPUT. */
-static int pcmmio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pcmmio_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec), byte_no = chan / 8, bit_no =
return insn->n;
}
-static void init_asics(comedi_device * dev)
+static void init_asics(struct comedi_device * dev)
{ /* sets up an
ASIC chip to defaults */
int asic;
}
}
-static void switch_page(comedi_device * dev, int asic, int page)
+static void switch_page(struct comedi_device * dev, int asic, int page)
{
if (asic < 0 || asic >= thisboard->dio_num_asics)
return; /* paranoia */
}
#ifdef notused
-static void lock_port(comedi_device * dev, int asic, int port)
+static void lock_port(struct comedi_device * dev, int asic, int port)
{
if (asic < 0 || asic >= thisboard->dio_num_asics)
return; /* paranoia */
return;
}
-static void unlock_port(comedi_device * dev, int asic, int port)
+static void unlock_port(struct comedi_device * dev, int asic, int port)
{
if (asic < 0 || asic >= thisboard->dio_num_asics)
return; /* paranoia */
static irqreturn_t interrupt_pcmmio(int irq, void *d PT_REGS_ARG)
{
int asic, got1 = 0;
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
for (asic = 0; asic < MAX_ASICS; ++asic) {
if (irq == devpriv->asics[asic].irq) {
return IRQ_HANDLED;
}
-static void pcmmio_stop_intr(comedi_device * dev, comedi_subdevice * s)
+static void pcmmio_stop_intr(struct comedi_device * dev, comedi_subdevice * s)
{
int nports, firstport, asic, port;
}
}
-static int pcmmio_start_intr(comedi_device * dev, comedi_subdevice * s)
+static int pcmmio_start_intr(struct comedi_device * dev, comedi_subdevice * s)
{
if (!subpriv->dio.intr.continuous && subpriv->dio.intr.stop_count == 0) {
/* An empty acquisition! */
return 0;
}
-static int pcmmio_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pcmmio_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
* Internal trigger function to start acquisition for an 'INTERRUPT' subdevice.
*/
static int
-pcmmio_inttrig_start_intr(comedi_device * dev, comedi_subdevice * s,
+pcmmio_inttrig_start_intr(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
unsigned long flags;
/*
* 'do_cmd' function for an 'INTERRUPT' subdevice.
*/
-static int pcmmio_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcmmio_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned long flags;
* 'do_cmdtest' function for an 'INTERRUPT' subdevice.
*/
static int
-pcmmio_cmdtest(comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
+pcmmio_cmdtest(struct comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
{
int err = 0;
unsigned int tmp;
}
/* All this is for AI and AO */
-static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return 1;
}
-static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
struct {
unsigned char pagelock; /* current page and lock */
* the board, and also about the kernel module that contains
* the device code.
*/
-static int pcmuio_attach(comedi_device * dev, comedi_devconfig * it);
-static int pcmuio_detach(comedi_device * dev);
+static int pcmuio_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int pcmuio_detach(struct comedi_device * dev);
static comedi_driver driver = {
driver_name:"pcmuio",
num_names:sizeof(pcmuio_boards) / sizeof(pcmuio_board),
};
-static int pcmuio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcmuio_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pcmuio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pcmuio_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static irqreturn_t interrupt_pcmuio(int irq, void *d PT_REGS_ARG);
-static void pcmuio_stop_intr(comedi_device *, comedi_subdevice *);
-static int pcmuio_cancel(comedi_device * dev, comedi_subdevice * s);
-static int pcmuio_cmd(comedi_device * dev, comedi_subdevice * s);
-static int pcmuio_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static void pcmuio_stop_intr(struct comedi_device *, comedi_subdevice *);
+static int pcmuio_cancel(struct comedi_device * dev, comedi_subdevice * s);
+static int pcmuio_cmd(struct comedi_device * dev, comedi_subdevice * s);
+static int pcmuio_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
/* some helper functions to deal with specifics of this device's registers */
-static void init_asics(comedi_device * dev); /* sets up/clears ASIC chips to defaults */
-static void switch_page(comedi_device * dev, int asic, int page);
+static void init_asics(struct comedi_device * dev); /* sets up/clears ASIC chips to defaults */
+static void switch_page(struct comedi_device * dev, int asic, int page);
#ifdef notused
-static void lock_port(comedi_device * dev, int asic, int port);
-static void unlock_port(comedi_device * dev, int asic, int port);
+static void lock_port(struct comedi_device * dev, int asic, int port);
+static void unlock_port(struct comedi_device * dev, int asic, int port);
#endif
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int pcmuio_attach(comedi_device * dev, comedi_devconfig * it)
+static int pcmuio_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int pcmuio_detach(comedi_device * dev)
+static int pcmuio_detach(struct comedi_device * dev)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int pcmuio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcmuio_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int byte_no;
* configured by a special insn_config instruction. chanspec
* contains the channel to be changed, and data[0] contains the
* value COMEDI_INPUT or COMEDI_OUTPUT. */
-static int pcmuio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int pcmuio_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec), byte_no = chan / 8, bit_no =
return insn->n;
}
-static void init_asics(comedi_device * dev)
+static void init_asics(struct comedi_device * dev)
{ /* sets up an
ASIC chip to defaults */
int asic;
}
}
-static void switch_page(comedi_device * dev, int asic, int page)
+static void switch_page(struct comedi_device * dev, int asic, int page)
{
if (asic < 0 || asic >= thisboard->num_asics)
return; /* paranoia */
}
#ifdef notused
-static void lock_port(comedi_device * dev, int asic, int port)
+static void lock_port(struct comedi_device * dev, int asic, int port)
{
if (asic < 0 || asic >= thisboard->num_asics)
return; /* paranoia */
dev->iobase + ASIC_IOSIZE * asic + REG_PAGELOCK);
}
-static void unlock_port(comedi_device * dev, int asic, int port)
+static void unlock_port(struct comedi_device * dev, int asic, int port)
{
if (asic < 0 || asic >= thisboard->num_asics)
return; /* paranoia */
static irqreturn_t interrupt_pcmuio(int irq, void *d PT_REGS_ARG)
{
int asic, got1 = 0;
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
for (asic = 0; asic < MAX_ASICS; ++asic) {
if (irq == devpriv->asics[asic].irq) {
return IRQ_HANDLED;
}
-static void pcmuio_stop_intr(comedi_device * dev, comedi_subdevice * s)
+static void pcmuio_stop_intr(struct comedi_device * dev, comedi_subdevice * s)
{
int nports, firstport, asic, port;
}
}
-static int pcmuio_start_intr(comedi_device * dev, comedi_subdevice * s)
+static int pcmuio_start_intr(struct comedi_device * dev, comedi_subdevice * s)
{
if (!subpriv->intr.continuous && subpriv->intr.stop_count == 0) {
/* An empty acquisition! */
return 0;
}
-static int pcmuio_cancel(comedi_device * dev, comedi_subdevice * s)
+static int pcmuio_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
unsigned long flags;
* Internal trigger function to start acquisition for an 'INTERRUPT' subdevice.
*/
static int
-pcmuio_inttrig_start_intr(comedi_device * dev, comedi_subdevice * s,
+pcmuio_inttrig_start_intr(struct comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
unsigned long flags;
/*
* 'do_cmd' function for an 'INTERRUPT' subdevice.
*/
-static int pcmuio_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcmuio_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned long flags;
* 'do_cmdtest' function for an 'INTERRUPT' subdevice.
*/
static int
-pcmuio_cmdtest(comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
+pcmuio_cmdtest(struct comedi_device * dev, comedi_subdevice * s, comedi_cmd * cmd)
{
int err = 0;
unsigned int tmp;
#include <linux/ioport.h>
-static int poc_attach(comedi_device * dev, comedi_devconfig * it);
-static int poc_detach(comedi_device * dev);
-static int readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int poc_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int poc_detach(struct comedi_device * dev);
+static int readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int dac02_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int dac02_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pcl733_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl733_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int pcl734_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl734_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
struct boarddef_struct {
const char *name;
unsigned int iosize;
- int (*setup) (comedi_device *);
+ int (*setup) (struct comedi_device *);
int type;
int n_chan;
int n_bits;
- int (*winsn) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*winsn) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*rinsn) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*rinsn) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
- int (*insnbits) (comedi_device *, comedi_subdevice *, comedi_insn *,
+ int (*insnbits) (struct comedi_device *, comedi_subdevice *, comedi_insn *,
unsigned int *);
const comedi_lrange *range;
};
offset:sizeof(boards[0]),
};
-static int poc_attach(comedi_device * dev, comedi_devconfig * it)
+static int poc_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
unsigned long iobase;
return 0;
}
-static int poc_detach(comedi_device * dev)
+static int poc_detach(struct comedi_device * dev)
{
/* only free stuff if it has been allocated by _attach */
if (dev->iobase)
return 0;
}
-static int readback_insn(comedi_device * dev, comedi_subdevice * s,
+static int readback_insn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan;
#define DAC02_LSB(a) (2 * a)
#define DAC02_MSB(a) (2 * a + 1)
-static int dac02_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int dac02_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int temp;
return 1;
}
-static int pcl733_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl733_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int pcl734_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int pcl734_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
struct semaphore eos;
- comedi_device *dev;
+ struct comedi_device *dev;
comedi_subdevice *s;
int count;
} local_info_t;
/* comedi interface code */
-static int daqp_attach(comedi_device * dev, comedi_devconfig * it);
-static int daqp_detach(comedi_device * dev);
+static int daqp_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int daqp_detach(struct comedi_device * dev);
static comedi_driver driver_daqp = {
driver_name:"quatech_daqp_cs",
module:THIS_MODULE,
#ifdef DAQP_DEBUG
-static void daqp_dump(comedi_device * dev)
+static void daqp_dump(struct comedi_device * dev)
{
printk("DAQP: status %02x; aux status %02x\n",
inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX));
/* Cancel a running acquisition */
-static int daqp_ai_cancel(comedi_device * dev, comedi_subdevice * s)
+static int daqp_ai_cancel(struct comedi_device * dev, comedi_subdevice * s)
{
local_info_t *local = (local_info_t *) s->private;
static void daqp_interrupt(int irq, void *dev_id PT_REGS_ARG)
{
local_info_t *local = (local_info_t *) dev_id;
- comedi_device *dev;
+ struct comedi_device *dev;
comedi_subdevice *s;
int loop_limit = 10000;
int status;
if (!dev->attached) {
printk(KERN_WARNING
- "daqp_interrupt(): comedi_device not yet attached.\n");
+ "daqp_interrupt(): struct comedi_device not yet attached.\n");
return;
}
/* One-shot analog data acquisition routine */
-static int daqp_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int daqp_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
* the command passes.
*/
-static int daqp_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int daqp_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return 0;
}
-static int daqp_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int daqp_ai_cmd(struct comedi_device * dev, comedi_subdevice * s)
{
local_info_t *local = (local_info_t *) s->private;
comedi_cmd *cmd = &s->async->cmd;
/* Single-shot analog output routine */
-static int daqp_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int daqp_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
/* Digital input routine */
-static int daqp_di_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int daqp_di_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
/* Digital output routine */
-static int daqp_do_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int daqp_do_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
* when it is inserted.
*/
-static int daqp_attach(comedi_device * dev, comedi_devconfig * it)
+static int daqp_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int ret;
local_info_t *local = dev_table[it->options[0]];
* card is removed, daqp_cs_detach() is called by the pcmcia subsystem.
*/
-static int daqp_detach(comedi_device * dev)
+static int daqp_detach(struct comedi_device * dev)
{
printk("comedi%d: detaching daqp\n", dev->minor);
* the board, and also about the kernel module that contains
* the device code.
*/
-static int rtd_attach(comedi_device *dev, comedi_devconfig *it);
-static int rtd_detach(comedi_device *dev);
+static int rtd_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int rtd_detach(struct comedi_device *dev);
static comedi_driver rtd520Driver = {
driver_name: DRV_NAME,
detach : rtd_detach,
};
-static int rtd_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int rtd_ai_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int rtd_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+static int rtd_ao_winsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int rtd_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int rtd_ao_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int rtd_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int rtd_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int rtd_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int rtd_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int rtd_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int rtd_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
-static int rtd_ai_cmd(comedi_device *dev, comedi_subdevice *s);
-static int rtd_ai_cancel(comedi_device *dev, comedi_subdevice *s);
-/* static int rtd_ai_poll (comedi_device *dev,comedi_subdevice *s); */
+static int rtd_ai_cmd(struct comedi_device *dev, comedi_subdevice *s);
+static int rtd_ai_cancel(struct comedi_device *dev, comedi_subdevice *s);
+/* static int rtd_ai_poll (struct comedi_device *dev,comedi_subdevice *s); */
static int rtd_ns_to_timer(unsigned int *ns, int roundMode);
static irqreturn_t rtd_interrupt(int irq, void *d PT_REGS_ARG);
-static int rtd520_probe_fifo_depth(comedi_device *dev);
+static int rtd520_probe_fifo_depth(struct comedi_device *dev);
/*
* Attach is called by the Comedi core to configure the driver
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int rtd_attach(comedi_device *dev, comedi_devconfig *it)
+static int rtd_attach(struct comedi_device *dev, comedi_devconfig *it)
{ /* board name and options flags */
comedi_subdevice *s;
struct pci_dev *pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int rtd_detach(comedi_device *dev)
+static int rtd_detach(struct comedi_device *dev)
{
#ifdef USE_DMA
int index;
/*
Convert a single comedi channel-gain entry to a RTD520 table entry
*/
-static unsigned short rtdConvertChanGain(comedi_device *dev,
+static unsigned short rtdConvertChanGain(struct comedi_device *dev,
unsigned int comediChan, int chanIndex)
{ /* index in channel list */
unsigned int chan, range, aref;
/*
Setup the channel-gain table from a comedi list
*/
-static void rtd_load_channelgain_list(comedi_device *dev,
+static void rtd_load_channelgain_list(struct comedi_device *dev,
unsigned int n_chan, unsigned int *list)
{
if (n_chan > 1) { /* setup channel gain table */
/* determine fifo size by doing adc conversions until the fifo half
empty status flag clears */
-static int rtd520_probe_fifo_depth(comedi_device *dev)
+static int rtd520_probe_fifo_depth(struct comedi_device *dev)
{
unsigned int chanspec = CR_PACK(0, 0, AREF_GROUND);
unsigned i;
Note, we don't do any settling delays. Use a instruction list to
select, delay, then read.
*/
-static int rtd_ai_rinsn(comedi_device *dev,
+static int rtd_ai_rinsn(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int n, ii;
The manual claims that we can do a lword read, but it doesn't work here.
*/
-static int ai_read_n(comedi_device *dev, comedi_subdevice *s, int count)
+static int ai_read_n(struct comedi_device *dev, comedi_subdevice *s, int count)
{
int ii;
/*
unknown amout of data is waiting in fifo.
*/
-static int ai_read_dregs(comedi_device *dev, comedi_subdevice *s)
+static int ai_read_dregs(struct comedi_device *dev, comedi_subdevice *s)
{
while (RtdFifoStatus(dev) & FS_ADC_NOT_EMPTY) { /* 1 -> not empty */
short sample;
/*
Terminate a DMA transfer and wait for everything to quiet down
*/
-void abort_dma(comedi_device *dev, unsigned int channel)
+void abort_dma(struct comedi_device *dev, unsigned int channel)
{ /* DMA channel 0, 1 */
unsigned long dma_cs_addr; /* the control/status register */
uint8_t status;
Process what is in the DMA transfer buffer and pass to comedi
Note: this is not re-entrant
*/
-static int ai_process_dma(comedi_device *dev, comedi_subdevice *s)
+static int ai_process_dma(struct comedi_device *dev, comedi_subdevice *s)
{
int ii, n;
s16 *dp;
void *d /* our data */
PT_REGS_ARG)
{ /* cpu context (ignored) */
- comedi_device *dev = d; /* must be called "dev" for devpriv */
+ struct comedi_device *dev = d; /* must be called "dev" for devpriv */
u16 status;
u16 fifoStatus;
comedi_subdevice *s = dev->subdevices + 0; /* analog in subdevice */
/*
return the number of samples available
*/
-static int rtd_ai_poll(comedi_device *dev, comedi_subdevice *s)
+static int rtd_ai_poll(struct comedi_device *dev, comedi_subdevice *s)
{
/* TODO: This needs to mask interrupts, read_dregs, and then re-enable */
/* Not sure what to do if DMA is active */
the command passes.
*/
-static int rtd_ai_cmdtest(comedi_device *dev,
+static int rtd_ai_cmdtest(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd)
{
int err = 0;
This is usually done by an interrupt handler.
Userland gets to the data using read calls.
*/
-static int rtd_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int rtd_ai_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_cmd *cmd = &s->async->cmd;
int timer;
/*
Stop a running data aquisition.
*/
-static int rtd_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int rtd_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
u16 status;
/*
Output one (or more) analog values to a single port as fast as possible.
*/
-static int rtd_ao_winsn(comedi_device *dev,
+static int rtd_ao_winsn(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int rtd_ao_rinsn(comedi_device *dev,
+static int rtd_ao_rinsn(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i;
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write
*/
-static int rtd_dio_insn_bits(comedi_device *dev,
+static int rtd_dio_insn_bits(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
/*
Configure one bit on a IO port as Input or Output (hence the name :-).
*/
-static int rtd_dio_insn_config(comedi_device *dev,
+static int rtd_dio_insn_config(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
#define this_board ((const boardtype *)dev->board_ptr)
-static int rti800_attach(comedi_device * dev, comedi_devconfig * it);
-static int rti800_detach(comedi_device * dev);
+static int rti800_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int rti800_detach(struct comedi_device * dev);
static comedi_driver driver_rti800 = {
driver_name:"rti800",
module:THIS_MODULE,
// settling delay times in usec for different gains
static const int gaindelay[] = { 10, 20, 40, 80 };
-static int rti800_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int rti800_ai_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, t;
return i;
}
-static int rti800_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int rti800_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int rti800_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int rti800_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
return i;
}
-static int rti800_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int rti800_di_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int rti800_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int rti800_do_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
options[8] - dac1 coding
*/
-static int rti800_attach(comedi_device * dev, comedi_devconfig * it)
+static int rti800_attach(struct comedi_device * dev, comedi_devconfig * it)
{
unsigned int irq;
unsigned long iobase;
return 0;
}
-static int rti800_detach(comedi_device * dev)
+static int rti800_detach(struct comedi_device * dev)
{
printk("comedi%d: rti800: remove\n", dev->minor);
#define RTI802_DATALOW 1
#define RTI802_DATAHIGH 2
-static int rti802_attach(comedi_device * dev, comedi_devconfig * it);
-static int rti802_detach(comedi_device * dev);
+static int rti802_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int rti802_detach(struct comedi_device * dev);
static comedi_driver driver_rti802 = {
driver_name:"rti802",
module:THIS_MODULE,
#define devpriv ((rti802_private *)dev->private)
-static int rti802_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
+static int rti802_ao_insn_read(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
return i;
}
-static int rti802_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
+static int rti802_ao_insn_write(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i, d;
return i;
}
-static int rti802_attach(comedi_device * dev, comedi_devconfig * it)
+static int rti802_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int i;
return 0;
}
-static int rti802_detach(comedi_device * dev)
+static int rti802_detach(struct comedi_device * dev)
{
printk("comedi%d: rti802: remove\n", dev->minor);
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
int data;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int s526_attach(comedi_device * dev, comedi_devconfig * it);
-static int s526_detach(comedi_device * dev);
+static int s526_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int s526_detach(struct comedi_device * dev);
static comedi_driver driver_s526 = {
driver_name:"s526",
module:THIS_MODULE,
num_names:sizeof(s526_boards) / sizeof(s526_board),
};
-static int s526_gpct_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_gpct_winsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_ai_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int s526_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int s526_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int s526_attach(comedi_device * dev, comedi_devconfig * it)
+static int s526_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
int iobase;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int s526_detach(comedi_device * dev)
+static int s526_detach(struct comedi_device * dev)
{
printk("comedi%d: s526: remove\n", dev->minor);
return 0;
}
-static int s526_gpct_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i; // counts the Data
return i;
}
-static int s526_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int subdev_channel = CR_CHAN(insn->chanspec); // Unpack chanspec
return insn->n;
}
-static int s526_gpct_winsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_gpct_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int subdev_channel = CR_CHAN(insn->chanspec); // Unpack chanspec
}
#define ISR_ADC_DONE 0x4
-static int s526_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_ai_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int result = -EINVAL;
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
-static int s526_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
return n;
}
-static int s526_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int s526_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int s526_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int s526_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int s526_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int s526_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int s526_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
MODULE_DEVICE_TABLE(pci, s626_pci_table);
-static int s626_attach(comedi_device *dev, comedi_devconfig *it);
-static int s626_detach(comedi_device *dev);
+static int s626_attach(struct comedi_device *dev, comedi_devconfig *it);
+static int s626_detach(struct comedi_device *dev);
static comedi_driver driver_s626 = {
driver_name:"s626",
COMEDI_PCI_INITCLEANUP_NOMODULE(driver_s626, s626_pci_table);
/* ioctl routines */
-static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data); */
-static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+/* static int s626_ai_rinsn(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data); */
+static int s626_ai_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s);
-static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_cmd(struct comedi_device *dev, comedi_subdevice *s);
+static int s626_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
-static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s);
-static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_cancel(struct comedi_device *dev, comedi_subdevice *s);
+static int s626_ao_winsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int s626_ao_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int s626_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_dio_set_irq(comedi_device *dev, unsigned int chan);
-static int s626_dio_reset_irq(comedi_device *dev, unsigned int gruop,
+static int s626_dio_set_irq(struct comedi_device *dev, unsigned int chan);
+static int s626_dio_reset_irq(struct comedi_device *dev, unsigned int gruop,
unsigned int mask);
-static int s626_dio_clear_irq(comedi_device *dev);
-static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_dio_clear_irq(struct comedi_device *dev);
+static int s626_enc_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int s626_enc_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
-static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int s626_enc_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data);
static int s626_ns_to_timer(int *nanosec, int round_mode);
static int s626_ai_load_polllist(uint8_t *ppl, comedi_cmd *cmd);
-static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_inttrig(struct comedi_device *dev, comedi_subdevice *s,
unsigned int trignum);
static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG);
static unsigned int s626_ai_reg_to_uint(int data);
/* end ioctl routines */
/* internal routines */
-static void s626_dio_init(comedi_device *dev);
-static void ResetADC(comedi_device *dev, uint8_t *ppl);
-static void LoadTrimDACs(comedi_device *dev);
-static void WriteTrimDAC(comedi_device *dev, uint8_t LogicalChan,
+static void s626_dio_init(struct comedi_device *dev);
+static void ResetADC(struct comedi_device *dev, uint8_t *ppl);
+static void LoadTrimDACs(struct comedi_device *dev);
+static void WriteTrimDAC(struct comedi_device *dev, uint8_t LogicalChan,
uint8_t DacData);
-static uint8_t I2Cread(comedi_device *dev, uint8_t addr);
-static uint32_t I2Chandshake(comedi_device *dev, uint32_t val);
-static void SetDAC(comedi_device *dev, uint16_t chan, short dacdata);
-static void SendDAC(comedi_device *dev, uint32_t val);
-static void WriteMISC2(comedi_device *dev, uint16_t NewImage);
-static void DEBItransfer(comedi_device *dev);
-static uint16_t DEBIread(comedi_device *dev, uint16_t addr);
-static void DEBIwrite(comedi_device *dev, uint16_t addr, uint16_t wdata);
-static void DEBIreplace(comedi_device *dev, uint16_t addr, uint16_t mask,
+static uint8_t I2Cread(struct comedi_device *dev, uint8_t addr);
+static uint32_t I2Chandshake(struct comedi_device *dev, uint32_t val);
+static void SetDAC(struct comedi_device *dev, uint16_t chan, short dacdata);
+static void SendDAC(struct comedi_device *dev, uint32_t val);
+static void WriteMISC2(struct comedi_device *dev, uint16_t NewImage);
+static void DEBItransfer(struct comedi_device *dev);
+static uint16_t DEBIread(struct comedi_device *dev, uint16_t addr);
+static void DEBIwrite(struct comedi_device *dev, uint16_t addr, uint16_t wdata);
+static void DEBIreplace(struct comedi_device *dev, uint16_t addr, uint16_t mask,
uint16_t wdata);
-static void CloseDMAB(comedi_device *dev, DMABUF *pdma, size_t bsize);
+static void CloseDMAB(struct comedi_device *dev, DMABUF *pdma, size_t bsize);
/* COUNTER OBJECT ------------------------------------------------ */
struct enc_private {
/* Pointers to functions that differ for A and B counters: */
- uint16_t(*GetEnable) (comedi_device *dev, struct enc_private *); /* Return clock enable. */
- uint16_t(*GetIntSrc) (comedi_device *dev, struct enc_private *); /* Return interrupt source. */
- uint16_t(*GetLoadTrig) (comedi_device *dev, struct enc_private *); /* Return preload trigger source. */
- uint16_t(*GetMode) (comedi_device *dev, struct enc_private *); /* Return standardized operating mode. */
- void (*PulseIndex) (comedi_device *dev, struct enc_private *); /* Generate soft index strobe. */
- void (*SetEnable) (comedi_device *dev, struct enc_private *, uint16_t enab); /* Program clock enable. */
- void (*SetIntSrc) (comedi_device *dev, struct enc_private *, uint16_t IntSource); /* Program interrupt source. */
- void (*SetLoadTrig) (comedi_device *dev, struct enc_private *, uint16_t Trig); /* Program preload trigger source. */
- void (*SetMode) (comedi_device *dev, struct enc_private *, uint16_t Setup, uint16_t DisableIntSrc); /* Program standardized operating mode. */
- void (*ResetCapFlags) (comedi_device *dev, struct enc_private *); /* Reset event capture flags. */
+ uint16_t(*GetEnable) (struct comedi_device *dev, struct enc_private *); /* Return clock enable. */
+ uint16_t(*GetIntSrc) (struct comedi_device *dev, struct enc_private *); /* Return interrupt source. */
+ uint16_t(*GetLoadTrig) (struct comedi_device *dev, struct enc_private *); /* Return preload trigger source. */
+ uint16_t(*GetMode) (struct comedi_device *dev, struct enc_private *); /* Return standardized operating mode. */
+ void (*PulseIndex) (struct comedi_device *dev, struct enc_private *); /* Generate soft index strobe. */
+ void (*SetEnable) (struct comedi_device *dev, struct enc_private *, uint16_t enab); /* Program clock enable. */
+ void (*SetIntSrc) (struct comedi_device *dev, struct enc_private *, uint16_t IntSource); /* Program interrupt source. */
+ void (*SetLoadTrig) (struct comedi_device *dev, struct enc_private *, uint16_t Trig); /* Program preload trigger source. */
+ void (*SetMode) (struct comedi_device *dev, struct enc_private *, uint16_t Setup, uint16_t DisableIntSrc); /* Program standardized operating mode. */
+ void (*ResetCapFlags) (struct comedi_device *dev, struct enc_private *); /* Reset event capture flags. */
uint16_t MyCRA; /* Address of CRA register. */
uint16_t MyCRB; /* Address of CRB register. */
#define encpriv ((struct enc_private *)(dev->subdevices+5)->private)
/* counters routines */
-static void s626_timer_load(comedi_device *dev, struct enc_private *k, int tick);
-static uint32_t ReadLatch(comedi_device *dev, struct enc_private *k);
-static void ResetCapFlags_A(comedi_device *dev, struct enc_private *k);
-static void ResetCapFlags_B(comedi_device *dev, struct enc_private *k);
-static uint16_t GetMode_A(comedi_device *dev, struct enc_private *k);
-static uint16_t GetMode_B(comedi_device *dev, struct enc_private *k);
-static void SetMode_A(comedi_device *dev, struct enc_private *k, uint16_t Setup,
+static void s626_timer_load(struct comedi_device *dev, struct enc_private *k, int tick);
+static uint32_t ReadLatch(struct comedi_device *dev, struct enc_private *k);
+static void ResetCapFlags_A(struct comedi_device *dev, struct enc_private *k);
+static void ResetCapFlags_B(struct comedi_device *dev, struct enc_private *k);
+static uint16_t GetMode_A(struct comedi_device *dev, struct enc_private *k);
+static uint16_t GetMode_B(struct comedi_device *dev, struct enc_private *k);
+static void SetMode_A(struct comedi_device *dev, struct enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc);
-static void SetMode_B(comedi_device *dev, struct enc_private *k, uint16_t Setup,
+static void SetMode_B(struct comedi_device *dev, struct enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc);
-static void SetEnable_A(comedi_device *dev, struct enc_private *k, uint16_t enab);
-static void SetEnable_B(comedi_device *dev, struct enc_private *k, uint16_t enab);
-static uint16_t GetEnable_A(comedi_device *dev, struct enc_private *k);
-static uint16_t GetEnable_B(comedi_device *dev, struct enc_private *k);
-static void SetLatchSource(comedi_device *dev, struct enc_private *k,
+static void SetEnable_A(struct comedi_device *dev, struct enc_private *k, uint16_t enab);
+static void SetEnable_B(struct comedi_device *dev, struct enc_private *k, uint16_t enab);
+static uint16_t GetEnable_A(struct comedi_device *dev, struct enc_private *k);
+static uint16_t GetEnable_B(struct comedi_device *dev, struct enc_private *k);
+static void SetLatchSource(struct comedi_device *dev, struct enc_private *k,
uint16_t value);
-/* static uint16_t GetLatchSource(comedi_device *dev, struct enc_private *k ); */
-static void SetLoadTrig_A(comedi_device *dev, struct enc_private *k, uint16_t Trig);
-static void SetLoadTrig_B(comedi_device *dev, struct enc_private *k, uint16_t Trig);
-static uint16_t GetLoadTrig_A(comedi_device *dev, struct enc_private *k);
-static uint16_t GetLoadTrig_B(comedi_device *dev, struct enc_private *k);
-static void SetIntSrc_B(comedi_device *dev, struct enc_private *k,
+/* static uint16_t GetLatchSource(struct comedi_device *dev, struct enc_private *k ); */
+static void SetLoadTrig_A(struct comedi_device *dev, struct enc_private *k, uint16_t Trig);
+static void SetLoadTrig_B(struct comedi_device *dev, struct enc_private *k, uint16_t Trig);
+static uint16_t GetLoadTrig_A(struct comedi_device *dev, struct enc_private *k);
+static uint16_t GetLoadTrig_B(struct comedi_device *dev, struct enc_private *k);
+static void SetIntSrc_B(struct comedi_device *dev, struct enc_private *k,
uint16_t IntSource);
-static void SetIntSrc_A(comedi_device *dev, struct enc_private *k,
+static void SetIntSrc_A(struct comedi_device *dev, struct enc_private *k,
uint16_t IntSource);
-static uint16_t GetIntSrc_A(comedi_device *dev, struct enc_private *k);
-static uint16_t GetIntSrc_B(comedi_device *dev, struct enc_private *k);
-/* static void SetClkMult(comedi_device *dev, struct enc_private *k, uint16_t value ) ; */
-/* static uint16_t GetClkMult(comedi_device *dev, struct enc_private *k ) ; */
-/* static void SetIndexPol(comedi_device *dev, struct enc_private *k, uint16_t value ); */
-/* static uint16_t GetClkPol(comedi_device *dev, struct enc_private *k ) ; */
-/* static void SetIndexSrc( comedi_device *dev,struct enc_private *k, uint16_t value ); */
-/* static uint16_t GetClkSrc( comedi_device *dev,struct enc_private *k ); */
-/* static void SetIndexSrc( comedi_device *dev,struct enc_private *k, uint16_t value ); */
-/* static uint16_t GetIndexSrc( comedi_device *dev,struct enc_private *k ); */
-static void PulseIndex_A(comedi_device *dev, struct enc_private *k);
-static void PulseIndex_B(comedi_device *dev, struct enc_private *k);
-static void Preload(comedi_device *dev, struct enc_private *k, uint32_t value);
-static void CountersInit(comedi_device *dev);
+static uint16_t GetIntSrc_A(struct comedi_device *dev, struct enc_private *k);
+static uint16_t GetIntSrc_B(struct comedi_device *dev, struct enc_private *k);
+/* static void SetClkMult(struct comedi_device *dev, struct enc_private *k, uint16_t value ) ; */
+/* static uint16_t GetClkMult(struct comedi_device *dev, struct enc_private *k ) ; */
+/* static void SetIndexPol(struct comedi_device *dev, struct enc_private *k, uint16_t value ); */
+/* static uint16_t GetClkPol(struct comedi_device *dev, struct enc_private *k ) ; */
+/* static void SetIndexSrc( struct comedi_device *dev,struct enc_private *k, uint16_t value ); */
+/* static uint16_t GetClkSrc( struct comedi_device *dev,struct enc_private *k ); */
+/* static void SetIndexSrc( struct comedi_device *dev,struct enc_private *k, uint16_t value ); */
+/* static uint16_t GetIndexSrc( struct comedi_device *dev,struct enc_private *k ); */
+static void PulseIndex_A(struct comedi_device *dev, struct enc_private *k);
+static void PulseIndex_B(struct comedi_device *dev, struct enc_private *k);
+static void Preload(struct comedi_device *dev, struct enc_private *k, uint32_t value);
+static void CountersInit(struct comedi_device *dev);
/* end internal routines */
/* Counter objects constructor. */
}
};
-static int s626_attach(comedi_device *dev, comedi_devconfig *it)
+static int s626_attach(struct comedi_device *dev, comedi_devconfig *it)
{
/* uint8_t PollList; */
/* uint16_t AdcData; */
static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
comedi_subdevice *s;
comedi_cmd *cmd;
struct enc_private *k;
return IRQ_HANDLED;
}
-static int s626_detach(comedi_device *dev)
+static int s626_detach(struct comedi_device *dev)
{
if (devpriv) {
/* stop ai_command */
/*
* this functions build the RPS program for hardware driven acquistion
*/
-void ResetADC(comedi_device *dev, uint8_t *ppl)
+void ResetADC(struct comedi_device *dev, uint8_t *ppl)
{
register uint32_t *pRPS;
uint32_t JmpAdrs;
}
/* TO COMPLETE, IF NECESSARY */
-static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}
-/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) */
+/* static int s626_ai_rinsn(struct comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) */
/* { */
/* register uint8_t i; */
/* register int32_t *readaddr; */
/* return i; */
/* } */
-static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
uint16_t chan = CR_CHAN(insn->chanspec);
return n;
}
-static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_inttrig(struct comedi_device *dev, comedi_subdevice *s,
unsigned int trignum)
{
if (trignum != 0)
}
/* TO COMPLETE */
-static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int s626_ai_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
uint8_t ppl[16];
return 0;
}
-static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int s626_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
int err = 0;
return 0;
}
-static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int s626_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
/* Stop RPS program in case it is currently running. */
MC_DISABLE(P_MC1, MC1_ERPS1);
return divider - 1;
}
-static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+static int s626_ao_winsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return i;
}
-static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+static int s626_ao_rinsn(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i;
* ports A, B and C, respectively.
*/
-static void s626_dio_init(comedi_device *dev)
+static void s626_dio_init(struct comedi_device *dev)
{
uint16_t group;
comedi_subdevice *s;
* This allows packed reading/writing of the DIO channels. The comedi
* core can convert between insn_bits and insn_read/write */
-static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int s626_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return 2;
}
-static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return 1;
}
-static int s626_dio_set_irq(comedi_device *dev, unsigned int chan)
+static int s626_dio_set_irq(struct comedi_device *dev, unsigned int chan)
{
unsigned int group;
unsigned int bitmask;
return 0;
}
-static int s626_dio_reset_irq(comedi_device *dev, unsigned int group,
+static int s626_dio_reset_irq(struct comedi_device *dev, unsigned int group,
unsigned int mask)
{
DEBUG("s626_dio_reset_irq: disable interrupt on dio channel %d group %d\n", mask, group);
return 0;
}
-static int s626_dio_clear_irq(comedi_device *dev)
+static int s626_dio_clear_irq(struct comedi_device *dev)
{
unsigned int group;
/* Now this function initializes the value of the counter (data[0])
and set the subdevice. To complete with trigger and interrupt
configuration */
-static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int s626_enc_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
return insn->n;
}
-static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int s626_enc_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return n;
}
-static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int s626_enc_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
return 1;
}
-static void s626_timer_load(comedi_device *dev, struct enc_private *k, int tick)
+static void s626_timer_load(struct comedi_device *dev, struct enc_private *k, int tick)
{
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
/* index. */
static uint8_t trimadrs[] =
{ 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 };
-static void LoadTrimDACs(comedi_device *dev)
+static void LoadTrimDACs(struct comedi_device *dev)
{
register uint8_t i;
WriteTrimDAC(dev, i, I2Cread(dev, trimadrs[i]));
}
-static void WriteTrimDAC(comedi_device *dev, uint8_t LogicalChan,
+static void WriteTrimDAC(struct comedi_device *dev, uint8_t LogicalChan,
uint8_t DacData)
{
uint32_t chan;
/* ************** EEPROM ACCESS FUNCTIONS ************** */
/* Read uint8_t from EEPROM. */
-static uint8_t I2Cread(comedi_device *dev, uint8_t addr)
+static uint8_t I2Cread(struct comedi_device *dev, uint8_t addr)
{
uint8_t rtnval;
return rtnval;
}
-static uint32_t I2Chandshake(comedi_device *dev, uint32_t val)
+static uint32_t I2Chandshake(struct comedi_device *dev, uint32_t val)
{
/* Write I2C command to I2C Transfer Control shadow register. */
WR7146(P_I2CCTRL, val);
/* Private helper function: Write setpoint to an application DAC channel. */
-static void SetDAC(comedi_device *dev, uint16_t chan, short dacdata)
+static void SetDAC(struct comedi_device *dev, uint16_t chan, short dacdata)
{
register uint16_t signmask;
register uint32_t WSImage;
* Dacpol contains valid target image.
*/
-static void SendDAC(comedi_device *dev, uint32_t val)
+static void SendDAC(struct comedi_device *dev, uint32_t val)
{
/* START THE SERIAL CLOCK RUNNING ------------- */
;
}
-static void WriteMISC2(comedi_device *dev, uint16_t NewImage)
+static void WriteMISC2(struct comedi_device *dev, uint16_t NewImage)
{
DEBIwrite(dev, LP_MISC1, MISC1_WENABLE); /* enab writes to */
/* MISC2 register. */
/* Initialize the DEBI interface for all transfers. */
-static uint16_t DEBIread(comedi_device *dev, uint16_t addr)
+static uint16_t DEBIread(struct comedi_device *dev, uint16_t addr)
{
uint16_t retval;
/* Execute a DEBI transfer. This must be called from within a */
/* critical section. */
-static void DEBItransfer(comedi_device *dev)
+static void DEBItransfer(struct comedi_device *dev)
{
/* Initiate upload of shadow RAM to DEBI control register. */
MC_ENABLE(P_MC2, MC2_UPLD_DEBI);
}
/* Write a value to a gate array register. */
-static void DEBIwrite(comedi_device *dev, uint16_t addr, uint16_t wdata)
+static void DEBIwrite(struct comedi_device *dev, uint16_t addr, uint16_t wdata)
{
/* Set up DEBI control register value in shadow RAM. */
* specifies bits that are to be preserved, wdata is new value to be
* or'd with the masked original.
*/
-static void DEBIreplace(comedi_device *dev, uint16_t addr, uint16_t mask,
+static void DEBIreplace(struct comedi_device *dev, uint16_t addr, uint16_t mask,
uint16_t wdata)
{
DEBItransfer(dev); /* Execute the DEBI Write transfer. */
}
-static void CloseDMAB(comedi_device *dev, DMABUF *pdma, size_t bsize)
+static void CloseDMAB(struct comedi_device *dev, DMABUF *pdma, size_t bsize)
{
void *vbptr;
dma_addr_t vpptr;
/* Read a counter's output latch. */
-static uint32_t ReadLatch(comedi_device *dev, struct enc_private *k)
+static uint32_t ReadLatch(struct comedi_device *dev, struct enc_private *k)
{
register uint32_t value;
/* DEBUG FIXME DEBUG("ReadLatch: Read Latch enter\n"); */
/* Reset a counter's index and overflow event capture flags. */
-static void ResetCapFlags_A(comedi_device *dev, struct enc_private *k)
+static void ResetCapFlags_A(struct comedi_device *dev, struct enc_private *k)
{
DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL),
CRBMSK_INTRESETCMD | CRBMSK_INTRESET_A);
}
-static void ResetCapFlags_B(comedi_device *dev, struct enc_private *k)
+static void ResetCapFlags_B(struct comedi_device *dev, struct enc_private *k)
{
DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL),
CRBMSK_INTRESETCMD | CRBMSK_INTRESET_B);
/* Return counter setup in a format (COUNTER_SETUP) that is consistent */
/* for both A and B counters. */
-static uint16_t GetMode_A(comedi_device *dev, struct enc_private *k)
+static uint16_t GetMode_A(struct comedi_device *dev, struct enc_private *k)
{
register uint16_t cra;
register uint16_t crb;
return setup;
}
-static uint16_t GetMode_B(comedi_device *dev, struct enc_private *k)
+static uint16_t GetMode_B(struct comedi_device *dev, struct enc_private *k)
{
register uint16_t cra;
register uint16_t crb;
* ClkPol, ClkEnab, IndexSrc, IndexPol, LoadSrc.
*/
-static void SetMode_A(comedi_device *dev, struct enc_private *k, uint16_t Setup,
+static void SetMode_A(struct comedi_device *dev, struct enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc)
{
register uint16_t cra;
(uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_A)), crb);
}
-static void SetMode_B(comedi_device *dev, struct enc_private *k, uint16_t Setup,
+static void SetMode_B(struct comedi_device *dev, struct enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc)
{
register uint16_t cra;
/* Return/set a counter's enable. enab: 0=always enabled, 1=enabled by index. */
-static void SetEnable_A(comedi_device *dev, struct enc_private *k, uint16_t enab)
+static void SetEnable_A(struct comedi_device *dev, struct enc_private *k, uint16_t enab)
{
DEBUG("SetEnable_A: SetEnable_A enter 3541\n");
DEBIreplace(dev, k->MyCRB,
(uint16_t) (enab << CRBBIT_CLKENAB_A));
}
-static void SetEnable_B(comedi_device *dev, struct enc_private *k, uint16_t enab)
+static void SetEnable_B(struct comedi_device *dev, struct enc_private *k, uint16_t enab)
{
DEBIreplace(dev, k->MyCRB,
(uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_B)),
(uint16_t) (enab << CRBBIT_CLKENAB_B));
}
-static uint16_t GetEnable_A(comedi_device *dev, struct enc_private *k)
+static uint16_t GetEnable_A(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_A) & 1;
}
-static uint16_t GetEnable_B(comedi_device *dev, struct enc_private *k)
+static uint16_t GetEnable_B(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_B) & 1;
}
* latches B.
*/
-static void SetLatchSource(comedi_device *dev, struct enc_private *k, uint16_t value)
+static void SetLatchSource(struct comedi_device *dev, struct enc_private *k, uint16_t value)
{
DEBUG("SetLatchSource: SetLatchSource enter 3550 \n");
DEBIreplace(dev, k->MyCRB,
}
/*
- * static uint16_t GetLatchSource(comedi_device *dev, struct enc_private *k )
+ * static uint16_t GetLatchSource(struct comedi_device *dev, struct enc_private *k )
* {
* return ( DEBIread( dev, k->MyCRB) >> CRBBIT_LATCHSRC ) & 3;
* }
* 2=OverflowA (B counters only), 3=disabled.
*/
-static void SetLoadTrig_A(comedi_device *dev, struct enc_private *k, uint16_t Trig)
+static void SetLoadTrig_A(struct comedi_device *dev, struct enc_private *k, uint16_t Trig)
{
DEBIreplace(dev, k->MyCRA, (uint16_t) (~CRAMSK_LOADSRC_A),
(uint16_t) (Trig << CRABIT_LOADSRC_A));
}
-static void SetLoadTrig_B(comedi_device *dev, struct enc_private *k, uint16_t Trig)
+static void SetLoadTrig_B(struct comedi_device *dev, struct enc_private *k, uint16_t Trig)
{
DEBIreplace(dev, k->MyCRB,
(uint16_t) (~(CRBMSK_LOADSRC_B | CRBMSK_INTCTRL)),
(uint16_t) (Trig << CRBBIT_LOADSRC_B));
}
-static uint16_t GetLoadTrig_A(comedi_device *dev, struct enc_private *k)
+static uint16_t GetLoadTrig_A(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRA) >> CRABIT_LOADSRC_A) & 3;
}
-static uint16_t GetLoadTrig_B(comedi_device *dev, struct enc_private *k)
+static uint16_t GetLoadTrig_B(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRB) >> CRBBIT_LOADSRC_B) & 3;
}
* 2=IndexOnly, 3=IndexAndOverflow.
*/
-static void SetIntSrc_A(comedi_device *dev, struct enc_private *k,
+static void SetIntSrc_A(struct comedi_device *dev, struct enc_private *k,
uint16_t IntSource)
{
/* Reset any pending counter overflow or index captures. */
MyEventBits[IntSource];
}
-static void SetIntSrc_B(comedi_device *dev, struct enc_private *k,
+static void SetIntSrc_B(struct comedi_device *dev, struct enc_private *k,
uint16_t IntSource)
{
uint16_t crb;
MyEventBits[IntSource];
}
-static uint16_t GetIntSrc_A(comedi_device *dev, struct enc_private *k)
+static uint16_t GetIntSrc_A(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRA) >> CRABIT_INTSRC_A) & 3;
}
-static uint16_t GetIntSrc_B(comedi_device *dev, struct enc_private *k)
+static uint16_t GetIntSrc_B(struct comedi_device *dev, struct enc_private *k)
{
return (DEBIread(dev, k->MyCRB) >> CRBBIT_INTSRC_B) & 3;
}
/* Return/set the clock multiplier. */
-/* static void SetClkMult(comedi_device *dev, struct enc_private *k, uint16_t value ) */
+/* static void SetClkMult(struct comedi_device *dev, struct enc_private *k, uint16_t value ) */
/* { */
/* k->SetMode(dev, k, (uint16_t)( ( k->GetMode(dev, k ) & ~STDMSK_CLKMULT ) | ( value << STDBIT_CLKMULT ) ), FALSE ); */
/* } */
-/* static uint16_t GetClkMult(comedi_device *dev, struct enc_private *k ) */
+/* static uint16_t GetClkMult(struct comedi_device *dev, struct enc_private *k ) */
/* { */
/* return ( k->GetMode(dev, k ) >> STDBIT_CLKMULT ) & 3; */
/* } */
/* Return/set the clock polarity. */
-/* static void SetClkPol( comedi_device *dev,struct enc_private *k, uint16_t value ) */
+/* static void SetClkPol( struct comedi_device *dev,struct enc_private *k, uint16_t value ) */
/* { */
/* k->SetMode(dev, k, (uint16_t)( ( k->GetMode(dev, k ) & ~STDMSK_CLKPOL ) | ( value << STDBIT_CLKPOL ) ), FALSE ); */
/* } */
-/* static uint16_t GetClkPol(comedi_device *dev, struct enc_private *k ) */
+/* static uint16_t GetClkPol(struct comedi_device *dev, struct enc_private *k ) */
/* { */
/* return ( k->GetMode(dev, k ) >> STDBIT_CLKPOL ) & 1; */
/* } */
/* Return/set the clock source. */
-/* static void SetClkSrc( comedi_device *dev,struct enc_private *k, uint16_t value ) */
+/* static void SetClkSrc( struct comedi_device *dev,struct enc_private *k, uint16_t value ) */
/* { */
/* k->SetMode(dev, k, (uint16_t)( ( k->GetMode(dev, k ) & ~STDMSK_CLKSRC ) | ( value << STDBIT_CLKSRC ) ), FALSE ); */
/* } */
-/* static uint16_t GetClkSrc( comedi_device *dev,struct enc_private *k ) */
+/* static uint16_t GetClkSrc( struct comedi_device *dev,struct enc_private *k ) */
/* { */
/* return ( k->GetMode(dev, k ) >> STDBIT_CLKSRC ) & 3; */
/* } */
/* Return/set the index polarity. */
-/* static void SetIndexPol(comedi_device *dev, struct enc_private *k, uint16_t value ) */
+/* static void SetIndexPol(struct comedi_device *dev, struct enc_private *k, uint16_t value ) */
/* { */
/* k->SetMode(dev, k, (uint16_t)( ( k->GetMode(dev, k ) & ~STDMSK_INDXPOL ) | ( (value != 0) << STDBIT_INDXPOL ) ), FALSE ); */
/* } */
-/* static uint16_t GetIndexPol(comedi_device *dev, struct enc_private *k ) */
+/* static uint16_t GetIndexPol(struct comedi_device *dev, struct enc_private *k ) */
/* { */
/* return ( k->GetMode(dev, k ) >> STDBIT_INDXPOL ) & 1; */
/* } */
/* Return/set the index source. */
-/* static void SetIndexSrc(comedi_device *dev, struct enc_private *k, uint16_t value ) */
+/* static void SetIndexSrc(struct comedi_device *dev, struct enc_private *k, uint16_t value ) */
/* { */
/* DEBUG("SetIndexSrc: set index src enter 3700\n"); */
/* k->SetMode(dev, k, (uint16_t)( ( k->GetMode(dev, k ) & ~STDMSK_INDXSRC ) | ( (value != 0) << STDBIT_INDXSRC ) ), FALSE ); */
/* } */
-/* static uint16_t GetIndexSrc(comedi_device *dev, struct enc_private *k ) */
+/* static uint16_t GetIndexSrc(struct comedi_device *dev, struct enc_private *k ) */
/* { */
/* return ( k->GetMode(dev, k ) >> STDBIT_INDXSRC ) & 1; */
/* } */
/* Generate an index pulse. */
-static void PulseIndex_A(comedi_device *dev, struct enc_private *k)
+static void PulseIndex_A(struct comedi_device *dev, struct enc_private *k)
{
register uint16_t cra;
DEBIwrite(dev, k->MyCRA, cra);
}
-static void PulseIndex_B(comedi_device *dev, struct enc_private *k)
+static void PulseIndex_B(struct comedi_device *dev, struct enc_private *k)
{
register uint16_t crb;
/* Write value into counter preload register. */
-static void Preload(comedi_device *dev, struct enc_private *k, uint32_t value)
+static void Preload(struct comedi_device *dev, struct enc_private *k, uint32_t value)
{
DEBUG("Preload: preload enter\n");
DEBIwrite(dev, (uint16_t) (k->MyLatchLsw), (uint16_t) value); /* Write value to preload register. */
(uint16_t) (value >> 16));
}
-static void CountersInit(comedi_device *dev)
+static void CountersInit(struct comedi_device *dev)
{
int chan;
struct enc_private *k;
*/
#define devpriv ((serial2002_private *)dev->private)
-static int serial2002_attach(comedi_device * dev, comedi_devconfig * it);
-static int serial2002_detach(comedi_device * dev);
+static int serial2002_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int serial2002_detach(struct comedi_device * dev);
comedi_driver driver_serial2002 = {
driver_name:"serial2002",
module:THIS_MODULE,
num_names:sizeof(serial2002_boards) / sizeof(serial2002_board),
};
-static int serial2002_di_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_di_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int serial2002_do_winsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_do_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int serial2002_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int serial2002_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int serial2002_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
struct serial_data {
}
}
-static void serial_2002_open(comedi_device * dev)
+static void serial_2002_open(struct comedi_device * dev)
{
char port[20];
}
}
-static void serial_2002_close(comedi_device * dev)
+static void serial_2002_close(struct comedi_device * dev)
{
if (!IS_ERR(devpriv->tty) && (devpriv->tty != 0)) {
filp_close(devpriv->tty, 0);
}
}
-static int serial2002_di_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_di_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_do_winsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_do_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_ei_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int serial2002_ei_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n;
return n;
}
-static int serial2002_attach(comedi_device * dev, comedi_devconfig * it)
+static int serial2002_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
return 1;
}
-static int serial2002_detach(comedi_device * dev)
+static int serial2002_detach(struct comedi_device * dev)
{
comedi_subdevice *s;
int i;
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct. */
typedef struct {
int data;
* the board, and also about the kernel module that contains
* the device code.
*/
-static int skel_attach(comedi_device * dev, comedi_devconfig * it);
-static int skel_detach(comedi_device * dev);
+static int skel_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int skel_detach(struct comedi_device * dev);
static comedi_driver driver_skel = {
driver_name:"dummy",
module:THIS_MODULE,
num_names:sizeof(skel_boards) / sizeof(skel_board),
};
-static int skel_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int skel_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int skel_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int skel_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int skel_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int skel_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int skel_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
-static int skel_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int skel_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int skel_ns_to_timer(unsigned int *ns, int round);
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int skel_attach(comedi_device * dev, comedi_devconfig * it)
+static int skel_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int skel_detach(comedi_device * dev)
+static int skel_detach(struct comedi_device * dev)
{
printk("comedi%d: skel: remove\n", dev->minor);
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
-static int skel_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ai_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int n, i;
return n;
}
-static int skel_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
+static int skel_ai_cmdtest(struct comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
int err = 0;
return *ns;
}
-static int skel_ao_winsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ao_winsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int skel_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
+static int skel_ao_rinsn(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int i;
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-static int skel_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
+static int skel_dio_insn_bits(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return 2;
}
-static int skel_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
+static int skel_dio_insn_config(struct comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
/* In the following section we define the API of this driver. */
/* ------------------------------------------------------------------------- */
-static int dnp_attach(comedi_device * dev, comedi_devconfig * it);
-static int dnp_detach(comedi_device * dev);
+static int dnp_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int dnp_detach(struct comedi_device * dev);
static comedi_driver driver_dnp = {
driver_name:"ssv_dnp",
COMEDI_INITCLEANUP(driver_dnp);
-static int dnp_dio_insn_bits(comedi_device * dev,
+static int dnp_dio_insn_bits(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
-static int dnp_dio_insn_config(comedi_device * dev,
+static int dnp_dio_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/* ------------------------------------------------------------------------- */
/* dev->board_ptr contains that address. */
/* ------------------------------------------------------------------------- */
-static int dnp_attach(comedi_device * dev, comedi_devconfig * it)
+static int dnp_attach(struct comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
/* deallocated automatically by the core. */
/* ------------------------------------------------------------------------- */
-static int dnp_detach(comedi_device * dev)
+static int dnp_detach(struct comedi_device * dev)
{
/* configure all ports as input (default) */
/* are able to use these instructions as well. */
/* ------------------------------------------------------------------------- */
-static int dnp_dio_insn_bits(comedi_device * dev,
+static int dnp_dio_insn_bits(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
/* COMEDI_INPUT or COMEDI_OUTPUT. */
/* ------------------------------------------------------------------------- */
-static int dnp_dio_insn_config(comedi_device * dev,
+static int dnp_dio_insn_config(struct comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
unsigned char usp_prev_cn_val[3]; /* previous channel value */
} unioxx5_subd_priv;
-static int unioxx5_attach(comedi_device * dev, comedi_devconfig * it);
-static int unioxx5_subdev_write(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_attach(struct comedi_device * dev, comedi_devconfig * it);
+static int unioxx5_subdev_write(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data);
-static int unioxx5_subdev_read(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_subdev_read(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data);
-static int unioxx5_insn_config(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_insn_config(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data);
-static int unioxx5_detach(comedi_device * dev);
+static int unioxx5_detach(struct comedi_device * dev);
static int __unioxx5_subdev_init(comedi_subdevice * subdev, int subdev_iobase,
int minor);
static int __unioxx5_digital_write(unioxx5_subd_priv * usp, unsigned int * data,
COMEDI_INITCLEANUP(unioxx5_driver);
-static int unioxx5_attach(comedi_device * dev, comedi_devconfig * it)
+static int unioxx5_attach(struct comedi_device * dev, comedi_devconfig * it)
{
int iobase, i, n_subd;
int id, num, ba;
return 0;
}
-static int unioxx5_subdev_read(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_subdev_read(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data)
{
unioxx5_subd_priv *usp = subdev->private;
return 1;
}
-static int unioxx5_subdev_write(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_subdev_write(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data)
{
unioxx5_subd_priv *usp = subdev->private;
}
/* for digital modules only */
-static int unioxx5_insn_config(comedi_device * dev, comedi_subdevice * subdev,
+static int unioxx5_insn_config(struct comedi_device * dev, comedi_subdevice * subdev,
comedi_insn * insn, unsigned int * data)
{
int channel_offset, flags, channel = CR_CHAN(insn->chanspec), type;
return 0;
}
-static int unioxx5_detach(comedi_device * dev)
+static int unioxx5_detach(struct comedi_device * dev)
{
int i;
comedi_subdevice *subdev;
/* interface structure in 2.6 */
struct usb_interface *interface;
/* comedi device for the interrupt context */
- comedi_device *comedidev;
+ struct comedi_device *comedidev;
/* is it USB_SPEED_HIGH or not? */
short int high_speed;
/* asynchronous command is running */
* This will cancel a running acquisition operation.
* This is called by comedi but never from inside the driver.
*/
-static int usbdux_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
struct usbduxsub *this_usbduxsub;
int res = 0;
{
int i, err, n;
struct usbduxsub *this_usbduxsub;
- comedi_device *this_comedidev;
+ struct comedi_device *this_comedidev;
comedi_subdevice *s;
/* the context variable points to the subdevice */
}
/* force unlink, is called by comedi */
-static int usbdux_ao_cancel(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_ao_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
struct usbduxsub *this_usbduxsub = dev->private;
int res = 0;
int i, ret;
int8_t *datap;
struct usbduxsub *this_usbduxsub;
- comedi_device *this_comedidev;
+ struct comedi_device *this_comedidev;
comedi_subdevice *s;
/* the context variable points to the subdevice */
return 0;
}
-static int usbdux_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ai_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
int err = 0, tmp, i;
return -EFAULT;
}
-static int usbdux_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ai_inttrig(struct comedi_device *dev, comedi_subdevice *s,
unsigned int trignum)
{
int ret;
return 1;
}
-static int usbdux_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_ai_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, range;
}
/* Mode 0 is used to get a single conversion on demand */
-static int usbdux_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ai_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i;
/************************************/
/* analog out */
-static int usbdux_ao_insn_read(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ao_insn_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i;
return i;
}
-static int usbdux_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ao_insn_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int i, err;
return i;
}
-static int usbdux_ao_inttrig(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ao_inttrig(struct comedi_device *dev, comedi_subdevice *s,
unsigned int trignum)
{
int ret;
return 1;
}
-static int usbdux_ao_cmdtest(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_ao_cmdtest(struct comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd)
{
int err = 0, tmp;
return 0;
}
-static int usbdux_ao_cmd(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_ao_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, gain;
return 0;
}
-static int usbdux_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_dio_insn_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
return insn->n;
}
-static int usbdux_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_dio_insn_bits(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
}
/* reads the 4 counters, only two are used just now */
-static int usbdux_counter_read(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_counter_read(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
return 1;
}
-static int usbdux_counter_write(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_counter_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
return 1;
}
-static int usbdux_counter_config(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_counter_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
/* nothing to do so far */
}
/* force unlink - is called by comedi */
-static int usbdux_pwm_cancel(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_pwm_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
struct usbduxsub *this_usbduxsub = dev->private;
int res = 0;
{
int ret;
struct usbduxsub *this_usbduxsub;
- comedi_device *this_comedidev;
+ struct comedi_device *this_comedidev;
comedi_subdevice *s;
/* printk(KERN_DEBUG "PWM: IRQ\n"); */
return 0;
}
-static int usbdux_pwm_period(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_pwm_period(struct comedi_device *dev, comedi_subdevice *s,
unsigned int period)
{
struct usbduxsub *this_usbduxsub = dev->private;
}
/* is called from insn so there's no need to do all the sanity checks */
-static int usbdux_pwm_start(comedi_device *dev, comedi_subdevice *s)
+static int usbdux_pwm_start(struct comedi_device *dev, comedi_subdevice *s)
{
int ret, i;
struct usbduxsub *this_usbduxsub = dev->private;
}
/* generates the bit pattern for PWM with the optional sign bit */
-static int usbdux_pwm_pattern(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_pwm_pattern(struct comedi_device *dev, comedi_subdevice *s,
int channel, unsigned int value, unsigned int sign)
{
struct usbduxsub *this_usbduxsub = dev->private;
return 1;
}
-static int usbdux_pwm_write(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_pwm_write(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
data[0], 0);
}
-static int usbdux_pwm_read(comedi_device *x1, comedi_subdevice *x2,
+static int usbdux_pwm_read(struct comedi_device *x1, comedi_subdevice *x2,
comedi_insn *x3, unsigned int *x4)
{
/* not needed */
};
/* switches on/off PWM */
-static int usbdux_pwm_config(comedi_device *dev, comedi_subdevice *s,
+static int usbdux_pwm_config(struct comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
}
/* is called when comedi-config is called */
-static int usbdux_attach(comedi_device *dev, comedi_devconfig *it)
+static int usbdux_attach(struct comedi_device *dev, comedi_devconfig *it)
{
int ret;
int index;
return 0;
}
-static int usbdux_detach(comedi_device *dev)
+static int usbdux_detach(struct comedi_device *dev)
{
struct usbduxsub *usbduxsub_tmp;
int16_t *insnBuffer; /* input buffer for single insn */
int ifnum; /* interface number */
struct usb_interface *interface; /* interface structure */
- comedi_device *comedidev; /* comedi device for the interrupt
+ struct comedi_device *comedidev; /* comedi device for the interrupt
context */
short int ai_cmd_running; /* asynchronous command is running */
short int ai_continous; /* continous aquisition */
* This will cancel a running acquisition operation.
* This is called by comedi but never from inside the driver.
*/
-static int usbduxfast_ai_cancel(comedi_device *dev, comedi_subdevice *s)
+static int usbduxfast_ai_cancel(struct comedi_device *dev, comedi_subdevice *s)
{
struct usbduxfastsub_s *udfs;
int ret;
{
int n, err;
struct usbduxfastsub_s *udfs;
- comedi_device *this_comedidev;
+ struct comedi_device *this_comedidev;
comedi_subdevice *s;
uint16_t *p;
return 0;
}
-static int usbduxfast_ai_cmdtest(comedi_device *dev,
+static int usbduxfast_ai_cmdtest(struct comedi_device *dev,
comedi_subdevice *s, comedi_cmd *cmd)
{
int err = 0, stop_mask = 0;
}
-static int usbduxfast_ai_inttrig(comedi_device *dev,
+static int usbduxfast_ai_inttrig(struct comedi_device *dev,
comedi_subdevice *s, unsigned int trignum)
{
int ret;
#define OUTBASE (1+0x10)
#define LOGBASE (1+0x18)
-static int usbduxfast_ai_cmd(comedi_device *dev, comedi_subdevice *s)
+static int usbduxfast_ai_cmd(struct comedi_device *dev, comedi_subdevice *s)
{
comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, gain, rngmask = 0xff;
/*
* Mode 0 is used to get a single conversion on demand.
*/
-static int usbduxfast_ai_insn_read(comedi_device *dev,
+static int usbduxfast_ai_insn_read(struct comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i, j, n, actual_length;
/*
* is called when comedi-config is called
*/
-static int usbduxfast_attach(comedi_device *dev, comedi_devconfig *it)
+static int usbduxfast_attach(struct comedi_device *dev, comedi_devconfig *it)
{
int ret;
int index;
return 0;
}
-static int usbduxfast_detach(comedi_device *dev)
+static int usbduxfast_detach(struct comedi_device *dev)
{
struct usbduxfastsub_s *udfs;
int comedi_get_n_subdevices(void *d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
return dev->n_subdevices;
}
const char *comedi_get_driver_name(void * d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
return dev->driver->driver_name;
}
const char *comedi_get_board_name(void * d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
return dev->board_name;
}
int comedi_get_subdevice_type(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
return s->type;
unsigned int comedi_get_subdevice_flags(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
return s->subdev_flags;
int comedi_find_subdevice_by_type(void *d, int type, unsigned int subd)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
if (subd > dev->n_subdevices)
return -ENODEV;
int comedi_get_n_channels(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
return s->n_chan;
int comedi_get_len_chanlist(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
return s->len_chanlist;
unsigned int comedi_get_maxdata(void *d, unsigned int subdevice,
unsigned int chan)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
if (s->maxdata_list)
int comedi_get_rangetype(void *d, unsigned int subdevice,
unsigned int chan)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
int ret;
int comedi_get_n_ranges(void *d, unsigned int subdevice, unsigned int chan)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
int ret;
int comedi_get_krange(void *d, unsigned int subdevice, unsigned int chan,
unsigned int range, comedi_krange *krange)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
const comedi_lrange *lr;
*/
unsigned int comedi_get_buf_head_pos(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
int comedi_get_buffer_contents(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
unsigned int num_bytes;
int comedi_set_user_int_count(void *d, unsigned int subdevice,
unsigned int buf_user_count)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
int num_bytes;
int comedi_mark_buffer_read(void *d, unsigned int subdevice,
unsigned int num_bytes)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
int comedi_mark_buffer_written(void *d, unsigned int subdevice,
unsigned int num_bytes)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
int bytes_written;
int comedi_get_buffer_size(void *d, unsigned int subdev)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdev;
comedi_async *async;
int comedi_get_buffer_offset(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
void *comedi_open(const char *filename)
{
struct comedi_device_file_info *dev_file_info;
- comedi_device *dev;
+ struct comedi_device *dev;
unsigned int minor;
if (strncmp(filename, "/dev/comedi", 11) != 0)
void *comedi_open_old(unsigned int minor)
{
struct comedi_device_file_info *dev_file_info;
- comedi_device *dev;
+ struct comedi_device *dev;
if (minor >= COMEDI_NUM_MINORS)
return NULL;
int comedi_close(void *d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
module_put(dev->driver->module);
int comedi_fileno(void *d)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
/* return something random */
return dev->minor;
int comedi_command(void *d, comedi_cmd *cmd)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
comedi_async *async;
unsigned runflags;
int comedi_command_test(void *d, comedi_cmd *cmd)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
if (cmd->subdev >= dev->n_subdevices)
*/
int comedi_do_insn(void *d, comedi_insn *insn)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
int ret = 0;
*/
int comedi_lock(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
unsigned long flags;
int ret = 0;
*/
int comedi_unlock(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
unsigned long flags;
comedi_async *async;
*/
int comedi_cancel(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
int ret = 0;
int comedi_register_callback(void *d, unsigned int subdevice,
unsigned int mask, int (*cb) (unsigned int, void *), void *arg)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
comedi_async *async;
int comedi_poll(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s = dev->subdevices;
comedi_async *async;
/* WARNING: not portable */
int comedi_map(void *d, unsigned int subdevice, void *ptr)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
if (subdevice >= dev->n_subdevices)
/* WARNING: not portable */
int comedi_unmap(void *d, unsigned int subdevice)
{
- comedi_device *dev = (comedi_device *) d;
+ struct comedi_device *dev = (struct comedi_device *) d;
comedi_subdevice *s;
if (subdevice >= dev->n_subdevices)
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(i);
- comedi_device *dev;
+ struct comedi_device *dev;
if (dev_file_info == NULL)
continue;
writes:
n comedi_krange structures to rangeinfo->range_ptr
*/
-int do_rangeinfo_ioctl(comedi_device *dev, comedi_rangeinfo *arg)
+int do_rangeinfo_ioctl(struct comedi_device *dev, comedi_rangeinfo *arg)
{
comedi_rangeinfo it;
int subd, chan;
irqreturn_t(*handler) (int irq, void *dev_id PT_REGS_ARG);
unsigned long flags;
const char *device;
- comedi_device *dev_id;
+ struct comedi_device *dev_id;
};
static int comedi_rt_get_irq(struct comedi_irq_struct *it);
int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int,
void *PT_REGS_ARG), unsigned long flags, const char *device,
- comedi_device *dev_id)
+ struct comedi_device *dev_id)
{
struct comedi_irq_struct *it;
int ret;
return 0;
}
-void comedi_free_irq(unsigned int irq, comedi_device *dev_id)
+void comedi_free_irq(unsigned int irq, struct comedi_device *dev_id)
{
struct comedi_irq_struct *it;
comedi_irqs[irq] = NULL;
}
-int comedi_switch_to_rt(comedi_device *dev)
+int comedi_switch_to_rt(struct comedi_device *dev)
{
struct comedi_irq_struct *it;
unsigned long flags;
return 0;
}
-void comedi_switch_to_non_rt(comedi_device *dev)
+void comedi_switch_to_non_rt(struct comedi_device *dev)
{
struct comedi_irq_struct *it;
unsigned long flags;