}
};
-/*
- * 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 usbduxsigma_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 usbduxsigma_private usbduxsub[NUMUSBDUX];
static DEFINE_SEMAPHORE(start_stop_sem);
-static void usbdux_ai_stop(struct usbduxsub *devpriv, int do_unlink)
+static void usbdux_ai_stop(struct usbduxsigma_private *devpriv, int do_unlink)
{
if (do_unlink) {
int i;
static int usbdux_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
down(&devpriv->sem);
/* unlink only if it is really running */
static void usbduxsub_ai_IsocIrq(struct urb *urb)
{
struct comedi_device *dev = urb->context;
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
unsigned int dio_state;
int32_t val;
comedi_event(dev, s);
}
-static void usbdux_ao_stop(struct usbduxsub *devpriv, int do_unlink)
+static void usbdux_ao_stop(struct usbduxsigma_private *devpriv, int do_unlink)
{
if (do_unlink) {
int i;
static int usbdux_ao_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
down(&devpriv->sem);
/* unlink only if it is really running */
static void usbduxsub_ao_IsocIrq(struct urb *urb)
{
struct comedi_device *dev = urb->context;
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->write_subdev;
uint8_t *datap;
int len;
const u8 *data, size_t size,
unsigned long context)
{
- struct usbduxsub *usbduxsub = dev->private;
+ struct usbduxsigma_private *usbduxsub = dev->private;
struct usb_device *usb = usbduxsub->usbdev;
uint8_t *buf;
uint8_t *tmp;
struct urb **urbs, int num_urbs,
int input_urb)
{
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
struct urb *urb;
int ret;
int i;
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int err = 0, i;
unsigned int tmpTimer;
#define SENDPWMON 7
#define SENDPWMOFF 8
-static int send_dux_commands(struct usbduxsub *this_usbduxsub, int cmd_type)
+static int send_dux_commands(struct usbduxsigma_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 usbduxsigma_private *this_usbduxsub,
+ int command)
{
int result = (-EFAULT);
int nrec;
static int usbdux_ai_inttrig(struct comedi_device *dev,
struct comedi_subdevice *s, unsigned int trignum)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int ret;
- struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
static int usbdux_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int chan;
int i, ret;
- struct usbduxsub *this_usbduxsub = dev->private;
int result;
uint8_t muxsg0 = 0;
uint8_t muxsg1 = 0;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int i;
int32_t one = 0;
int chan;
int err;
- struct usbduxsub *this_usbduxsub = dev->private;
uint8_t muxsg0 = 0;
uint8_t muxsg1 = 0;
uint8_t sysred = 0;
static int usbdux_getstatusinfo(struct comedi_device *dev, int chan)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
uint8_t sysred = 0;
uint32_t one;
int err;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int i;
int chan = CR_CHAN(insn->chanspec);
- struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int i, err;
int chan = CR_CHAN(insn->chanspec);
- struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
static int usbdux_ao_inttrig(struct comedi_device *dev,
struct comedi_subdevice *s, unsigned int trignum)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int ret;
- struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int err = 0;
unsigned int flags;
static int usbdux_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, gain;
int i, ret;
- struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
struct comedi_insn *insn,
unsigned int *data)
{
-
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int err;
if (!this_usbduxsub)
return insn->n;
}
-static void usbdux_pwm_stop(struct usbduxsub *devpriv, int do_unlink)
+static void usbdux_pwm_stop(struct usbduxsigma_private *devpriv, int do_unlink)
{
if (do_unlink) {
if (devpriv->urbPwm)
static int usbdux_pwm_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
/* unlink only if it is really running */
usbdux_pwm_stop(devpriv, devpriv->pwm_cmd_running);
static void usbduxsub_pwm_irq(struct urb *urb)
{
struct comedi_device *dev = urb->context;
- struct usbduxsub *devpriv = dev->private;
+ struct usbduxsigma_private *devpriv = dev->private;
int ret;
switch (urb->status) {
}
}
-static int usbduxsub_submit_PwmURBs(struct usbduxsub *usbduxsub)
+static int usbduxsub_submit_PwmURBs(struct usbduxsigma_private *usbduxsub)
{
int errFlag;
static int usbdux_pwm_period(struct comedi_device *dev,
struct comedi_subdevice *s, unsigned int period)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int fx2delay = 255;
if (period < MIN_PWM_PERIOD) {
static int usbdux_pwm_start(struct comedi_device *dev,
struct comedi_subdevice *s)
{
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int ret, i;
- struct usbduxsub *this_usbduxsub = dev->private;
if (this_usbduxsub->pwm_cmd_running) {
/* already running */
struct comedi_subdevice *s, int channel,
unsigned int value, unsigned int sign)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_private *this_usbduxsub = dev->private;
int i, szbuf;
char *pBuf;
char pwm_mask;
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- struct usbduxsub *this_usbduxsub = dev->private;
+ struct usbduxsigma_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 usbduxsigma_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 usbduxsigma_private *usbduxsub_tmp)
{
int i;
}
static int usbduxsigma_attach_common(struct comedi_device *dev,
- struct usbduxsub *uds)
+ struct usbduxsigma_private *uds)
{
int ret;
struct comedi_subdevice *s;
unsigned long context_unused)
{
struct usb_interface *uinterf = comedi_to_usb_interface(dev);
- struct usbduxsub *uds = usb_get_intfdata(uinterf);
+ struct usbduxsigma_private *uds = usb_get_intfdata(uinterf);
struct usb_device *usb = uds->usbdev;
int ret;
static void usbduxsigma_detach(struct comedi_device *dev)
{
- struct usbduxsub *usb = dev->private;
+ struct usbduxsigma_private *usb = dev->private;
if (usb) {
down(&usb->sem);
static void usbduxsigma_usb_disconnect(struct usb_interface *intf)
{
- struct usbduxsub *usbduxsub_tmp = usb_get_intfdata(intf);
+ struct usbduxsigma_private *usbduxsub_tmp = usb_get_intfdata(intf);
struct usb_device *udev = interface_to_usbdev(intf);
if (!usbduxsub_tmp) {