#define PCI20341_MUX 0x04 /* Enable on-board MUX */
#define PCI20341_SCANLIST 0x80 /* Channel/Gain Scan List */
-typedef union {
+union pci20xxx_subdev_private {
void *iobase;
struct {
void *iobase;
int settling_time;
int ai_gain;
} pci20341;
-} pci20xxx_subdev_private;
+};
struct pci20xxx_private {
void *ioaddr;
- pci20xxx_subdev_private subdev_private[PCI20000_MODULES];
+ union pci20xxx_subdev_private subdev_private[PCI20000_MODULES];
};
int ret;
int id;
struct comedi_subdevice *s;
- pci20xxx_subdev_private *sdp;
+ union pci20xxx_subdev_private *sdp;
if ((ret = alloc_subdevices(dev, 1 + PCI20000_MODULES)) < 0)
return ret;
static int pci20006_init(struct comedi_device * dev, struct comedi_subdevice * s,
int opt0, int opt1)
{
- pci20xxx_subdev_private *sdp = s->private;
+ union pci20xxx_subdev_private *sdp = s->private;
if (opt0 < 0 || opt0 > 2)
opt0 = 0;
static int pci20006_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data)
{
- pci20xxx_subdev_private *sdp = s->private;
+ union pci20xxx_subdev_private *sdp = s->private;
data[0] = sdp->pci20006.last_data[CR_CHAN(insn->chanspec)];
static int pci20006_insn_write(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data)
{
- pci20xxx_subdev_private *sdp = s->private;
+ union pci20xxx_subdev_private *sdp = s->private;
int hi, lo;
unsigned int boarddata;
static int pci20341_init(struct comedi_device * dev, struct comedi_subdevice * s,
int opt0, int opt1)
{
- pci20xxx_subdev_private *sdp = s->private;
+ union pci20xxx_subdev_private *sdp = s->private;
int option;
/* options handling */
static int pci20341_insn_read(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data)
{
- pci20xxx_subdev_private *sdp = s->private;
+ union pci20xxx_subdev_private *sdp = s->private;
unsigned int i = 0, j = 0;
int lo, hi;
unsigned char eoc; /* end of conversion */