devpriv->dux_commands[0] = cmd_type;
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast: dux_commands: ",
- devpriv->comedidev->minor);
- for (tmp = 0; tmp < SIZEOFDUXBUFFER; tmp++)
- printk(" %02x", devpriv->dux_commands[tmp]);
- printk("\n");
-#endif
-
tmp = usb_bulk_msg(devpriv->usb,
usb_sndbulkpipe(devpriv->usb, CHANNELLISTEP),
devpriv->dux_commands,
usb_kill_urb(devpriv->urbIn);
j = 0;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi: usbduxfast: unlinked InURB: res=%d\n", j);
-#endif
return err;
}
pr_err("%s: devpriv=NULL!\n", __func__);
return -EFAULT;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi: usbduxfast_ai_stop\n");
-#endif
devpriv->ai_cmd_running = 0;
int ret;
/* force unlink of all urbs */
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi: usbduxfast_ai_cancel\n");
-#endif
if (!devpriv) {
dev_err(dev->class_dev, "%s: devpriv=NULL\n", __func__);
return -EFAULT;
{
int ret;
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi: usbduxfast: uploading %d bytes", len);
- printk(KERN_DEBUG " to addr %d, first byte=%d.\n",
- startAddr, local_transfer_buffer[0]);
-#endif
/* brequest, firmware */
ret = usb_control_msg(devpriv->usb, usb_sndctrlpipe(devpriv->usb, 0),
USBDUXFASTSUB_FIRMWARE,
local_transfer_buffer,
len, /* length */
EZTIMEOUT); /* timeout */
-
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi_: usbduxfast: result=%d\n", ret);
-#endif
-
if (ret < 0) {
dev_err(&devpriv->intf->dev, "uppload failed\n");
return ret;
devpriv->transfer_buffer,
SIZEINBUF, usbduxfastsub_ai_Irq, devpriv->comedidev);
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast: submitting in-urb: "
- "0x%p,0x%p\n", devpriv->comedidev->minor, devpriv->urbIn->context,
- devpriv->urbIn->dev);
-#endif
ret = usb_submit_urb(devpriv->urbIn, GFP_ATOMIC);
if (ret) {
dev_err(&devpriv->intf->dev,
up(&devpriv->sem);
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast_ai_inttrig\n", dev->minor);
-#endif
if (trignum != 0) {
dev_err(dev->class_dev, "%s: invalid trignum\n", __func__);
int result;
long steps, steps_tmp;
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast_ai_cmd\n", dev->minor);
-#endif
if (!devpriv)
return -EFAULT;
up(&devpriv->sem);
return -EINVAL;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast: steps=%ld, convert_arg=%u\n",
- dev->minor, steps, cmd->convert_arg);
-#endif
switch (cmd->chanlist_len) {
case 1:
return -EFAULT;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi %d: sending commands to the usb device\n",
- dev->minor);
-#endif
/* 0 means that the AD commands are sent */
result = send_dux_commands(devpriv, SENDADCOMMANDS);
if (result < 0) {
dev_err(dev->class_dev, "%s: no usb dev.\n", __func__);
return -ENODEV;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: ai_insn_read, insn->n=%d, "
- "insn->subdev=%d\n", dev->minor, insn->n, insn->subdev);
-#endif
+
down(&devpriv->sem);
if (!devpriv->probed) {
up(&devpriv->sem);
devpriv->dux_commands[OUTBASE + 6] = 0xFF & rngmask;
devpriv->dux_commands[LOGBASE + 0] = 0;
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi %d: sending commands to the usb device\n",
- dev->minor);
-#endif
/* 0 means that the AD commands are sent */
err = send_dux_commands(devpriv, SENDADCOMMANDS);
if (err < 0) {
up(&devpriv->sem);
return err;
}
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi%d: usbduxfast: submitting in-urb: "
- "0x%p,0x%p\n", devpriv->comedidev->minor, devpriv->urbIn->context,
- devpriv->urbIn->dev);
-#endif
+
for (i = 0; i < PACKETS_TO_IGNORE; i++) {
err = usb_bulk_msg(devpriv->usb,
usb_rcvbulkpipe(devpriv->usb, BULKINEP),
static void tidy_up(struct usbduxfast_private *devpriv)
{
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi_: usbduxfast: tiding up\n");
-#endif
-
if (!devpriv)
return;
tidy_up(devpriv);
up(&devpriv->sem);
up(&start_stop_sem);
-
-#ifdef CONFIG_COMEDI_DEBUG
- printk(KERN_DEBUG "comedi_: usbduxfast: disconnected from the usb\n");
-#endif
}
static const struct usb_device_id usbduxfast_usb_table[] = {