}
-struct file_operations comedi_fops={
+const struct file_operations comedi_fops={
owner : THIS_MODULE,
llseek : comedi_lseek,
ioctl : comedi_ioctl,
#define _COMEDI_FOPS_H
extern struct class *comedi_class;
-extern struct file_operations comedi_fops;
+extern const struct file_operations comedi_fops;
#endif //_COMEDI_FOPS_H
int io_range; // len of I/O space
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{ "acl7225b", ACL7225_SIZE, },
{ "p16r16dio", P16R16DIO_SIZE, },
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_acl7225b = {
driver_name: "acl7225b",
/* Board descriptions */
typedef struct {
- char *name;
+ const char *name;
unsigned short dev_id; /* `lspci` will show you this */
int ao_chans;
//int ao_bits;
} pci6208_board;
-static pci6208_board pci6208_boards[] = {
+static const pci6208_board pci6208_boards[] = {
/*{
name : "pci6208v",
dev_id : 0x6208, //not sure
MODULE_DEVICE_TABLE(pci, pci6208_pci_table);
/* Will be initialized in pci6208_find device(). */
-#define thisboard ((pci6208_board *)dev->board_ptr)
+#define thisboard ((const pci6208_board *)dev->board_ptr)
typedef struct{
int data;
int device_id;
}adl_pci7296_board;
-static adl_pci7296_board adl_pci7296_boards[] = {
+static const adl_pci7296_board adl_pci7296_boards[] = {
{ "pci7296", PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296 },
};
};
MODULE_DEVICE_TABLE(pci, adl_pci7296_pci_table);
-#define thisboard ((adl_pci7296_board *)dev->board_ptr)
+#define thisboard ((const adl_pci7296_board *)dev->board_ptr)
typedef struct{
int data;
int device_id;
} adl_pci7432_board;
-static adl_pci7432_board adl_pci7432_boards[] = {
+static const adl_pci7432_board adl_pci7432_boards[] = {
{ "pci7432", PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7432 },
};
};
MODULE_DEVICE_TABLE(pci, adl_pci7432_pci_table);
-#define thisboard ((adl_pci7432_board *)dev->board_ptr)
+#define thisboard ((const adl_pci7432_board *)dev->board_ptr)
typedef struct{
int data;
int device_id;
} adl_pci8164_board;
-static adl_pci8164_board adl_pci8164_boards[] = {
+static const adl_pci8164_board adl_pci8164_boards[] = {
{ "pci8164", PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI8164 },
};
};
MODULE_DEVICE_TABLE(pci, adl_pci8164_pci_table);
-#define thisboard ((adl_pci8164_board *)dev->board_ptr)
+#define thisboard ((const adl_pci8164_board *)dev->board_ptr)
typedef struct{
int data;
static void pci9111_ai_munge(comedi_device *dev, comedi_subdevice *s, void *data,
unsigned int num_bytes, unsigned int start_chan_index );
-static comedi_lrange pci9111_hr_ai_range=
+static const comedi_lrange pci9111_hr_ai_range=
{
5,
{
int ai_resolution_mask;
int ao_resolution; // resolution of D/A
int ao_resolution_mask;
- comedi_lrange *ai_range_list; // rangelist for A/D
- comedi_lrange *ao_range_list; // rangelist for D/A
+ const comedi_lrange *ai_range_list; // rangelist for A/D
+ const comedi_lrange *ao_range_list; // rangelist for D/A
unsigned int ai_acquisition_period_min_ns;
} pci9111_board_struct;
-static pci9111_board_struct pci9111_boards[] =
+static const pci9111_board_struct pci9111_boards[] =
{
{
name: "pci9111_hr",
unsigned long io_base, io_range, lcr_io_base, lcr_io_range;
struct pci_dev* pci_device;
int error,i;
- pci9111_board_struct* board;
+ const pci9111_board_struct* board;
if(alloc_private(dev, sizeof(pci9111_private_data_struct)) < 0)
{
#define EXTTRG_AI 0 /* ext trg is used by AI */
-static comedi_lrange range_pci9118dg_hr={ 8, {
+static const comedi_lrange range_pci9118dg_hr={ 8, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
}
};
-static comedi_lrange range_pci9118hg={ 8, {
+static const comedi_lrange range_pci9118hg={ 8, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
int n_aochan; // num of D/A chans
int ai_maxdata; // resolution of A/D
int ao_maxdata; // resolution of D/A
- comedi_lrange *rangelist_ai; // rangelist for A/D
- comedi_lrange *rangelist_ao; // rangelist for D/A
+ const comedi_lrange *rangelist_ai; // rangelist for A/D
+ const comedi_lrange *rangelist_ao; // rangelist for D/A
unsigned int ai_ns_min; // max sample speed of card v ns
unsigned int ai_pacer_min; // minimal pacer value (c1*c2 or c1 in burst)
int half_fifo_size; // size of FIFO/2
};
MODULE_DEVICE_TABLE(pci, pci9118_pci_table);
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pci9118dg", PCI_VENDOR_ID_AMCC, 0x80d9,
AMCC_OP_REG_SIZE, IORANGE_9118,
#define Syncont_SC0 1 /* set synchronous output mode */
-static comedi_lrange range_pci1710_3={ 9, {
+static const comedi_lrange range_pci1710_3={ 9, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
}
};
-static char range_codes_pci1710_3[]={0x00, 0x01, 0x02, 0x03, 0x04, 0x10, 0x11, 0x12, 0x13 };
+static const char range_codes_pci1710_3[]={0x00, 0x01, 0x02, 0x03, 0x04, 0x10, 0x11, 0x12, 0x13 };
-static comedi_lrange range_pci1710hg={ 12, {
+static const comedi_lrange range_pci1710hg={ 12, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
}
};
-static char range_codes_pci1710hg[]={0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13 };
+static const char range_codes_pci1710hg[]={0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13 };
-static comedi_lrange range_pci17x1={ 5, {
+static const comedi_lrange range_pci17x1={ 5, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
}
};
-static char range_codes_pci17x1[]={0x00, 0x01, 0x02, 0x03, 0x04 };
+static const char range_codes_pci17x1[]={0x00, 0x01, 0x02, 0x03, 0x04 };
-static comedi_lrange range_pci1720={ 4, {
+static const comedi_lrange range_pci1720={ 4, {
UNI_RANGE(5),
UNI_RANGE(10),
BIP_RANGE(5),
}
};
-static comedi_lrange range_pci171x_da={ 2, {
+static const comedi_lrange range_pci171x_da={ 2, {
UNI_RANGE(5),
UNI_RANGE(10),
}
int n_counter; // num of counters
int ai_maxdata; // resolution of A/D
int ao_maxdata; // resolution of D/A
- comedi_lrange *rangelist_ai; // rangelist for A/D
- char *rangecode_ai; // range codes for programming
- comedi_lrange *rangelist_ao; // rangelist for D/A
+ const comedi_lrange *rangelist_ai; // rangelist for A/D
+ const char *rangecode_ai; // range codes for programming
+ const comedi_lrange *rangelist_ao; // rangelist for D/A
unsigned int ai_ns_min; // max sample speed of card v ns
unsigned int fifo_half_size; // size of FIFO/2
} boardtype;
};
MODULE_DEVICE_TABLE(pci, pci1710_pci_table);
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pci1710", 0x1710,
IORANGE_171x, 1, TYPE_PCI171X,
} pci1710_private;
#define devpriv ((pci1710_private *)dev->private)
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
/*
==============================================================================
static int pci1710_reset(comedi_device *dev);
static int pci171x_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static unsigned int muxonechan[] ={ 0x0000, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505, 0x0606, 0x0707, // used for gain list programming
+static const unsigned int muxonechan[] ={ 0x0000, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505, 0x0606, 0x0707, // used for gain list programming
0x0808, 0x0909, 0x0a0a, 0x0b0b, 0x0c0c, 0x0d0d, 0x0e0e, 0x0f0f,
0x1010, 0x1111, 0x1212, 0x1313, 0x1414, 0x1515, 0x1616, 0x1717,
0x1818, 0x1919, 0x1a1a, 0x1b1b, 0x1c1c, 0x1d1d, 0x1e1e, 0x1f1f};
};
MODULE_DEVICE_TABLE(pci, pci_dio_pci_table);
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pci1730", PCI_VENDOR_ID_ADVANTECH, 0x1730, PCIDIO_MAINREG,
TYPE_PCI1730,
static pci_dio_private *pci_priv=NULL; /* list of allocated cards */
#define devpriv ((pci_dio_private *)dev->private)
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
/*
==============================================================================
static int pci_dio_insn_bits_di_b(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- diosubd_data *d=(diosubd_data *)s->private;
+ const diosubd_data *d=(const diosubd_data *)s->private;
int i;
data[1]=0;
static int pci_dio_insn_bits_di_w(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- diosubd_data *d=(diosubd_data *)s->private;
+ const diosubd_data *d=(const diosubd_data *)s->private;
int i;
data[1]=0;
static int pci_dio_insn_bits_do_b(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn, lsampl_t *data)
{
- diosubd_data *d=(diosubd_data *)s->private;
+ const diosubd_data *d=(const diosubd_data *)s->private;
int i;
if (data[0]) {
static int pci_dio_insn_bits_do_w(comedi_device *dev, comedi_subdevice *s,
comedi_insn *insn,lsampl_t *data)
{
- diosubd_data *d=(diosubd_data *)s->private;
+ const diosubd_data *d=(const diosubd_data *)s->private;
int i;
if (data[0]) {
==============================================================================
*/
static int pci_dio_add_di(comedi_device *dev, comedi_subdevice *s,
- diosubd_data *d, int subdev)
+ const diosubd_data *d, int subdev)
{
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE|SDF_GROUND|SDF_COMMON|d->specflags;
s->insn_bits=pci_dio_insn_bits_di_w;
break;
}
- s->private=d;
+ s->private=(void *)d;
return 0;
}
==============================================================================
*/
static int pci_dio_add_do(comedi_device *dev, comedi_subdevice *s,
- diosubd_data *d, int subdev)
+ const diosubd_data *d, int subdev)
{
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE|SDF_GROUND|SDF_COMMON;
s->insn_bits=pci_dio_insn_bits_do_w;
break;
}
- s->private=d;
+ s->private=(void *)d;
return 0;
}
const char *name;
} board_type;
-static board_type board_types[] =
+static const board_type board_types[] =
{
{
name: "aio_aio12_8"
},
};
-#define thisboard ((board_type *) dev->board_ptr)
+#define thisboard ((const board_type *) dev->board_ptr)
typedef struct
{
return insn->n;
}
-static comedi_lrange range_aio_aio12_8 =
+static const comedi_lrange range_aio_aio12_8 =
{
4,
{
int di;
} aio_iiro_16_board;
-static aio_iiro_16_board aio_iiro_16_boards[] =
+static const aio_iiro_16_board aio_iiro_16_boards[] =
{
{
name: "aio_iiro_16",
},
};
-#define thisboard ((aio_iiro_16_board *) dev->board_ptr)
+#define thisboard ((const aio_iiro_16_board *) dev->board_ptr)
typedef struct
{
enum dio200_layout layout;
} dio200_board;
-static dio200_board dio200_boards[] = {
+static const dio200_board dio200_boards[] = {
{
name: "pc212e",
bustype: isa_bustype,
char has_clk_gat_sce; /* has clock/gate selection registers */
} dio200_layout;
-static dio200_layout dio200_layouts[] = {
+static const dio200_layout dio200_layouts[] = {
[pc212_layout] = {
n_subdevs: 6,
sdtype: { sd_8255, sd_8254, sd_8254, sd_8254, sd_8254, sd_intr },
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((dio200_board *)dev->board_ptr)
+#define thisboard ((const dio200_board *)dev->board_ptr)
#define thislayout (&dio200_layouts[((dio200_board *)dev->board_ptr)->layout])
/* this structure is for data unique to this hardware driver. If
unsigned long iobase = 0;
unsigned int irq = 0;
int bus = 0, slot = 0;
- dio200_layout *layout;
+ const dio200_layout *layout;
int share_irq = 0;
int sdx;
unsigned n;
static int
dio200_detach(comedi_device *dev)
{
- dio200_layout *layout;
+ const dio200_layout *layout;
unsigned n;
printk(KERN_DEBUG "comedi%d: %s: detach\n", dev->minor,
typedef struct pc236_board_struct{
const char *name;
- char *fancy_name;
+ const char *fancy_name;
enum pc236_bustype bustype;
enum pc236_model model;
}pc236_board;
-static pc236_board pc236_boards[] = {
+static const pc236_board pc236_boards[] = {
{
name: "pc36at",
fancy_name: "PC36AT",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((pc236_board *)dev->board_ptr)
+#define thisboard ((const pc236_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
typedef struct pc263_board_struct{
const char *name;
- char *fancy_name;
+ const char *fancy_name;
enum pc263_bustype bustype;
enum pc263_model model;
}pc263_board;
-static pc263_board pc263_boards[] = {
+static const pc263_board pc263_boards[] = {
{
name: "pc263",
fancy_name: "PC263",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((pc263_board *)dev->board_ptr)
+#define thisboard ((const pc263_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
*/
/* The software selectable internal ranges for PCI224 (option[2] == 0). */
-static comedi_lrange range_pci224_internal = {
+static const comedi_lrange range_pci224_internal = {
8,
{
BIP_RANGE(10),
}
};
-static unsigned short hwrange_pci224_internal[8] = {
+static const unsigned short hwrange_pci224_internal[8] = {
PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_10,
PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_5,
PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_2_5,
};
/* The software selectable external ranges for PCI224 (option[2] == 1). */
-static comedi_lrange range_pci224_external = {
+static const comedi_lrange range_pci224_external = {
2,
{
RANGE_ext(-1, 1), /* bipolar [-Vref,+Vref] */
}
};
-static unsigned short hwrange_pci224_external[2] = {
+static const unsigned short hwrange_pci224_external[2] = {
PCI224_DACCON_POLAR_BI,
PCI224_DACCON_POLAR_UNI,
};
/* The hardware selectable Vref*2 external range for PCI234
* (option[2] == 1, option[3+n] == 0). */
-static comedi_lrange range_pci234_ext2 = {
+static const comedi_lrange range_pci234_ext2 = {
1,
{
RANGE_ext(-2, 2),
/* The hardware selectable Vref external range for PCI234
* (option[2] == 1, option[3+n] == 1). */
-static comedi_lrange range_pci234_ext = {
+static const comedi_lrange range_pci234_ext = {
1,
{
RANGE_ext(-1, 1),
};
/* This serves for all the PCI234 ranges. */
-static unsigned short hwrange_pci234[1] = {
+static const unsigned short hwrange_pci234[1] = {
PCI224_DACCON_POLAR_BI, /* bipolar - hardware ignores it! */
};
unsigned int ao_bits;
} pci224_board;
-static pci224_board pci224_boards[] = {
+static const pci224_board pci224_boards[] = {
{
name: "pci224",
model: pci224_model,
feel free to suggest moving the variable to the comedi_device struct. */
typedef struct {
struct pci_dev *pci_dev; /* PCI device */
- unsigned short *hwrange;
+ const unsigned short *hwrange;
unsigned long iobase1;
spinlock_t ao_spinlock;
lsampl_t *ao_readback;
/* Sort out channel range options. */
if (thisboard->model == pci234_model) {
/* PCI234 range options. */
- s->range_table_list = kmalloc(
+ const comedi_lrange **range_table_list;
+
+ s->range_table_list = range_table_list = kmalloc(
sizeof(comedi_lrange *) * s->n_chan,
GFP_KERNEL);
if (!s->range_table_list) {
if (n < COMEDI_NDEVCONFOPTS - 3 &&
it->options[3+n] == 1) {
if (it->options[2] == 1) {
- s->range_table_list[n] =
+ range_table_list[n] =
&range_pci234_ext;
} else {
- s->range_table_list[n] =
+ range_table_list[n] =
&range_bipolar5;
}
} else {
if (it->options[2] == 1) {
- s->range_table_list[n] =
+ range_table_list[n] =
&range_pci234_ext2;
} else {
- s->range_table_list[n] =
+ range_table_list[n] =
&range_bipolar10;
}
}
int ao_bits;
int have_dio;
}pci230_board;
-static pci230_board pci230_boards[] = {
+static const pci230_board pci230_boards[] = {
{
name: "pci230",
id: PCI_DEVICE_ID_PCI230,
* Useful for shorthand access to the particular board structure
*/
#define n_pci230_boards (sizeof(pci230_boards)/sizeof(pci230_boards[0]))
-#define thisboard ((pci230_board *)dev->board_ptr)
+#define thisboard ((const pci230_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
#define devpriv ((struct pci230_private *)dev->private)
/* PCI230 analogue input range table */
-static comedi_lrange pci230_ai_range = { 7, {
+static const comedi_lrange pci230_ai_range = { 7, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
}};
/* PCI230 analogue output range table */
-static comedi_lrange pci230_ao_range = { 2, {
+static const comedi_lrange pci230_ao_range = { 2, {
UNI_RANGE(10),
BIP_RANGE(10)
}};
typedef struct das16cs_board_struct{
- char *name;
+ const char *name;
int device_id;
int n_ao_chans;
}das16cs_board;
-static das16cs_board das16cs_boards[] = {
+static const das16cs_board das16cs_boards[] = {
{
device_id: 0x0000, /* unknown */
name: "PC-CARD DAS16/16",
},
};
#define n_boards (sizeof(das16cs_boards)/sizeof(das16cs_boards[0]))
-#define thisboard ((das16cs_board *)dev->board_ptr)
+#define thisboard ((const das16cs_board *)dev->board_ptr)
typedef struct{
dev_link_t *link;
static dev_link_t *dev_list = NULL;
-static comedi_lrange das16cs_ai_range = { 4, {
+static const comedi_lrange das16cs_ai_range = { 4, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
// bit in hexadecimal representation of range index that indicates unipolar input range
#define IS_UNIPOLAR 0x4
// analog input ranges for most boards
-static comedi_lrange cb_pcidas_ranges =
+static const comedi_lrange cb_pcidas_ranges =
{
8,
{
};
// pci-das1001 input ranges
-static comedi_lrange cb_pcidas_alt_ranges =
+static const comedi_lrange cb_pcidas_alt_ranges =
{
8,
{
};
// analog output ranges
-static comedi_lrange cb_pcidas_ao_ranges =
+static const comedi_lrange cb_pcidas_ao_ranges =
{
4,
{
typedef struct cb_pcidas_board_struct
{
- char *name;
+ const char *name;
unsigned short device_id;
int ai_se_chans; // Inputs in single-ended mode
int ai_diff_chans; // Inputs in differential mode
int has_ao_fifo; // analog output has fifo
int ao_scan_speed; // analog output speed for 1602 series (for a scan, not conversion)
int fifo_size; // number of samples fifo can hold
- comedi_lrange *ranges;
+ const comedi_lrange *ranges;
enum trimpot_model trimpot;
unsigned has_dac08 : 1;
} cb_pcidas_board;
-static cb_pcidas_board cb_pcidas_boards[] =
+static const cb_pcidas_board cb_pcidas_boards[] =
{
{
name: "pci-das1602/16",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((cb_pcidas_board *)dev->board_ptr)
+#define thisboard ((const cb_pcidas_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
};
// analog input ranges for 64xx boards
-static comedi_lrange ai_ranges_64xx =
+static const comedi_lrange ai_ranges_64xx =
{
8,
{
};
/* analog input ranges for 60xx boards */
-static comedi_lrange ai_ranges_60xx =
+static const comedi_lrange ai_ranges_60xx =
{
4,
{
};
/* analog input ranges for 6030, etc boards */
-static comedi_lrange ai_ranges_6030 =
+static const comedi_lrange ai_ranges_6030 =
{
14,
{
};
/* analog input ranges for 6052, etc boards */
-static comedi_lrange ai_ranges_6052 =
+static const comedi_lrange ai_ranges_6052 =
{
15,
{
};
// analog input ranges for 4020 board
-static comedi_lrange ai_ranges_4020 =
+static const comedi_lrange ai_ranges_4020 =
{
2,
{
};
// analog output ranges
-static comedi_lrange ao_ranges_64xx =
+static const comedi_lrange ao_ranges_64xx =
{
4,
{
UNI_RANGE(10),
}
};
-static int ao_range_code_64xx[] =
+static const int ao_range_code_64xx[] =
{
0x0,
0x1,
0x3,
};
-static comedi_lrange ao_ranges_60xx =
+static const comedi_lrange ao_ranges_60xx =
{
1,
{
BIP_RANGE(10),
}
};
-static int ao_range_code_60xx[] =
+static const int ao_range_code_60xx[] =
{
0x0,
};
-static comedi_lrange ao_ranges_6030 =
+static const comedi_lrange ao_ranges_6030 =
{
2,
{
UNI_RANGE(10),
}
};
-static int ao_range_code_6030[] =
+static const int ao_range_code_6030[] =
{
0x0,
0x2,
};
-static comedi_lrange ao_ranges_4020 =
+static const comedi_lrange ao_ranges_4020 =
{
2,
{
BIP_RANGE(10),
}
};
-static int ao_range_code_4020[] =
+static const int ao_range_code_4020[] =
{
0x1,
0x0,
typedef struct pcidas64_board_struct
{
- char *name;
+ const char *name;
int device_id; // pci device id
int ai_se_chans; // number of ai inputs in single-ended mode
int ai_bits; // analog input resolution
int ai_speed; // fastest conversion period in ns
- comedi_lrange *ai_range_table;
+ const comedi_lrange *ai_range_table;
int ao_nchan; // number of analog out channels
int ao_bits; // analog output resolution
int ao_scan_speed; // analog output speed (for a scan, not conversion)
- comedi_lrange *ao_range_table;
- int *ao_range_code;
+ const comedi_lrange *ao_range_table;
+ const int *ao_range_code;
const hw_fifo_info_t *const ai_fifo;
enum register_layout layout; // different board families have slightly different registers
unsigned has_8255 : 1;
static unsigned int ai_range_bits_6xxx( const comedi_device *dev, unsigned int range_index )
{
- comedi_krange *range = &board( dev )->ai_range_table->range[ range_index ];
+ const comedi_krange *range = &board( dev )->ai_range_table->range[ range_index ];
unsigned int bits = 0;
switch( range->max )
#define DADATA 8 // FIRST D/A DATA REGISTER (0)
-static comedi_lrange cb_pcidda_ranges =
+static const comedi_lrange cb_pcidda_ranges =
{
6,
{
*/
typedef struct cb_pcidda_board_struct
{
- char *name;
+ const char *name;
char status; // Driver status:
// 0 - tested
// 1 - manual read, not tested
unsigned short device_id;
int ao_chans;
int ao_bits;
- comedi_lrange *ranges;
+ const comedi_lrange *ranges;
} cb_pcidda_board;
-static cb_pcidda_board cb_pcidda_boards[] =
+static const cb_pcidda_board cb_pcidda_boards[] =
{
{
name: "pci-dda02/12",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((cb_pcidda_board *)dev->board_ptr)
+#define thisboard ((const cb_pcidda_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
/* Board description */
typedef struct cb_pcimdas_board_struct
{
- char *name;
+ const char *name;
unsigned short device_id;
int ai_se_chans; // Inputs in single-ended mode
int ai_diff_chans; // Inputs in differential mode
int fifo_size; // number of samples fifo can hold
int dio_bits; // number of dio bits
int has_dio; // has DIO
- comedi_lrange *ranges;
+ const comedi_lrange *ranges;
} cb_pcimdas_board;
-static cb_pcimdas_board cb_pcimdas_boards[] =
+static const cb_pcimdas_board cb_pcimdas_boards[] =
{
{
name: "PCIM-DAS1602/16",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((cb_pcimdas_board *)dev->board_ptr)
+#define thisboard ((const cb_pcimdas_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
* will someday support more than 1 board...
*/
typedef struct board_struct {
- char *name;
+ const char *name;
unsigned short device_id;
int ao_chans;
int ao_bits;
DIO_INTERNAL /* unimplemented */
};
-static board boards[] = {
+static const board boards[] = {
{
name: "cb_pcimdda06-16",
device_id: PCI_ID_PCIM_DDA06_16,
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((board *)dev->board_ptr)
+#define thisboard ((const board *)dev->board_ptr)
/* Number of boards in boards[] */
#define N_BOARDS (sizeof(boards) / sizeof(board))
};
typedef struct BondingBoard BondingBoard;
-static BondingBoard bondingBoards[] = {
+static const BondingBoard bondingBoards[] = {
{
name: MODULE_NAME,
},
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((BondingBoard *)dev->board_ptr)
+#define thisboard ((const BondingBoard *)dev->board_ptr)
struct BondedDevice
{
#define N_CHANS 8
-static waveform_board waveform_boards[] = {
+static const waveform_board waveform_boards[] = {
{
name: "comedi_test",
ai_chans: N_CHANS,
have_dio: 0,
},
};
-#define thisboard ((waveform_board *)dev->board_ptr)
+#define thisboard ((const waveform_board *)dev->board_ptr)
/* Data unique to this driver */
typedef struct{
static const int nano_per_micro = 1000; // 1000 nanosec in a microsec
// fake analog input ranges
-static comedi_lrange waveform_ai_ranges =
+static const comedi_lrange waveform_ai_ranges =
{
2,
{
comedi_subdevice *s = dev->read_subdev;
unsigned int offset = s->maxdata / 2;
u64 value;
- comedi_krange *krange = &s->range_table->range[range_index];
+ const comedi_krange *krange = &s->range_table->range[range_index];
u64 binary_amplitude;
binary_amplitude = s->maxdata;
comedi_subdevice *s = dev->read_subdev;
unsigned int offset = s->maxdata / 2;
u64 value;
- comedi_krange *krange = &s->range_table->range[range_index];
+ const comedi_krange *krange = &s->range_table->range[range_index];
current_time %= devpriv->usec_period;
value = s->maxdata;
} contec_model;
typedef struct contec_board {
- char *name;
+ const char *name;
int model;
int in_ports;
int out_ports;
int out_offs;
int out_boffs;
} contec_board;
-static contec_board contec_boards[] = {
+static const contec_board contec_boards[] = {
{ "PIO1616L", PIO1616L, 16, 16, 0, 2, 10 },
};
};
MODULE_DEVICE_TABLE(pci, contec_pci_table);
-#define thisboard ((contec_board *)dev->board_ptr)
+#define thisboard ((const contec_board *)dev->board_ptr)
typedef struct{
int data;
#define DAQBOARD2000_CPLD_DONE 0x0004
// Available ranges
-static comedi_lrange range_daqboard2000_ai = { 13, {
+static const comedi_lrange range_daqboard2000_ai = { 13, {
RANGE(-10, 10),
RANGE(-5, 5),
RANGE(-2.5, 2.5),
RANGE(0, 0.3125)
}};
-static comedi_lrange range_daqboard2000_ao = { 1, {
+static const comedi_lrange range_daqboard2000_ao = { 1, {
RANGE(-10, 10)
}};
};
typedef struct {
- char *name;
+ const char *name;
int id;
}boardtype;
-static boardtype boardtypes[]={
+static const boardtype boardtypes[]={
{ "ids2", DAQBOARD2000_SUBSYSTEM_IDS2 },
{ "ids4", DAQBOARD2000_SUBSYSTEM_IDS4 },
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static struct pci_device_id daqboard2000_pci_table[] __devinitdata = {
{ 0x1616, 0x0409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
static int das08ao_ao_winsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data);
static void i8254_set_mode_low(unsigned int base, int channel, unsigned int mode);
-static comedi_lrange range_das08_pgl = { 9, {
+static const comedi_lrange range_das08_pgl = { 9, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
UNI_RANGE(2.5),
UNI_RANGE(1.25)
}};
-static comedi_lrange range_das08_pgh = { 12, {
+static const comedi_lrange range_das08_pgh = { 12, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(1),
UNI_RANGE(0.1),
UNI_RANGE(0.01),
}};
-static comedi_lrange range_das08_pgm = { 9, {
+static const comedi_lrange range_das08_pgm = { 9, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(0.5),
*/
-static comedi_lrange *das08_ai_lranges[]={
+static const comedi_lrange * const das08_ai_lranges[]={
&range_unknown,
&range_bipolar5,
&range_das08_pgh,
&range_das08_pgm,
};
-static int das08_pgh_gainlist[] = { 8, 0, 10, 2, 12, 4, 14, 6, 1, 3, 5, 7 };
-static int das08_pgl_gainlist[] = { 8, 0, 2, 4, 6, 1, 3, 5, 7 };
-static int das08_pgm_gainlist[] = { 8, 0, 10, 12, 14, 9, 11, 13, 15 };
+static const int das08_pgh_gainlist[] = { 8, 0, 10, 2, 12, 4, 14, 6, 1, 3, 5, 7 };
+static const int das08_pgl_gainlist[] = { 8, 0, 2, 4, 6, 1, 3, 5, 7 };
+static const int das08_pgm_gainlist[] = { 8, 0, 10, 12, 14, 9, 11, 13, 15 };
-static int *das08_gainlists[] = {
+static const int * const das08_gainlists[] = {
NULL,
NULL,
das08_pgh_gainlist,
das08_pgm_gainlist,
};
-static struct das08_board_struct das08_boards[]={
+static const struct das08_board_struct das08_boards[]={
{
name: "das08", // cio-das08.pdf
bustype: isa,
MODULE_DEVICE_TABLE(pci, das08_pci_table);
#define devpriv ((struct das08_private_struct *)dev->private)
-#define thisboard ((struct das08_board_struct *)dev->board_ptr)
+#define thisboard ((const struct das08_board_struct *)dev->board_ptr)
#define TIMEOUT 100000
struct das08_private_struct{
unsigned int do_mux_bits; // bits for do/mux register on boards without seperate do register
unsigned int do_bits; // bits for do register on boards with register dedicated to digital out only
- unsigned int *pg_gainlist;
+ const unsigned int *pg_gainlist;
struct pci_dev *pdev; // struct for pci-das08
unsigned int pci_iobase; // additional base address for pci-das08
struct i8254_struct i8254;
*/
static dev_link_t *dev_list = NULL;
-#define thisboard ((struct das08_board_struct *)dev->board_ptr)
+#define thisboard ((const struct das08_board_struct *)dev->board_ptr)
static int das08_cs_attach(comedi_device *dev,comedi_devconfig *it);
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0644);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-static char *version =
+static const char *version =
"das08.c pcmcia code (Frank Hess), modified from dummy_cs.c 1.31 2001/08/24 12:13:13 (David Hinds)";
#else
#define DEBUG(n, args...)
database.
*/
-static dev_info_t dev_info = "pcm-das08";
+static const dev_info_t dev_info = "pcm-das08";
/*
A dev_link_t structure has fields for most things that are needed
#define DAS1600_WS 0x02
#define DAS1600_CLK_10MHZ 0x01
-static comedi_lrange range_das1x01_bip = { 4, {
+static const comedi_lrange range_das1x01_bip = { 4, {
BIP_RANGE( 10 ),
BIP_RANGE( 1 ),
BIP_RANGE( 0.1 ),
BIP_RANGE( 0.01 ),
}};
-static comedi_lrange range_das1x01_unip = { 4, {
+static const comedi_lrange range_das1x01_unip = { 4, {
UNI_RANGE( 10 ),
UNI_RANGE( 1 ),
UNI_RANGE( 0.1 ),
UNI_RANGE( 0.01 ),
}};
-static comedi_lrange range_das1x02_bip = { 4, {
+static const comedi_lrange range_das1x02_bip = { 4, {
BIP_RANGE( 10 ),
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 ),
}};
-static comedi_lrange range_das1x02_unip = { 4, {
+static const comedi_lrange range_das1x02_unip = { 4, {
UNI_RANGE( 10 ),
UNI_RANGE( 5 ),
UNI_RANGE( 2.5 ),
UNI_RANGE( 1.25 ),
}};
-static comedi_lrange range_das16jr = { 9, {
+static const comedi_lrange range_das16jr = { 9, {
// also used by 16/330
BIP_RANGE( 10 ),
BIP_RANGE( 5 ),
UNI_RANGE( 2.5 ),
UNI_RANGE( 1.25 ),
}};
-static comedi_lrange range_das16jr_16 = { 8, {
+static const comedi_lrange range_das16jr_16 = { 8, {
BIP_RANGE( 10 ),
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
UNI_RANGE( 1.25 ),
}};
-static int das16jr_gainlist[] = { 8, 0, 1, 2, 3, 4, 5, 6, 7 };
-static int das16jr_16_gainlist[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
-static int das1600_gainlist[] = { 0, 1, 2, 3 };
+static const int das16jr_gainlist[] = { 8, 0, 1, 2, 3, 4, 5, 6, 7 };
+static const int das16jr_16_gainlist[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+static const int das1600_gainlist[] = { 0, 1, 2, 3 };
enum {
das16_pg_none = 0,
das16_pg_16jr,
das16_pg_1601,
das16_pg_1602,
};
-static int *das16_gainlists[] = {
+static const int * const das16_gainlists[] = {
NULL,
das16jr_gainlist,
das16jr_16_gainlist,
das1600_gainlist,
das1600_gainlist,
};
-static comedi_lrange *das16_ai_uni_lranges[]={
+static const comedi_lrange * const das16_ai_uni_lranges[]={
&range_unknown,
&range_das16jr,
&range_das16jr_16,
&range_das1x01_unip,
&range_das1x02_unip,
};
-static comedi_lrange *das16_ai_bip_lranges[]={
+static const comedi_lrange *const das16_ai_bip_lranges[]={
&range_unknown,
&range_das16jr,
&range_das16jr_16,
unsigned int id;
} das16_board;
-static struct das16_board_struct das16_boards[]={
+static const struct das16_board_struct das16_boards[]={
{
name: "das-16",
ai: das16_ai_rinsn,
#define DAS16M1_82C55 0x400
#define DAS16M1_8254_THIRD 0x404
-static comedi_lrange range_das16m1 =
+static const comedi_lrange range_das16m1 =
{ 9,
{
BIP_RANGE( 5 ),
unsigned int ai_speed;
}das16m1_board;
-static das16m1_board das16m1_boards[]={
+static const das16m1_board das16m1_boards[]={
{
name: "cio-das16/m1", // CIO-DAS16_M1.pdf
ai_speed: 1000, // 1MHz max speed
unsigned int divisor2; // divides master clock to obtain conversion speed
};
#define devpriv ((struct das16m1_private_struct *)(dev->private))
-#define thisboard ((struct das16m1_board_struct *)(dev->board_ptr))
+#define thisboard ((const das16m1_board *)(dev->board_ptr))
COMEDI_INITCLEANUP(driver_das16m1);
static unsigned int suggest_transfer_size(comedi_cmd *cmd);
// analog input ranges
-static comedi_lrange range_ai_das1801 = {
+static const comedi_lrange range_ai_das1801 = {
8,
{
RANGE( -5, 5 ),
}
};
-static comedi_lrange range_ai_das1802 = {
+static const comedi_lrange range_ai_das1802 = {
8,
{
RANGE(-10, 10),
int do_n_chan; /* number of digital output channels */
int ao_ability; /* 0 == no analog out, 1 == basic analog out, 2 == waveform analog out */
int ao_n_chan; /* number of analog out channels */
- comedi_lrange *range_ai; /* available input ranges */
+ const comedi_lrange *range_ai; /* available input ranges */
}das1800_board;
/* Warning: the maximum conversion speeds listed below are
* not always achievable depending on board setup (see
* user manual.)
*/
-static das1800_board das1800_boards[] =
+static const das1800_board das1800_boards[] =
{
{
name: "das-1701st",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((das1800_board *)dev->board_ptr)
+#define thisboard ((const das1800_board *)dev->board_ptr)
typedef struct{
volatile unsigned int count; /* number of data points left to be taken */
#define devpriv ((das1800_private *)dev->private)
// analog out range for boards with basic analog out
-static comedi_lrange range_ao_1 = {
+static const comedi_lrange range_ao_1 = {
1,
{
RANGE(-10, 10),
// analog out range for 'ao' boards
/*
-static comedi_lrange range_ao_2 = {
+static const comedi_lrange range_ao_2 = {
2,
{
RANGE(-10, 10),
typedef struct das800_board_struct{
const char *name;
int ai_speed;
- comedi_lrange *ai_range;
+ const comedi_lrange *ai_range;
int resolution;
}das800_board;
//analog input ranges
-static comedi_lrange range_das800_ai = {
+static const comedi_lrange range_das800_ai = {
1,
{
RANGE( -5, 5 ),
}
};
-static comedi_lrange range_das801_ai = {
+static const comedi_lrange range_das801_ai = {
9,
{
RANGE(-5, 5),
}
};
-static comedi_lrange range_cio_das801_ai = {
+static const comedi_lrange range_cio_das801_ai = {
9,
{
RANGE(-5, 5),
}
};
-static comedi_lrange range_das802_ai = {
+static const comedi_lrange range_das802_ai = {
9,
{
RANGE(-5, 5),
}
};
-static comedi_lrange range_das80216_ai = {
+static const comedi_lrange range_das80216_ai = {
8,
{
RANGE(-10, 10),
enum{das800, ciodas800, das801, ciodas801, das802, ciodas802, ciodas80216};
-static das800_board das800_boards[] =
+static const das800_board das800_boards[] =
{
{
name: "das-800",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((das800_board *)dev->board_ptr)
+#define thisboard ((const das800_board *)dev->board_ptr)
typedef struct{
volatile unsigned int count; /* number of data points left to be taken */
#define DMM32AT_DIRCH 0x08
/* board AI ranges in comedi structure */
-static comedi_lrange dmm32at_airanges =
+static const comedi_lrange dmm32at_airanges =
{
4,
{
/* register values for above ranges */
-static unsigned char dmm32at_rangebits[] = {
+static const unsigned char dmm32at_rangebits[] = {
DMM32AT_RANGE_U10,
DMM32AT_RANGE_U5,
DMM32AT_RANGE_B10,
/* only one of these ranges is valid, as set by a jumper on the
* board. The application should only use the range set by the jumper
*/
-static comedi_lrange dmm32at_aoranges =
+static const comedi_lrange dmm32at_aoranges =
{
4,
{
const char *name;
int ai_chans;
int ai_bits;
- comedi_lrange *ai_ranges;
+ const comedi_lrange *ai_ranges;
int ao_chans;
int ao_bits;
- comedi_lrange *ao_ranges;
+ const comedi_lrange *ao_ranges;
int have_dio;
int dio_chans;
}dmm32at_board;
-static dmm32at_board dmm32at_boards[] = {
+static const dmm32at_board dmm32at_boards[] = {
{
name: "dmm32at",
ai_chans: 32,
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((dmm32at_board *)dev->board_ptr)
+#define thisboard ((const dmm32at_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
#if 0
// ignore 'defined but not used' warning
-static comedi_lrange range_dt2801_ai_pgh_bipolar={ 4, {
+static const comedi_lrange range_dt2801_ai_pgh_bipolar={ 4, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 ),
}};
#endif
-static comedi_lrange range_dt2801_ai_pgl_bipolar={ 4, {
+static const comedi_lrange range_dt2801_ai_pgl_bipolar={ 4, {
RANGE( -10, 10 ),
RANGE( -1, 1 ),
RANGE( -0.1, 0.1 ),
}};
#if 0
// ignore 'defined but not used' warning
-static comedi_lrange range_dt2801_ai_pgh_unipolar={ 4, {
+static const comedi_lrange range_dt2801_ai_pgh_unipolar={ 4, {
RANGE( 0, 10 ),
RANGE( 0, 5 ),
RANGE( 0, 2.5 ),
RANGE( 0, 1.25 ),
}};
#endif
-static comedi_lrange range_dt2801_ai_pgl_unipolar={ 4, {
+static const comedi_lrange range_dt2801_ai_pgl_unipolar={ 4, {
RANGE( 0, 10 ),
RANGE( 0, 1 ),
RANGE( 0, 0.1 ),
}};
typedef struct{
- char *name;
+ const char *name;
int boardcode;
int ad_diff;
int ad_chan;
/* Typeid's for the different boards of the DT2801-series
(taken from the test-software, that comes with the board)
*/
-static boardtype_t boardtypes[] =
+static const boardtype_t boardtypes[] =
{
{
name: "dt2801",
},
};
#define n_boardtypes ((sizeof(boardtypes))/(sizeof(boardtypes[0])))
-#define boardtype (*(boardtype_t *)dev->board_ptr)
+#define boardtype (*(const boardtype_t *)dev->board_ptr)
typedef struct{
- comedi_lrange *dac_range_types[2];
+ const comedi_lrange *dac_range_types[2];
lsampl_t ao_readback[2];
}dt2801_private;
#define devpriv ((dt2801_private *)dev->private)
}
-static comedi_lrange *dac_range_table[]={
+static const comedi_lrange *dac_range_table[]={
&range_bipolar10,
&range_bipolar5,
&range_bipolar2_5,
&range_unipolar5
};
-static comedi_lrange *dac_range_lkup(int opt)
+static const comedi_lrange *dac_range_lkup(int opt)
{
if(opt<0 || opt>5)return &range_unknown;
return dac_range_table[opt];
}
-static comedi_lrange *ai_range_lkup(int type,int opt)
+static const comedi_lrange *ai_range_lkup(int type,int opt)
{
switch(type){
case 0:
#include <linux/ioport.h>
-static char *driver_name = "dt2811";
+static const char *driver_name = "dt2811";
-static comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, {
+static const comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, {
RANGE( 0, 5 ),
RANGE( 0, 2.5 ),
RANGE( 0, 1.25 ),
RANGE( 0, 0.625 )
}};
-static comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, {
+static const comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, {
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 ),
RANGE( -0.625, 0.625 ),
RANGE( -0.3125, 0.3125 )
}};
-static comedi_lrange range_dt2811_pgh_ai_5_bipolar = { 4, {
+static const comedi_lrange range_dt2811_pgh_ai_5_bipolar = { 4, {
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 ),
RANGE( -0.625, 0.625 )
}};
-static comedi_lrange range_dt2811_pgl_ai_5_unipolar = { 4, {
+static const comedi_lrange range_dt2811_pgl_ai_5_unipolar = { 4, {
RANGE( 0, 5 ),
RANGE( 0, 0.5 ),
RANGE( 0, 0.05 ),
RANGE( 0, 0.01 )
}};
-static comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = { 4, {
+static const comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = { 4, {
RANGE( -2.5, 2.5 ),
RANGE( -0.25, 0.25 ),
RANGE( -0.025, 0.025 ),
RANGE( -0.005, 0.005 )
}};
-static comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, {
+static const comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, {
RANGE( -5, 5 ),
RANGE( -0.5, 0.5 ),
RANGE( -0.05, 0.05 ),
typedef struct {
const char *name;
- comedi_lrange *bip_5;
- comedi_lrange *bip_2_5;
- comedi_lrange *unip_5;
+ const comedi_lrange *bip_5;
+ const comedi_lrange *bip_2_5;
+ const comedi_lrange *unip_5;
}boardtype;
-static boardtype boardtypes[]={
+static const boardtype boardtypes[]={
{ "dt2811-pgh",
&range_dt2811_pgh_ai_5_bipolar,
&range_dt2811_pgh_ai_2_5_bipolar,
&range_dt2811_pgl_ai_5_unipolar,
},
};
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static int dt2811_attach(comedi_device *dev,comedi_devconfig *it);
static int dt2811_detach(comedi_device *dev);
enum {
dac_bipolar_5, dac_bipolar_2_5, dac_unipolar_5
} dac_range[2];
- comedi_lrange * range_type_list[2];
+ const comedi_lrange * range_type_list[2];
lsampl_t ao_readback[2];
} dt2811_private;
#define devpriv ((dt2811_private *)dev->private)
-static comedi_lrange *dac_range_types[] =
+static const comedi_lrange *dac_range_types[] =
{
&range_bipolar5,
&range_bipolar2_5,
#include <linux/delay.h>
-static comedi_lrange range_dt2815_ao_32_current = { 1, {
+static const comedi_lrange range_dt2815_ao_32_current = { 1, {
RANGE_mA( 0, 32 )
}};
-static comedi_lrange range_dt2815_ao_20_current = { 1, {
+static const comedi_lrange range_dt2815_ao_20_current = { 1, {
RANGE_mA( 4, 20 )
}};
static void dt2815_free_resources(comedi_device * dev);
typedef struct {
- comedi_lrange * range_type_list[8];
+ const comedi_lrange * range_type_list[8];
lsampl_t ao_readback[8];
} dt2815_private;
{
comedi_subdevice *s;
int i;
- comedi_lrange *current_range_type, *voltage_range_type;
+ const comedi_lrange *current_range_type, *voltage_range_type;
unsigned long iobase;
iobase = it->options[0];
#define DT2821_XCLK 0x0002 /* (R/W) external clock enable */
#define DT2821_BDINIT 0x0001 /* (W) initialize board */
-static comedi_lrange range_dt282x_ai_lo_bipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_lo_bipolar = { 4, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 )
}};
-static comedi_lrange range_dt282x_ai_lo_unipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_lo_unipolar = { 4, {
RANGE( 0, 10 ),
RANGE( 0, 5 ),
RANGE( 0, 2.5 ),
RANGE( 0, 1.25 )
}};
-static comedi_lrange range_dt282x_ai_5_bipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_5_bipolar = { 4, {
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 ),
RANGE( -0.625, 0.625 ),
}};
-static comedi_lrange range_dt282x_ai_5_unipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_5_unipolar = { 4, {
RANGE( 0, 5 ),
RANGE( 0, 2.5 ),
RANGE( 0, 1.25 ),
RANGE( 0, 0.625 ),
}};
-static comedi_lrange range_dt282x_ai_hi_bipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_hi_bipolar = { 4, {
RANGE( -10, 10 ),
RANGE( -1, 1 ),
RANGE( -0.1, 0.1 ),
RANGE( -0.02, 0.02 )
}};
-static comedi_lrange range_dt282x_ai_hi_unipolar = { 4, {
+static const comedi_lrange range_dt282x_ai_hi_unipolar = { 4, {
RANGE( 0, 10 ),
RANGE( 0, 1 ),
RANGE( 0, 0.1 ),
int dabits;
} boardtype_t;
-static boardtype_t boardtypes[] =
+static const boardtype_t boardtypes[] =
{
{ name: "dt2821",
adbits: 12,
},
};
#define n_boardtypes sizeof(boardtypes)/sizeof(boardtype_t)
-#define this_board ((boardtype_t *)dev->board_ptr)
+#define this_board ((const boardtype_t *)dev->board_ptr)
typedef struct {
int da0_2scomp; /* same, for DAC0 */
int da1_2scomp; /* same, for DAC1 */
- comedi_lrange *darangelist[2];
+ const comedi_lrange *darangelist[2];
sampl_t ao[2];
} dt282x_private;
#define devpriv ((dt282x_private *)dev->private)
-#define boardtype (*(boardtype_t *)dev->board_ptr)
+#define boardtype (*(const boardtype_t *)dev->board_ptr)
/*
* Some useless abstractions
}
-static comedi_lrange *ai_range_table[]={
+static const comedi_lrange * const ai_range_table[]={
&range_dt282x_ai_lo_bipolar,
&range_dt282x_ai_lo_unipolar,
&range_dt282x_ai_5_bipolar,
&range_dt282x_ai_5_unipolar };
-static comedi_lrange *ai_range_pgl_table[]={
+static const comedi_lrange * const ai_range_pgl_table[]={
&range_dt282x_ai_hi_bipolar,
&range_dt282x_ai_hi_unipolar };
-static comedi_lrange *opt_ai_range_lkup(int ispgl,int x)
+static const comedi_lrange *opt_ai_range_lkup(int ispgl,int x)
{
if(ispgl){
if(x<0 || x>=2)x=0;
return ai_range_table[x];
}
}
-static comedi_lrange *ao_range_table[]={
+static const comedi_lrange * const ao_range_table[]={
&range_bipolar10,
&range_unipolar10,
&range_bipolar5,
&range_unipolar5,
&range_bipolar2_5 };
-static comedi_lrange *opt_ao_range_lkup(int x)
+static const comedi_lrange *opt_ao_range_lkup(int x)
{
if(x<0 || x>=5)x=0;
return ao_range_table[x];
#define PCI_VENDOR_ID_DT 0x1116
-static comedi_lrange range_dt3000_ai = { 4, {
+static const comedi_lrange range_dt3000_ai = { 4, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( -1.25, 1.25 )
}};
-static comedi_lrange range_dt3000_ai_pgl = { 4, {
+static const comedi_lrange range_dt3000_ai_pgl = { 4, {
RANGE( -10, 10 ),
RANGE( -1, 1 ),
RANGE( -0.1, 0.1 ),
}};
typedef struct{
- char *name;
+ const char *name;
unsigned int device_id;
int adchan;
int adbits;
int ai_speed;
- comedi_lrange *adrange;
+ const comedi_lrange *adrange;
int dachan;
int dabits;
}dt3k_boardtype;
-static dt3k_boardtype dt3k_boardtypes[]={
+static const dt3k_boardtype dt3k_boardtypes[]={
{ name: "dt3001",
device_id: 0x22,
adchan: 16,
},
};
#define n_dt3k_boards sizeof(dt3k_boardtypes)/sizeof(dt3k_boardtype)
-#define this_board ((dt3k_boardtype *)dev->board_ptr)
+#define this_board ((const dt3k_boardtype *)dev->board_ptr)
static struct pci_device_id dt3k_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_DT, 0x0022, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
comedi_dt9812_t *comedi;
} slot_dt9812_t;
-static comedi_lrange dt9812_10_ain_range={ 1, {
+static const comedi_lrange dt9812_10_ain_range={ 1, {
BIP_RANGE(10),
}
};
-static comedi_lrange dt9812_2pt5_ain_range={ 1, {
+static const comedi_lrange dt9812_2pt5_ain_range={ 1, {
UNI_RANGE(2.5),
}
};
-static comedi_lrange dt9812_10_aout_range={ 1, {
+static const comedi_lrange dt9812_10_aout_range={ 1, {
BIP_RANGE(10),
}
};
-static comedi_lrange dt9812_2pt5_aout_range={ 1, {
+static const comedi_lrange dt9812_2pt5_aout_range={ 1, {
UNI_RANGE(2.5),
}
};
} fl512_private;
#define devpriv ((fl512_private *) dev->private)
-static comedi_lrange range_fl512 =
+static const comedi_lrange range_fl512 =
{ 4, {
BIP_RANGE(0.5),
BIP_RANGE(1),
// Define analogue range
-static comedi_lrange range_analog={ 4, {
+static const comedi_lrange range_analog={ 4, {
UNI_RANGE(5),
UNI_RANGE(10),
BIP_RANGE(5),
}
};
-static char range_codes_analog[]={0x00, 0x20, 0x10, 0x30};
+static const char range_codes_analog[]={0x00, 0x20, 0x10, 0x30};
/*
int n_ctrs; // num of counters
int ai_maxdata; // resolution of A/D
int ao_maxdata; // resolution of D/A
- comedi_lrange *rangelist_ai; // rangelist for A/D
- char *rangecode; // range codes for programming
- comedi_lrange *rangelist_ao; // rangelist for D/A
+ const comedi_lrange *rangelist_ai; // rangelist for A/D
+ const char *rangecode; // range codes for programming
+ const comedi_lrange *rangelist_ao; // rangelist for D/A
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"icp_multi", // Driver name
DEVICE_ID, // PCI device ID
} icp_multi_private;
#define devpriv ((icp_multi_private *)dev->private)
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
/*
==============================================================================
void *iobase;
struct {
void *iobase;
- comedi_lrange *ao_range_list[2]; /* range of channels of ao module */
+ const comedi_lrange *ao_range_list[2]; /* range of channels of ao module */
lsampl_t last_data[2];
}pci20006;
struct {
static int pci20006_insn_write(comedi_device * dev, comedi_subdevice * s,
comedi_insn *insn, lsampl_t *data);
-static comedi_lrange *pci20006_range_list[] = {
+static const comedi_lrange *pci20006_range_list[] = {
&range_bipolar10,
&range_unipolar10,
&range_bipolar5,
static int pci20341_insn_read(comedi_device * dev, comedi_subdevice * s,
comedi_insn *insn, lsampl_t *data);
-static int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 };
-static int pci20341_settling_time[] = { 0x58, 0x58, 0x93, 0x99 };
+static const int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 };
+static const int pci20341_settling_time[] = { 0x58, 0x58, 0x93, 0x99 };
-static comedi_lrange range_bipolar0_5 = { 1, { BIP_RANGE(0.5) }};
-static comedi_lrange range_bipolar0_05 = { 1, { BIP_RANGE(0.05) }};
-static comedi_lrange range_bipolar0_025 = { 1, { BIP_RANGE(0.025) }};
+static const comedi_lrange range_bipolar0_5 = { 1, { BIP_RANGE(0.5) }};
+static const comedi_lrange range_bipolar0_05 = { 1, { BIP_RANGE(0.05) }};
+static const comedi_lrange range_bipolar0_025 = { 1, { BIP_RANGE(0.025) }};
-static comedi_lrange *pci20341_ranges[] = {
+static const comedi_lrange * const pci20341_ranges[] = {
&range_bipolar5,
&range_bipolar0_5,
&range_bipolar0_05,
int length;
comedi_krange range;
} range[9];
- comedi_lrange *range_table_list[8 * 7 + 2];
+ const comedi_lrange * range_table_list[8 * 7 + 2];
lsampl_t maxdata_list[8 * 7 + 2];
u16 errors;
int retries;
typedef struct
{
- char *name;
+ const char *name;
int device_id;
int cnt_channel_nbr;
int cnt_bits;
} cnt_board_struct;
-static cnt_board_struct cnt_boards[] =
+static const cnt_board_struct cnt_boards[] =
{
{
name: CNT_DRIVER_NAME,
#include "me4000_fw.h"
#endif
-me4000_board_t me4000_boards[] = {
+static const me4000_board_t me4000_boards[] = {
{ "ME-4650" , 0x4650, { 0, 0 }, { 16, 0, 0, 0 }, { 4 }, { 0 } },
{ "ME-4660" , 0x4660, { 0, 0 }, { 32, 0, 16, 0 }, { 4 }, { 3 } },
-static comedi_lrange me4000_ai_range=
+static const comedi_lrange me4000_ai_range=
{
4,
{
-static comedi_lrange me4000_ao_range=
+static const comedi_lrange me4000_ao_range=
{
1,
{
} me4000_board_t;
-#define thisboard ((me4000_board_t *)dev->board_ptr)
+#define thisboard ((const me4000_board_t *)dev->board_ptr)
/*=============================================================================
static int me_attach(comedi_device *dev, comedi_devconfig *it);
static int me_detach(comedi_device *dev);
-static comedi_lrange me2000_ai_range=
+static const comedi_lrange me2000_ai_range=
{
8,
{
}
};
-static comedi_lrange me2600_ai_range=
+static const comedi_lrange me2600_ai_range=
{
8,
{
}
};
-static comedi_lrange me2600_ao_range=
+static const comedi_lrange me2600_ao_range=
{
3,
{
int ao_channel_nbr; // DA config
int ao_resolution;
int ao_resolution_mask;
- comedi_lrange *ao_range_list;
+ const comedi_lrange *ao_range_list;
int ai_channel_nbr; // AD config
int ai_resolution;
int ai_resolution_mask;
- comedi_lrange *ai_range_list;
+ const comedi_lrange *ai_range_list;
int dio_channel_nbr; // DIO config
} me_board_struct;
-static me_board_struct me_boards[] =
+static const me_board_struct me_boards[] =
{
{ // -- ME-2600i --
name: ME_DRIVER_NAME,
/* names of bits in mite registers */
-static char *mite_CHOR_strings[] = {
+static const char * const mite_CHOR_strings[] = {
"start", "cont", "stop", "abort",
"freset", "clrlc", "clrrb", "clrdone",
"clr_lpause", "set_lpause", "clr_send_tc",
"dmareset",
};
-static char *mite_CHCR_strings[] = {
+static const char * const mite_CHCR_strings[] = {
"continue", "ringbuff", "2", "3",
"4", "5", "6", "7",
"8", "9", "10", "11",
"clr_linkp_ie", "set_linkp_ie", "clr_dma_ie", "set_dma_ie",
};
-static char *mite_MCR_strings[] = {
+static const char * const mite_MCR_strings[] = {
"amdevice", "1", "2", "3",
"4", "5", "portio", "portvxi",
"psizebyte", "psizehalf (byte & half = word)", "aseqxp1", "11",
"28", "29", "30", "stopen",
};
-static char *mite_DCR_strings[] = {
+static const char * const mite_DCR_strings[] = {
"amdevice", "1", "2", "3",
"4", "5", "portio", "portvxi",
"psizebyte", "psizehalf (byte & half = word)", "aseqxp1", "aseqxp2",
"28", "wsdevc", "wsdevs", "rwdevpack",
};
-static char *mite_LKCR_strings[] = {
+static const char * const mite_LKCR_strings[] = {
"amdevice", "1", "2", "3",
"4", "5", "portio", "portvxi",
"psizebyte", "psizehalf (byte & half = word)", "asequp", "aseqdown",
};
-static char *mite_CHSR_strings[] = {
+static const char * const mite_CHSR_strings[] = {
"d.err0", "d.err1", "m.err0", "m.err1",
"l.err0", "l.err1", "drq0", "drq1",
"end", "xferr", "operr0", "operr1",
#define devpriv ((skel_private *)dev->private)
//----------------------------------------------------------------------------
-static comedi_lrange range_mpc624_bipolar1 =
+static const comedi_lrange range_mpc624_bipolar1 =
{
1,
{
BIP_RANGE(2.02)
}
};
-static comedi_lrange range_mpc624_bipolar10 =
+static const comedi_lrange range_mpc624_bipolar10 =
{
1,
{
typedef struct{
int dev_id;
- char *name;
+ const char *name;
}ni6527_board;
-static ni6527_board ni6527_boards[] = {
+static const ni6527_board ni6527_boards[] = {
{
dev_id: 0x2b20,
name: "pci-6527",
};
#define n_ni6527_boards (sizeof(ni6527_boards)/sizeof(ni6527_boards[0]))
-#define this_board ((ni6527_board *)dev->board_ptr)
+#define this_board ((const ni6527_board *)dev->board_ptr)
static struct pci_device_id ni6527_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_NATINST, 0x2b10, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
unsigned num_do_ports;
unsigned invert_outputs : 1;
}ni_65xx_board;
-static ni_65xx_board ni_65xx_boards[] = {
+static const ni_65xx_board ni_65xx_boards[] = {
{
dev_id: 0x7085,
name: "pci-6509",
int cnt_bits; /* number of bits in each counter */
} ni_660x_board;
-static ni_660x_board ni_660x_boards[] =
+static const ni_660x_board ni_660x_boards[] =
{
{
dev_id : 0x2c60,
};
MODULE_DEVICE_TABLE(pci, ni_660x_pci_table);
-#define thisboard ((ni_660x_board *)dev->board_ptr)
+#define thisboard ((const ni_660x_board *)dev->board_ptr)
/* initialized in ni_660x_find_device() */
typedef struct
typedef struct ni_670x_board_struct
{
unsigned short dev_id;
- char *name;
+ const char *name;
unsigned short ao_chans;
unsigned short ao_bits;
}ni_670x_board;
-static ni_670x_board ni_670x_boards[] =
+static const ni_670x_board ni_670x_boards[] =
{
{
dev_id : 0x2c90,
s->n_chan = thisboard->ao_chans;
s->maxdata = 0xffff;
if(s->n_chan == 32){
- s->range_table_list = kmalloc(sizeof(comedi_lrange *)*32,
+ const comedi_lrange **range_table_list;
+
+ range_table_list = kmalloc(sizeof(comedi_lrange *)*32,
GFP_KERNEL);
+ if(!range_table_list)
+ return -ENOMEM;
+ s->range_table_list = range_table_list;
for(i=0;i<16;i++){
- s->range_table_list[i] = &range_bipolar10;
- s->range_table_list[16+i] = &range_0_20mA;
+ range_table_list[i] = &range_bipolar10;
+ range_table_list[16+i] = &range_0_20mA;
}
}else{
s->range_table = &range_bipolar10;
#define HW_COUNT_DISABLE 0x30 // disable hardware counting of conversions
typedef struct a2150_board_struct{
- char *name;
+ const char *name;
int clock[4]; // master clock periods, in nanoseconds
int num_clocks; // number of available master clock speeds
int ai_speed; // maximum conversion rate in nanoseconds
}a2150_board;
//analog input range
-static comedi_lrange range_a2150 = {
+static const comedi_lrange range_a2150 = {
1,
{
RANGE( -2.828, 2.828 ),
// enum must match board indices
enum{a2150_c, a2150_s};
-static a2150_board a2150_boards[] =
+static const a2150_board a2150_boards[] =
{
{
name: "at-a2150c",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((a2150_board *)dev->board_ptr)
+#define thisboard ((const a2150_board *)dev->board_ptr)
typedef struct{
volatile unsigned int count; /* number of data points left to be taken */
const char *name;
int n_ao_chans;
}atao_board;
-static atao_board atao_boards[] = {
+static const atao_board atao_boards[] = {
{
name: "ai-ao-6",
n_ao_chans: 6,
#define MAX_N_CALDACS 32
-static ni_board ni_boards[]={
+static const ni_board ni_boards[]={
{ device_id: 44,
isapnp_id: 0x0000, /* XXX unknown */
name: "at-mio-16e-1",
}
};
-static int ni_irqpin[]={-1,-1,-1,0,1,2,-1,3,-1,-1,4,5,6,-1,-1,7};
+static const int ni_irqpin[]={-1,-1,-1,0,1,2,-1,3,-1,-1,4,5,6,-1,-1,7};
#define interrupt_pin(a) (ni_irqpin[(a)])
const char *name;
int has_8255;
}atmio16_board_t;
-static atmio16_board_t atmio16_boards[]={
+static const atmio16_board_t atmio16_boards[]={
{
name: "atmio16",
has_8255: 0,
};
#define n_atmio16_boards sizeof(atmio16_boards)/sizeof(atmio16_boards[0])
-#define boardtype ((atmio16_board_t *)dev->board_ptr)
+#define boardtype ((const atmio16_board_t *)dev->board_ptr)
/* function prototypes */
COMEDI_INITCLEANUP(driver_atmio16d);
/* range structs */
-static comedi_lrange range_atmio16d_ai_10_bipolar = { 4, {
+static const comedi_lrange range_atmio16d_ai_10_bipolar = { 4, {
BIP_RANGE( 10 ),
BIP_RANGE( 1 ),
BIP_RANGE( 0.1 ),
BIP_RANGE( 0.02 )
} };
-static comedi_lrange range_atmio16d_ai_5_bipolar = { 4, {
+static const comedi_lrange range_atmio16d_ai_5_bipolar = { 4, {
BIP_RANGE( 5 ),
BIP_RANGE( 0.5 ),
BIP_RANGE( 0.05 ),
BIP_RANGE( 0.01 )
} };
-static comedi_lrange range_atmio16d_ai_unipolar = { 4, {
+static const comedi_lrange range_atmio16d_ai_unipolar = { 4, {
UNI_RANGE( 10 ),
UNI_RANGE( 1 ),
UNI_RANGE( 0.1 ),
enum { dac_bipolar, dac_unipolar } dac0_range, dac1_range;
enum { dac_internal, dac_external } dac0_reference, dac1_reference;
enum { dac_2comp, dac_straight } dac0_coding, dac1_coding;
- comedi_lrange *ao_range_type_list[2];
+ const comedi_lrange *ao_range_type_list[2];
lsampl_t ao_readback[2];
unsigned int com_reg_1_state; /* current state of command register 1 */
unsigned int com_reg_2_state; /* current state of command register 2 */
}dio24_board;
-static dio24_board dio24_boards[] =
+static const dio24_board dio24_boards[] =
{
{
name: "daqcard-dio24",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((dio24_board *)dev->board_ptr)
+#define thisboard ((const dio24_board *)dev->board_ptr)
typedef struct{
int data; /* number of data points left to be taken */
database.
*/
-static dev_info_t dev_info = "ni_daq_dio24";
+static const dev_info_t dev_info = "ni_daq_dio24";
/*
A dev_link_t structure has fields for most things that are needed
//analog input ranges
#define NUM_LABPC_PLUS_AI_RANGES 16
// indicates unipolar ranges
-static int labpc_plus_is_unipolar[NUM_LABPC_PLUS_AI_RANGES] =
+static const int labpc_plus_is_unipolar[NUM_LABPC_PLUS_AI_RANGES] =
{
0,
0,
1,
};
// map range index to gain bits
-static int labpc_plus_ai_gain_bits[NUM_LABPC_PLUS_AI_RANGES] =
+static const int labpc_plus_ai_gain_bits[NUM_LABPC_PLUS_AI_RANGES] =
{
0x00,
0x10,
0x60,
0x70,
};
-static comedi_lrange range_labpc_plus_ai = {
+static const comedi_lrange range_labpc_plus_ai = {
NUM_LABPC_PLUS_AI_RANGES,
{
BIP_RANGE(5),
#define NUM_LABPC_1200_AI_RANGES 14
// indicates unipolar ranges
-static int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
+static const int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
{
0,
0,
1,
};
// map range index to gain bits
-static int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
+static const int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
{
0x00,
0x20,
0x60,
0x70,
};
-static comedi_lrange range_labpc_1200_ai = {
+static const comedi_lrange range_labpc_1200_ai = {
NUM_LABPC_1200_AI_RANGES,
{
BIP_RANGE(5),
//analog output ranges
#define AO_RANGE_IS_UNIPOLAR 0x1
-comedi_lrange range_labpc_ao = {
+static const comedi_lrange range_labpc_ao = {
2,
{
BIP_RANGE(5),
writeb(byte, (void*) address);
}
-static labpc_board labpc_boards[] =
+static const labpc_board labpc_boards[] =
{
{
name: "lab-pc-1200",
},
};
-labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS] =
+const labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS] =
{
{
name: "daqcard-1200",
enum labpc_bustype bustype; // ISA/PCI/etc.
enum labpc_register_layout register_layout; // 1200 has extra registers compared to pc+
int has_ao; // has analog output true/false
- comedi_lrange *ai_range_table;
- int *ai_range_code;
- int *ai_range_is_unipolar;
+ const comedi_lrange *ai_range_table;
+ const int *ai_range_code;
+ const int *ai_range_is_unipolar;
unsigned ai_scan_up : 1; // board can auto scan up in ai channels, not just down
unsigned memory_mapped_io : 1; /* uses memory mapped io instead of ioports */
}labpc_board;
}labpc_private;
#define NUM_LABPC_CS_BOARDS 2
-extern labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS];
+extern const labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS];
int labpc_common_attach( comedi_device *dev, unsigned long iobase,
unsigned int irq, unsigned int dma );
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((labpc_board *)dev->board_ptr)
+#define thisboard ((const labpc_board *)dev->board_ptr)
static comedi_driver driver_labpc_cs =
{
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0644);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-static char *version =
+static const char *version =
"ni_labpc.c, based on dummy_cs.c 1.31 2001/08/24 12:13:13";
#else
#define DEBUG(n, args...)
database.
*/
-static dev_info_t dev_info = "daqcard-1200";
+static const dev_info_t dev_info = "daqcard-1200";
/*
A dev_link_t structure has fields for most things that are needed
static const unsigned old_RTSI_clock_channel = 7;
/* Note: this table must match the ai_gain_* definitions */
-static short ni_gainlkup[][16]={
+static const short ni_gainlkup[][16]={
/* ai_gain_16 */
{ 0, 1, 2, 3, 4, 5, 6, 7, 0x100, 0x101, 0x102, 0x103, 0x104, 0x105,
0x106, 0x107 },
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
};
-static comedi_lrange range_ni_E_ai={ 16, {
+static const comedi_lrange range_ni_E_ai={ 16, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2.5, 2.5 ),
RANGE( 0, 0.2 ),
RANGE( 0, 0.1 ),
}};
-static comedi_lrange range_ni_E_ai_limited={ 8, {
+static const comedi_lrange range_ni_E_ai_limited={ 8, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -1, 1 ),
RANGE( 0, 1 ),
RANGE( 0, 0.1 ),
}};
-static comedi_lrange range_ni_E_ai_limited14={ 14, {
+static const comedi_lrange range_ni_E_ai_limited14={ 14, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2, 2 ),
RANGE( 0, 0.2 ),
RANGE( 0, 0.1 ),
}};
-static comedi_lrange range_ni_E_ai_bipolar4={ 4, {
+static const comedi_lrange range_ni_E_ai_bipolar4={ 4, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -0.5, 0.5 ),
RANGE( -0.05, 0.05 ),
}};
-static comedi_lrange range_ni_E_ai_611x={ 8, {
+static const comedi_lrange range_ni_E_ai_611x={ 8, {
RANGE( -50, 50 ),
RANGE( -20, 20 ),
RANGE( -10, 10 ),
RANGE( -0.5, 0.5 ),
RANGE( -0.2, 0.2 ),
}};
-static comedi_lrange range_ni_M_ai_622x={ 4, {
+static const comedi_lrange range_ni_M_ai_622x={ 4, {
RANGE(-10, 10),
RANGE(-5, 5),
RANGE(-1, 1),
RANGE(-0.2, 0.2),
}};
-static comedi_lrange range_ni_M_ai_628x={ 7, {
+static const comedi_lrange range_ni_M_ai_628x={ 7, {
RANGE( -10, 10 ),
RANGE( -5, 5 ),
RANGE( -2, 2 ),
RANGE( -0.2, 0.2 ),
RANGE( -0.1, 0.1 ),
}};
-static comedi_lrange range_ni_S_ai_6143 = { 1, {
+static const comedi_lrange range_ni_S_ai_6143 = { 1, {
RANGE( -5, +5 ),
}};
-static comedi_lrange range_ni_E_ao_ext = { 4, {
+static const comedi_lrange range_ni_E_ao_ext = { 4, {
RANGE( -10, 10 ),
RANGE( 0, 10 ),
RANGE_ext( -1, 1 ),
RANGE_ext( 0, 1 ),
}};
-static comedi_lrange *ni_range_lkup[]={
+static const comedi_lrange * const ni_range_lkup[]={
&range_ni_E_ai,
&range_ni_E_ai_limited,
&range_ni_E_ai_limited14,
}
#ifdef DEBUG_STATUS_A
-static char *status_a_strings[]={
+static const char * const status_a_strings[]={
"passthru0","fifo","G0_gate","G0_TC",
"stop","start","sc_tc","start1",
"start2","sc_tc_error","overflow","overrun",
#endif
#ifdef DEBUG_STATUS_B
-static char *status_b_strings[]={
+static const char * const status_b_strings[]={
"passthru1","fifo","G1_gate","G1_TC",
"UI2_TC","UPDATE","UC_TC","BC_TC",
"start1","overrun","start","bc_tc_error",
}
for(i=0;i<n_chans;i++)
{
- comedi_krange *krange;
+ const comedi_krange *krange;
chan = CR_CHAN(chanspec[i]);
range = CR_RANGE(chanspec[i]);
krange = s->range_table->range + range;
s->n_chan=n_chans;
if(diffbits){
+ unsigned int *maxdata_list;
if(n_chans>MAX_N_CALDACS){
printk("BUG! MAX_N_CALDACS too small\n");
}
- s->maxdata_list=devpriv->caldac_maxdata_list;
+ s->maxdata_list=maxdata_list=devpriv->caldac_maxdata_list;
chan=0;
for(i=0;i<n_dacs;i++){
type = boardtype.caldac[i];
for(j=0;j<caldacs[type].n_chans;j++){
- s->maxdata_list[chan]=
+ maxdata_list[chan]=
(1<<caldacs[type].n_bits)-1;
chan++;
}
#define MAX_N_CALDACS 32
-static ni_board ni_boards[]={
+static const ni_board ni_boards[]={
{ device_id: 0x010d,
name: "DAQCard-ai-16xe-50",
n_adchan: 16,
static void cs_detach(struct pcmcia_device *);
static dev_link_t *dev_list = NULL;
-static dev_info_t dev_info = "ni_mio_cs";
+static const dev_info_t dev_info = "ni_mio_cs";
static dev_node_t dev_node = {
"ni_mio_cs",
COMEDI_MAJOR,0,
typedef struct{
int dev_id;
- char *name;
+ const char *name;
int n_8255;
unsigned int is_diodaq : 1;
unsigned int uses_firmware : 1;
}nidio_board;
-static nidio_board nidio_boards[]={
+static const nidio_board nidio_boards[]={
{
dev_id: 0x1150,
name: "pci-dio-32hs",
},
};
#define n_nidio_boards (sizeof(nidio_boards)/sizeof(nidio_boards[0]))
-#define this_board ((nidio_board *)dev->board_ptr)
+#define this_board ((const nidio_board *)dev->board_ptr)
static struct pci_device_id ni_pcidio_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_NATINST, 0x1150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
}
#ifdef DEBUG_FLAGS
-static char *flags_strings[] = {
+static const char * const flags_strings[] = {
"TransferReady", "CountExpired", "2", "3",
"4", "Waited", "PrimaryTC", "SecondaryTC",
};
63 different possibilities. An AO channel
can not act as it's own OFFSET or REFERENCE.
*/
-static comedi_lrange range_ni_M_628x_ao = { 8, {
+static const comedi_lrange range_ni_M_628x_ao = { 8, {
RANGE(-10, 10),
RANGE(-5, 5),
RANGE(-2, 2),
RANGE(4, 6),
RANGE_ext(-1, 1)
}};
-static comedi_lrange range_ni_M_625x_ao = { 3, {
+static const comedi_lrange range_ni_M_625x_ao = { 3, {
RANGE(-10, 10),
RANGE(-5, 5),
RANGE_ext(-1, 1)
}};
-static comedi_lrange range_ni_M_622x_ao = { 1, {
+static const comedi_lrange range_ni_M_622x_ao = { 1, {
RANGE(-10, 10),
}};
-static ni_board ni_boards[]={
+static const ni_board ni_boards[]={
{ device_id: 0x0162, // NI also says 0x1620. typo?
name: "pci-mio-16xe-50",
n_adchan: 16,
ni_reg_6143 = 0x20
};
-static comedi_lrange range_ni_E_ao_ext;
+static const comedi_lrange range_ni_E_ao_ext;
enum m_series_register_offsets
{
int n_aochan;
int aobits;
int ao_fifo_depth;
- comedi_lrange *ao_range_table;
+ const comedi_lrange *ao_range_table;
unsigned ao_speed;
unsigned num_p0_dio_channels;
enum caldac_enum caldac[3];
}ni_board;
-static ni_board ni_boards[];
#define n_ni_boards (sizeof(ni_boards)/sizeof(ni_board))
#define boardtype (*(ni_board *)dev->board_ptr)
#define PCL711_DO_LO 13
#define PCL711_DO_HI 14
-static comedi_lrange range_pcl711b_ai = { 5, {
+static const comedi_lrange range_pcl711b_ai = { 5, {
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 ),
BIP_RANGE( 0.625 ),
BIP_RANGE( 0.3125 )
}};
-static comedi_lrange range_acl8112hg_ai = { 12, {
+static const comedi_lrange range_acl8112hg_ai = { 12, {
BIP_RANGE( 5 ),
BIP_RANGE( 0.5 ),
BIP_RANGE( 0.05 ),
BIP_RANGE( 0.1 ),
BIP_RANGE( 0.01 )
}};
-static comedi_lrange range_acl8112dg_ai = { 9, {
+static const comedi_lrange range_acl8112dg_ai = { 9, {
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 ),
#define PCL711_TIMEOUT 100
#define PCL711_DRDY 0x10
-static int i8253_osc_base = 500; /* 2 Mhz */
+static const int i8253_osc_base = 500; /* 2 Mhz */
typedef struct {
const char *name;
int n_aichan;
int n_aochan;
int maxirq;
- comedi_lrange * ai_range_type;
+ const comedi_lrange * ai_range_type;
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl711", 0, 0, 0, 5, 8, 1, 0, &range_bipolar5},
{"pcl711b", 1, 0, 0, 5, 8, 1, 7, &range_pcl711b_ai},
{"acl8112dg", 0, 1, 1, 9, 16, 2, 15, &range_acl8112dg_ai},
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static int pcl711_attach(comedi_device *dev,comedi_devconfig *it);
static int pcl711_detach(comedi_device *dev);
char is_pet48;
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl724", 24, 1, 0x00fc, PCL724_SIZE, 0, 0, },
{"pcl722", 144, 6, 0x00fc, PCL722_SIZE, 1, 0, },
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_pcl724={
driver_name: "pcl724",
#define PCL727_DI_HI 0
#define PCL727_DI_LO 1
-static comedi_lrange range_4_20mA={ 1, {RANGE_mA(4,20)}};
-static comedi_lrange range_0_20mA={ 1, {RANGE_mA(0,20)}};
+static const comedi_lrange range_4_20mA={ 1, {RANGE_mA(4,20)}};
+static const comedi_lrange range_0_20mA={ 1, {RANGE_mA(0,20)}};
-static comedi_lrange *rangelist_726[]={
+static const comedi_lrange * const rangelist_726[]={
&range_unipolar5, &range_unipolar10,
&range_bipolar5, &range_bipolar10,
&range_4_20mA, &range_unknown
};
-static comedi_lrange *rangelist_727[]={
+static const comedi_lrange * const rangelist_727[]={
&range_unipolar5, &range_unipolar10,
&range_bipolar5,
&range_4_20mA
};
-static comedi_lrange *rangelist_728[]={
+static const comedi_lrange * const rangelist_728[]={
&range_unipolar5, &range_unipolar10,
&range_bipolar5, &range_bipolar10,
&range_4_20mA, &range_0_20mA
int di_lo;
int do_hi;
int do_lo;
- comedi_lrange **range_type_list;// list of supported ranges
+ const comedi_lrange * const *range_type_list;// list of supported ranges
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl726", 6, 6, 0x0000, PCL726_SIZE, 1,
PCL726_DI_HI, PCL726_DI_LO, PCL726_DO_HI, PCL726_DO_LO,
&rangelist_728[0], },
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_pcl726={
driver_name: "pcl726",
typedef struct{
int bipolar[12];
- comedi_lrange *rangelist[12];
+ const comedi_lrange *rangelist[12];
lsampl_t ao_readback[12];
}pcl726_private;
#define devpriv ((pcl726_private *)dev->private)
unsigned int io_range; // len of I/O space
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{ "pcl730", PCL730_SIZE, },
{ "iso730", PCL730_SIZE, },
{ "acl7130", ACL7130_SIZE, },
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_pcl730 = {
driver_name: "pcl730",
#define MAX_CHANLIST_LEN 256 /* length of scan list */
-static comedi_lrange range_pcl812pg_ai = { 5, {
+static const comedi_lrange range_pcl812pg_ai = { 5, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
BIP_RANGE(0.3125),
}};
-static comedi_lrange range_pcl812pg2_ai = { 5, {
+static const comedi_lrange range_pcl812pg2_ai = { 5, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
}};
-static comedi_lrange range812_bipolar1_25 = { 1, {
+static const comedi_lrange range812_bipolar1_25 = { 1, {
BIP_RANGE(1.25),
}};
-static comedi_lrange range812_bipolar0_625 = { 1, {
+static const comedi_lrange range812_bipolar0_625 = { 1, {
BIP_RANGE(0.625),
}};
-static comedi_lrange range812_bipolar0_3125 = { 1, {
+static const comedi_lrange range812_bipolar0_3125 = { 1, {
BIP_RANGE(0.3125),
}};
-static comedi_lrange range_pcl813b_ai = { 4, {
+static const comedi_lrange range_pcl813b_ai = { 4, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
}};
-static comedi_lrange range_pcl813b2_ai = { 4, {
+static const comedi_lrange range_pcl813b2_ai = { 4, {
UNI_RANGE(10),
UNI_RANGE(5),
UNI_RANGE(2.5),
UNI_RANGE(1.25),
}};
-static comedi_lrange range_iso813_1_ai = { 5, {
+static const comedi_lrange range_iso813_1_ai = { 5, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
BIP_RANGE(0.3125),
}};
-static comedi_lrange range_iso813_1_2_ai = { 5, {
+static const comedi_lrange range_iso813_1_2_ai = { 5, {
UNI_RANGE(10),
UNI_RANGE(5),
UNI_RANGE(2.5),
UNI_RANGE(1.25),
UNI_RANGE(0.625),
}};
-static comedi_lrange range_iso813_2_ai = { 4, {
+static const comedi_lrange range_iso813_2_ai = { 4, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
}};
-static comedi_lrange range_iso813_2_2_ai = { 4, {
+static const comedi_lrange range_iso813_2_2_ai = { 4, {
UNI_RANGE(10),
UNI_RANGE(5),
UNI_RANGE(2.5),
UNI_RANGE(1.25),
}};
-static comedi_lrange range_acl8113_1_ai = { 4, {
+static const comedi_lrange range_acl8113_1_ai = { 4, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
}};
-static comedi_lrange range_acl8113_1_2_ai = { 4, {
+static const comedi_lrange range_acl8113_1_2_ai = { 4, {
UNI_RANGE(10),
UNI_RANGE(5),
UNI_RANGE(2.5),
UNI_RANGE(1.25),
}};
-static comedi_lrange range_acl8113_2_ai = { 3, {
+static const comedi_lrange range_acl8113_2_ai = { 3, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
}};
-static comedi_lrange range_acl8113_2_2_ai = { 3, {
+static const comedi_lrange range_acl8113_2_2_ai = { 3, {
UNI_RANGE(10),
UNI_RANGE(5),
UNI_RANGE(2.5),
}};
-static comedi_lrange range_acl8112dg_ai = { 9, {
+static const comedi_lrange range_acl8112dg_ai = { 9, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
UNI_RANGE(1.25),
BIP_RANGE(10),
}};
-static comedi_lrange range_acl8112hg_ai = { 12, {
+static const comedi_lrange range_acl8112hg_ai = { 12, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
BIP_RANGE(0.1),
BIP_RANGE(0.01),
}};
-static comedi_lrange range_a821pgh_ai = { 4, {
+static const comedi_lrange range_a821pgh_ai = { 4, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
int ai_maxdata; // AI resolution
unsigned int ai_ns_min; // max sample speed of card v ns
unsigned int i8254_osc_base; // clock base
- comedi_lrange *rangelist_ai; // rangelist for A/D
- comedi_lrange *rangelist_ao; // rangelist for D/A
+ const comedi_lrange *rangelist_ai; // rangelist for A/D
+ const comedi_lrange *rangelist_ao; // rangelist for D/A
unsigned int IRQbits; // allowed IRQ
unsigned char DMAbits; // allowed DMA chans
unsigned char io_range; // iorange for this board
unsigned char haveMPC508; // 1=board use MPC508A multiplexor
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl812", boardPCL812, 16, 0, 2, 16, 16, 0x0fff,
33000, 500, &range_bipolar10, &range_unipolar5,
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_pcl812={
driver_name: "pcl812",
#define MAGIC_DMA_WORD 0x5a5a
-static comedi_lrange range_pcl816 = { 8, {
+static const comedi_lrange range_pcl816 = { 8, {
BIP_RANGE (10),
BIP_RANGE (5),
BIP_RANGE (2.5),
int n_aochan; // num of D/A chans
int n_dichan; // num of DI chans
int n_dochan; // num of DO chans
- comedi_lrange *ai_range_type; // default A/D rangelist
- comedi_lrange *ao_range_type; // dafault D/A rangelist
+ const comedi_lrange *ai_range_type; // default A/D rangelist
+ const comedi_lrange *ao_range_type; // dafault D/A rangelist
unsigned int io_range; // len of IO space
unsigned int IRQbits; // allowed interrupts
unsigned int DMAbits; // allowed DMA chans
}
boardtype;
-static boardtype boardtypes[] = {
+static const boardtype boardtypes[] = {
{"pcl816", 8, 16, 10000, 1, 16, 16, &range_pcl816,
&range_pcl816, PCLx1x_RANGE,
0x00fc, // IRQ mask
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
#define devpriv ((pcl816_private *)dev->private)
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static int pcl816_attach (comedi_device * dev, comedi_devconfig * it);
static int pcl816_detach (comedi_device * dev);
#define MAGIC_DMA_WORD 0x5a5a
-static comedi_lrange range_pcl818h_ai = { 9, {
+static const comedi_lrange range_pcl818h_ai = { 9, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(10),
}};
-static comedi_lrange range_pcl818hg_ai = { 10, {
+static const comedi_lrange range_pcl818hg_ai = { 10, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
BIP_RANGE(0.01),
}};
-static comedi_lrange range_pcl818l_l_ai = { 4, {
+static const comedi_lrange range_pcl818l_l_ai = { 4, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
BIP_RANGE(0.625),
}};
-static comedi_lrange range_pcl818l_h_ai = { 4, {
+static const comedi_lrange range_pcl818l_h_ai = { 4, {
BIP_RANGE(10),
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
}};
-static comedi_lrange range718_bipolar1 = { 1, { BIP_RANGE(1), }};
-static comedi_lrange range718_bipolar0_5 = { 1, { BIP_RANGE(0.5), }};
-static comedi_lrange range718_unipolar2 = { 1, { UNI_RANGE(2), }};
-static comedi_lrange range718_unipolar1 = { 1, { BIP_RANGE(1), }};
+static const comedi_lrange range718_bipolar1 = { 1, { BIP_RANGE(1), }};
+static const comedi_lrange range718_bipolar0_5 = { 1, { BIP_RANGE(0.5), }};
+static const comedi_lrange range718_unipolar2 = { 1, { UNI_RANGE(2), }};
+static const comedi_lrange range718_unipolar1 = { 1, { BIP_RANGE(1), }};
static int pcl818_attach(comedi_device *dev,comedi_devconfig *it);
static int pcl818_detach(comedi_device *dev);
int n_aochan; // num of D/A chans
int n_dichan; // num of DI chans
int n_dochan; // num of DO chans
- comedi_lrange *ai_range_type; // default A/D rangelist
- comedi_lrange *ao_range_type; // default D/A rangelist
+ const comedi_lrange *ai_range_type; // default A/D rangelist
+ const comedi_lrange *ao_range_type; // default D/A rangelist
unsigned int io_range; // len of IO space
unsigned int IRQbits; // allowed interrupts
unsigned int DMAbits; // allowed DMA chans
int is_818;
} boardtype;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcl818l", 4, 16, 8, 25000, 1, 16, 16, &range_pcl818l_l_ai, &range_unipolar5, PCLx1x_RANGE, 0x00fc,
0x0a, 0xfff, 0xfff, 0, 1 },
} pcl818_private;
-static unsigned int muxonechan[] ={ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, // used for gain list programming
+static const unsigned int muxonechan[] ={ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, // used for gain list programming
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
#define devpriv ((pcl818_private *)dev->private)
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
/*
==============================================================================
int dio_1;
int dio_2;
} priv_pcm3724;
-static boardtype boardtypes[] =
+static const boardtype boardtypes[] =
{
{"pcm3724", 48, 2, 0x00fc, PCM3724_SIZE,},
};
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static comedi_driver driver_pcm3724={
driver_name: "pcm3724",
const char *name;
int n_ai_bits;
};
-static struct pcmad_board_struct pcmad_boards[]={
+static const struct pcmad_board_struct pcmad_boards[]={
{
name: "pcmad12",
n_ai_bits: 12,
n_ai_bits: 16,
},
};
-#define this_board ((struct pcmad_board_struct *)(dev->board_ptr))
+#define this_board ((const struct pcmad_board_struct *)(dev->board_ptr))
#define n_pcmad_boards (sizeof(pcmad_boards)/sizeof(pcmad_boards[0]))
struct pcmad_priv_struct{
*/
typedef struct pcmda12_board_struct
{
- const char * const name;
+ const char *name;
} pcmda12_board;
/* note these have no effect and are merely here for reference..
these are configured by jumpering the board! */
-static comedi_lrange pcmda12_ranges =
+static const comedi_lrange pcmda12_ranges =
{
3,
{
}
};
-static pcmda12_board pcmda12_boards[] =
+static const pcmda12_board pcmda12_boards[] =
{
{
name: "pcmda12",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((pcmda12_board *)dev->board_ptr)
+#define thisboard ((const pcmda12_board *)dev->board_ptr)
typedef struct
{
*/
typedef struct pcmmio_board_struct
{
- const char * const name;
+ const char *name;
const int dio_num_asics;
const int dio_num_ports;
const int total_iosize;
const int ao_bits;
const int n_ai_chans;
const int n_ao_chans;
- comedi_lrange *ai_range_table, *ao_range_table;
+ const comedi_lrange *ai_range_table, *ao_range_table;
comedi_insn_fn_t ai_rinsn, ao_rinsn, ao_winsn;
} pcmmio_board;
-static struct {
- int length;
- comedi_krange ranges[4];
-} ranges_ai = { 4, { RANGE(-5.,5.), RANGE(-10.,10.), RANGE(0.,5.), RANGE(0.,10.) } };
+static const comedi_lrange ranges_ai =
+{ 4, { RANGE(-5.,5.), RANGE(-10.,10.), RANGE(0.,5.), RANGE(0.,10.) } };
-static struct {
- int length;
- comedi_krange ranges[6];
-} ranges_ao = { 6, { RANGE(0.,5.), RANGE(0.,10.) , RANGE(-5.,5.), RANGE(-10.,10.), RANGE(-2.5, 2.5), RANGE(-2.5, 7.5) } };
+static const comedi_lrange ranges_ao =
+{ 6, { RANGE(0.,5.), RANGE(0.,10.) , RANGE(-5.,5.), RANGE(-10.,10.), RANGE(-2.5, 2.5), RANGE(-2.5, 7.5) } };
-static pcmmio_board pcmmio_boards[] =
+static const pcmmio_board pcmmio_boards[] =
{
{
name: "pcmmio",
ao_bits: 16,
n_ai_chans: 16,
n_ao_chans: 8,
- ai_range_table: (comedi_lrange *)&ranges_ai,
- ao_range_table: (comedi_lrange *)&ranges_ao,
+ ai_range_table: &ranges_ai,
+ ao_range_table: &ranges_ao,
ai_rinsn: ai_rinsn,
ao_rinsn: ao_rinsn,
ao_winsn: ao_winsn
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((pcmmio_board *)dev->board_ptr)
+#define thisboard ((const pcmmio_board *)dev->board_ptr)
/* this structure is for data unique to this subdevice. */
typedef struct
*/
typedef struct pcmuio_board_struct
{
- const char * const name;
+ const char *name;
const int num_asics;
const int num_channels_per_port;
const int num_ports;
} pcmuio_board;
-static pcmuio_board pcmuio_boards[] =
+static const pcmuio_board pcmuio_boards[] =
{
{
name: "pcmuio48",
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((pcmuio_board *)dev->board_ptr)
+#define thisboard ((const pcmuio_board *)dev->board_ptr)
/* this structure is for data unique to this subdevice. */
typedef struct
int (*winsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*rinsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*insnbits)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
- comedi_lrange* range;
+ const comedi_lrange *range;
};
-static struct boarddef_struct boards[]={
+static const struct boarddef_struct boards[]={
{
name: "dac02",
iosize: 8,
},
};
#define n_boards (sizeof(boards)/sizeof(boards[0]))
-#define this_board ((struct boarddef_struct *)dev->board_ptr)
+#define this_board ((const struct boarddef_struct *)dev->board_ptr)
static comedi_driver driver_poc=
{
* +/- 1.25V, and the D/A converter has only one: +/- 5V.
*/
-static comedi_lrange range_daqp_ai = { 4, {
+static const comedi_lrange range_daqp_ai = { 4, {
BIP_RANGE( 10 ),
BIP_RANGE( 5 ),
BIP_RANGE( 2.5 ),
BIP_RANGE( 1.25 )
}};
-static comedi_lrange range_daqp_ao = { 1, {BIP_RANGE(5)}};
+static const comedi_lrange range_daqp_ao = { 1, {BIP_RANGE(5)}};
/*====================================================================*/
database.
*/
-static dev_info_t dev_info = "quatech_daqp_cs";
+static const dev_info_t dev_info = "quatech_daqp_cs";
/*======================================================================
/*
The board has 3 input modes and the gains of 1,2,4,...32 (, 64, 128)
*/
-static comedi_lrange rtd_ai_7520_range = { 18, {
+static const comedi_lrange rtd_ai_7520_range = { 18, {
/* +-5V input range gain steps */
BIP_RANGE(5.0),
BIP_RANGE(5.0/2),
}};
/* PCI4520 has two more gains (6 more entries) */
-static comedi_lrange rtd_ai_4520_range = { 24, {
+static const comedi_lrange rtd_ai_4520_range = { 24, {
/* +-5V input range gain steps */
BIP_RANGE(5.0),
BIP_RANGE(5.0/2),
}};
/* Table order matches range values */
-static comedi_lrange rtd_ao_range = { 4, {
+static const comedi_lrange rtd_ao_range = { 4, {
RANGE(0, 5),
RANGE(0, 10),
RANGE(-5, 5),
int rangeUniStart; /* start of +10V range */
} rtdBoard;
-static rtdBoard rtd520Boards[] = {
+static const rtdBoard rtd520Boards[] = {
{
name: "DM7520",
device_id: 0x7520,
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((rtdBoard *)dev->board_ptr)
+#define thisboard ((const rtdBoard *)dev->board_ptr)
/*
This structure is for data unique to this hardware driver.
#include "am9513.h"
-static comedi_lrange range_rti800_ai_10_bipolar = { 4, {
+static const comedi_lrange range_rti800_ai_10_bipolar = { 4, {
BIP_RANGE( 10 ),
BIP_RANGE( 1 ),
BIP_RANGE( 0.1 ),
BIP_RANGE( 0.02 )
}};
-static comedi_lrange range_rti800_ai_5_bipolar = { 4, {
+static const comedi_lrange range_rti800_ai_5_bipolar = { 4, {
BIP_RANGE( 5 ),
BIP_RANGE( 0.5 ),
BIP_RANGE( 0.05 ),
BIP_RANGE( 0.01 )
}};
-static comedi_lrange range_rti800_ai_unipolar = { 4, {
+static const comedi_lrange range_rti800_ai_unipolar = { 4, {
UNI_RANGE( 10 ),
UNI_RANGE( 1 ),
UNI_RANGE( 0.1 ),
const char *name;
int has_ao;
}boardtype;
-static boardtype boardtypes[]={
+static const boardtype boardtypes[]={
{ "rti800", 0 },
{ "rti815", 1 },
};
-#define this_board ((boardtype *)dev->board_ptr)
+#define this_board ((const boardtype *)dev->board_ptr)
static int rti800_attach(comedi_device *dev,comedi_devconfig *it);
static int rti800_detach(comedi_device *dev);
enum {
dac_2comp, dac_straight
} dac0_coding, dac1_coding;
- comedi_lrange * ao_range_type_list[2];
+ const comedi_lrange * ao_range_type_list[2];
lsampl_t ao_readback[2];
int muxgain_bits;
} rti800_private;
}
// settling delay times in usec for different gains
-static int gaindelay[]={10,20,40,80};
+static const int gaindelay[]={10,20,40,80};
static int rti800_ai_insn_read(comedi_device *dev,comedi_subdevice *s,
comedi_insn *insn,lsampl_t *data)
enum {
dac_2comp, dac_straight
} dac_coding[8];
- comedi_lrange * range_type_list[8];
+ const comedi_lrange * range_type_list[8];
lsampl_t ao_readback[8];
} rti802_private;
int have_dio;
}s526_board;
-static s526_board s526_boards[] = {
+static const s526_board s526_boards[] = {
{
name: "s526",
gpct_chans: 4,
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((s526_board *)dev->board_ptr)
+#define thisboard ((const s526_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
MODULE_LICENSE("GPL");
typedef struct s626_board_struct{
- char *name;
+ const char *name;
int ai_chans;
int ai_bits;
int ao_chans;
int enc_chans;
} s626_board;
-static s626_board s626_boards[] = {
+static const s626_board s626_boards[] = {
{
name: "s626",
ai_chans: S626_ADC_CHANNELS,
}
};
-#define thisboard ((s626_board *)dev->board_ptr)
+#define thisboard ((const s626_board *)dev->board_ptr)
#define PCI_VENDOR_ID_S626 0x1131
#define PCI_DEVICE_ID_S626 0x7146
#define I2C_B1(ATTR,VAL) ( ( (ATTR) << 4 ) | ( (VAL) << 16 ) )
#define I2C_B0(ATTR,VAL) ( ( (ATTR) << 2 ) | ( (VAL) << 8 ) )
-static comedi_lrange s626_range_table={ 2,{
+static const comedi_lrange s626_range_table={ 2,{
RANGE(-5 , 5),
RANGE(-10, 10),
}};
const char *name;
} serial2002_board;
-serial2002_board serial2002_boards[] = {
+static const serial2002_board serial2002_boards[] = {
{
name: "serial2002"
}
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((serial2002_board *)dev->board_ptr)
+#define thisboard ((const serial2002_board *)dev->board_ptr)
typedef struct {
// HACK...
}
if (c) {
comedi_subdevice *s;
+ const comedi_lrange **range_table_list = NULL;
+ unsigned int *maxdata_list;
int j, chan;
for (chan = 0, j = 0 ; j < 32 ; j++) {
s->n_chan = chan;
s->maxdata = 0;
if (s->maxdata_list) { kfree(s->maxdata_list); }
- s->maxdata_list = kmalloc(sizeof(lsampl_t)*s->n_chan, GFP_KERNEL);
+ s->maxdata_list = maxdata_list =
+ kmalloc(sizeof(lsampl_t)*s->n_chan, GFP_KERNEL);
if (s->range_table_list) { kfree(s->range_table_list); }
if (range) {
s->range_table = 0;
- s->range_table_list =
+ s->range_table_list = range_table_list =
kmalloc(sizeof(serial2002_range_table_t)*s->n_chan, GFP_KERNEL);
}
for (chan = 0, j = 0 ; j < 32 ; j++) {
range[j].length = 1;
range[j].range.min = c[j].min;
range[j].range.max = c[j].max;
- s->range_table_list[chan] = (comedi_lrange*)&range[j];
+ range_table_list[chan] = (const comedi_lrange*)&range[j];
}
- s->maxdata_list[chan] = ((long long)1<<c[j].bits) - 1;
+ maxdata_list[chan] = ((long long)1<<c[j].bits) - 1;
chan++;
}
}
int ai_bits;
int have_dio;
}skel_board;
-static skel_board skel_boards[] = {
+static const skel_board skel_boards[] = {
{
name: "skel-100",
ai_chans: 16,
/*
* Useful for shorthand access to the particular board structure
*/
-#define thisboard ((skel_board *)dev->board_ptr)
+#define thisboard ((const skel_board *)dev->board_ptr)
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
int have_dio;
} dnp_board;
-static dnp_board dnp_boards[] = { /* we only support one DNP 'board' */
+static const dnp_board dnp_boards[] = { /* we only support one DNP 'board' */
{ /* variant at the moment */
name: "dnp-1486",
ai_chans: 16,
/* Useful for shorthand access to the particular board structure ----------- */
-#define thisboard ((dnp_board *)dev->board_ptr)
+#define thisboard ((const dnp_board *)dev->board_ptr)
/* This structure is for data unique to the DNP driver --------------------- */
/////////////////////////////////////////////
// comedi constants
-static comedi_lrange range_usbdux_ai_range = { 4, {
+static const comedi_lrange range_usbdux_ai_range = { 4, {
BIP_RANGE( 4.096 ),
BIP_RANGE( 4.096/2 ),
UNI_RANGE( 4.096 ),
} };
-static comedi_lrange range_usbdux_ao_range = { 2, {
+static const comedi_lrange range_usbdux_ao_range = { 2, {
BIP_RANGE( 4.096 ),
UNI_RANGE( 4.096 ),
} };
/////////////////////////////////////////////
// comedi constants
-static comedi_lrange range_usbduxfast_ai_range = { 2, {
+static const comedi_lrange range_usbduxfast_ai_range = { 2, {
BIP_RANGE( 0.75 ),
BIP_RANGE( 0.5 ),
} };
{
comedi_device *dev = (comedi_device *)d;
comedi_subdevice *s = dev->subdevices + subdevice;
- comedi_lrange *lr;
+ const comedi_lrange *lr;
if (s->range_table_list) {
lr=s->range_table_list[chan];
#include <asm/uaccess.h>
-comedi_lrange range_bipolar10={ 1, {BIP_RANGE(10)}};
-comedi_lrange range_bipolar5={ 1, {BIP_RANGE(5)}};
-comedi_lrange range_bipolar2_5={ 1, {BIP_RANGE(2.5)}};
-comedi_lrange range_unipolar10={ 1, {UNI_RANGE(10)}};
-comedi_lrange range_unipolar5={ 1, {UNI_RANGE(5)}};
-comedi_lrange range_unknown={ 1, {{0,1000000,UNIT_none}}};
+const comedi_lrange range_bipolar10={ 1, {BIP_RANGE(10)}};
+const comedi_lrange range_bipolar5={ 1, {BIP_RANGE(5)}};
+const comedi_lrange range_bipolar2_5={ 1, {BIP_RANGE(2.5)}};
+const comedi_lrange range_unipolar10={ 1, {UNI_RANGE(10)}};
+const comedi_lrange range_unipolar5={ 1, {UNI_RANGE(5)}};
+const comedi_lrange range_unknown={ 1, {{0,1000000,UNIT_none}}};
/*
COMEDI_RANGEINFO
{
comedi_rangeinfo it;
int minor,subd,chan;
- comedi_lrange *lr;
+ const comedi_lrange *lr;
comedi_subdevice *s;
comedi_device *query_dev;
int io_bits;
lsampl_t maxdata; /* if maxdata==0, use list */
- lsampl_t *maxdata_list; /* list is channel specific */
+ const lsampl_t *maxdata_list; /* list is channel specific */
unsigned int flags;
- unsigned int *flaglist;
+ const unsigned int *flaglist;
unsigned int settling_time_0;
- comedi_lrange *range_table;
- comedi_lrange **range_table_list;
+ const comedi_lrange *range_table;
+ const comedi_lrange * const *range_table_list;
unsigned int *chanlist; /* driver-owned chanlist (not used) */
#define BIP_RANGE(a) {-(a)*1e6,(a)*1e6,0}
#define UNI_RANGE(a) {0,(a)*1e6,0}
-extern comedi_lrange range_bipolar10;
-extern comedi_lrange range_bipolar5;
-extern comedi_lrange range_bipolar2_5;
-extern comedi_lrange range_unipolar10;
-extern comedi_lrange range_unipolar5;
-extern comedi_lrange range_unknown;
+extern const comedi_lrange range_bipolar10;
+extern const comedi_lrange range_bipolar5;
+extern const comedi_lrange range_bipolar2_5;
+extern const comedi_lrange range_unipolar10;
+extern const comedi_lrange range_unipolar5;
+extern const comedi_lrange range_unknown;
#define range_digital range_unipolar5