static int do_bufconfig_ioctl(struct comedi_device *dev, void *arg)
{
comedi_bufconfig bc;
- comedi_async *async;
+ struct comedi_async *async;
struct comedi_subdevice *s;
int ret = 0;
{
comedi_bufinfo bi;
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
if (copy_from_user(&bi, arg, sizeof(comedi_bufinfo)))
return -EFAULT;
{
comedi_cmd user_cmd;
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
int ret = 0;
unsigned int *chanlist_saver = NULL;
void comedi_unmap(struct vm_area_struct *area)
{
- comedi_async *async;
+ struct comedi_async *async;
struct comedi_device *dev;
async = area->vm_private_data;
struct comedi_device_file_info *dev_file_info =
comedi_get_device_file_info(minor);
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 size;
int n_pages;
loff_t *offset)
{
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode);
loff_t *offset)
{
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
int n, m, count = 0, retval = 0;
DECLARE_WAITQUEUE(wait, current);
const unsigned minor = iminor(file->f_dentry->d_inode);
*/
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);
#ifdef CONFIG_COMEDI_RT
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_mask = 0;
#define COMEDI_NUM_BOARD_MINORS 0x30
#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_lrange_struct comedi_lrange;
void *private;
- comedi_async *async;
+ struct comedi_async *async;
void *lock;
void *busy;
dma_addr_t dma_addr;
};
-struct comedi_async_struct {
+struct comedi_async {
struct comedi_subdevice *subdevice;
void *prealloc_buf; /* pre-allocated buffer */
}
}
-int comedi_buf_put(comedi_async *async, short x);
-int comedi_buf_get(comedi_async *async, short *x);
+int comedi_buf_put(struct 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_alloc(comedi_async *async, unsigned int nbytes);
-unsigned int comedi_buf_write_alloc_strict(comedi_async *async,
+unsigned int comedi_buf_write_n_available(struct comedi_async *async);
+unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes);
+unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async,
unsigned int nbytes);
-unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes);
-unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes);
-unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes);
-unsigned int comedi_buf_read_n_available(comedi_async *async);
-void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset,
+unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
+unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes);
+unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes);
+unsigned int comedi_buf_read_n_available(struct comedi_async *async);
+void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
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);
-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;
}
-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;
}
-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)
{
{
int i;
struct comedi_subdevice *s;
- comedi_async *async = NULL;
+ struct comedi_async *async = NULL;
int ret;
for (i = 0; i < dev->n_subdevices; i++) {
SDF_CMD_WRITE)) == 0);
BUG_ON(!s->do_cmdtest);
- async = kzalloc(sizeof(comedi_async), GFP_KERNEL);
+ async = kzalloc(sizeof(struct comedi_async), GFP_KERNEL);
if (async == NULL) {
printk("failed to allocate async struct\n");
return -ENOMEM;
int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long new_size)
{
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
/* Round up new_size to multiple of PAGE_SIZE */
new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK;
/* munging is applied to data by core as it passes between user
* 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;
unsigned int count = 0;
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 nbytes;
}
/* 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;
}
/* 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 free_end = async->buf_read_count + async->prealloc_bufsz;
}
/* 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 -
async->buf_write_alloc_count) > 0) {
}
/* 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) >
0) {
}
/* 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 */
smp_mb();
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)
{
unsigned int write_ptr = async->buf_write_ptr + 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 *src;
}
}
-unsigned int comedi_buf_read_n_available(comedi_async *async)
+unsigned int comedi_buf_read_n_available(struct comedi_async *async)
{
unsigned 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);
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));
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_count = 0;
+----------------------------------------------------------------------------+
*/
-/*int i_APCI3120_InterruptHandleEos(struct comedi_device *dev)
+/*
+ * int i_APCI3120_InterruptHandleEos(struct comedi_device *dev)
{
int n_chan,i;
short *data;
struct comedi_subdevice *s=dev->subdevices+0;
- comedi_async *async = s->async;
- data=async->data+async->buf_int_ptr;//new samples added from here onwards
- n_chan=devpriv->ui_AiNbrofChannels;
+ struct comedi_async *async = s->async;
+ data=async->data+async->buf_int_ptr;
+ n_chan=devpriv->ui_AiNbrofChannels;
for(i=0;i<n_chan;i++)
{
{
struct comedi_device *dev = p_device;
struct comedi_subdevice *subdevice = dev->read_subdev;
- comedi_async *async;
+ struct comedi_async *async;
unsigned long irq_flags;
unsigned char intcsr;
pci224_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s, void *data,
unsigned int num_bytes, unsigned int chan_index)
{
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
short *array = data;
unsigned int length = num_bytes / sizeof(*array);
unsigned int offset;
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;
unsigned long irqflags;
{
unsigned long irqflags;
unsigned short conv;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
set_bit(AI_CMD_STARTED, &devpriv->state);
unsigned char zgat;
/* Get the command. */
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
/*
{
short data;
int i, ret;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
if (!devpriv->ao_continuous && (devpriv->ao_scan_count == 0)) {
/* 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)
{
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
unsigned int num_scans;
unsigned int room;
unsigned int i;
unsigned int todo;
unsigned int fifoamount;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
unsigned int scanlen = async->cmd.scan_end_arg;
/* Determine number of samples to read. */
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);
static int ai_config_insn(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_insn * insn, unsigned int * data);
static int cb_pcidas_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_cmd * cmd);
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,
- unsigned int trig_num);
+static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
+ struct comedi_subdevice *subdev,
+ unsigned int trig_num);
static int cb_pcidas_ao_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
comedi_cmd * cmd);
static irqreturn_t cb_pcidas_interrupt(int irq, void *d PT_REGS_ARG);
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;
unsigned int bits;
unsigned long flags;
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;
unsigned int i;
unsigned long flags;
return 0;
}
-static int cb_pcidas_ao_inttrig(struct comedi_device * dev, struct comedi_subdevice * s,
- unsigned int trig_num)
+static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ unsigned int trig_num)
{
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;
unsigned long flags;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async;
+ struct comedi_async *async;
int status, s5933_status;
int half_fifo = thisboard->fifo_size / 2;
unsigned int num_samples, i;
static void handle_ao_interrupt(struct comedi_device * dev, unsigned int status)
{
struct comedi_subdevice *s = dev->write_subdev;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
unsigned int half_fifo = thisboard->fifo_size / 2;
unsigned int num_points;
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)
{
unsigned long flags;
return 0;
}
-// cancel analog output command
-static int cb_pcidas_ao_cancel(struct comedi_device * dev, struct comedi_subdevice * s)
+/* cancel analog output command */
+static int cb_pcidas_ao_cancel(struct comedi_device *dev,
+ struct comedi_subdevice *s)
{
unsigned long flags;
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;
uint32_t bits;
unsigned int i;
static void pio_drain_ai_fifo_16(struct comedi_device * dev)
{
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
unsigned int i;
uint16_t prepost_bits;
static void pio_drain_ai_fifo_32(struct comedi_device * dev)
{
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
unsigned int i;
unsigned int max_transfer = 100000;
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;
int j;
int num_samples = 0;
unsigned int plx_status)
{
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
uint8_t dma1_status;
unsigned long flags;
unsigned int plx_status)
{
struct comedi_subdevice *s = dev->write_subdev;
- comedi_async *async;
+ struct comedi_async *async;
comedi_cmd *cmd;
uint8_t dma0_status;
unsigned long flags;
static void increment_scan_progress(struct comedi_subdevice *subd,
unsigned int num_bytes)
{
- comedi_async *async = subd->async;
+ struct comedi_async *async = subd->async;
unsigned int scan_length = cfc_bytes_per_scan(subd);
async->scan_progress += num_bytes;
unsigned int cfc_write_array_to_buffer(struct comedi_subdevice *subd, void *data,
unsigned int num_bytes)
{
- comedi_async *async = subd->async;
+ struct comedi_async *async = subd->async;
unsigned int retval;
if (num_bytes == 0)
unsigned int cfc_read_array_from_buffer(struct comedi_subdevice *subd, void *data,
unsigned int num_bytes)
{
- comedi_async *async = subd->async;
+ struct comedi_async *async = subd->async;
if (num_bytes == 0)
return 0;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + 0;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
int i, ret;
unsigned long long n;
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;
RTIME now, delay, period;
int ret;
static void waveform_ai_interrupt(unsigned long 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;
unsigned int i, j;
/* all times in microsec */
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;
unsigned int byte;
unsigned long flags;
{
unsigned long dma_flags, spin_flags;
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async;
+ struct comedi_async *async;
comedi_cmd *cmd;
int num_bytes, residue;
int buffer_index;
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;
unsigned int byte, i;
static void das16m1_handler(struct comedi_device * dev, unsigned int status)
{
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
comedi_cmd *cmd;
u16 num_samples;
u16 hw_counter;
static void das1800_ai_handler(struct comedi_device * dev)
{
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;
unsigned int status = inb(dev->iobase + DAS1800_STATUS);
{
int ret;
int control_a, control_c;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd cmd = async->cmd;
if (!dev->irq) {
short dataPoint = 0;
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev; /* analog input subdevice */
- comedi_async *async;
+ struct comedi_async *async;
int status;
unsigned long irq_flags;
static const int max_loops = 128; // half-fifo size for cio-das802/16
int startChan, endChan, scan, gain;
int conv_bits;
unsigned long irq_flags;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
if (!dev->irq) {
comedi_error(dev,
{
uint32_t bits;
unsigned long flags;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
hpdi_writel(dev, RX_FIFO_RESET_BIT, BOARD_CONTROL_REG);
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;
int j;
int num_samples = 0;
{
struct comedi_device *dev = d;
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 plx_status;
uint32_t plx_bits;
/**************************************/
-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;
int i;
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;
unsigned int nbytes, old_alloc_count;
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;
u32 nbytes_ub, nbytes_lb;
unsigned mite_dma_tcr(struct mite_channel *mite_chan);
void mite_dma_arm(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_output_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, struct comedi_async * async);
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_read_from_memory_lb(struct mite_channel *mite_chan);
int mite_done(struct mite_channel *mite_chan);
#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);
void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan,
int dir);
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits);
int mite_buf_change(struct mite_dma_descriptor_ring *ring,
- comedi_async *async);
+ struct comedi_async *async);
#ifdef DEBUG_MITE
void mite_print_chsr(unsigned int chsr);
unsigned long flags;
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async;
+ struct comedi_async *async;
comedi_cmd *cmd;
unsigned int max_points, num_points, residue, leftover;
short dpnt;
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;
unsigned long lock_flags;
unsigned int old_config_bits = devpriv->config_bits;
int channel, range, aref;
unsigned long irq_flags;
int ret;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
enum transfer_type xfer;
unsigned long flags;
{
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async;
+ struct comedi_async *async;
comedi_cmd *cmd;
if (dev->attached == 0) {
{
unsigned int lsb, msb;
short data;
- comedi_async *async = dev->read_subdev->async;
+ struct comedi_async *async = dev->read_subdev->async;
const int timeout = 10000;
unsigned int i;
static void labpc_drain_dma(struct comedi_device * dev)
{
struct comedi_subdevice *s = dev->read_subdev;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
int status;
unsigned long flags;
unsigned int max_points, num_points, residue, leftover;
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;
int chan;
int i;
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;
if (boardtype.reg_type == ni_reg_611x) {
static void ni_ai_munge(struct comedi_device * dev, struct comedi_subdevice * s,
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 length = num_bytes / bytes_per_sample(s);
short *array = data;
static void ni_ao_munge(struct comedi_device * dev, struct comedi_subdevice * s,
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 i;
unsigned int offset;
{
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices;
- comedi_async *async = s->async;
+ struct comedi_async *async = s->async;
struct mite_struct *mite = devpriv->mite;
//int i, j;
comedi_insn * insn, unsigned int * data);
extern int ni_tio_winsn(struct ni_gpct *counter,
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_cancel(struct ni_gpct *counter);
extern void ni_tio_handle_interrupt(struct ni_gpct *counter,
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;
comedi_cmd *cmd = &async->cmd;
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");
return -ENOTSUPP;
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;
int set_gate_source = 0;
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;
int retval = 0;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
async = s->async;
if (async == NULL)
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
unsigned int num_bytes;
if (subdevice >= dev->n_subdevices)
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
int num_bytes;
async = s->async;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
if (subdevice >= dev->n_subdevices)
return -1;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
int bytes_written;
if (subdevice >= dev->n_subdevices)
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdev;
- comedi_async *async;
+ struct comedi_async *async;
if (subdev >= dev->n_subdevices)
return -1;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_async *async;
+ struct comedi_async *async;
if (subdevice >= dev->n_subdevices)
return -1;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
unsigned runflags;
if (cmd->subdev >= dev->n_subdevices)
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s;
unsigned long flags;
- comedi_async *async;
+ struct comedi_async *async;
int ret;
if (subdevice >= dev->n_subdevices)
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s;
- comedi_async *async;
+ struct comedi_async *async;
if (subdevice >= dev->n_subdevices)
return -EINVAL;
{
struct comedi_device *dev = (struct comedi_device *) d;
struct comedi_subdevice *s = dev->subdevices;
- comedi_async *async;
+ struct comedi_async *async;
if (subdevice >= dev->n_subdevices)
return -EINVAL;