*/
struct usbduxfast_private {
int attached; /* is attached? */
- int probed; /* is it associated with a subdevice? */
struct usb_device *usb; /* pointer to the usb-device */
struct urb *urbIn; /* BULK-transfer handling: urb */
int8_t *transfer_buffer;
return -EFAULT;
}
down(&devpriv->sem);
- if (!devpriv->probed) {
- up(&devpriv->sem);
- return -ENODEV;
- }
/* unlink */
ret = usbduxfast_ai_stop(devpriv, 1);
up(&devpriv->sem);
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
- struct usbduxfast_private *devpriv = dev->private;
int err = 0;
long int steps, tmp;
int minSamplPer;
- if (!devpriv->probed)
- return -ENODEV;
-
/* Step 1 : check if triggers are trivially valid */
err |= cfc_check_trigger_src(&cmd->start_src,
return -EFAULT;
down(&devpriv->sem);
- if (!devpriv->probed) {
- up(&devpriv->sem);
- return -ENODEV;
- }
if (trignum != 0) {
dev_err(dev->class_dev, "%s: invalid trignum\n", __func__);
return -EFAULT;
down(&devpriv->sem);
- if (!devpriv->probed) {
- up(&devpriv->sem);
- return -ENODEV;
- }
if (devpriv->ai_cmd_running) {
dev_err(dev->class_dev,
"ai_cmd not possible. Another ai_cmd is running.\n");
}
down(&devpriv->sem);
- if (!devpriv->probed) {
- up(&devpriv->sem);
- return -ENODEV;
- }
if (devpriv->ai_cmd_running) {
dev_err(dev->class_dev,
"ai_insn_read not possible. Async Command is running.\n");
if (!devpriv->transfer_buffer)
return -ENOMEM;
- devpriv->probed = 1;
-
/*
* Request, and upload, the firmware so we can
* complete the comedi_driver (*auto_attach).
if (devpriv->intf)
usb_set_intfdata(devpriv->intf, NULL);
- devpriv->probed = 0;
-
if (devpriv->urbIn) {
/* waits until a running transfer is over */
usb_kill_urb(devpriv->urbIn);