nidas v1.2.3
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 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

◆ __KERNEL__

#define __KERNEL__

◆ MODULE

#define MODULE

◆ REPO_REVISION

#define REPO_REVISION   "unknown"

Referenced by emerald_init_module().

Function Documentation

◆ emerald_cleanup_module()

static void emerald_cleanup_module ( void )
static

◆ emerald_init_module()

static int __init emerald_init_module ( void )
static

◆ emerald_ioctl()

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

◆ emerald_open()

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

◆ emerald_release()

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

◆ emm_check_config()

static int emm_check_config ( emerald_config * config,
const char * devname )
static

◆ emm_check_model()

static int emm_check_model ( emerald_board * brd)
static

◆ emm_enable_ports()

static void emm_enable_ports ( emerald_board * brd)
static

◆ emm_get_digio_port_out()

static int emm_get_digio_port_out ( emerald_board * brd,
int port )
static

References port.

Referenced by emerald_ioctl().

◆ emm_get_port_mode()

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

◆ emm_get_port_mode_eeprom()

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

References EMERALD_MM_8P, EMERALD_NR_PORTS, and port.

Referenced by emerald_ioctl().

◆ emm_load_config_from_eeprom()

static int emm_load_config_from_eeprom ( emerald_board * brd)
static

◆ emm_mode_to_string()

static const char * emm_mode_to_string ( int mode)
static

◆ emm_printk_port_modes()

static void emm_printk_port_modes ( emerald_board * brd)
static

◆ emm_read_config()

static void emm_read_config ( emerald_board * brd)
static

◆ emm_read_digio()

static int emm_read_digio ( emerald_board * brd)
static

◆ emm_read_digio_port()

static int emm_read_digio_port ( emerald_board * brd,
int port )
static

References emm_read_digio(), and port.

Referenced by emerald_ioctl().

◆ emm_read_eeconfig()

static int emm_read_eeconfig ( emerald_board * brd,
emerald_config * config )
static

◆ emm_set_digio_out()

static void emm_set_digio_out ( emerald_board * brd,
int val )
static

Referenced by emerald_init_module().

◆ emm_set_digio_port_out()

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

References port.

Referenced by emerald_ioctl().

◆ emm_set_port_mode()

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

◆ emm_set_port_mode_eeprom()

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

References EMERALD_MM_8P, EMERALD_NR_PORTS, and port.

Referenced by emerald_ioctl().

◆ emm_write_config()

static int emm_write_config ( emerald_board * brd,
emerald_config * config )
static

References EMERALD_NR_PORTS.

Referenced by emerald_init_module(), and emerald_ioctl().

◆ emm_write_digio_port()

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

References port.

Referenced by emerald_ioctl().

◆ emm_write_eeconfig()

static int emm_write_eeconfig ( emerald_board * brd,
emerald_config * config )
static

References EMERALD_NR_PORTS.

Referenced by emerald_init_module(), and emerald_ioctl().

◆ MODULE_AUTHOR()

MODULE_AUTHOR ( "Gordon Maclean" )

◆ MODULE_DESCRIPTION()

MODULE_DESCRIPTION ( "driver module supporting initialization and digital I/O on Diamond System Emerald serial port card" )

◆ module_exit()

module_exit ( emerald_cleanup_module )

◆ module_init()

module_init ( emerald_init_module )

◆ MODULE_LICENSE()

MODULE_LICENSE ( "Dual BSD/GPL" )

◆ module_param()

module_param ( tty_port_offset ,
int ,
S_IRUGO  )

◆ module_param_array()

module_param_array ( ioports ,
uint ,
emerald_nr_addrs ,
S_IRUGO  )

◆ MODULE_VERSION()

MODULE_VERSION ( REPO_REVISION )

Variable Documentation

◆ emerald_boards

emerald_board* emerald_boards = 0
static

◆ emerald_class

struct class* emerald_class
static

◆ emerald_device

dev_t emerald_device = MKDEV(0,0)
static

◆ emerald_fops

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_open(struct inode *inode, struct file *filp)
Definition emerald.c:692
static int emerald_release(struct inode *inode, struct file *filp)
Definition emerald.c:730
static long emerald_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
Definition emerald.c:739

Referenced by emerald_init_module().

◆ emerald_nports

int emerald_nports = 0
static

◆ emerald_nr_addrs

int emerald_nr_addrs = 0
static

◆ emerald_nr_ok

int emerald_nr_ok = 0
static

◆ emerald_ports

emerald_port* emerald_ports = 0
static

◆ ioport_base

unsigned long ioport_base = (unsigned long) SYSTEM_ISA_IOPORT_BASE
static

◆ ioports

unsigned int ioports[EMERALD_MAX_NR_DEVS] = {0,0,0,0}
static

Referenced by emerald_init_module().

◆ tty_port_offset

int tty_port_offset = 5
static

Referenced by emerald_init_module().