* This is the structure which holds all the data of
* this driver one sub device just now: A/D
*/
-typedef struct {
+struct usbduxsub {
/* attached? */
int attached;
/* is it associated with a subdevice? */
/* commands */
int8_t *dux_commands;
struct semaphore sem;
-} usbduxsub_t;
+};
/*
* The pointer to the private usb-data of the driver is also the private data
* _before_ any comedi command is issued. The usb subsystem must be initialised
* before comedi can access it.
*/
-static usbduxsub_t usbduxsub[NUMUSBDUX];
+static struct usbduxsub usbduxsub[NUMUSBDUX];
static DECLARE_MUTEX(start_stop_sem);
* Stops the data acquision
* It should be safe to call this function from any context
*/
-static int usbduxsub_unlink_InURBs(usbduxsub_t *usbduxsub_tmp)
+static int usbduxsub_unlink_InURBs(struct usbduxsub *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(usbduxsub_t *this_usbduxsub, int do_unlink)
+static int usbdux_ai_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
{
int ret = 0;
*/
static int usbdux_ai_cancel(comedi_device *dev, comedi_subdevice *s)
{
- usbduxsub_t *this_usbduxsub;
+ struct usbduxsub *this_usbduxsub;
int res = 0;
/* force unlink of all urbs */
static void usbduxsub_ai_IsocIrq(struct urb *urb)
{
int i, err, n;
- usbduxsub_t *this_usbduxsub;
+ struct usbduxsub *this_usbduxsub;
comedi_device *this_comedidev;
comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is usbduxsub_t */
+ /* the private structure of the subdevice is struct usbduxsub */
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(usbduxsub_t *usbduxsub_tmp)
+static int usbduxsub_unlink_OutURBs(struct usbduxsub *usbduxsub_tmp)
{
int i = 0;
int err = 0;
/* This will cancel a running acquisition operation
* in any context.
*/
-static int usbdux_ao_stop(usbduxsub_t *this_usbduxsub, int do_unlink)
+static int usbdux_ao_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
{
int ret = 0;
/* force unlink, is called by comedi */
static int usbdux_ao_cancel(comedi_device *dev, comedi_subdevice *s)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int res = 0;
if (!this_usbduxsub)
{
int i, ret;
int8_t *datap;
- usbduxsub_t *this_usbduxsub;
+ struct usbduxsub *this_usbduxsub;
comedi_device *this_comedidev;
comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is usbduxsub_t */
+ /* the private structure of the subdevice is struct usbduxsub */
this_usbduxsub = this_comedidev->private;
s = this_comedidev->subdevices + SUBDEV_DA;
}
}
-static int usbduxsub_start(usbduxsub_t *usbduxsub)
+static int usbduxsub_start(struct usbduxsub *usbduxsub)
{
int errcode = 0;
uint8_t local_transfer_buffer[16];
return 0;
}
-static int usbduxsub_stop(usbduxsub_t *usbduxsub)
+static int usbduxsub_stop(struct usbduxsub *usbduxsub)
{
int errcode = 0;
return 0;
}
-static int usbduxsub_upload(usbduxsub_t *usbduxsub,
+static int usbduxsub_upload(struct usbduxsub *usbduxsub,
uint8_t *local_transfer_buffer,
unsigned int startAddr, unsigned int len)
{
return 0;
}
-static int firmwareUpload(usbduxsub_t *usbduxsub, uint8_t *firmwareBinary,
+static int firmwareUpload(struct usbduxsub *usbduxsub, uint8_t *firmwareBinary,
int sizeFirmware)
{
int ret;
return 0;
}
-static int usbduxsub_submit_InURBs(usbduxsub_t *usbduxsub)
+static int usbduxsub_submit_InURBs(struct usbduxsub *usbduxsub)
{
int i, errFlag;
return 0;
}
-static int usbduxsub_submit_OutURBs(usbduxsub_t *usbduxsub)
+static int usbduxsub_submit_OutURBs(struct usbduxsub *usbduxsub)
{
int i, errFlag;
{
int err = 0, tmp, i;
unsigned int tmpTimer;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!(this_usbduxsub->probed))
return -ENODEV;
#define SENDPWMON 7
#define SENDPWMOFF 8
-static int send_dux_commands(usbduxsub_t *this_usbduxsub, int cmd_type)
+static int send_dux_commands(struct usbduxsub *this_usbduxsub, int cmd_type)
{
int result, nsent;
return result;
}
-static int receive_dux_commands(usbduxsub_t *this_usbduxsub, int command)
+static int receive_dux_commands(struct usbduxsub *this_usbduxsub, int command)
{
int result = (-EFAULT);
int nrec;
unsigned int trignum)
{
int ret;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, range;
int i, ret;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int result;
if (!this_usbduxsub)
lsampl_t one = 0;
int chan, range;
int err;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return 0;
{
int i;
int chan = CR_CHAN(insn->chanspec);
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
{
int i, err;
int chan = CR_CHAN(insn->chanspec);
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
unsigned int trignum)
{
int ret;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
comedi_cmd *cmd)
{
int err = 0, tmp;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
comedi_cmd *cmd = &s->async->cmd;
unsigned int chan, gain;
int i, ret;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
comedi_insn *insn, lsampl_t *data)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int err;
if (!this_usbduxsub)
static int usbdux_counter_read(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int chan = insn->chanspec;
int err;
static int usbdux_counter_write(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int err;
if (!this_usbduxsub)
/***********************************/
/* PWM */
-static int usbduxsub_unlink_PwmURBs(usbduxsub_t *usbduxsub_tmp)
+static int usbduxsub_unlink_PwmURBs(struct usbduxsub *usbduxsub_tmp)
{
int err = 0;
/* This cancels a running acquisition operation
* in any context.
*/
-static int usbdux_pwm_stop(usbduxsub_t *this_usbduxsub, int do_unlink)
+static int usbdux_pwm_stop(struct usbduxsub *this_usbduxsub, int do_unlink)
{
int ret = 0;
/* force unlink - is called by comedi */
static int usbdux_pwm_cancel(comedi_device *dev, comedi_subdevice *s)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int res = 0;
/* unlink only if it is really running */
static void usbduxsub_pwm_irq(struct urb *urb)
{
int ret;
- usbduxsub_t *this_usbduxsub;
+ struct usbduxsub *this_usbduxsub;
comedi_device *this_comedidev;
comedi_subdevice *s;
/* the context variable points to the subdevice */
this_comedidev = urb->context;
- /* the private structure of the subdevice is usbduxsub_t */
+ /* the private structure of the subdevice is struct usbduxsub */
this_usbduxsub = this_comedidev->private;
s = this_comedidev->subdevices + SUBDEV_DA;
}
}
-static int usbduxsub_submit_PwmURBs(usbduxsub_t *usbduxsub)
+static int usbduxsub_submit_PwmURBs(struct usbduxsub *usbduxsub)
{
int errFlag;
static int usbdux_pwm_period(comedi_device *dev, comedi_subdevice *s,
lsampl_t period)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int fx2delay = 255;
if (period < MIN_PWM_PERIOD) {
static int usbdux_pwm_start(comedi_device *dev, comedi_subdevice *s)
{
int ret, i;
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
dev_dbg(&this_usbduxsub->interface->dev, "comedi%d: %s\n",
dev->minor, __func__);
static int usbdux_pwm_pattern(comedi_device *dev, comedi_subdevice *s,
int channel, lsampl_t value, lsampl_t sign)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
int i, szbuf;
char *pBuf;
char pwm_mask;
static int usbdux_pwm_write(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
if (!this_usbduxsub)
return -EFAULT;
static int usbdux_pwm_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- usbduxsub_t *this_usbduxsub = dev->private;
+ struct usbduxsub *this_usbduxsub = dev->private;
switch (data[0]) {
case INSN_CONFIG_ARM:
/* switch it on */
/* end of PWM */
/*****************************************************************/
-static void tidy_up(usbduxsub_t *usbduxsub_tmp)
+static void tidy_up(struct usbduxsub *usbduxsub_tmp)
{
int i;
#define FIRMWARE_MAX_LEN 0x2000
/* taken from David Brownell's fxload and adjusted for this driver */
-static int read_firmware(usbduxsub_t *usbduxsub, void *firmwarePtr, long size)
+static int read_firmware(struct usbduxsub *usbduxsub, void *firmwarePtr,
+ long size)
{
struct device *dev = &usbduxsub->interface->dev;
int i = 0;
static void usbduxsub_disconnect(struct usb_interface *intf)
{
- usbduxsub_t *usbduxsub_tmp = usb_get_intfdata(intf);
+ struct usbduxsub *usbduxsub_tmp = usb_get_intfdata(intf);
struct usb_device *udev = interface_to_usbdev(intf);
if (!usbduxsub_tmp) {
int ret;
int index;
int i;
- usbduxsub_t *udev;
+ struct usbduxsub *udev;
comedi_subdevice *s = NULL;
dev->private = NULL;
static int usbdux_detach(comedi_device *dev)
{
- usbduxsub_t *usbduxsub_tmp;
+ struct usbduxsub *usbduxsub_tmp;
if (!dev) {
printk(KERN_ERR