nidas v1.2.3
Macros | Functions | Variables
mesa.c File Reference
#include <linux/fs.h>
#include <linux/moduleparam.h>
#include <linux/module.h>
#include <linux/version.h>
#include <asm/io.h>
#include <linux/poll.h>
#include <linux/ioport.h>
#include <linux/cdev.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <nidas/linux/mesa.h>
#include <nidas/linux/ver_macros.h>
#include <nidas/linux/irigclock.h>
#include <nidas/linux/klog.h>
#include <nidas/linux/util.h>
#include <nidas/linux/isa_bus.h>
#include <nidas/linux/Revision.h>

Macros

#define REPO_REVISION   "unknown"
 
#define DEVNAME_MESA   "mesa"
 
#define MESA_CNTR_SAMPLE_QUEUE_SIZE   128
 
#define MESA_RADAR_SAMPLE_QUEUE_SIZE   32
 
#define MESA_P260X_SAMPLE_QUEUE_SIZE   32
 

Functions

 MODULE_AUTHOR ("Mike Spowart <spowart@ucar.edu>")
 
 MODULE_DESCRIPTION ("Mesa ISA driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (REPO_REVISION)
 
 module_param_array (ioport, int, numboards, S_IRUGO)
 
 MODULE_PARM_DESC (ioport, "ISA memory base of each board (default 0x220)")
 
static void read_counter (void *ptr)
 
static void read_radar (void *ptr)
 
static void read_260x (void *ptr)
 
static void outportbwswap (struct MESA_Board *brd, unsigned char thebyte)
 
static int load_start (struct MESA_Board *brd)
 
static int load_finish (struct MESA_Board *brd)
 
static int load_program (struct MESA_Board *brd, struct mesa_prog *buf)
 
static int close_ports (struct MESA_Board *brd)
 
static int mesa_open (struct inode *inode, struct file *filp)
 
static int mesa_release (struct inode *inode, struct file *filp)
 
static int data_ready (struct MESA_Board *brd)
 
static unsigned int mesa_poll (struct file *filp, poll_table *wait)
 
static ssize_t mesa_read (struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
 
static long mesa_ioctl (struct file *filp, unsigned int cmd, unsigned long arg)
 
static void mesa_cleanup (void)
 
static int __init mesa_init (void)
 
 module_init (mesa_init)
 
 module_exit (mesa_cleanup)
 

Variables

static struct MESA_Board * boards = 0
 
static int numboards = 0
 
static unsigned int ioport [MESA_4I34_MAX_NR_DEVS] = { 0x220, 0, 0, 0 }
 
static dev_t mesa_device = MKDEV(0, 0)
 
static struct cdev mesa_cdev
 
static struct class * mesa_class
 
static struct file_operations mesa_fops
 

Macro Definition Documentation

◆ DEVNAME_MESA

#define DEVNAME_MESA   "mesa"

Referenced by mesa_init().

◆ MESA_CNTR_SAMPLE_QUEUE_SIZE

#define MESA_CNTR_SAMPLE_QUEUE_SIZE   128

Referenced by mesa_ioctl(), and read_counter().

◆ MESA_P260X_SAMPLE_QUEUE_SIZE

#define MESA_P260X_SAMPLE_QUEUE_SIZE   32

Referenced by mesa_ioctl(), and read_260x().

◆ MESA_RADAR_SAMPLE_QUEUE_SIZE

#define MESA_RADAR_SAMPLE_QUEUE_SIZE   32

Referenced by mesa_ioctl(), and read_radar().

◆ REPO_REVISION

#define REPO_REVISION   "unknown"

Referenced by mesa_init().

Function Documentation

◆ close_ports()

static int close_ports ( struct MESA_Board * brd)
static

◆ data_ready()

static int data_ready ( struct MESA_Board * brd)
inlinestatic

Referenced by mesa_poll(), and mesa_read().

◆ load_finish()

static int load_finish ( struct MESA_Board * brd)
static

Referenced by mesa_ioctl().

◆ load_program()

static int load_program ( struct MESA_Board * brd,
struct mesa_prog * buf )
static

References outportbwswap().

Referenced by mesa_ioctl().

◆ load_start()

static int load_start ( struct MESA_Board * brd)
static

Referenced by mesa_ioctl().

◆ mesa_cleanup()

static void mesa_cleanup ( void )
static

◆ mesa_init()

static int __init mesa_init ( void )
static

◆ mesa_ioctl()

static long mesa_ioctl ( struct file * filp,
unsigned int cmd,
unsigned long arg )
static

◆ mesa_open()

static int mesa_open ( struct inode * inode,
struct file * filp )
static

References boards, MSECS_PER_SEC, and numboards.

◆ mesa_poll()

static unsigned int mesa_poll ( struct file * filp,
poll_table * wait )
static

References data_ready().

◆ mesa_read()

static ssize_t mesa_read ( struct file * filp,
char __user * buf,
size_t count,
loff_t * f_pos )
static

◆ mesa_release()

static int mesa_release ( struct inode * inode,
struct file * filp )
static

References close_ports().

◆ MODULE_AUTHOR()

MODULE_AUTHOR ( "Mike Spowart <spowart@ucar.edu>" )

◆ MODULE_DESCRIPTION()

MODULE_DESCRIPTION ( "Mesa ISA driver" )

◆ module_exit()

module_exit ( mesa_cleanup )

◆ module_init()

module_init ( mesa_init )

◆ MODULE_LICENSE()

MODULE_LICENSE ( "GPL" )

◆ module_param_array()

module_param_array ( ioport ,
int ,
numboards ,
S_IRUGO  )

◆ MODULE_PARM_DESC()

MODULE_PARM_DESC ( ioport ,
"ISA memory base of each board (default 0x220)"  )

◆ MODULE_VERSION()

MODULE_VERSION ( REPO_REVISION )

◆ outportbwswap()

static void outportbwswap ( struct MESA_Board * brd,
unsigned char thebyte )
static

Referenced by load_program().

◆ read_260x()

static void read_260x ( void * ptr)
static

◆ read_counter()

static void read_counter ( void * ptr)
static

References ID_COUNTERS, and MESA_CNTR_SAMPLE_QUEUE_SIZE.

Referenced by mesa_ioctl().

◆ read_radar()

static void read_radar ( void * ptr)
static

Variable Documentation

◆ boards

struct MESA_Board* boards = 0
static

Referenced by mesa_cleanup(), mesa_init(), and mesa_open().

◆ ioport

unsigned int ioport[MESA_4I34_MAX_NR_DEVS] = { 0x220, 0, 0, 0 }
static

Referenced by mesa_init(), and test_ISA_Writes().

◆ mesa_cdev

struct cdev mesa_cdev
static

Referenced by mesa_cleanup(), and mesa_init().

◆ mesa_class

struct class* mesa_class
static

Referenced by mesa_cleanup(), and mesa_init().

◆ mesa_device

dev_t mesa_device = MKDEV(0, 0)
static

Referenced by mesa_cleanup(), and mesa_init().

◆ mesa_fops

struct file_operations mesa_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.read = mesa_read,
.poll = mesa_poll,
.open = mesa_open,
.unlocked_ioctl = mesa_ioctl,
.release = mesa_release,
.llseek = no_llseek,
}
static long mesa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
Definition mesa.c:618
static int mesa_release(struct inode *inode, struct file *filp)
Definition mesa.c:537
static unsigned int mesa_poll(struct file *filp, poll_table *wait)
Definition mesa.c:562
static int mesa_open(struct inode *inode, struct file *filp)
Definition mesa.c:489
static ssize_t mesa_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
Definition mesa.c:575

Referenced by mesa_init().

◆ numboards

int numboards = 0
static

Referenced by mesa_cleanup(), mesa_init(), and mesa_open().