nidas  v1.2-1520
Macros | Functions | Variables
emerald.c File Reference
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/fcntl.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <linux/serial_reg.h>
#include "emerald.h"
#include <nidas/linux/ver_macros.h>
#include <nidas/linux/isa_bus.h>
#include <nidas/linux/klog.h>
#include <nidas/linux/Revision.h>

Macros

#define __KERNEL__
 
#define MODULE
 
#define REPO_REVISION   "unknown"
 

Functions

 module_param_array (ioports, uint, emerald_nr_addrs, S_IRUGO)
 
 module_param (tty_port_offset, int, S_IRUGO)
 
 MODULE_AUTHOR ("Gordon Maclean")
 
 MODULE_DESCRIPTION ("driver module supporting initialization and digital I/O on Diamond System Emerald serial port card")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_VERSION (REPO_REVISION)
 
static int emm_check_config (emerald_config *config, const char *devname)
 
static void emm_enable_ports (emerald_board *brd)
 
static void emm_disable_ports (emerald_board *brd)
 
static int emm_check_model (emerald_board *brd)
 
static void emm_read_config (emerald_board *brd)
 
static int emm_write_config (emerald_board *brd, emerald_config *config)
 
static int emm_read_eeconfig (emerald_board *brd, emerald_config *config)
 
static int emm_write_eeconfig (emerald_board *brd, emerald_config *config)
 
static int emm_load_config_from_eeprom (emerald_board *brd)
 
static const char * emm_mode_to_string (int mode)
 
static void emm_printk_port_modes (emerald_board *brd)
 
static int emm_set_port_mode (emerald_board *brd, int port, int mode)
 
static int emm_get_port_mode (emerald_board *brd, int port)
 
static int emm_set_port_mode_eeprom (emerald_board *brd, int port, int mode)
 
static int emm_get_port_mode_eeprom (emerald_board *brd, int port)
 
static int emm_get_digio_port_out (emerald_board *brd, int port)
 
static void emm_set_digio_out (emerald_board *brd, int val)
 
static void emm_set_digio_port_out (emerald_board *brd, int port, int val)
 
static int emm_read_digio (emerald_board *brd)
 
static int emm_read_digio_port (emerald_board *brd, int port)
 
static void emm_write_digio_port (emerald_board *brd, int port, int val)
 
static int emerald_open (struct inode *inode, struct file *filp)
 
static int emerald_release (struct inode *inode, struct file *filp)
 
static long emerald_ioctl (struct file *filp, unsigned int cmd, unsigned long arg)
 
static void emerald_cleanup_module (void)
 
static int __init emerald_init_module (void)
 
 module_init (emerald_init_module)
 
 module_exit (emerald_cleanup_module)
 

Variables

static dev_t emerald_device = MKDEV(0,0)
 
static unsigned long ioport_base = (unsigned long) SYSTEM_ISA_IOPORT_BASE
 
static unsigned int ioports [EMERALD_MAX_NR_DEVS] = {0,0,0,0}
 
static int emerald_nr_addrs = 0
 
static int emerald_nr_ok = 0
 
static emerald_board * emerald_boards = 0
 
static emerald_port * emerald_ports = 0
 
static int emerald_nports = 0
 
static int tty_port_offset = 5
 
static struct class * emerald_class
 
static struct file_operations emerald_fops
 

Macro Definition Documentation

#define __KERNEL__
#define MODULE
#define REPO_REVISION   "unknown"

Referenced by emerald_init_module().

Function Documentation

static void emerald_cleanup_module ( void  )
static
static int __init emerald_init_module ( void  )
static
static long emerald_ioctl ( struct file *  filp,
unsigned int  cmd,
unsigned long  arg 
)
static
static int emerald_open ( struct inode *  inode,
struct file *  filp 
)
static
static int emerald_release ( struct inode *  inode,
struct file *  filp 
)
static
static int emm_check_config ( emerald_config config,
const char *  devname 
)
static
static int emm_check_model ( emerald_board *  brd)
static
static void emm_disable_ports ( emerald_board *  brd)
static
static void emm_enable_ports ( emerald_board *  brd)
static
static int emm_get_digio_port_out ( emerald_board *  brd,
int  port 
)
static

Referenced by emerald_ioctl().

static int emm_get_port_mode ( emerald_board *  brd,
int  port 
)
static
static int emm_get_port_mode_eeprom ( emerald_board *  brd,
int  port 
)
static

References EMERALD_MM_8P, and EMERALD_NR_PORTS.

Referenced by emerald_ioctl().

static int emm_load_config_from_eeprom ( emerald_board *  brd)
static
static const char* emm_mode_to_string ( int  mode)
static
static void emm_printk_port_modes ( emerald_board *  brd)
static
static void emm_read_config ( emerald_board *  brd)
static
static int emm_read_digio ( emerald_board *  brd)
static
static int emm_read_digio_port ( emerald_board *  brd,
int  port 
)
static

References emm_read_digio().

Referenced by emerald_ioctl().

static int emm_read_eeconfig ( emerald_board *  brd,
emerald_config config 
)
static
static void emm_set_digio_out ( emerald_board *  brd,
int  val 
)
static

Referenced by emerald_init_module().

static void emm_set_digio_port_out ( emerald_board *  brd,
int  port,
int  val 
)
static

References port.

Referenced by emerald_ioctl().

static int emm_set_port_mode ( emerald_board *  brd,
int  port,
int  mode 
)
static
static int emm_set_port_mode_eeprom ( emerald_board *  brd,
int  port,
int  mode 
)
static

References EMERALD_MM_8P, and EMERALD_NR_PORTS.

Referenced by emerald_ioctl().

static int emm_write_config ( emerald_board *  brd,
emerald_config config 
)
static
static void emm_write_digio_port ( emerald_board *  brd,
int  port,
int  val 
)
static

References port.

Referenced by emerald_ioctl().

static int emm_write_eeconfig ( emerald_board *  brd,
emerald_config config 
)
static
MODULE_AUTHOR ( "Gordon Maclean"  )
MODULE_DESCRIPTION ( "driver module supporting initialization and digital I/O on Diamond System Emerald serial port card"  )
module_exit ( emerald_cleanup_module  )
module_init ( emerald_init_module  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( tty_port_offset  ,
int  ,
S_IRUGO   
)
module_param_array ( ioports  ,
uint  ,
emerald_nr_addrs  ,
S_IRUGO   
)
MODULE_VERSION ( REPO_REVISION  )

Variable Documentation

emerald_board* emerald_boards = 0
static
struct class* emerald_class
static
dev_t emerald_device = MKDEV(0,0)
static
struct file_operations emerald_fops
static
Initial value:
= {
.owner = THIS_MODULE,
.unlocked_ioctl = emerald_ioctl,
.open = emerald_open,
.release = emerald_release,
.llseek = no_llseek,
}
static int emerald_release(struct inode *inode, struct file *filp)
Definition: emerald.c:723
static int emerald_open(struct inode *inode, struct file *filp)
Definition: emerald.c:685
static long emerald_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
Definition: emerald.c:732
int emerald_nports = 0
static
int emerald_nr_addrs = 0
static
int emerald_nr_ok = 0
static
emerald_port* emerald_ports = 0
static
unsigned long ioport_base = (unsigned long) SYSTEM_ISA_IOPORT_BASE
static
unsigned int ioports[EMERALD_MAX_NR_DEVS] = {0,0,0,0}
static

Referenced by emerald_init_module().

int tty_port_offset = 5
static

Referenced by emerald_init_module().