-#define DRIVER_VERSION "v1.00pre11"
+#define DRIVER_VERSION "v1.00pre12"
#define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com"
#define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"
/*
Description: University of Stirling USB DAQ & INCITE Technology Limited
Devices: [ITL] USB-DUX (usbdux.o)
Author: Bernd Porr <BerndPorr@f2s.com>
-Updated: 13 Apr 2005
+Updated: 23 May 2005
Status: Stable
Configuration options:
You have to upload firmware with the -i option. The
// generates loads of debug info
// #define NOISY_DUX_DEBUGBUG
-// generates moderate amount of debug info
-#define CONFIG_COMEDI_DEBUG
-
-// uncomment this if you don't want to have debug infos from CVS versions
-#undef CONFIG_COMEDI_DEBUG
-
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
// Stops the data acquision
// It should be safe to call this function from any context
static int usbduxsub_unlink_InURBs(usbduxsub_t* usbduxsub_tmp) {
- int i,j=0;
+ int i=0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+ int j=0;
+#endif
int err=0;
if (usbduxsub_tmp && usbduxsub_tmp->urbIn) {
usb_kill_urb(usbduxsub_tmp->urbIn[i]);
#endif
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk("comedi: usbdux: unlinked InURB %d: res=%d\n",
- i,
- j);
+#ifdef NOISY_DUX_DEBUGBUG
+ printk("comedi: usbdux: unlinked InURB %d, err=%d\n",
+ i,err);
#endif
}
}
return -EFAULT;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi: usbdux_ai_stop\n");
#endif
int res=0;
// force unlink of all urbs
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi: usbdux_ai_cancel\n");
#endif
this_usbduxsub=dev->private;
static int usbduxsub_unlink_OutURBs(usbduxsub_t* usbduxsub_tmp) {
- int i,j=0;
+ int i=0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+ int j=0;
+#endif
+
int err=0;
if (usbduxsub_tmp && usbduxsub_tmp->urbOut) {
usb_kill_urb(usbduxsub_tmp->urbOut[i]);
#endif
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk("comedi: usbdux: unlinked OutURB %d: res=%d\n",i,j);
+#ifdef NOISY_DUX_DEBUGBUG
+ printk("comedi: usbdux: unlinked OutURB %d: res=%d\n",
+ i,err);
#endif
}
}
int ret=0;
if (!this_usbduxsub) {
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi?: usbdux_ao_stop: this_usbduxsub=NULL!\n");
#endif
return -EFAULT;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi: usbdux_ao_cancel\n");
#endif
if (do_unlink) {
// timeout
EZTIMEOUT
);
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi_: usbdux: result=%d\n",errcode);
#endif
if (errcode<0) {
usbduxsub->urbIn[i]->dev = usbduxsub->usbdev;
usbduxsub->urbIn[i]->status = 0;
usbduxsub->urbIn[i]->transfer_flags = URB_ISO_ASAP;
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux: submitting in-urb[%d]: %p,%p intv=%d\n",
usbduxsub->comedidev->minor,
i,
return -EFAULT;
}
for (i=0; i < usbduxsub->numOfOutBuffers; i++) {
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi_: usbdux: submitting out-urb[%d]\n",i);
#endif
// in case of a resubmission after an unlink...
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux_ai_cmdtest\n",dev->minor);
#endif
/* make sure triggers are valid */
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux_ai_inttrig\n",dev->minor);
#endif
usbduxsub_t* this_usbduxsub=dev->private;
int result;
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux_ai_cmd\n",dev->minor);
#endif
if (!this_usbduxsub) {
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi %d: sending commands to the usb device: ",
dev->minor);
printk("size=%u\n",
if (!(this_usbduxsub->probed)) {
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux_ao_cmdtest\n",dev->minor);
#endif
/* make sure triggers are valid */
}
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: err=%d, scan_begin_src=%d, scan_begin_arg=%d, convert_src=%d, convert_arg=%d\n",
dev->minor,
err,
up(&this_usbduxsub->sem);
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux_ao_cmd\n",dev->minor);
#endif
break;
}
this_usbduxsub->dac_commands[i]=(chan<<6);
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: dac command for ch %d is %x\n",
dev->minor,
i,
// 1ms
// timing of the scan: we get all channels at once
this_usbduxsub->ao_timer = cmd->scan_begin_arg/1000000;
-#ifdef CONFIG_COMEDI_DEBUG
+#ifdef NOISY_DUX_DEBUGBUG
printk("comedi%d: usbdux: scan_begin_src=%d, scan_begin_arg=%d, convert_src=%d, convert_arg=%d\n",
dev->minor,
cmd->scan_begin_src,
// we've reached the bottom of the function
usbduxsub[index].probed=1;
up(&start_stop_sem);
- printk("comedi_: usbdux%d has been successfully initialized.\n",index);
+ printk("comedi_: usbdux%d has been successfully initialised.\n",index);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
return (void*)(&usbduxsub[index]);
#else
up(&start_stop_sem);
- printk("comedi%d: successfully attached to usbdux.\n",
+ printk("comedi%d: attached to usbdux.\n",
dev->minor);
return 0;