Commit d163679c authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

Staging: comedi: Remove comedi_async typedef

Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 34c43922
...@@ -275,7 +275,7 @@ static int do_devconfig_ioctl(struct comedi_device *dev, comedi_devconfig *arg) ...@@ -275,7 +275,7 @@ 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_bufconfig_ioctl(struct comedi_device *dev, void *arg)
{ {
comedi_bufconfig bc; comedi_bufconfig bc;
comedi_async *async; struct comedi_async *async;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret = 0; int ret = 0;
...@@ -558,7 +558,7 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, void *arg) ...@@ -558,7 +558,7 @@ static int do_bufinfo_ioctl(struct comedi_device *dev, void *arg)
{ {
comedi_bufinfo bi; comedi_bufinfo bi;
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
if (copy_from_user(&bi, arg, sizeof(comedi_bufinfo))) if (copy_from_user(&bi, arg, sizeof(comedi_bufinfo)))
return -EFAULT; return -EFAULT;
...@@ -979,7 +979,7 @@ static int do_cmd_ioctl(struct comedi_device *dev, void *arg, void *file) ...@@ -979,7 +979,7 @@ static int do_cmd_ioctl(struct comedi_device *dev, void *arg, void *file)
{ {
comedi_cmd user_cmd; comedi_cmd user_cmd;
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
int ret = 0; int ret = 0;
unsigned int *chanlist_saver = NULL; unsigned int *chanlist_saver = NULL;
...@@ -1384,7 +1384,7 @@ static int do_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -1384,7 +1384,7 @@ static int do_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
void comedi_unmap(struct vm_area_struct *area) void comedi_unmap(struct vm_area_struct *area)
{ {
comedi_async *async; struct comedi_async *async;
struct comedi_device *dev; struct comedi_device *dev;
async = area->vm_private_data; async = area->vm_private_data;
...@@ -1405,7 +1405,7 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1405,7 +1405,7 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
struct comedi_device_file_info *dev_file_info = struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor); comedi_get_device_file_info(minor);
struct comedi_device *dev = dev_file_info->device; struct comedi_device *dev = dev_file_info->device;
comedi_async *async = NULL; struct comedi_async *async = NULL;
unsigned long start = vma->vm_start; unsigned long start = vma->vm_start;
unsigned long size; unsigned long size;
int n_pages; int n_pages;
...@@ -1524,7 +1524,7 @@ static ssize_t comedi_write(struct file *file, const char *buf, size_t nbytes, ...@@ -1524,7 +1524,7 @@ static ssize_t comedi_write(struct file *file, const char *buf, size_t nbytes,
loff_t *offset) loff_t *offset)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
int n, m, count = 0, retval = 0; int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode); const unsigned minor = iminor(file->f_dentry->d_inode);
...@@ -1626,7 +1626,7 @@ static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes, ...@@ -1626,7 +1626,7 @@ static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes,
loff_t *offset) loff_t *offset)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
int n, m, count = 0, retval = 0; int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode); const unsigned minor = iminor(file->f_dentry->d_inode);
...@@ -1735,7 +1735,7 @@ static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes, ...@@ -1735,7 +1735,7 @@ static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes,
*/ */
void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s) void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_set_subdevice_runflags(s, SRF_RUNNING, 0); comedi_set_subdevice_runflags(s, SRF_RUNNING, 0);
#ifdef CONFIG_COMEDI_RT #ifdef CONFIG_COMEDI_RT
...@@ -2008,7 +2008,7 @@ void comedi_error(const struct comedi_device *dev, const char *s) ...@@ -2008,7 +2008,7 @@ void comedi_error(const struct comedi_device *dev, const char *s)
void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s) void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned runflags = 0; unsigned runflags = 0;
unsigned runflags_mask = 0; unsigned runflags_mask = 0;
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
#define COMEDI_NUM_BOARD_MINORS 0x30 #define COMEDI_NUM_BOARD_MINORS 0x30
#define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS #define COMEDI_FIRST_SUBDEVICE_MINOR COMEDI_NUM_BOARD_MINORS
typedef struct comedi_async_struct comedi_async;
typedef struct comedi_driver_struct comedi_driver; typedef struct comedi_driver_struct comedi_driver;
typedef struct comedi_lrange_struct comedi_lrange; typedef struct comedi_lrange_struct comedi_lrange;
...@@ -139,7 +138,7 @@ struct comedi_subdevice { ...@@ -139,7 +138,7 @@ struct comedi_subdevice {
void *private; void *private;
comedi_async *async; struct comedi_async *async;
void *lock; void *lock;
void *busy; void *busy;
...@@ -196,7 +195,7 @@ struct comedi_buf_page { ...@@ -196,7 +195,7 @@ struct comedi_buf_page {
dma_addr_t dma_addr; dma_addr_t dma_addr;
}; };
struct comedi_async_struct { struct comedi_async {
struct comedi_subdevice *subdevice; struct comedi_subdevice *subdevice;
void *prealloc_buf; /* pre-allocated buffer */ void *prealloc_buf; /* pre-allocated buffer */
...@@ -469,31 +468,31 @@ static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *h ...@@ -469,31 +468,31 @@ static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *h
} }
} }
int comedi_buf_put(comedi_async *async, short x); int comedi_buf_put(struct comedi_async *async, short x);
int comedi_buf_get(comedi_async *async, short *x); int comedi_buf_get(struct comedi_async *async, short *x);
unsigned int comedi_buf_write_n_available(comedi_async *async); unsigned int comedi_buf_write_n_available(struct comedi_async *async);
unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes); unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes);
unsigned int comedi_buf_write_alloc_strict(comedi_async *async, unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
unsigned int nbytes); unsigned int nbytes);
unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes); unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes); unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes);
unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes); unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes);
unsigned int comedi_buf_read_n_available(comedi_async *async); unsigned int comedi_buf_read_n_available(struct comedi_async *async);
void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset, void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
const void *source, unsigned int num_bytes); const void *source, unsigned int num_bytes);
void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset, void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
void *destination, unsigned int num_bytes); void *destination, unsigned int num_bytes);
static inline unsigned comedi_buf_write_n_allocated(comedi_async *async) static inline unsigned comedi_buf_write_n_allocated(struct comedi_async *async)
{ {
return async->buf_write_alloc_count - async->buf_write_count; return async->buf_write_alloc_count - async->buf_write_count;
} }
static inline unsigned comedi_buf_read_n_allocated(comedi_async *async) static inline unsigned comedi_buf_read_n_allocated(struct comedi_async *async)
{ {
return async->buf_read_alloc_count - async->buf_read_count; return async->buf_read_alloc_count - async->buf_read_count;
} }
void comedi_reset_async_buf(comedi_async *async); void comedi_reset_async_buf(struct comedi_async *async);
static inline void *comedi_aux_data(int options[], int n) static inline void *comedi_aux_data(int options[], int n)
{ {
......
...@@ -228,7 +228,7 @@ static int postconfig(struct comedi_device *dev) ...@@ -228,7 +228,7 @@ static int postconfig(struct comedi_device *dev)
{ {
int i; int i;
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async = NULL; struct comedi_async *async = NULL;
int ret; int ret;
for (i = 0; i < dev->n_subdevices; i++) { for (i = 0; i < dev->n_subdevices; i++) {
...@@ -245,7 +245,7 @@ static int postconfig(struct comedi_device *dev) ...@@ -245,7 +245,7 @@ static int postconfig(struct comedi_device *dev)
SDF_CMD_WRITE)) == 0); SDF_CMD_WRITE)) == 0);
BUG_ON(!s->do_cmdtest); BUG_ON(!s->do_cmdtest);
async = kzalloc(sizeof(comedi_async), GFP_KERNEL); async = kzalloc(sizeof(struct comedi_async), GFP_KERNEL);
if (async == NULL) { if (async == NULL) {
printk("failed to allocate async struct\n"); printk("failed to allocate async struct\n");
return -ENOMEM; return -ENOMEM;
...@@ -415,7 +415,7 @@ static inline unsigned long kvirt_to_kva(unsigned long adr) ...@@ -415,7 +415,7 @@ static inline unsigned long kvirt_to_kva(unsigned long adr)
int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long new_size) unsigned long new_size)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
/* Round up new_size to multiple of PAGE_SIZE */ /* Round up new_size to multiple of PAGE_SIZE */
new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK; new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK;
...@@ -536,7 +536,7 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -536,7 +536,7 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
/* munging is applied to data by core as it passes between user /* munging is applied to data by core as it passes between user
* and kernel space */ * and kernel space */
unsigned int comedi_buf_munge(comedi_async *async, unsigned int num_bytes) unsigned int comedi_buf_munge(struct comedi_async *async, unsigned int num_bytes)
{ {
struct comedi_subdevice *s = async->subdevice; struct comedi_subdevice *s = async->subdevice;
unsigned int count = 0; unsigned int count = 0;
...@@ -580,7 +580,7 @@ unsigned int comedi_buf_munge(comedi_async *async, unsigned int num_bytes) ...@@ -580,7 +580,7 @@ unsigned int comedi_buf_munge(comedi_async *async, unsigned int num_bytes)
return count; return count;
} }
unsigned int comedi_buf_write_n_available(comedi_async *async) unsigned int comedi_buf_write_n_available(struct comedi_async *async)
{ {
unsigned int free_end; unsigned int free_end;
unsigned int nbytes; unsigned int nbytes;
...@@ -600,7 +600,7 @@ unsigned int comedi_buf_write_n_available(comedi_async *async) ...@@ -600,7 +600,7 @@ unsigned int comedi_buf_write_n_available(comedi_async *async)
} }
/* allocates chunk for the writer from free buffer space */ /* allocates chunk for the writer from free buffer space */
unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes) unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes)
{ {
unsigned int free_end = async->buf_read_count + async->prealloc_bufsz; unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
...@@ -615,7 +615,7 @@ unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes) ...@@ -615,7 +615,7 @@ unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes)
} }
/* allocates nothing unless it can completely fulfill the request */ /* allocates nothing unless it can completely fulfill the request */
unsigned int comedi_buf_write_alloc_strict(comedi_async *async, unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
unsigned int nbytes) unsigned int nbytes)
{ {
unsigned int free_end = async->buf_read_count + async->prealloc_bufsz; unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
...@@ -631,7 +631,7 @@ unsigned int comedi_buf_write_alloc_strict(comedi_async *async, ...@@ -631,7 +631,7 @@ unsigned int comedi_buf_write_alloc_strict(comedi_async *async,
} }
/* transfers a chunk from writer to filled buffer space */ /* transfers a chunk from writer to filled buffer space */
unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes) unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
{ {
if ((int)(async->buf_write_count + nbytes - if ((int)(async->buf_write_count + nbytes -
async->buf_write_alloc_count) > 0) { async->buf_write_alloc_count) > 0) {
...@@ -649,7 +649,7 @@ unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes) ...@@ -649,7 +649,7 @@ unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes)
} }
/* allocates a chunk for the reader from filled (and munged) buffer space */ /* allocates a chunk for the reader from filled (and munged) buffer space */
unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes) unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes)
{ {
if ((int)(async->buf_read_alloc_count + nbytes - async->munge_count) > if ((int)(async->buf_read_alloc_count + nbytes - async->munge_count) >
0) { 0) {
...@@ -663,7 +663,7 @@ unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes) ...@@ -663,7 +663,7 @@ unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes)
} }
/* transfers control of a chunk from reader to free buffer space */ /* transfers control of a chunk from reader to free buffer space */
unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes) unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes)
{ {
/* barrier insures data has been read out of buffer before read count is incremented */ /* barrier insures data has been read out of buffer before read count is incremented */
smp_mb(); smp_mb();
...@@ -679,7 +679,7 @@ unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes) ...@@ -679,7 +679,7 @@ unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes)
return nbytes; return nbytes;
} }
void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset, void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
const void *data, unsigned int num_bytes) const void *data, unsigned int num_bytes)
{ {
unsigned int write_ptr = async->buf_write_ptr + offset; unsigned int write_ptr = async->buf_write_ptr + offset;
...@@ -704,7 +704,7 @@ void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset, ...@@ -704,7 +704,7 @@ void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset,
} }
} }
void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset, void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
void *dest, unsigned int nbytes) void *dest, unsigned int nbytes)
{ {
void *src; void *src;
...@@ -730,7 +730,7 @@ void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset, ...@@ -730,7 +730,7 @@ void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset,
} }
} }
unsigned int comedi_buf_read_n_available(comedi_async *async) unsigned int comedi_buf_read_n_available(struct comedi_async *async)
{ {
unsigned num_bytes; unsigned num_bytes;
...@@ -745,7 +745,7 @@ unsigned int comedi_buf_read_n_available(comedi_async *async) ...@@ -745,7 +745,7 @@ unsigned int comedi_buf_read_n_available(comedi_async *async)
return num_bytes; return num_bytes;
} }
int comedi_buf_get(comedi_async *async, short *x) int comedi_buf_get(struct comedi_async *async, short *x)
{ {
unsigned int n = comedi_buf_read_n_available(async); unsigned int n = comedi_buf_read_n_available(async);
...@@ -757,7 +757,7 @@ int comedi_buf_get(comedi_async *async, short *x) ...@@ -757,7 +757,7 @@ int comedi_buf_get(comedi_async *async, short *x)
return 1; return 1;
} }
int comedi_buf_put(comedi_async *async, short x) int comedi_buf_put(struct comedi_async *async, short x)
{ {
unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(short)); unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(short));
...@@ -770,7 +770,7 @@ int comedi_buf_put(comedi_async *async, short x) ...@@ -770,7 +770,7 @@ int comedi_buf_put(comedi_async *async, short x)
return 1; return 1;
} }
void comedi_reset_async_buf(comedi_async *async) void comedi_reset_async_buf(struct comedi_async *async)
{ {
async->buf_write_alloc_count = 0; async->buf_write_alloc_count = 0;
async->buf_write_count = 0; async->buf_write_count = 0;
......
...@@ -1630,13 +1630,14 @@ void v_APCI3120_Interrupt(int irq, void *d) ...@@ -1630,13 +1630,14 @@ void v_APCI3120_Interrupt(int irq, void *d)
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
/*int i_APCI3120_InterruptHandleEos(struct comedi_device *dev) /*
* int i_APCI3120_InterruptHandleEos(struct comedi_device *dev)
{ {
int n_chan,i; int n_chan,i;
short *data; short *data;
struct comedi_subdevice *s=dev->subdevices+0; struct comedi_subdevice *s=dev->subdevices+0;
comedi_async *async = s->async; struct comedi_async *async = s->async;
data=async->data+async->buf_int_ptr;//new samples added from here onwards data=async->data+async->buf_int_ptr;
n_chan=devpriv->ui_AiNbrofChannels; n_chan=devpriv->ui_AiNbrofChannels;
for(i=0;i<n_chan;i++) for(i=0;i<n_chan;i++)
......
...@@ -913,7 +913,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device PT_REGS_ARG) ...@@ -913,7 +913,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device PT_REGS_ARG)
{ {
struct comedi_device *dev = p_device; struct comedi_device *dev = p_device;
struct comedi_subdevice *subdevice = dev->read_subdev; struct comedi_subdevice *subdevice = dev->read_subdev;
comedi_async *async; struct comedi_async *async;
unsigned long irq_flags; unsigned long irq_flags;
unsigned char intcsr; unsigned char intcsr;
......
...@@ -1185,7 +1185,7 @@ static void ...@@ -1185,7 +1185,7 @@ static void
pci224_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s, void *data, pci224_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s, void *data,
unsigned int num_bytes, unsigned int chan_index) unsigned int num_bytes, unsigned int chan_index)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
short *array = data; short *array = data;
unsigned int length = num_bytes / sizeof(*array); unsigned int length = num_bytes / sizeof(*array);
unsigned int offset; unsigned int offset;
......
...@@ -1450,7 +1450,7 @@ static int pci230_ao_inttrig_scan_begin(struct comedi_device * dev, ...@@ -1450,7 +1450,7 @@ static int pci230_ao_inttrig_scan_begin(struct comedi_device * dev,
static void pci230_ao_start(struct comedi_device * dev, struct comedi_subdevice * s) static void pci230_ao_start(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned long irqflags; unsigned long irqflags;
...@@ -2147,7 +2147,7 @@ static void pci230_ai_start(struct comedi_device * dev, struct comedi_subdevice ...@@ -2147,7 +2147,7 @@ static void pci230_ai_start(struct comedi_device * dev, struct comedi_subdevice
{ {
unsigned long irqflags; unsigned long irqflags;
unsigned short conv; unsigned short conv;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
set_bit(AI_CMD_STARTED, &devpriv->state); set_bit(AI_CMD_STARTED, &devpriv->state);
...@@ -2300,7 +2300,7 @@ static int pci230_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s ...@@ -2300,7 +2300,7 @@ static int pci230_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s
unsigned char zgat; unsigned char zgat;
/* Get the command. */ /* Get the command. */
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
/* /*
...@@ -2626,7 +2626,7 @@ static void pci230_handle_ao_nofifo(struct comedi_device * dev, struct comedi_su ...@@ -2626,7 +2626,7 @@ static void pci230_handle_ao_nofifo(struct comedi_device * dev, struct comedi_su
{ {
short data; short data;
int i, ret; int i, ret;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
if (!devpriv->ao_continuous && (devpriv->ao_scan_count == 0)) { if (!devpriv->ao_continuous && (devpriv->ao_scan_count == 0)) {
...@@ -2661,7 +2661,7 @@ static void pci230_handle_ao_nofifo(struct comedi_device * dev, struct comedi_su ...@@ -2661,7 +2661,7 @@ static void pci230_handle_ao_nofifo(struct comedi_device * dev, struct comedi_su
/* Returns 0 if AO finished due to completion or error, 1 if still going. */ /* Returns 0 if AO finished due to completion or error, 1 if still going. */
static int pci230_handle_ao_fifo(struct comedi_device * dev, struct comedi_subdevice * s) static int pci230_handle_ao_fifo(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int num_scans; unsigned int num_scans;
unsigned int room; unsigned int room;
...@@ -2769,7 +2769,7 @@ static void pci230_handle_ai(struct comedi_device * dev, struct comedi_subdevice ...@@ -2769,7 +2769,7 @@ static void pci230_handle_ai(struct comedi_device * dev, struct comedi_subdevice
unsigned int i; unsigned int i;
unsigned int todo; unsigned int todo;
unsigned int fifoamount; unsigned int fifoamount;
comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int scanlen = async->cmd.scan_end_arg; unsigned int scanlen = async->cmd.scan_end_arg;
/* Determine number of samples to read. */ /* Determine number of samples to read. */
......
...@@ -449,7 +449,7 @@ static comedi_driver driver_cb_pcidas = { ...@@ -449,7 +449,7 @@ static comedi_driver driver_cb_pcidas = {
detach:cb_pcidas_detach, detach:cb_pcidas_detach,
}; };
static int cb_pcidas_ai_rinsn(struct comedi_device * dev, struct comedi_subdevice * s, static int cb_pcidas_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data); comedi_insn * insn, unsigned int * data);
static int ai_config_insn(struct comedi_device * dev, struct comedi_subdevice * s, static int ai_config_insn(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data); comedi_insn * insn, unsigned int * data);
...@@ -463,7 +463,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device * dev, struct comedi_subdevice ...@@ -463,7 +463,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device * dev, struct comedi_subdevice
static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s, static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_cmd * cmd); comedi_cmd * cmd);
static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice * s); static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice * s);
static int cb_pcidas_ao_inttrig(struct comedi_device * dev, struct comedi_subdevice * subdev, static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
struct comedi_subdevice *subdev,
unsigned int trig_num); unsigned int trig_num);
static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s, static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_cmd * cmd); comedi_cmd * cmd);
...@@ -1164,7 +1165,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, struct comedi_subdev ...@@ -1164,7 +1165,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, struct comedi_subdev
static int cb_pcidas_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s) static int cb_pcidas_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int bits; unsigned int bits;
unsigned long flags; unsigned long flags;
...@@ -1364,7 +1365,7 @@ static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, struct comedi_subdev ...@@ -1364,7 +1365,7 @@ static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, struct comedi_subdev
static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice * s) static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int i; unsigned int i;
unsigned long flags; unsigned long flags;
...@@ -1425,11 +1426,12 @@ static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice ...@@ -1425,11 +1426,12 @@ static int cb_pcidas_ao_cmd(struct comedi_device * dev, struct comedi_subdevice
return 0; return 0;
} }
static int cb_pcidas_ao_inttrig(struct comedi_device * dev, struct comedi_subdevice * s, static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
struct comedi_subdevice *s,
unsigned int trig_num) unsigned int trig_num)
{ {
unsigned int num_bytes, num_points = thisboard->fifo_size; unsigned int num_bytes, num_points = thisboard->fifo_size;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &s->async->cmd; comedi_cmd *cmd = &s->async->cmd;
unsigned long flags; unsigned long flags;
...@@ -1478,7 +1480,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -1478,7 +1480,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async; struct comedi_async *async;
int status, s5933_status; int status, s5933_status;
int half_fifo = thisboard->fifo_size / 2; int half_fifo = thisboard->fifo_size / 2;
unsigned int num_samples, i; unsigned int num_samples, i;
...@@ -1589,7 +1591,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -1589,7 +1591,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG)
static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status) static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status)
{ {
struct comedi_subdevice *s = dev->write_subdev; struct comedi_subdevice *s = dev->write_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int half_fifo = thisboard->fifo_size / 2; unsigned int half_fifo = thisboard->fifo_size / 2;
unsigned int num_points; unsigned int num_points;
...@@ -1642,7 +1644,7 @@ static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status) ...@@ -1642,7 +1644,7 @@ static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status)
comedi_event(dev, s); comedi_event(dev, s);
} }
// cancel analog input command /* cancel analog input command */
static int cb_pcidas_cancel(struct comedi_device * dev, struct comedi_subdevice * s) static int cb_pcidas_cancel(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
unsigned long flags; unsigned long flags;
...@@ -1661,8 +1663,9 @@ static int cb_pcidas_cancel(struct comedi_device * dev, struct comedi_subdevice ...@@ -1661,8 +1663,9 @@ static int cb_pcidas_cancel(struct comedi_device * dev, struct comedi_subdevice
return 0; return 0;
} }
// cancel analog output command /* cancel analog output command */
static int cb_pcidas_ao_cancel(struct comedi_device * dev, struct comedi_subdevice * s) static int cb_pcidas_ao_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -2681,7 +2681,7 @@ static inline void load_first_dma_descriptor(struct comedi_device * dev, ...@@ -2681,7 +2681,7 @@ static inline void load_first_dma_descriptor(struct comedi_device * dev,
static int ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s) static int ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
uint32_t bits; uint32_t bits;
unsigned int i; unsigned int i;
...@@ -2800,7 +2800,7 @@ static int ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s) ...@@ -2800,7 +2800,7 @@ static int ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
static void pio_drain_ai_fifo_16(struct comedi_device * dev) static void pio_drain_ai_fifo_16(struct comedi_device * dev)
{ {
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int i; unsigned int i;
uint16_t prepost_bits; uint16_t prepost_bits;
...@@ -2867,7 +2867,7 @@ static void pio_drain_ai_fifo_16(struct comedi_device * dev) ...@@ -2867,7 +2867,7 @@ static void pio_drain_ai_fifo_16(struct comedi_device * dev)
static void pio_drain_ai_fifo_32(struct comedi_device * dev) static void pio_drain_ai_fifo_32(struct comedi_device * dev)
{ {
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int i; unsigned int i;
unsigned int max_transfer = 100000; unsigned int max_transfer = 100000;
...@@ -2908,7 +2908,7 @@ static void pio_drain_ai_fifo(struct comedi_device * dev) ...@@ -2908,7 +2908,7 @@ static void pio_drain_ai_fifo(struct comedi_device * dev)
static void drain_dma_buffers(struct 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; struct comedi_async *async = dev->read_subdev->async;
uint32_t next_transfer_addr; uint32_t next_transfer_addr;
int j; int j;
int num_samples = 0; int num_samples = 0;
...@@ -2956,7 +2956,7 @@ void handle_ai_interrupt(struct comedi_device * dev, unsigned short status, ...@@ -2956,7 +2956,7 @@ void handle_ai_interrupt(struct comedi_device * dev, unsigned short status,
unsigned int plx_status) unsigned int plx_status)
{ {
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
uint8_t dma1_status; uint8_t dma1_status;
unsigned long flags; unsigned long flags;
...@@ -3078,7 +3078,7 @@ static void handle_ao_interrupt(struct comedi_device * dev, unsigned short statu ...@@ -3078,7 +3078,7 @@ static void handle_ao_interrupt(struct comedi_device * dev, unsigned short statu
unsigned int plx_status) unsigned int plx_status)
{ {
struct comedi_subdevice *s = dev->write_subdev; struct comedi_subdevice *s = dev->write_subdev;
comedi_async *async; struct comedi_async *async;
comedi_cmd *cmd; comedi_cmd *cmd;
uint8_t dma0_status; uint8_t dma0_status;
unsigned long flags; unsigned long flags;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
static void increment_scan_progress(struct comedi_subdevice *subd, static void increment_scan_progress(struct comedi_subdevice *subd,
unsigned int num_bytes) unsigned int num_bytes)
{ {
comedi_async *async = subd->async; struct comedi_async *async = subd->async;
unsigned int scan_length = cfc_bytes_per_scan(subd); unsigned int scan_length = cfc_bytes_per_scan(subd);
async->scan_progress += num_bytes; async->scan_progress += num_bytes;
...@@ -45,7 +45,7 @@ static void increment_scan_progress(struct comedi_subdevice *subd, ...@@ -45,7 +45,7 @@ static void increment_scan_progress(struct comedi_subdevice *subd,
unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *subd, void *data, unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *subd, void *data,
unsigned int num_bytes) unsigned int num_bytes)
{ {
comedi_async *async = subd->async; struct comedi_async *async = subd->async;
unsigned int retval; unsigned int retval;
if (num_bytes == 0) if (num_bytes == 0)
...@@ -70,7 +70,7 @@ EXPORT_SYMBOL(cfc_write_array_to_buffer); ...@@ -70,7 +70,7 @@ EXPORT_SYMBOL(cfc_write_array_to_buffer);
unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *subd, void *data, unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *subd, void *data,
unsigned int num_bytes) unsigned int num_bytes)
{ {
comedi_async *async = subd->async; struct comedi_async *async = subd->async;
if (num_bytes == 0) if (num_bytes == 0)
return 0; return 0;
......
...@@ -292,7 +292,7 @@ static void scan_task_func(comedi_rt_task_context_t d) ...@@ -292,7 +292,7 @@ static void scan_task_func(comedi_rt_task_context_t d)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + 0; struct comedi_subdevice *s = dev->subdevices + 0;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
int i, ret; int i, ret;
unsigned long long n; unsigned long long n;
...@@ -580,7 +580,7 @@ static int timer_inttrig(struct comedi_device * dev, struct comedi_subdevice * s ...@@ -580,7 +580,7 @@ static int timer_inttrig(struct comedi_device * dev, struct comedi_subdevice * s
static int timer_start_cmd(struct comedi_device * dev, struct comedi_subdevice * s) static int timer_start_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
RTIME now, delay, period; RTIME now, delay, period;
int ret; int ret;
......
...@@ -144,7 +144,7 @@ static const comedi_lrange waveform_ai_ranges = { ...@@ -144,7 +144,7 @@ static const comedi_lrange waveform_ai_ranges = {
static void waveform_ai_interrupt(unsigned long arg) static void waveform_ai_interrupt(unsigned long arg)
{ {
struct comedi_device *dev = (struct comedi_device *) arg; struct comedi_device *dev = (struct comedi_device *) arg;
comedi_async *async = dev->read_subdev->async; struct comedi_async *async = dev->read_subdev->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int i, j; unsigned int i, j;
/* all times in microsec */ /* all times in microsec */
......
...@@ -895,7 +895,7 @@ static int das16_cmd_test(struct comedi_device * dev, struct comedi_subdevice * ...@@ -895,7 +895,7 @@ static int das16_cmd_test(struct comedi_device * dev, struct comedi_subdevice *
static int das16_cmd_exec(struct comedi_device * dev, struct comedi_subdevice * s) static int das16_cmd_exec(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int byte; unsigned int byte;
unsigned long flags; unsigned long flags;
...@@ -1201,7 +1201,7 @@ static void das16_interrupt(struct comedi_device * dev) ...@@ -1201,7 +1201,7 @@ static void das16_interrupt(struct comedi_device * dev)
{ {
unsigned long dma_flags, spin_flags; unsigned long dma_flags, spin_flags;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async; struct comedi_async *async;
comedi_cmd *cmd; comedi_cmd *cmd;
int num_bytes, residue; int num_bytes, residue;
int buffer_index; int buffer_index;
......
...@@ -324,7 +324,7 @@ static int das16m1_cmd_test(struct comedi_device * dev, struct comedi_subdevice ...@@ -324,7 +324,7 @@ static int das16m1_cmd_test(struct comedi_device * dev, struct comedi_subdevice
static int das16m1_cmd_exec(struct comedi_device * dev, struct comedi_subdevice * s) static int das16m1_cmd_exec(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int byte, i; unsigned int byte, i;
...@@ -517,7 +517,7 @@ static void munge_sample_array(short * array, unsigned int num_elements) ...@@ -517,7 +517,7 @@ static void munge_sample_array(short * array, unsigned int num_elements)
static void das16m1_handler(struct comedi_device * dev, unsigned int status) static void das16m1_handler(struct comedi_device * dev, unsigned int status)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
comedi_cmd *cmd; comedi_cmd *cmd;
u16 num_samples; u16 num_samples;
u16 hw_counter; u16 hw_counter;
......
...@@ -912,7 +912,7 @@ static irqreturn_t das1800_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -912,7 +912,7 @@ static irqreturn_t das1800_interrupt(int irq, void *d PT_REGS_ARG)
static void das1800_ai_handler(struct comedi_device * dev) static void das1800_ai_handler(struct comedi_device * dev)
{ {
struct comedi_subdevice *s = dev->subdevices + 0; /* analog input subdevice */ struct comedi_subdevice *s = dev->subdevices + 0; /* analog input subdevice */
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned int status = inb(dev->iobase + DAS1800_STATUS); unsigned int status = inb(dev->iobase + DAS1800_STATUS);
...@@ -1493,7 +1493,7 @@ static int das1800_ai_do_cmd(struct comedi_device * dev, struct comedi_subdevice ...@@ -1493,7 +1493,7 @@ static int das1800_ai_do_cmd(struct comedi_device * dev, struct comedi_subdevice
{ {
int ret; int ret;
int control_a, control_c; int control_a, control_c;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd cmd = async->cmd; comedi_cmd cmd = async->cmd;
if (!dev->irq) { if (!dev->irq) {
......
...@@ -349,7 +349,7 @@ static irqreturn_t das800_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -349,7 +349,7 @@ static irqreturn_t das800_interrupt(int irq, void *d PT_REGS_ARG)
short dataPoint = 0; short dataPoint = 0;
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev; /* analog input subdevice */ struct comedi_subdevice *s = dev->read_subdev; /* analog input subdevice */
comedi_async *async; struct comedi_async *async;
int status; int status;
unsigned long irq_flags; unsigned long irq_flags;
static const int max_loops = 128; // half-fifo size for cio-das802/16 static const int max_loops = 128; // half-fifo size for cio-das802/16
...@@ -714,7 +714,7 @@ static int das800_ai_do_cmd(struct comedi_device * dev, struct comedi_subdevice ...@@ -714,7 +714,7 @@ static int das800_ai_do_cmd(struct comedi_device * dev, struct comedi_subdevice
int startChan, endChan, scan, gain; int startChan, endChan, scan, gain;
int conv_bits; int conv_bits;
unsigned long irq_flags; unsigned long irq_flags;
comedi_async *async = s->async; struct comedi_async *async = s->async;
if (!dev->irq) { if (!dev->irq) {
comedi_error(dev, comedi_error(dev,
......
...@@ -838,7 +838,7 @@ static int di_cmd(struct comedi_device * dev, struct comedi_subdevice * s) ...@@ -838,7 +838,7 @@ static int di_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
uint32_t bits; uint32_t bits;
unsigned long flags; unsigned long flags;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
hpdi_writel(dev, RX_FIFO_RESET_BIT, BOARD_CONTROL_REG); hpdi_writel(dev, RX_FIFO_RESET_BIT, BOARD_CONTROL_REG);
...@@ -897,7 +897,7 @@ static int hpdi_cmd(struct comedi_device * dev, struct comedi_subdevice * s) ...@@ -897,7 +897,7 @@ static int hpdi_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
static void drain_dma_buffers(struct 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; struct comedi_async *async = dev->read_subdev->async;
uint32_t next_transfer_addr; uint32_t next_transfer_addr;
int j; int j;
int num_samples = 0; int num_samples = 0;
...@@ -945,7 +945,7 @@ static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -945,7 +945,7 @@ static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
uint32_t hpdi_intr_status, hpdi_board_status; uint32_t hpdi_intr_status, hpdi_board_status;
uint32_t plx_status; uint32_t plx_status;
uint32_t plx_bits; uint32_t plx_bits;
......
...@@ -317,7 +317,7 @@ void mite_dma_arm(struct mite_channel *mite_chan) ...@@ -317,7 +317,7 @@ void mite_dma_arm(struct mite_channel *mite_chan)
/**************************************/ /**************************************/
int mite_buf_change(struct mite_dma_descriptor_ring *ring, comedi_async * async) int mite_buf_change(struct mite_dma_descriptor_ring *ring, struct comedi_async * async)
{ {
unsigned int n_links; unsigned int n_links;
int i; int i;
...@@ -526,7 +526,7 @@ void mite_dma_disarm(struct mite_channel *mite_chan) ...@@ -526,7 +526,7 @@ void mite_dma_disarm(struct mite_channel *mite_chan)
writel(chor, mite->mite_io_addr + MITE_CHOR(mite_chan->channel)); writel(chor, mite->mite_io_addr + MITE_CHOR(mite_chan->channel));
} }
int mite_sync_input_dma(struct mite_channel *mite_chan, comedi_async * async) int mite_sync_input_dma(struct mite_channel *mite_chan, struct comedi_async * async)
{ {
int count; int count;
unsigned int nbytes, old_alloc_count; unsigned int nbytes, old_alloc_count;
...@@ -561,7 +561,7 @@ int mite_sync_input_dma(struct mite_channel *mite_chan, comedi_async * async) ...@@ -561,7 +561,7 @@ int mite_sync_input_dma(struct mite_channel *mite_chan, comedi_async * async)
return 0; return 0;
} }
int mite_sync_output_dma(struct mite_channel *mite_chan, comedi_async * async) int mite_sync_output_dma(struct mite_channel *mite_chan, struct comedi_async * async)
{ {
int count; int count;
u32 nbytes_ub, nbytes_lb; u32 nbytes_ub, nbytes_lb;
......
...@@ -142,8 +142,8 @@ void mite_release_channel(struct mite_channel *mite_chan); ...@@ -142,8 +142,8 @@ void mite_release_channel(struct mite_channel *mite_chan);
unsigned mite_dma_tcr(struct mite_channel *mite_chan); unsigned mite_dma_tcr(struct mite_channel *mite_chan);
void mite_dma_arm(struct mite_channel *mite_chan); void mite_dma_arm(struct mite_channel *mite_chan);
void mite_dma_disarm(struct mite_channel *mite_chan); void mite_dma_disarm(struct mite_channel *mite_chan);
int mite_sync_input_dma(struct mite_channel *mite_chan, comedi_async * async); int mite_sync_input_dma(struct mite_channel *mite_chan, struct comedi_async * async);
int mite_sync_output_dma(struct mite_channel *mite_chan, comedi_async * async); int mite_sync_output_dma(struct mite_channel *mite_chan, struct comedi_async * async);
u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan); u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan);
u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan); u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan);
u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan); u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan);
...@@ -153,7 +153,7 @@ unsigned mite_get_status(struct mite_channel *mite_chan); ...@@ -153,7 +153,7 @@ unsigned mite_get_status(struct mite_channel *mite_chan);
int mite_done(struct mite_channel *mite_chan); int mite_done(struct mite_channel *mite_chan);
#if 0 #if 0
unsigned long mite_ll_from_kvmem(struct mite_struct *mite, comedi_async * async, unsigned long mite_ll_from_kvmem(struct mite_struct *mite, struct comedi_async * async,
int len); int len);
void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan, void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan,
int dir); int dir);
...@@ -162,7 +162,7 @@ void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan, ...@@ -162,7 +162,7 @@ void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan,
void mite_prep_dma(struct mite_channel *mite_chan, void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits); unsigned int num_device_bits, unsigned int num_memory_bits);
int mite_buf_change(struct mite_dma_descriptor_ring *ring, int mite_buf_change(struct mite_dma_descriptor_ring *ring,
comedi_async *async); struct comedi_async *async);
#ifdef DEBUG_MITE #ifdef DEBUG_MITE
void mite_print_chsr(unsigned int chsr); void mite_print_chsr(unsigned int chsr);
......
...@@ -214,7 +214,7 @@ static irqreturn_t a2150_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -214,7 +214,7 @@ static irqreturn_t a2150_interrupt(int irq, void *d PT_REGS_ARG)
unsigned long flags; unsigned long flags;
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async; struct comedi_async *async;
comedi_cmd *cmd; comedi_cmd *cmd;
unsigned int max_points, num_points, residue, leftover; unsigned int max_points, num_points, residue, leftover;
short dpnt; short dpnt;
...@@ -617,7 +617,7 @@ static int a2150_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice ...@@ -617,7 +617,7 @@ static int a2150_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice
static int a2150_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s) static int a2150_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
unsigned long lock_flags; unsigned long lock_flags;
unsigned int old_config_bits = devpriv->config_bits; unsigned int old_config_bits = devpriv->config_bits;
......
...@@ -1068,7 +1068,7 @@ static int labpc_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s) ...@@ -1068,7 +1068,7 @@ static int labpc_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
int channel, range, aref; int channel, range, aref;
unsigned long irq_flags; unsigned long irq_flags;
int ret; int ret;
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
enum transfer_type xfer; enum transfer_type xfer;
unsigned long flags; unsigned long flags;
...@@ -1313,7 +1313,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -1313,7 +1313,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d PT_REGS_ARG)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async; struct comedi_async *async;
comedi_cmd *cmd; comedi_cmd *cmd;
if (dev->attached == 0) { if (dev->attached == 0) {
...@@ -1397,7 +1397,7 @@ static int labpc_drain_fifo(struct comedi_device * dev) ...@@ -1397,7 +1397,7 @@ static int labpc_drain_fifo(struct comedi_device * dev)
{ {
unsigned int lsb, msb; unsigned int lsb, msb;
short data; short data;
comedi_async *async = dev->read_subdev->async; struct comedi_async *async = dev->read_subdev->async;
const int timeout = 10000; const int timeout = 10000;
unsigned int i; unsigned int i;
...@@ -1430,7 +1430,7 @@ static int labpc_drain_fifo(struct comedi_device * dev) ...@@ -1430,7 +1430,7 @@ static int labpc_drain_fifo(struct comedi_device * dev)
static void labpc_drain_dma(struct comedi_device * dev) static void labpc_drain_dma(struct comedi_device * dev)
{ {
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
comedi_async *async = s->async; struct comedi_async *async = s->async;
int status; int status;
unsigned long flags; unsigned long flags;
unsigned int max_points, num_points, residue, leftover; unsigned int max_points, num_points, residue, leftover;
......
...@@ -1206,7 +1206,7 @@ static void ni_mio_print_status_b(int status) ...@@ -1206,7 +1206,7 @@ static void ni_mio_print_status_b(int status)
static void ni_ao_fifo_load(struct comedi_device * dev, struct comedi_subdevice * s, int n) static void ni_ao_fifo_load(struct comedi_device * dev, struct comedi_subdevice * s, int n)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
int chan; int chan;
int i; int i;
...@@ -1309,7 +1309,7 @@ static int ni_ao_prep_fifo(struct comedi_device * dev, struct comedi_subdevice * ...@@ -1309,7 +1309,7 @@ static int ni_ao_prep_fifo(struct comedi_device * dev, struct comedi_subdevice *
static void ni_ai_fifo_read(struct comedi_device * dev, struct comedi_subdevice * s, int n) static void ni_ai_fifo_read(struct comedi_device * dev, struct comedi_subdevice * s, int n)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
int i; int i;
if (boardtype.reg_type == ni_reg_611x) { if (boardtype.reg_type == ni_reg_611x) {
...@@ -1516,7 +1516,7 @@ static void get_last_sample_6143(struct comedi_device * dev) ...@@ -1516,7 +1516,7 @@ static void get_last_sample_6143(struct comedi_device * dev)
static void ni_ai_munge(struct comedi_device * dev, struct comedi_subdevice * s, static void ni_ai_munge(struct comedi_device * dev, struct comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int chan_index) void *data, unsigned int num_bytes, unsigned int chan_index)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int i; unsigned int i;
unsigned int length = num_bytes / bytes_per_sample(s); unsigned int length = num_bytes / bytes_per_sample(s);
short *array = data; short *array = data;
...@@ -2780,7 +2780,7 @@ static int ni_ai_config_analog_trig(struct comedi_device * dev, struct comedi_su ...@@ -2780,7 +2780,7 @@ static int ni_ai_config_analog_trig(struct comedi_device * dev, struct comedi_su
static void ni_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s, static void ni_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int chan_index) void *data, unsigned int num_bytes, unsigned int chan_index)
{ {
comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int range; unsigned int range;
unsigned int i; unsigned int i;
unsigned int offset; unsigned int offset;
......
...@@ -481,7 +481,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d PT_REGS_ARG) ...@@ -481,7 +481,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d PT_REGS_ARG)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices; struct comedi_subdevice *s = dev->subdevices;
comedi_async *async = s->async; struct comedi_async *async = s->async;
struct mite_struct *mite = devpriv->mite; struct mite_struct *mite = devpriv->mite;
//int i, j; //int i, j;
......
...@@ -145,7 +145,7 @@ extern int ni_tio_insn_config(struct ni_gpct *counter, ...@@ -145,7 +145,7 @@ extern int ni_tio_insn_config(struct ni_gpct *counter,
comedi_insn * insn, unsigned int * data); comedi_insn * insn, unsigned int * data);
extern int ni_tio_winsn(struct ni_gpct *counter, extern int ni_tio_winsn(struct ni_gpct *counter,
comedi_insn * insn, unsigned int * data); comedi_insn * insn, unsigned int * data);
extern int ni_tio_cmd(struct ni_gpct *counter, comedi_async * async); extern int ni_tio_cmd(struct ni_gpct *counter, struct comedi_async *async);
extern int ni_tio_cmdtest(struct ni_gpct *counter, comedi_cmd * cmd); extern int ni_tio_cmdtest(struct ni_gpct *counter, comedi_cmd * cmd);
extern int ni_tio_cancel(struct ni_gpct *counter); extern int ni_tio_cancel(struct ni_gpct *counter);
extern void ni_tio_handle_interrupt(struct ni_gpct *counter, extern void ni_tio_handle_interrupt(struct ni_gpct *counter,
......
...@@ -121,7 +121,7 @@ static int ni_tio_input_inttrig(struct comedi_device * dev, struct comedi_subdev ...@@ -121,7 +121,7 @@ static int ni_tio_input_inttrig(struct comedi_device * dev, struct comedi_subdev
return retval; return retval;
} }
static int ni_tio_input_cmd(struct ni_gpct *counter, comedi_async * async) static int ni_tio_input_cmd(struct ni_gpct *counter, struct comedi_async *async)
{ {
struct ni_gpct_device *counter_dev = counter->counter_dev; struct ni_gpct_device *counter_dev = counter->counter_dev;
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
...@@ -169,7 +169,7 @@ static int ni_tio_input_cmd(struct ni_gpct *counter, comedi_async * async) ...@@ -169,7 +169,7 @@ static int ni_tio_input_cmd(struct ni_gpct *counter, comedi_async * async)
return retval; return retval;
} }
static int ni_tio_output_cmd(struct ni_gpct *counter, comedi_async * async) static int ni_tio_output_cmd(struct ni_gpct *counter, struct comedi_async *async)
{ {
rt_printk("ni_tio: output commands not yet implemented.\n"); rt_printk("ni_tio: output commands not yet implemented.\n");
return -ENOTSUPP; return -ENOTSUPP;
...@@ -181,7 +181,7 @@ static int ni_tio_output_cmd(struct ni_gpct *counter, comedi_async * async) ...@@ -181,7 +181,7 @@ static int ni_tio_output_cmd(struct ni_gpct *counter, comedi_async * async)
return ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE); return ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE);
} }
static int ni_tio_cmd_setup(struct ni_gpct *counter, comedi_async * async) static int ni_tio_cmd_setup(struct ni_gpct *counter, struct comedi_async *async)
{ {
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
int set_gate_source = 0; int set_gate_source = 0;
...@@ -207,7 +207,7 @@ static int ni_tio_cmd_setup(struct ni_gpct *counter, comedi_async * async) ...@@ -207,7 +207,7 @@ static int ni_tio_cmd_setup(struct ni_gpct *counter, comedi_async * async)
return retval; return retval;
} }
int ni_tio_cmd(struct ni_gpct *counter, comedi_async * async) int ni_tio_cmd(struct ni_gpct *counter, struct comedi_async *async)
{ {
comedi_cmd *cmd = &async->cmd; comedi_cmd *cmd = &async->cmd;
int retval = 0; int retval = 0;
......
...@@ -175,7 +175,7 @@ unsigned int comedi_get_buf_head_pos(void *d, unsigned int subdevice) ...@@ -175,7 +175,7 @@ unsigned int comedi_get_buf_head_pos(void *d, unsigned int subdevice)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
async = s->async; async = s->async;
if (async == NULL) if (async == NULL)
...@@ -188,7 +188,7 @@ int comedi_get_buffer_contents(void *d, unsigned int subdevice) ...@@ -188,7 +188,7 @@ int comedi_get_buffer_contents(void *d, unsigned int subdevice)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
unsigned int num_bytes; unsigned int num_bytes;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
...@@ -208,7 +208,7 @@ int comedi_set_user_int_count(void *d, unsigned int subdevice, ...@@ -208,7 +208,7 @@ int comedi_set_user_int_count(void *d, unsigned int subdevice,
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
int num_bytes; int num_bytes;
async = s->async; async = s->async;
...@@ -229,7 +229,7 @@ int comedi_mark_buffer_read(void *d, unsigned int subdevice, ...@@ -229,7 +229,7 @@ int comedi_mark_buffer_read(void *d, unsigned int subdevice,
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
return -1; return -1;
...@@ -248,7 +248,7 @@ int comedi_mark_buffer_written(void *d, unsigned int subdevice, ...@@ -248,7 +248,7 @@ int comedi_mark_buffer_written(void *d, unsigned int subdevice,
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
int bytes_written; int bytes_written;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
...@@ -267,7 +267,7 @@ int comedi_get_buffer_size(void *d, unsigned int subdev) ...@@ -267,7 +267,7 @@ int comedi_get_buffer_size(void *d, unsigned int subdev)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdev; struct comedi_subdevice *s = dev->subdevices + subdev;
comedi_async *async; struct comedi_async *async;
if (subdev >= dev->n_subdevices) if (subdev >= dev->n_subdevices)
return -1; return -1;
...@@ -282,7 +282,7 @@ int comedi_get_buffer_offset(void *d, unsigned int subdevice) ...@@ -282,7 +282,7 @@ int comedi_get_buffer_offset(void *d, unsigned int subdevice)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice; struct comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async; struct comedi_async *async;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
return -1; return -1;
......
...@@ -125,7 +125,7 @@ int comedi_command(void *d, comedi_cmd *cmd) ...@@ -125,7 +125,7 @@ int comedi_command(void *d, comedi_cmd *cmd)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
unsigned runflags; unsigned runflags;
if (cmd->subdev >= dev->n_subdevices) if (cmd->subdev >= dev->n_subdevices)
...@@ -372,7 +372,7 @@ int comedi_unlock(void *d, unsigned int subdevice) ...@@ -372,7 +372,7 @@ int comedi_unlock(void *d, unsigned int subdevice)
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned long flags; unsigned long flags;
comedi_async *async; struct comedi_async *async;
int ret; int ret;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
...@@ -469,7 +469,7 @@ int comedi_register_callback(void *d, unsigned int subdevice, ...@@ -469,7 +469,7 @@ int comedi_register_callback(void *d, unsigned int subdevice,
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s; struct comedi_subdevice *s;
comedi_async *async; struct comedi_async *async;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
return -EINVAL; return -EINVAL;
...@@ -505,7 +505,7 @@ int comedi_poll(void *d, unsigned int subdevice) ...@@ -505,7 +505,7 @@ int comedi_poll(void *d, unsigned int subdevice)
{ {
struct comedi_device *dev = (struct comedi_device *) d; struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices; struct comedi_subdevice *s = dev->subdevices;
comedi_async *async; struct comedi_async *async;
if (subdevice >= dev->n_subdevices) if (subdevice >= dev->n_subdevices)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment