From 1169d536703b341d1bb787a32b290b2dc6c311d2 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Tue, 10 Jul 2007 15:37:07 +0000 Subject: [PATCH] Added buf_change functions for gpct subdevices. --- comedi/drivers/ni_pcimio.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index 94fe5931..55ea61a1 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -1454,6 +1454,10 @@ static int pcimio_ai_change(comedi_device *dev, comedi_subdevice *s, unsigned long new_size); static int pcimio_ao_change(comedi_device *dev, comedi_subdevice *s, unsigned long new_size); +static int pcimio_gpct0_change(comedi_device *dev, comedi_subdevice *s, + unsigned long new_size); +static int pcimio_gpct1_change(comedi_device *dev, comedi_subdevice *s, + unsigned long new_size); static void m_series_init_eeprom_buffer(comedi_device *dev) { @@ -1586,8 +1590,10 @@ static int pcimio_attach(comedi_device *dev,comedi_devconfig *it) ret = ni_E_init(dev,it); if(ret<0)return ret; - dev->subdevices[0].buf_change = pcimio_ai_change; - dev->subdevices[1].buf_change = pcimio_ao_change; + dev->subdevices[NI_AI_SUBDEV].buf_change = &pcimio_ai_change; + dev->subdevices[NI_AO_SUBDEV].buf_change = &pcimio_ao_change; + dev->subdevices[NI_GPCT_SUBDEV(0)].buf_change = &pcimio_gpct0_change; + dev->subdevices[NI_GPCT_SUBDEV(1)].buf_change = &pcimio_gpct1_change; return ret; } @@ -1641,3 +1647,25 @@ static int pcimio_ao_change(comedi_device *dev, comedi_subdevice *s, return 0; } + +static int pcimio_gpct0_change(comedi_device *dev, comedi_subdevice *s, + unsigned long new_size) +{ + int ret; + + ret = mite_buf_change(devpriv->gpct_mite_ring[0], s->async); + if(ret < 0) return ret; + + return 0; +} + +static int pcimio_gpct1_change(comedi_device *dev, comedi_subdevice *s, + unsigned long new_size) +{ + int ret; + + ret = mite_buf_change(devpriv->gpct_mite_ring[1], s->async); + if(ret < 0) return ret; + + return 0; +} -- 2.26.2