Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
comedidev.h File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kdev_t.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/wait.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/vmalloc.h>
#include <linux/dma-mapping.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/timer.h>
#include <linux/pci.h>
#include "comedi.h"

Go to the source code of this file.

Data Structures

struct  comedi_subdevice
 
struct  comedi_buf_page
 
struct  comedi_async
 
struct  comedi_driver
 
struct  comedi_device
 
struct  comedi_device_file_info
 
struct  comedi_lrange
 

Macros

#define DPRINTK(format, args...)
 
#define COMEDI_VERSION(a, b, c)   (((a) << 16) + ((b) << 8) + (c))
 
#define COMEDI_VERSION_CODE
 
#define COMEDI_RELEASE   VERSION
 
#define PCI_VENDOR_ID_ADLINK   0x144a
 
#define PCI_VENDOR_ID_ICP   0x104c
 
#define PCI_VENDOR_ID_CONTEC   0x1221
 
#define COMEDI_NUM_MINORS   0x100
 
#define COMEDI_NUM_BOARD_MINORS   0x30
 
#define COMEDI_FIRST_SUBDEVICE_MINOR   COMEDI_NUM_BOARD_MINORS
 
#define module_comedi_driver(__comedi_driver)
 
#define module_comedi_pci_driver(__comedi_driver, __pci_driver)
 
#define module_comedi_usb_driver(__comedi_driver, __usb_driver)
 
#define RANGE(a, b)   {(a)*1e6, (b)*1e6, 0}
 
#define RANGE_ext(a, b)   {(a)*1e6, (b)*1e6, RF_EXTERNAL}
 
#define RANGE_mA(a, b)   {(a)*1e6, (b)*1e6, UNIT_mA}
 
#define RANGE_unitless(a, b)   {(a)*1e6, (b)*1e6, 0}
 
#define BIP_RANGE(a)   {-(a)*1e6, (a)*1e6, 0}
 
#define UNI_RANGE(a)   {0, (a)*1e6, 0}
 
#define range_digital   range_unipolar5
 
#define GCC_ZERO_LENGTH_ARRAY   0
 

Enumerations

enum  comedi_minor_bits { COMEDI_DEVICE_MINOR_MASK = 0xf, COMEDI_SUBDEVICE_MINOR_MASK = 0xf0 }
 
enum  subdevice_runflags { SRF_USER = 0x00000001, SRF_RT = 0x00000002, SRF_ERROR = 0x00000004, SRF_RUNNING = 0x08000000 }
 

Functions

void comedi_event (struct comedi_device *dev, struct comedi_subdevice *s)
 
void comedi_error (const struct comedi_device *dev, const char *s)
 
struct comedi_device_file_infocomedi_get_device_file_info (unsigned minor)
 
int comedi_alloc_subdevices (struct comedi_device *, int)
 
void comedi_device_detach (struct comedi_device *dev)
 
int comedi_device_attach (struct comedi_device *dev, struct comedi_devconfig *it)
 
int comedi_driver_register (struct comedi_driver *)
 
int comedi_driver_unregister (struct comedi_driver *)
 
int comedi_pci_enable (struct pci_dev *, const char *)
 
void comedi_pci_disable (struct pci_dev *)
 
int comedi_pci_driver_register (struct comedi_driver *, struct pci_driver *)
 
void comedi_pci_driver_unregister (struct comedi_driver *, struct pci_driver *)
 
int comedi_usb_driver_register (struct comedi_driver *, struct usb_driver *)
 
void comedi_usb_driver_unregister (struct comedi_driver *, struct usb_driver *)
 
void init_polling (void)
 
void cleanup_polling (void)
 
void start_polling (struct comedi_device *)
 
void stop_polling (struct comedi_device *)
 
int comedi_check_chanlist (struct comedi_subdevice *s, int n, unsigned int *chanlist)
 
unsigned comedi_get_subdevice_runflags (struct comedi_subdevice *s)
 
int comedi_buf_put (struct comedi_async *async, short x)
 
int comedi_buf_get (struct comedi_async *async, short *x)
 
unsigned int comedi_buf_write_n_available (struct comedi_async *async)
 
unsigned int comedi_buf_write_alloc (struct comedi_async *async, unsigned int nbytes)
 
unsigned int comedi_buf_write_alloc_strict (struct comedi_async *async, unsigned int nbytes)
 
unsigned comedi_buf_write_free (struct comedi_async *async, unsigned int nbytes)
 
unsigned comedi_buf_read_alloc (struct comedi_async *async, unsigned nbytes)
 
unsigned comedi_buf_read_free (struct comedi_async *async, unsigned int nbytes)
 
unsigned int comedi_buf_read_n_available (struct comedi_async *async)
 
void comedi_buf_memcpy_to (struct comedi_async *async, unsigned int offset, const void *source, unsigned int num_bytes)
 
void comedi_buf_memcpy_from (struct comedi_async *async, unsigned int offset, void *destination, unsigned int num_bytes)
 
int comedi_alloc_subdevice_minor (struct comedi_device *dev, struct comedi_subdevice *s)
 
void comedi_free_subdevice_minor (struct comedi_subdevice *s)
 
int comedi_pci_auto_config (struct pci_dev *pcidev, struct comedi_driver *driver)
 
void comedi_pci_auto_unconfig (struct pci_dev *pcidev)
 
int comedi_usb_auto_config (struct usb_interface *intf, struct comedi_driver *driver)
 
void comedi_usb_auto_unconfig (struct usb_interface *intf)
 

Variables

struct comedi_lrange range_bipolar10
 
struct comedi_lrange range_bipolar5
 
struct comedi_lrange range_bipolar2_5
 
struct comedi_lrange range_unipolar10
 
struct comedi_lrange range_unipolar5
 
struct comedi_lrange range_unknown
 

Macro Definition Documentation

#define BIP_RANGE (   a)    {-(a)*1e6, (a)*1e6, 0}

Definition at line 393 of file comedidev.h.

#define COMEDI_FIRST_SUBDEVICE_MINOR   COMEDI_NUM_BOARD_MINORS

Definition at line 63 of file comedidev.h.

#define COMEDI_NUM_BOARD_MINORS   0x30

Definition at line 62 of file comedidev.h.

#define COMEDI_NUM_MINORS   0x100

Definition at line 61 of file comedidev.h.

#define COMEDI_RELEASE   VERSION

Definition at line 55 of file comedidev.h.

#define COMEDI_VERSION (   a,
  b,
  c 
)    (((a) << 16) + ((b) << 8) + (c))

Definition at line 52 of file comedidev.h.

#define COMEDI_VERSION_CODE
#define DPRINTK (   format,
  args... 
)
Value:
do { \
if (comedi_debug) \
pr_debug("comedi: " format, ## args); \
} while (0)

Definition at line 47 of file comedidev.h.

#define GCC_ZERO_LENGTH_ARRAY   0

Definition at line 408 of file comedidev.h.

#define module_comedi_driver (   __comedi_driver)
Value:

module_comedi_driver() - Helper macro for registering a comedi driver : comedi_driver struct

Helper macro for comedi drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit().

Definition at line 311 of file comedidev.h.

#define module_comedi_pci_driver (   __comedi_driver,
  __pci_driver 
)
Value:

module_comedi_pci_driver() - Helper macro for registering a comedi PCI driver : comedi_driver struct : pci_driver struct

Helper macro for comedi PCI drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit()

Definition at line 331 of file comedidev.h.

#define module_comedi_usb_driver (   __comedi_driver,
  __usb_driver 
)
Value:

module_comedi_usb_driver() - Helper macro for registering a comedi USB driver : comedi_driver struct : usb_driver struct

Helper macro for comedi USB drivers which do not do anything special in module init/exit. This eliminates a lot of boilerplate. Each module may only use this macro once, and calling it replaces module_init() and module_exit()

Definition at line 350 of file comedidev.h.

#define PCI_VENDOR_ID_ADLINK   0x144a

Definition at line 57 of file comedidev.h.

#define PCI_VENDOR_ID_CONTEC   0x1221

Definition at line 59 of file comedidev.h.

#define PCI_VENDOR_ID_ICP   0x104c

Definition at line 58 of file comedidev.h.

#define RANGE (   a,
  b 
)    {(a)*1e6, (b)*1e6, 0}

Definition at line 389 of file comedidev.h.

#define range_digital   range_unipolar5

Definition at line 403 of file comedidev.h.

#define RANGE_ext (   a,
  b 
)    {(a)*1e6, (b)*1e6, RF_EXTERNAL}

Definition at line 390 of file comedidev.h.

#define RANGE_mA (   a,
  b 
)    {(a)*1e6, (b)*1e6, UNIT_mA}

Definition at line 391 of file comedidev.h.

#define RANGE_unitless (   a,
  b 
)    {(a)*1e6, (b)*1e6, 0}

Definition at line 392 of file comedidev.h.

#define UNI_RANGE (   a)    {0, (a)*1e6, 0}

Definition at line 394 of file comedidev.h.

Enumeration Type Documentation

Enumerator:
COMEDI_DEVICE_MINOR_MASK 
COMEDI_SUBDEVICE_MINOR_MASK 

Definition at line 266 of file comedidev.h.

Enumerator:
SRF_USER 
SRF_RT 
SRF_ERROR 
SRF_RUNNING 

Definition at line 373 of file comedidev.h.

Function Documentation

void cleanup_polling ( void  )
int comedi_alloc_subdevice_minor ( struct comedi_device dev,
struct comedi_subdevice s 
)

Definition at line 2475 of file comedi_fops.c.

int comedi_alloc_subdevices ( struct comedi_device ,
int   
)

Definition at line 59 of file drivers.c.

int comedi_buf_get ( struct comedi_async async,
short x 
)

Definition at line 790 of file drivers.c.

void comedi_buf_memcpy_from ( struct comedi_async async,
unsigned int  offset,
void destination,
unsigned int  num_bytes 
)

Definition at line 747 of file drivers.c.

void comedi_buf_memcpy_to ( struct comedi_async async,
unsigned int  offset,
const void source,
unsigned int  num_bytes 
)

Definition at line 721 of file drivers.c.

int comedi_buf_put ( struct comedi_async async,
short  x 
)

Definition at line 803 of file drivers.c.

unsigned comedi_buf_read_alloc ( struct comedi_async async,
unsigned  nbytes 
)

Definition at line 688 of file drivers.c.

unsigned comedi_buf_read_free ( struct comedi_async async,
unsigned int  nbytes 
)

Definition at line 703 of file drivers.c.

unsigned int comedi_buf_read_n_available ( struct comedi_async async)

Definition at line 774 of file drivers.c.

unsigned int comedi_buf_write_alloc ( struct comedi_async async,
unsigned int  nbytes 
)

Definition at line 636 of file drivers.c.

unsigned int comedi_buf_write_alloc_strict ( struct comedi_async async,
unsigned int  nbytes 
)

Definition at line 653 of file drivers.c.

unsigned comedi_buf_write_free ( struct comedi_async async,
unsigned int  nbytes 
)

Definition at line 669 of file drivers.c.

unsigned int comedi_buf_write_n_available ( struct comedi_async async)

Definition at line 616 of file drivers.c.

int comedi_check_chanlist ( struct comedi_subdevice s,
int  n,
unsigned int chanlist 
)

Definition at line 131 of file range.c.

int comedi_device_attach ( struct comedi_device dev,
struct comedi_devconfig it 
)

Definition at line 153 of file drivers.c.

void comedi_device_detach ( struct comedi_device dev)

Definition at line 127 of file drivers.c.

int comedi_driver_register ( struct comedi_driver )

Definition at line 203 of file drivers.c.

int comedi_driver_unregister ( struct comedi_driver )

Definition at line 212 of file drivers.c.

void comedi_error ( const struct comedi_device dev,
const char s 
)

Definition at line 2295 of file comedi_fops.c.

void comedi_event ( struct comedi_device dev,
struct comedi_subdevice s 
)

Definition at line 2301 of file comedi_fops.c.

void comedi_free_subdevice_minor ( struct comedi_subdevice s)

Definition at line 2512 of file comedi_fops.c.

struct comedi_device_file_info* comedi_get_device_file_info ( unsigned  minor)
read

Definition at line 2536 of file comedi_fops.c.

unsigned comedi_get_subdevice_runflags ( struct comedi_subdevice s)

Definition at line 2344 of file comedi_fops.c.

int comedi_pci_auto_config ( struct pci_dev pcidev,
struct comedi_driver driver 
)

Definition at line 994 of file drivers.c.

void comedi_pci_auto_unconfig ( struct pci_dev pcidev)

Definition at line 1004 of file drivers.c.

void comedi_pci_disable ( struct pci_dev pdev)

comedi_pci_disable() - Release the regions and disable the PCI device. : pci_dev struct

This must be matched with a previous successful call to comedi_pci_enable().

Definition at line 961 of file drivers.c.

int comedi_pci_driver_register ( struct comedi_driver ,
struct pci_driver  
)

Definition at line 1010 of file drivers.c.

void comedi_pci_driver_unregister ( struct comedi_driver ,
struct pci_driver  
)

Definition at line 1033 of file drivers.c.

int comedi_pci_enable ( struct pci_dev pdev,
const char res_name 
)

comedi_pci_enable() - Enable the PCI device and request the regions. : pci_dev struct : name for the requested reqource

Definition at line 939 of file drivers.c.

int comedi_usb_auto_config ( struct usb_interface intf,
struct comedi_driver driver 
)
void comedi_usb_auto_unconfig ( struct usb_interface intf)
int comedi_usb_driver_register ( struct comedi_driver ,
struct usb_driver *   
)
void comedi_usb_driver_unregister ( struct comedi_driver ,
struct usb_driver *   
)
void init_polling ( void  )
void start_polling ( struct comedi_device )
void stop_polling ( struct comedi_device )

Variable Documentation

struct comedi_lrange range_bipolar10

Definition at line 28 of file range.c.

struct comedi_lrange range_bipolar2_5

Definition at line 32 of file range.c.

struct comedi_lrange range_bipolar5

Definition at line 30 of file range.c.

struct comedi_lrange range_unipolar10

Definition at line 34 of file range.c.

struct comedi_lrange range_unipolar5

Definition at line 36 of file range.c.

struct comedi_lrange range_unknown

Definition at line 38 of file range.c.