From: David Schleef Date: Thu, 23 Mar 2000 18:58:49 +0000 (+0000) Subject: fixed data_len issues X-Git-Tag: r0_7_42~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b79f3ebb367a90addebe46c623c5891d0821ca67;p=comedi.git fixed data_len issues --- diff --git a/comedi/kcomedilib/data.c b/comedi/kcomedilib/data.c index e9e8addc..3ee3603a 100644 --- a/comedi/kcomedilib/data.c +++ b/comedi/kcomedilib/data.c @@ -56,6 +56,7 @@ int comedi_data_write(unsigned int dev,unsigned int subdev,unsigned int chan, chan = CR_PACK(chan,range,aref); cmd.subdev = subdev; cmd.data = &sdata; + cmd.data_len = sizeof(sampl_t); cmd.chanlist = &chan; @@ -77,6 +78,7 @@ int comedi_data_read(unsigned int dev,unsigned int subdev,unsigned int chan, chan = CR_PACK(chan,range,aref); cmd.subdev = subdev; cmd.data = &sdata; + cmd.data_len = sizeof(sampl_t); cmd.chanlist = &chan; diff --git a/comedi/kcomedilib/dio.c b/comedi/kcomedilib/dio.c index 44a2c935..e1be35f7 100644 --- a/comedi/kcomedilib/dio.c +++ b/comedi/kcomedilib/dio.c @@ -55,6 +55,7 @@ int comedi_dio_config(unsigned int dev,unsigned int subdev,unsigned int chan, cmd.subdev = subdev; cmd.data = &sdata; + cmd.data_len = sizeof(sampl_t); cmd.chanlist = &chan; @@ -74,6 +75,7 @@ int comedi_dio_read(unsigned int dev,unsigned int subdev,unsigned int chan, cmd.n = 1; cmd.subdev = subdev; cmd.data = &sdata; + cmd.data_len = sizeof(sampl_t); cmd.chanlist = &chan; ret = comedi_trig_ioctl(dev,subdev,&cmd); @@ -97,6 +99,7 @@ int comedi_dio_write(unsigned int dev,unsigned int subdev,unsigned int chan, cmd.n = 1; cmd.subdev = subdev; cmd.data = &sdata; + cmd.data_len = sizeof(sampl_t); cmd.chanlist = &chan; ret = comedi_trig_ioctl(dev,subdev,&cmd); diff --git a/comedi/kcomedilib/kcomedilib_main.c b/comedi/kcomedilib/kcomedilib_main.c index 2559f549..310e8822 100644 --- a/comedi/kcomedilib/kcomedilib_main.c +++ b/comedi/kcomedilib/kcomedilib_main.c @@ -375,7 +375,7 @@ static int comedi_trig_ioctl_modeN(comedi_device *dev,comedi_subdevice *s,comedi ret=-EINVAL; goto cleanup; #else - it->data_len=it->n_chan*it->n; + it->data_len=it->n_chan*it->n*sizeof(sample_t); rt_printk("comedi: warning: trig->data_len not set\n"); #endif }