}
}
- // check channel/gain list against card's limitations
- if(cmd->chanlist)
- {
- gain = CR_RANGE(cmd->chanlist[0]);
- start_chan = CR_CHAN(cmd->chanlist[0]);
- for(i = 1; i < cmd->chanlist_len; i++)
- {
- if(CR_CHAN(cmd->chanlist[i]) != (start_chan + i) % s->n_chan)
- {
- comedi_error(dev, "entries in chanlist must be consecutive channels, counting upwards\n");
- err++;
- }
- if(CR_RANGE(cmd->chanlist[i]) != gain)
- {
- comedi_error(dev, "entries in chanlist must all have the same gain\n");
- err++;
- }
- }
- }
-
if(err)return 3;
/* step 4: fix up any arguments */
if(err) return 4;
+ // check channel/gain list against card's limitations
+ if(cmd->chanlist)
+ {
+ gain = CR_RANGE(cmd->chanlist[0]);
+ start_chan = CR_CHAN(cmd->chanlist[0]);
+ for(i = 1; i < cmd->chanlist_len; i++)
+ {
+ if(CR_CHAN(cmd->chanlist[i]) != (start_chan + i) % s->n_chan)
+ {
+ comedi_error(dev, "entries in chanlist must be consecutive channels, counting upwards\n");
+ err++;
+ }
+ if(CR_RANGE(cmd->chanlist[i]) != gain)
+ {
+ comedi_error(dev, "entries in chanlist must all have the same gain\n");
+ err++;
+ }
+ }
+ }
+
+ if(err) return 5;
+
return 0;
}
{
unsigned int err=0, tmp, i;
- // check chanlist against board's peculiarities
- if(cmd->chanlist && cmd->chanlist_len > 1)
- {
- for(i = 0; i < cmd->chanlist_len; i++)
- {
- // even/odd channels must go into even/odd queue addresses
- if((i % 2) != (CR_CHAN(cmd->chanlist[i]) % 2))
- {
- comedi_error(dev, "bad chanlist:\n"
- " even/odd channels must go have even/odd chanlist indices");
- err++;
- }
- }
- if((cmd->chanlist_len % 2) != 0)
- {
- comedi_error(dev, "chanlist must be of even length or length 1");
- err++;
- }
- }
- if(err) return -EINVAL;
-
/* make sure triggers are valid */
tmp=cmd->start_src;
cmd->start_src &= TRIG_NOW | TRIG_EXT;
if(err) return 4;
+ // check chanlist against board's peculiarities
+ if(cmd->chanlist && cmd->chanlist_len > 1)
+ {
+ for(i = 0; i < cmd->chanlist_len; i++)
+ {
+ // even/odd channels must go into even/odd queue addresses
+ if((i % 2) != (CR_CHAN(cmd->chanlist[i]) % 2))
+ {
+ comedi_error(dev, "bad chanlist:\n"
+ " even/odd channels must go have even/odd chanlist indices");
+ err++;
+ }
+ }
+ if((cmd->chanlist_len % 2) != 0)
+ {
+ comedi_error(dev, "chanlist must be of even length or length 1");
+ err++;
+ }
+ }
+
+ if(err) return 5;
+
return 0;
}
err++;
}
- // make sure user is not trying to mix unipolar and bipolar ranges
- if(cmd->chanlist)
- {
- unipolar = CR_RANGE(cmd->chanlist[0]) & UNIPOLAR;
- for(i = 1; i < cmd->chanlist_len; i++)
- {
- if(unipolar != (CR_RANGE(cmd->chanlist[i]) & UNIPOLAR))
- {
- comedi_error(dev, "unipolar and bipolar ranges cannot be mixed in the chanlist");
- err++;
- break;
- }
- }
- }
-
switch(cmd->stop_src)
{
case TRIG_EXT:
if(err) return 4;
+ // make sure user is not trying to mix unipolar and bipolar ranges
+ if(cmd->chanlist)
+ {
+ unipolar = CR_RANGE(cmd->chanlist[0]) & UNIPOLAR;
+ for(i = 1; i < cmd->chanlist_len; i++)
+ {
+ if(unipolar != (CR_RANGE(cmd->chanlist[i]) & UNIPOLAR))
+ {
+ comedi_error(dev, "unipolar and bipolar ranges cannot be mixed in the chanlist");
+ err++;
+ break;
+ }
+ }
+ }
+
+ if(err) return 5;
+
return 0;
}
err++;
}
}
+
+ if(err)return 3;
+
+ /* step 4: fix up any arguments */
+
+ if(cmd->convert_src == TRIG_TIMER)
+ {
+ tmp = cmd->convert_arg;
+ /* calculate counter values that give desired timing */
+ i8253_cascade_ns_to_timer_2div(TIMER_BASE, &(devpriv->divisor1), &(devpriv->divisor2), &(cmd->convert_arg), cmd->flags & TRIG_ROUND_MASK);
+ if(tmp != cmd->convert_arg) err++;
+ }
+
+ if(err)return 4;
+
// check channel/gain list against card's limitations
if(cmd->chanlist)
{
}
}
- if(err)return 3;
-
- /* step 4: fix up any arguments */
-
- if(cmd->convert_src == TRIG_TIMER)
- {
- tmp = cmd->convert_arg;
- /* calculate counter values that give desired timing */
- i8253_cascade_ns_to_timer_2div(TIMER_BASE, &(devpriv->divisor1), &(devpriv->divisor2), &(cmd->convert_arg), cmd->flags & TRIG_ROUND_MASK);
- if(tmp != cmd->convert_arg) err++;
- }
-
- if(err)return 4;
+ if(err)return 5;
return 0;
}