*/
#include <linux/comedidev.h>
#include <linux/pci.h>
+#include "mf624.h"
#define EXTDEBUG
#define MF624_EXIT_FAILURE -1
#define N_BOARDS (sizeof(mf624_boards) / sizeof(mf624_board))
-static struct pci_device_id mf624_pci_table[] __devinitdata = {
- { PCI_VENDOR_ID_MF624, PCI_DEVICE_ID_MF624, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { 0 }
-};
-MODULE_DEVICE_TABLE(pci, mf624_pci_table);
-
-
/* Private data structure */
typedef struct{
int data;
/*static irqreturn_t mf624_interrupt(int irq, void *d, struct pt_regs *regs);*/
-/*
- * The comedi_driver structure tells the Comedi core module
- * which functions to call to configure/deconfigure (attach/detach)
- * the board, and also about the kernel module that contains
- * the device code.
- */
-static comedi_driver driver_mf624 = {
- driver_name: "mf624",
- module: THIS_MODULE,
- attach: mf624_attach,
- detach: mf624_detach,
-};
-
#define thisboard ((mf624_board *)dev->board_ptr)
/*
* in the driver structure, dev->board_ptr contains that
* address.
*/
-static int mf624_attach(comedi_device *dev, comedi_devconfig *it)
+static int mf624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
comedi_subdevice *s;
struct pci_dev* pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int mf624_detach(comedi_device *dev)
+static int mf624_detach(struct comedi_device *dev)
{
//rt_printk("comedi%d: mf624: remove\n", dev->minor);
}
/* read n samples on Analog Input channel */
-static int mf624_ai_rinsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
- unsigned int dat, n, i, status, chan = CR_CHAN(insn->chanspec);
+ unsigned int dat, n, i, status;
+ unsigned int chan = CR_CHAN(insn->chanspec);
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: mf624_ai_rinsn called \n", dev->minor);
/* Analog input configuration */
-static int mf624_ai_cfg(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_ai_cfg(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: _insn_ai_cfg called\n", dev->minor);
/* write n samples on Analog Output channel */
-static int mf624_ao_winsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
- unsigned int i, chan = CR_CHAN(insn->chanspec), status;
+ unsigned int i, status;
+ unsigned int chan = CR_CHAN(insn->chanspec);
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: _ao_winsn called\n", dev->minor);
#endif
/* Analog output configuration */
-static int mf624_ao_cfg(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data){
+static int mf624_ao_cfg(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
+{
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: _ao_cfg called\n, dev->minor");
#endif
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int mf624_ao_rinsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
unsigned int i, chan = CR_CHAN(insn->chanspec);
}
/* Write digital data */
-static int mf624_do_insn_bits(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: _do_insn_bits called \
}
/* Read digital data */
-static int mf624_di_insn_bits(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+static int mf624_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
+ struct comedi_insn *insn, lsampl_t *data)
{
#ifdef EXTDEBUG
rt_printk("comedi%d: mf624: _di_insn_bits called with \
}
+static struct pci_device_id mf624_pci_table[] __devinitdata = {
+ { PCI_VENDOR_ID_MF624, PCI_DEVICE_ID_MF624, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, mf624_pci_table);
+
+/*
+ * The comedi_driver structure tells the Comedi core module
+ * which functions to call to configure/deconfigure (attach/detach)
+ * the board, and also about the kernel module that contains
+ * the device code.
+ */
+static comedi_driver driver_mf624 = {
+ driver_name: "mf624",
+ module: THIS_MODULE,
+ attach: mf624_attach,
+ detach: mf624_detach,
+};
+
+
MODULE_AUTHOR("Francois Poulain <fpoulain@gmail.com>;\
(Rostislav Lisovy <lisovy@gmail.com>)");
MODULE_DESCRIPTION("Humusoft MF624 Multifunction I/O Card");
MODULE_LICENSE("GPL");
-
-/* A convenient macro that defines init_module() and cleanup_module(), as necessary. */
COMEDI_INITCLEANUP(driver_mf624);