#define MAGIC_DMA_WORD 0x5a5a
-static const comedi_lrange range_pcl816 = { 8, {
+static const struct comedi_lrange range_pcl816 = { 8, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
int n_aochan; // num of D/A chans
int n_dichan; // num of DI chans
int n_dochan; // num of DO chans
- const comedi_lrange *ai_range_type; // default A/D rangelist
- const comedi_lrange *ao_range_type; // dafault D/A rangelist
+ const struct comedi_lrange *ai_range_type; // default A/D rangelist
+ const struct comedi_lrange *ao_range_type; // dafault D/A rangelist
unsigned int io_range; // len of IO space
unsigned int IRQbits; // allowed interrupts
unsigned int DMAbits; // allowed DMA chans
#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 RTC_timer_lock = 0; /* RTC int lock */
#endif
-static comedi_driver driver_pcl816 = {
+static struct comedi_driver driver_pcl816 = {
driver_name:"pcl816",
module:THIS_MODULE,
attach:pcl816_attach,
#endif
int irq_was_now_closed; // when IRQ finish, there's stored int816_mode for last interrupt
int int816_mode; // who now uses IRQ - 1=AI1 int, 2=AI1 dma, 3=AI3 int, 4AI3 dma
- comedi_subdevice *last_int_sub; // ptr to subdevice which now finish
+ struct comedi_subdevice *last_int_sub; // ptr to subdevice which now finish
int ai_act_scan; // how many scans we finished
unsigned int ai_act_chanlist[16]; // MUX setting for actual AI operations
unsigned int ai_act_chanlist_len; // how long is actual MUX list
unsigned int ai_act_chanlist_pos; // actual position in MUX list
unsigned int ai_poll_ptr; // how many sampes transfer poll
- comedi_subdevice *sub_ai; // ptr to AI subdevice
+ struct comedi_subdevice *sub_ai; // ptr to AI subdevice
#ifdef unused
struct timer_list rtc_irq_timer; // timer for RTC sanity check
unsigned long rtc_freq; // RTC int freq
/*
==============================================================================
*/
-static int check_and_setup_channel_list(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 check_and_setup_channel_list(struct comedi_device * dev,
+ struct comedi_subdevice * s, unsigned int *chanlist, int chanlen);
+static int pcl816_ai_cancel(struct comedi_device * dev, struct 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,
- comedi_cmd * cmd);
-static int pcl816_ai_cmd(comedi_device * dev, comedi_subdevice * s);
+static int pcl816_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_cmd * cmd);
+static int pcl816_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s);
/*
==============================================================================
ANALOG INPUT MODE0, 816 cards, slow version
*/
-static int pcl816_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, unsigned int * data)
+static int pcl816_ai_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
int n;
int timeout;
*/
static irqreturn_t interrupt_pcl816_ai_mode13_int(int irq, void *d)
{
- comedi_device *dev = d;
- comedi_subdevice *s = dev->subdevices + 0;
+ struct comedi_device *dev = d;
+ struct 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, struct 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;
- comedi_subdevice *s = dev->subdevices + 0;
+ struct comedi_device *dev = d;
+ struct comedi_subdevice *s = dev->subdevices + 0;
int len, bufptr, this_dma_buf;
unsigned long dma_flags;
short *ptr;
*/
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) {
==============================================================================
COMMAND MODE
*/
-static void pcl816_cmdtest_out(int e, comedi_cmd * cmd)
+static void pcl816_cmdtest_out(int e, struct comedi_cmd * cmd)
{
rt_printk("pcl816 e=%d startsrc=%x scansrc=%x convsrc=%x\n", e,
cmd->start_src, cmd->scan_begin_src, cmd->convert_src);
/*
==============================================================================
*/
-static int pcl816_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
- comedi_cmd * cmd)
+static int pcl816_ai_cmdtest(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_cmd * cmd)
{
int err = 0;
int tmp, divisor1, divisor2;
return 0;
}
-static int pcl816_ai_cmd(comedi_device * dev, comedi_subdevice * s)
+static int pcl816_ai_cmd(struct comedi_device * dev, struct comedi_subdevice * s)
{
unsigned int divisor1 = 0, divisor2 = 0, dma_flags, bytes, dmairq;
- comedi_cmd *cmd = &s->async->cmd;
+ struct comedi_cmd *cmd = &s->async->cmd;
if (cmd->start_src != TRIG_NOW)
return -EINVAL;
return 0;
}
-static int pcl816_ai_poll(comedi_device * dev, comedi_subdevice * s)
+static int pcl816_ai_poll(struct comedi_device * dev, struct 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, struct 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, struct 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;
unsigned int irq, dma;
unsigned long pages;
//int i;
- comedi_subdevice *s;
+ struct comedi_subdevice *s;
/* claim our I/O space */
iobase = it->options[0];
==============================================================================
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);
)