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

axis_pci.h File Reference


Detailed Description

Master Data structures referenced by most code defined here.

Author:
Andrew Roca
Open file objects have a private pointer that we can use to store data of our choosing. In most cases we store a pointer to either a axis_component_instance or an axis_pci_device_entry. The axis_pci_device_entry contains all of the variables needed for one instance of the Axis hardware. The component_instance assiocates a small integer and a axis_pci_device_entry. We stash a table of these in the axis_pci_device_entry structure. This way we can indentify individual inputs without any excessive overhead.

#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 "spi_io.h"
#include "parallel_io.h"
#include "serial_io.h"
#include "des_io.h"
#include "axis_w1.h"
#include "axis_hardware.h"

Include dependency graph for axis_pci.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  axis_region
 Stash information about the PCI IO/Mem region we intend to use. More...

struct  axis_component_instance
 associates a axis_pci_device_entry with a integer which can be used to identify individual components More...

struct  axis_pci_device_entry
 Hardware master control structure. More...


Functions

proc_dir_entry * create_proc_read_write_entry (const char *name, mode_t mode, struct proc_dir_entry *base, read_proc_t *read_proc, write_proc_t *write_proc, void *data)
 This creates a /proc/entry that can be both read and written.

void enable_pci_interrupts (struct axis_pci_device_entry *device)
 Enable PLX interrupts.

void disable_pci_interrupts (struct axis_pci_device_entry *device)
 Disable PLX interrupts.

axis_pci_device_entrychoose_device (struct inode *inode_ptr,struct file *file_ptr)
 Find a axis device for DES ops.

axis_pci_device_entryfind_axis_device (void)
 Find a axis device for DES ops.

void delete_axis_pci_device (struct axis_pci_device_entry *device)
 unload axis PCI based resources

int pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
 Called by PCI on load/detection.

void create_proc_id_entries (struct axis_pci_device_entry *device)
 Creates a couple of /proc entries to export FPGA ID and issue data.

void delete_proc_id_entries (struct axis_pci_device_entry *device)
 Deletes the issue and ID /proc entries.


Function Documentation

struct axis_pci_device_entry* choose_device struct inode *  inode_ptr,
struct file *  file_ptr
 

Find a axis device for DES ops.

Parameters:
inode_ptr - not currently used
file_ptr - not currently used
Returns:
master structure pointer

Des operations need not be associated with a particular hardware set in future we may if we have multiple device want to load balance DES ops entry allows logic to be added later

void create_proc_id_entries struct axis_pci_device_entry device  ) 
 

Creates a couple of /proc entries to export FPGA ID and issue data.

Returns:
none
Parameters:
device - Pointer to the hardware master control block
This function creates a /proc entry that exports the formatted contents of the FPGA ID and issue register

Here is the call graph for this function:

create_proc_read_write_entry const char *  name,
mode_t  mode,
struct proc_dir_entry *  base,
read_proc_t *  read_proc,
write_proc_t *  write_proc,
void *  data
[inline, static]
 

This creates a /proc/entry that can be both read and written.

Parameters:
name - Name to be given to the new entry
mode - Entries file permissions
base - Identifies the directory into which this entry is to be made
read_proc - function pointer to callback function called if the entry is read
write_proc - function pointer to callback function called if the entry is written
data - void * to user supplied data that will be passed to callback functions
Returns:
proc_dir_entry * pointer to a proc_dir_entry that contains the new file system entry

void delete_axis_pci_device struct axis_pci_device_entry device  ) 
 

unload axis PCI based resources

Parameters:
device - master structure
Returns:
none

Clean up occurs when we de-register from the PCI subsystem rather than being directly called by the module unload function

Here is the call graph for this function:

void delete_proc_id_entries struct axis_pci_device_entry device  ) 
 

Deletes the issue and ID /proc entries.

Returns:
none
Parameters:
device - Pointer to the hardware master control block
Deletes the ISSUE related entries in the axis /Proc filesystem

void disable_pci_interrupts struct axis_pci_device_entry device  )  [inline, static]
 

Disable PLX interrupts.

Parameters:
device - hardware master structure

The PLX 9030 needs explicit instruction to enable/disable interrupts

Returns:
none

void enable_pci_interrupts struct axis_pci_device_entry device  )  [inline, static]
 

Enable PLX interrupts.

Parameters:
device - hardware master structure
The PLX 9030 needs explicit instruction to enable interrupts
Parameters:
axis_pci_device_entry * - address of master device struct
Returns:
none

struct axis_pci_device_entry* find_axis_device void   ) 
 

Find a axis device for DES ops.

Returns:
master structure pointer

Des operations need not be associated with a particular hardware set in future we may if we have multiple device want to load balance DES ops entry allows logic to be added later

int pci_probe struct pci_dev *  dev,
const struct pci_device_id *  id
 

Called by PCI on load/detection.

Parameters:
dev - pointer to structure containing PCI configuration for device
id - pointer to structure containing vendor and device ids
Returns:
0 on success

Called if the PCI sub system thinks our hardware is present Check that it is the right hardware if it is remember the PCI devices details

Here is the call graph for this function:


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