From: David Schleef Date: Wed, 2 Feb 2000 04:49:42 +0000 (+0000) Subject: moved module.c to comedi_fops.c X-Git-Tag: r0_7_38~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d1a336867648009bb05355334383ac1d32ec0b96;p=comedi.git moved module.c to comedi_fops.c merged patch --- diff --git a/Makefile b/Makefile index 627e3c44..45637b69 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERS1 = 0 VERS2 = 7 -VERS3 = 36 +VERS3 = 37 INSTALLDIR=/usr diff --git a/comedi/Config.in b/comedi/Config.in index 88e8b2f6..326d0ab4 100644 --- a/comedi/Config.in +++ b/comedi/Config.in @@ -1,46 +1,54 @@ +#mainmenu_option next_comment +#comment 'Comedi support' + +#tristate 'Comedi support' CONFIG_COMEDI + define_bool CONFIG_COMEDI m +if [ "$CONFIG_COMEDI" != "n" ];then + comment 'Comedi Features' -#bool 'Backwards compatibility' CONFIG_BACKWARDS +#bool 'Backwards compatibility' CONFIG_COMEDI_BACKWARDS tristate 'Kernel Comedilib' CONFIG_COMEDI_KLIB if [ "$CONFIG_RTL" = "y" ];then - define_bool CONFIG_COMEDI_RT y - define_bool CONFIG_COMEDI_RTL y + bool 'Real-time support' CONFIG_COMEDI_RT + if [ "$CONFIG_COMEDI_RT" = "y" ];then + define_bool CONFIG_COMEDI_RTL y + fi fi -if [ "$CONFIG_RTAI" = "y" ];then +if [ "$CONFIG_RTHAL" = "y" ];then bool 'Real-time support' CONFIG_COMEDI_RT - if [ "$CONFIG_RTAI" = "y" ];then + if [ "$CONFIG_COMEDI_RT" = "y" ];then define_bool CONFIG_COMEDI_RTAI y fi fi bool 'Verbose Debugging' CONFIG_COMEDI_DEBUG +bool 'Version 0.8 support' CONFIG_COMEDI_VER08 comment 'Hardware device drivers' bool 'Data Translation boards' CONFIG_COMEDI_DT -if [ "$CONFIG_DT" = "y" ];then - tristate 'DT 2801' CONFIG_COMEDI_DT2801 - tristate 'DT 2811' CONFIG_COMEDI_DT2811 - tristate 'DT 2814' CONFIG_COMEDI_DT2814 - tristate 'DT 2815' CONFIG_COMEDI_DT2815 - tristate 'DT 2817' CONFIG_COMEDI_DT2817 - tristate 'DT 2821 series' CONFIG_COMEDI_DT282x - if [ "$CONFIG_EXPERIMENTAL" = "y" ];then - tristate 'DT3000' CONFIG_COMEDI_DT3000 - fi +if [ "$CONFIG_COMEDI_DT" = "y" ];then + tristate ' DT 2801' CONFIG_COMEDI_DT2801 + tristate ' DT 2811' CONFIG_COMEDI_DT2811 + tristate ' DT 2814' CONFIG_COMEDI_DT2814 + tristate ' DT 2815' CONFIG_COMEDI_DT2815 + tristate ' DT 2817' CONFIG_COMEDI_DT2817 + tristate ' DT 2821 series' CONFIG_COMEDI_DT282x + tristate ' DT3000' CONFIG_COMEDI_DT3000 fi bool 'National Instruments boards' CONFIG_COMEDI_NI -if [ "$CONFIG_NI" = "y" ];then - tristate 'AT-MIO E series' CONFIG_COMEDI_NI_ATMIO +if [ "$CONFIG_COMEDI_NI" = "y" ];then + tristate ' AT-MIO E series' CONFIG_COMEDI_NI_ATMIO if [ "$CONFIG_PCI" = "y" ];then - tristate 'PCI-MIO E series' CONFIG_COMEDI_NI_PCIMIO - tristate 'NI PCI-DIO series' CONFIG_COMEDI_NI_PCIDIO + tristate ' PCI-MIO E series' CONFIG_COMEDI_NI_PCIMIO + tristate ' NI PCI-DIO series' CONFIG_COMEDI_NI_PCIDIO if [ "$CONFIG_COMEDI_NI_PCIMIO" = "y" -o "$CONFIG_COMEDI_NI_PCIDIO" = "y" ];then define_bool CONFIG_COMEDI_MITE y fi @@ -61,4 +69,6 @@ tristate 'PCL-726' CONFIG_COMEDI_PCL726 tristate 'Analog Devices RTI-800/815' CONFIG_COMEDI_RTI800 tristate 'Analog Devices RTI-802' CONFIG_COMEDI_RTI802 +fi +#endmenu diff --git a/comedi/Makefile b/comedi/Makefile index ad92c156..5ba357fe 100644 --- a/comedi/Makefile +++ b/comedi/Makefile @@ -13,10 +13,13 @@ endif MOD_LIST_NAME := MISC_MODULES M_OBJS := comedi.o -MI_OBJS := module.o dummy.o proc.o range.o drivers.o kvmem.o +MI_OBJS := comedi_fops.o dummy.o proc.o range.o drivers.o kvmem.o MIX_OBJS := comedi_ksyms.o +ifeq ($(CONFIG_COMEDI_REALTIME),y) +MI_OBJS += rt.o +endif ifeq ($(CONFIG_COMEDI_RTL),y) MI_OBJS += rtl.o @@ -53,8 +56,8 @@ range-$(CONFIG_COMEDI_DAS1600) += drivers/das1600.c include $(TOPDIR)/Rules.make -comedi.o: $(MI_OBJS) - $(LD) -r -o $@ $(MI_OBJS) +comedi.o: $(MI_OBJS) $(MIX_OBJS) + $(LD) -r -o $@ $(MI_OBJS) $(MIX_OBJS) range.h: mk_range $(TOPDIR)/.config -rm -f range.h diff --git a/comedi/module.c b/comedi/comedi_fops.c similarity index 94% rename from comedi/module.c rename to comedi/comedi_fops.c index c514a6ce..aa6fd023 100644 --- a/comedi/module.c +++ b/comedi/comedi_fops.c @@ -1,9 +1,9 @@ /* - module/module.c + comedi/comedi_fops.c comedi kernel module COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 1997-8 David A. Schleef + Copyright (C) 1997-2000 David A. Schleef This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include +#define __NO_VERSION__ #include #include #include @@ -1502,97 +1503,3 @@ int command_to_mode(comedi_trig *it,comedi_cmd *cmd) return -EINVAL; } -#ifdef CONFIG_COMEDI_RT - -static struct comedi_irq_struct *comedi_irqs; - -int comedi_request_irq(unsigned irq,void (*handler)(int, void *,struct pt_regs *), - unsigned long flags,const char *device,void *dev_id) -{ - struct comedi_irq_struct *it; - int ret; - - it=kmalloc(sizeof(*it),GFP_KERNEL); - if(!it) - return -ENOMEM; - - it->handler=handler; - it->irq=irq; - it->dev_id=dev_id; - it->flags=flags; - - ret=request_irq(irq,handler,flags&~SA_PRIORITY,device,dev_id); - if(ret<0){ - kfree(it); - return ret; - } - - if(flags&SA_PRIORITY){ - get_priority_irq(it); - } - - it->next=comedi_irqs; - comedi_irqs=it; - - return 0; -} - -int comedi_change_irq_flags(unsigned int irq,void *dev_id,unsigned long flags) -{ - struct comedi_irq_struct *it; - - it=get_irq_struct(irq); - if(it){ - if((it->flags&~SA_PRIORITY)!=(flags&~SA_PRIORITY)) - return -EINVAL; - - if((it->flags&SA_PRIORITY)==(flags&SA_PRIORITY)) - return 0; - - it->flags=flags; - if(flags&SA_PRIORITY){ - return get_priority_irq(it); - }else{ - return free_priority_irq(it); - } - } - - return -EINVAL; -} - -void comedi_free_irq(unsigned int irq,void *dev_id) -{ - struct comedi_irq_struct *it,*prev; - - prev=NULL; - for(it=comedi_irqs;it;it=it->next){ - if(it->irq==irq){ - break; - } - prev=it; - } - if(it->flags&SA_PRIORITY) - free_priority_irq(it); - - free_irq(it->irq,it->dev_id); - - if(prev) prev->next=it->next; - else comedi_irqs=it->next; - - kfree(it); -} - -struct comedi_irq_struct *get_irq_struct(unsigned int irq) -{ - struct comedi_irq_struct *it; - - for(it=comedi_irqs;it;it=it->next){ - if(it->irq==irq){ - return it; - } - } - return NULL; -} - -#endif - diff --git a/comedi/comedi_ksyms.c b/comedi/comedi_ksyms.c index f5d45960..36cdea77 100644 --- a/comedi/comedi_ksyms.c +++ b/comedi/comedi_ksyms.c @@ -60,6 +60,10 @@ EXPORT_SYMBOL(comedi_driver_unregister); EXPORT_SYMBOL(comedi_bufcheck); EXPORT_SYMBOL(comedi_done); EXPORT_SYMBOL(comedi_error); +EXPORT_SYMBOL(do_pack); +EXPORT_SYMBOL(di_unpack); +EXPORT_SYMBOL(comedi_eobuf); +EXPORT_SYMBOL(comedi_eos); #endif diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 301a8852..75092741 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -549,6 +549,18 @@ static void ni_load_channelgain_list(comedi_device *dev,unsigned int n_chan,unsi rt_printk("ni_E: timeout 1\n"); } +static int ni_ai_cmd(comedi_device *dev,comedi_subdevice *s) +{ + int wsave; + + wsave = win_save(); + + win_out(1,ADC_FIFO_Clear); + + + + return 0; +} /* mode 2 is timed, multi-channel diff --git a/comedi/rtai.c b/comedi/rtai.c index 3fcbe4d9..94f1a252 100644 --- a/comedi/rtai.c +++ b/comedi/rtai.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/comedi/rtl.c b/comedi/rtl.c index da8c222f..ff615e0a 100644 --- a/comedi/rtl.c +++ b/comedi/rtl.c @@ -7,7 +7,6 @@ #include #include -#include #include #include #include diff --git a/comedi/rtl_v1.c b/comedi/rtl_v1.c index b0a37533..78ef04c0 100644 --- a/comedi/rtl_v1.c +++ b/comedi/rtl_v1.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/scripts/config.dist b/scripts/config.dist index 1d4e3ed9..3f7d2e2f 100644 --- a/scripts/config.dist +++ b/scripts/config.dist @@ -1,45 +1,39 @@ # # Automatically generated make config: don't edit # +CONFIG_COMEDI=m # -# Features +# Comedi Features # -CONFIG_EXPORT=y -# CONFIG_COMEDI_RT is not set -CONFIG_DEBUG=y +CONFIG_COMEDI_KLIB=y +CONFIG_COMEDI_DEBUG=y # # Hardware device drivers # -CONFIG_DT=y -# CONFIG_DT2801 is not set -# CONFIG_DT2811 is not set -# CONFIG_DT2814 is not set -# CONFIG_DT2815 is not set -# CONFIG_DT2817 is not set -# CONFIG_DT282x is not set -CONFIG_NI=y -# CONFIG_ATMIO_E is not set -# CONFIG_PCIMIO_E is not set -# CONFIG_NI_PCIDIO is not set -# CONFIG_DAS08 is not set -# CONFIG_DAS08JR is not set -# CONFIG_DAS1600 is not set -# CONFIG_8255 is not set +CONFIG_COMEDI_DT=y +# CONFIG_COMEDI_DT2801 is not set +# CONFIG_COMEDI_DT2811 is not set +# CONFIG_COMEDI_DT2814 is not set +# CONFIG_COMEDI_DT2815 is not set +# CONFIG_COMEDI_DT2817 is not set +# CONFIG_COMEDI_DT282x is not set +# CONFIG_COMEDI_DT3000 is not set +CONFIG_COMEDI_NI=y +# CONFIG_COMEDI_NI_ATMIO is not set +# CONFIG_COMEDI_NI_PCIMIO is not set +# CONFIG_COMEDI_NI_PCIDIO is not set +# CONFIG_COMEDI_DAS08 is not set +# CONFIG_COMEDI_DAS08JR is not set +# CONFIG_COMEDI_DAS1600 is not set +# CONFIG_COMEDI_DAS16 is not set +# CONFIG_COMEDI_DAS6402 is not set +# CONFIG_COMEDI_8255 is not set +# CONFIG_COMEDI_MULTIQ3 is not set # CONFIG_COMEDI_PARPORT is not set -# CONFIG_RTI800 is not set -# CONFIG_RTI802 is not set -# CONFIG_PCL711 is not set -# CONFIG_PCL725 is not set -# CONFIG_PCL726 is not set -# CONFIG_MULTIQ3 is not set - -# -# Experimental extras (might not compile and/or work) -# -# CONFIG_ATMIO16F is not set -# CONFIG_DAS6402 is not set -# CONFIG_RTI860 is not set -# CONFIG_DT3000 is not set -# CONFIG_DAS16 is not set +# CONFIG_COMEDI_PCL711 is not set +# CONFIG_COMEDI_PCL725 is not set +# CONFIG_COMEDI_PCL726 is not set +# CONFIG_COMEDI_RTI800 is not set +# CONFIG_COMEDI_RTI802 is not set