/*-- function prototypes ----------------------------------------------------*/
-static int cnt_attach(struct comedi_device * dev, comedi_devconfig * it);
-static int cnt_detach(struct comedi_device * dev);
+static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it);
+static int cnt_detach(struct comedi_device *dev);
static DEFINE_PCI_DEVICE_TABLE(cnt_pci_table) = {
{PCI_VENDOR_ID_KOLTER, CNT_CARD_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
/*-- board specification structure ------------------------------------------*/
-typedef struct {
+struct cnt_board_struct {
+
const char *name;
int device_id;
int cnt_channel_nbr;
int cnt_bits;
-} cnt_board_struct;
+};
+
-static const cnt_board_struct cnt_boards[] = {
+static const struct cnt_board_struct cnt_boards[] = {
{
name: CNT_DRIVER_NAME,
device_id:CNT_CARD_DEVICE_ID,
cnt_bits:24}
};
-#define cnt_board_nbr (sizeof(cnt_boards)/sizeof(cnt_board_struct))
+#define cnt_board_nbr (sizeof(cnt_boards)/sizeof(struct cnt_board_struct))
/*-- device private structure -----------------------------------------------*/
-typedef struct {
+struct cnt_device_private {
+
struct pci_dev *pcidev;
-} cnt_device_private;
+};
+
-#define devpriv ((cnt_device_private *)dev->private)
+#define devpriv ((struct cnt_device_private *)dev->private)
-static comedi_driver cnt_driver = {
+static struct comedi_driver cnt_driver = {
driver_name:CNT_DRIVER_NAME,
module:THIS_MODULE,
attach:cnt_attach,
/* This should be used only for resetting the counters; maybe it is better
to make a special command 'reset'. */
-static int cnt_winsn(struct comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
+static int cnt_winsn(struct comedi_device *dev,
+ struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
/*-- counter read -----------------------------------------------------------*/
-static int cnt_rinsn(struct comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
+static int cnt_rinsn(struct comedi_device *dev,
+ struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
{
unsigned char a0, a1, a2, a3, a4;
int chan = CR_CHAN(insn->chanspec);
/*-- attach -----------------------------------------------------------------*/
-static int cnt_attach(struct comedi_device * dev, comedi_devconfig * it)
+static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
- comedi_subdevice *subdevice;
+ struct comedi_subdevice *subdevice;
struct pci_dev *pci_device;
- cnt_board_struct *board;
+ struct cnt_board_struct *board;
unsigned long io_base;
int error, i;
/* allocate device private structure */
- if ((error = alloc_private(dev, sizeof(cnt_device_private))) < 0) {
+ if ((error = alloc_private(dev, sizeof(struct cnt_device_private))) < 0) {
return error;
}
}
dev->board_ptr = cnt_boards + i;
- board = (cnt_board_struct *) dev->
+ board = (struct cnt_board_struct *) dev->
board_ptr;
goto found;
}
subdevice->insn_read = cnt_rinsn;
subdevice->insn_write = cnt_winsn;
- // select 20MHz clock
+ /* select 20MHz clock */
outb(3, dev->iobase + 248);
- // reset all counters
+ /* reset all counters */
outb(0, dev->iobase);
outb(0, dev->iobase + 0x20);
outb(0, dev->iobase + 0x40);
/*-- detach -----------------------------------------------------------------*/
-static int cnt_detach(struct comedi_device * dev)
+static int cnt_detach(struct comedi_device *dev)
{
if (devpriv && devpriv->pcidev) {
if (dev->iobase) {