}
};
-/*
- * private structure of one subdevice
- */
-
-/*
- * This is the structure which holds all the data of
- * this driver one sub device just now: A/D
- */
-struct usbduxsub {
+struct usbdux_private {
/* attached? */
int attached;
/* is it associated with a subdevice? */
* _before_ any comedi command is issued. The usb subsystem must be initialised
* before comedi can access it.
*/
-static struct usbduxsub usbduxsub[NUMUSBDUX];
+static struct usbdux_private usbduxsub[NUMUSBDUX];
static DEFINE_SEMAPHORE(start_stop_sem);
* Stops the data acquision
* It should be safe to call this function from any context
*/
-static int usbduxsub_unlink_inurbs(struct usbduxsub *usbduxsub_tmp)
+static int usbduxsub_unlink_inurbs(struct usbdux_private *usbduxsub_tmp)
{
int i = 0;
int err = 0;
* Is called from within this driver from both the
* interrupt context and from comedi
*/
-static int usbdux_ai_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
+static int usbdux_ai_stop(struct usbdux_private *this_usbduxsub, int do_unlink)
{
int ret = 0;
static int usbdux_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *this_usbduxsub;
+ struct usbdux_private *this_usbduxsub;
int res = 0;
/* force unlink of all urbs */
static void usbduxsub_ai_isoc_irq(struct urb *urb)
{
int i, err, n;
- struct usbduxsub *this_usbduxsub;
+ struct usbdux_private *this_usbduxsub;
struct comedi_device *this_comedidev;
struct comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is struct usbduxsub */
+ /* the private structure of the subdevice is struct usbdux_private */
this_usbduxsub = this_comedidev->private;
/* subdevice which is the AD converter */
s = &this_comedidev->subdevices[SUBDEV_AD];
comedi_event(this_usbduxsub->comedidev, s);
}
-static int usbduxsub_unlink_outurbs(struct usbduxsub *usbduxsub_tmp)
+static int usbduxsub_unlink_outurbs(struct usbdux_private *usbduxsub_tmp)
{
int i = 0;
int err = 0;
/* This will cancel a running acquisition operation
* in any context.
*/
-static int usbdux_ao_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
+static int usbdux_ao_stop(struct usbdux_private *this_usbduxsub, int do_unlink)
{
int ret = 0;
static int usbdux_ao_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int res = 0;
if (!this_usbduxsub)
{
int i, ret;
int8_t *datap;
- struct usbduxsub *this_usbduxsub;
+ struct usbdux_private *this_usbduxsub;
struct comedi_device *this_comedidev;
struct comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is struct usbduxsub */
+ /* the private structure of the subdevice is struct usbdux_private */
this_usbduxsub = this_comedidev->private;
s = &this_comedidev->subdevices[SUBDEV_DA];
const u8 *data, size_t size,
unsigned long context)
{
- struct usbduxsub *usbduxsub = dev->private;
+ struct usbdux_private *usbduxsub = dev->private;
struct usb_device *usb = usbduxsub->usbdev;
uint8_t *buf;
uint8_t *tmp;
return ret;
}
-static int usbduxsub_submit_inurbs(struct usbduxsub *usbduxsub)
+static int usbduxsub_submit_inurbs(struct usbdux_private *usbduxsub)
{
int i, err_flag;
return 0;
}
-static int usbduxsub_submit_outurbs(struct usbduxsub *usbduxsub)
+static int usbduxsub_submit_outurbs(struct usbdux_private *usbduxsub)
{
int i, err_flag;
static int usbdux_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int err = 0, i;
unsigned int tmp_timer;
#define SENDPWMON 7
#define SENDPWMOFF 8
-static int send_dux_commands(struct usbduxsub *this_usbduxsub, int cmd_type)
+static int send_dux_commands(struct usbdux_private *this_usbduxsub, int cmd_type)
{
int result, nsent;
return result;
}
-static int receive_dux_commands(struct usbduxsub *this_usbduxsub, int command)
+static int receive_dux_commands(struct usbdux_private *this_usbduxsub, int command)
{
int result = (-EFAULT);
int nrec;
struct comedi_subdevice *s, unsigned int trignum)
{
int ret;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, range;
int i, ret;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int result;
if (!this_usbduxsub)
unsigned int one = 0;
int chan, range;
int err;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return 0;
{
int i;
int chan = CR_CHAN(insn->chanspec);
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
{
int i, err;
int chan = CR_CHAN(insn->chanspec);
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_subdevice *s, unsigned int trignum)
{
int ret;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
static int usbdux_ao_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int err = 0;
unsigned int flags;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, gain;
int i, ret;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int err;
if (!this_usbduxsub)
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int chan = insn->chanspec;
int err;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int err;
if (!this_usbduxsub)
/***********************************/
/* PWM */
-static int usbduxsub_unlink_pwm_urbs(struct usbduxsub *usbduxsub_tmp)
+static int usbduxsub_unlink_pwm_urbs(struct usbdux_private *usbduxsub_tmp)
{
int err = 0;
/* This cancels a running acquisition operation
* in any context.
*/
-static int usbdux_pwm_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
+static int usbdux_pwm_stop(struct usbdux_private *this_usbduxsub, int do_unlink)
{
int ret = 0;
static int usbdux_pwm_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int res = 0;
/* unlink only if it is really running */
static void usbduxsub_pwm_irq(struct urb *urb)
{
int ret;
- struct usbduxsub *this_usbduxsub;
+ struct usbdux_private *this_usbduxsub;
struct comedi_device *this_comedidev;
struct comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is struct usbduxsub */
+ /* the private structure of the subdevice is struct usbdux_private */
this_usbduxsub = this_comedidev->private;
s = &this_comedidev->subdevices[SUBDEV_DA];
}
}
-static int usbduxsub_submit_pwm_urbs(struct usbduxsub *usbduxsub)
+static int usbduxsub_submit_pwm_urbs(struct usbdux_private *usbduxsub)
{
int err_flag;
static int usbdux_pwm_period(struct comedi_device *dev,
struct comedi_subdevice *s, unsigned int period)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int fx2delay = 255;
if (period < MIN_PWM_PERIOD) {
struct comedi_subdevice *s)
{
int ret, i;
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
dev_dbg(&this_usbduxsub->interface->dev, "comedi%d: %s\n",
dev->minor, __func__);
struct comedi_subdevice *s, int channel,
unsigned int value, unsigned int sign)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
int i, szbuf;
char *p_buf;
char pwm_mask;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbdux_private *this_usbduxsub = dev->private;
switch (data[0]) {
case INSN_CONFIG_ARM:
/* switch it on */
/* end of PWM */
/*****************************************************************/
-static void tidy_up(struct usbduxsub *usbduxsub_tmp)
+static void tidy_up(struct usbdux_private *usbduxsub_tmp)
{
int i;
}
static int usbdux_attach_common(struct comedi_device *dev,
- struct usbduxsub *udev)
+ struct usbdux_private *udev)
{
int ret;
struct comedi_subdevice *s = NULL;
unsigned long context_unused)
{
struct usb_interface *uinterf = comedi_to_usb_interface(dev);
- struct usbduxsub *this_usbduxsub = usb_get_intfdata(uinterf);
+ struct usbdux_private *this_usbduxsub = usb_get_intfdata(uinterf);
struct usb_device *usb = usbduxsub->usbdev;
int ret;
static void usbdux_detach(struct comedi_device *dev)
{
- struct usbduxsub *usb = dev->private;
+ struct usbdux_private *usb = dev->private;
if (usb) {
down(&usb->sem);
static void usbdux_usb_disconnect(struct usb_interface *intf)
{
- struct usbduxsub *usbduxsub_tmp = usb_get_intfdata(intf);
+ struct usbdux_private *usbduxsub_tmp = usb_get_intfdata(intf);
struct usb_device *udev = interface_to_usbdev(intf);
if (!usbduxsub_tmp) {