Main Page | Data Structures | File List | Data Fields | Globals

parallel_io.h File Reference


Detailed Description

Parallel interface support.

Author:
Andrew Roca
Exports functions to create and destroy a /proc system for parallel IO also exports several file operations structures defined by the parallel system to allow conventional (read/write) IO by user programs on Axis hardware. The IO mirror structure are defined here used by parallel_io.c and are embedded in the PCI structures

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/list.h>
#include <linux/ioport.h>
#include <linux/serial.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/mtd/mtd.h>
#include <linux/crypto.h>
#include <asm/uaccess.h>
#include "axis_hardware.h"

Include dependency graph for parallel_io.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  input_def
 Properties on individual input. More...

struct  output_def
 Properties on individual output. More...

struct  axis_io_bitmap
 Mirrors for Axis Parallel IO. More...


Defines

#define AXIS_DIPSWITCH_NUMBER   16
#define AXIS_DIPSWITCH_MAP_SIZE   (AXIS_DIPSWITCH_NUMBER>>3)
#define AXIS_OUTPUTS_NUMBER   32
#define AXIS_OUTPUTS_MAP_SIZE   (AXIS_OUTPUTS_NUMBER>>3)
#define PARALLEL_IO_CONFIGURATION   (0x30+CONTROL_OFFSET)
#define PARALLEL_OUTPUTS_PORT   (0x34+CONTROL_OFFSET)
#define RAW_PARALLEL_INPUTS_PORT   (0x20+CONTROL_OFFSET)
#define DEBOUNCED_PARALLEL_INPUTS_PORT   (0x28+CONTROL_OFFSET)
#define RAW_MISC_INPUTS_PORT   (0x24+CONTROL_OFFSET)
#define DEBOUNCED_MISC_INPUTS_PORT   (0x2C+CONTROL_OFFSET)
#define READ_INPUTS_MASK_REGISTER   (0x38+CONTROL_OFFSET)
#define READ_MISC_MASK_REGISTER   (0x3C+CONTROL_OFFSET)
#define DIPSWITCH_OFFSET   0x64
#define AUTO_READ_ENABLE   (1<<0)
#define AUTO_WRITE_ENABLE   (1<<4)
#define MISC_INPUTS   4
#define AXIS_INPUTS_NUMBER   40
#define AXIS_INPUTS_MAP_SIZE   (AXIS_INPUTS_NUMBER>>3)
#define AXIS_OUTPUTS_NUMBER   32
#define AXIS_OUTPUTS_MAP_SIZE   (AXIS_OUTPUTS_NUMBER>>3)

Functions

void create_proc_dipswitch_entries (struct axis_pci_device_entry *device)
 create /proc entries for dipswitches

void delete_proc_dipswitch_entries (struct axis_pci_device_entry *device)
 Remove the /proc dipswitch entries.

void create_proc_input_entries (struct axis_pci_device_entry *device)
 create /proc entries for inputs

void delete_proc_input_entries (struct axis_pci_device_entry *device)
 Remove the /proc input entries.

void create_proc_output_entries (struct axis_pci_device_entry *device)
 create /proc entries for outputs

void delete_proc_output_entries (struct axis_pci_device_entry *device)
 Remove the /proc output entries.

void update_inputs_bitmap (struct axis_pci_device_entry *device)
 synchs the inputs mirror with physical hardware

void enable_axis_inputs (struct axis_pci_device_entry *device)
 Enables Axis inputs.

void init_parallel_io (struct axis_pci_device_entry *device)
 Initalises AXIS parallel.


Variables

file_operations output_file_operations
file_operations dipswitch_file_operations
file_operations input_file_operations


Define Documentation

#define AUTO_READ_ENABLE   (1<<0)
 

#define AUTO_WRITE_ENABLE   (1<<4)
 

#define AXIS_DIPSWITCH_MAP_SIZE   (AXIS_DIPSWITCH_NUMBER>>3)
 

#define AXIS_DIPSWITCH_NUMBER   16
 

#define AXIS_INPUTS_MAP_SIZE   (AXIS_INPUTS_NUMBER>>3)
 

#define AXIS_INPUTS_NUMBER   40
 

#define AXIS_OUTPUTS_MAP_SIZE   (AXIS_OUTPUTS_NUMBER>>3)
 

#define AXIS_OUTPUTS_MAP_SIZE   (AXIS_OUTPUTS_NUMBER>>3)
 

#define AXIS_OUTPUTS_NUMBER   32
 

#define AXIS_OUTPUTS_NUMBER   32
 

#define DEBOUNCED_MISC_INPUTS_PORT   (0x2C+CONTROL_OFFSET)
 

#define DEBOUNCED_PARALLEL_INPUTS_PORT   (0x28+CONTROL_OFFSET)
 

#define DIPSWITCH_OFFSET   0x64
 

#define MISC_INPUTS   4
 

#define PARALLEL_IO_CONFIGURATION   (0x30+CONTROL_OFFSET)
 

#define PARALLEL_OUTPUTS_PORT   (0x34+CONTROL_OFFSET)
 

#define RAW_MISC_INPUTS_PORT   (0x24+CONTROL_OFFSET)
 

#define RAW_PARALLEL_INPUTS_PORT   (0x20+CONTROL_OFFSET)
 

#define READ_INPUTS_MASK_REGISTER   (0x38+CONTROL_OFFSET)
 

#define READ_MISC_MASK_REGISTER   (0x3C+CONTROL_OFFSET)
 


Function Documentation

void create_proc_dipswitch_entries struct axis_pci_device_entry device  ) 
 

create /proc entries for dipswitches

Parameters:
device - master hardware structure
Returns:
NONE

Called by the PCI probe function creates a directory full of inputs

Here is the call graph for this function:

void create_proc_input_entries struct axis_pci_device_entry device  ) 
 

create /proc entries for inputs

Parameters:
device - master hardware structure
Returns:
NONE

Called by the PCI probe function creates a directory full of inputs

Here is the call graph for this function:

void create_proc_output_entries struct axis_pci_device_entry device  ) 
 

create /proc entries for outputs

Parameters:
device - master hardware structure
Returns:
NONE

Called by the PCI probe function creates a directory full of outputs

Here is the call graph for this function:

void delete_proc_dipswitch_entries struct axis_pci_device_entry device  ) 
 

Remove the /proc dipswitch entries.

Parameters:
device - master hardware structure
Returns:
NONE

Removes the /proc dipswitch entries

void delete_proc_input_entries struct axis_pci_device_entry device  ) 
 

Remove the /proc input entries.

Parameters:
device - master hardware structure
Returns:
NONE

Delete all the input /proc entries called if PCI device removed (unlikely) or on module unload

void delete_proc_output_entries struct axis_pci_device_entry device  ) 
 

Remove the /proc output entries.

Parameters:
device - master hardware structure
Returns:
NONE

Remove all the entries in the /proc file system related to outputs

void enable_axis_inputs struct axis_pci_device_entry device  ) 
 

Enables Axis inputs.

Parameters:
device - hardware master structure
Returns:
NONE

Enables Axis inputs

void init_parallel_io struct axis_pci_device_entry device  ) 
 

Initalises AXIS parallel.

Parameters:
device - hardware master structure
Returns:
NONE

Initalises AXIS parallel, called as PCI device is detected

Here is the call graph for this function:

void update_inputs_bitmap struct axis_pci_device_entry device  ) 
 

synchs the inputs mirror with physical hardware

Parameters:
device - hardware master structure
Returns:
NONE

Reads the inputs temp version pending stage two inputs


Variable Documentation

struct file_operations dipswitch_file_operations
 

struct file_operations input_file_operations
 

struct file_operations output_file_operations
 


Generated on Fri Jan 28 12:36:51 2005 for Axis Kernel Driver by doxygen 1.3.6