00001 00008 /**************************************************************************** 00009 * 00010 * Axis 2 PCI Linux Kernel driver 00011 * File: axis_sram.h 00012 * Version: 1.0 00013 * Copyright 2004 Heber Limited (http://www.heber.co.uk) 00014 * 00015 * This program is free software; you can redistribute it and/or modify it 00016 * under the terms of the GNU General Public License as published by the 00017 * Free Software Foundation; either version 2, or (at your option) any 00018 * later version. 00019 * 00020 * This program is distributed in the hope that it will be useful, but 00021 * WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 * General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU General Public License along 00026 * with this program; if not, write to the Free Software Foundation, Inc., 00027 * 675 Mass Ave, Cambridge, MA 02139, USA. 00028 * 00029 * Changes: 00030 * 00031 ****************************************************************************/ 00032 #ifndef AXIS_SRAM_H 00033 #define AXIS_SRAM_H 00034 #ifndef _LINUX_KERNEL_H 00035 #include <linux/kernel.h> 00036 #include <linux/sched.h> 00037 #include <linux/version.h> 00038 #include <linux/module.h> 00039 #include <linux/proc_fs.h> 00040 #include <linux/delay.h> 00041 #include <linux/pci.h> 00042 #include <linux/list.h> 00043 #include <linux/ioport.h> 00044 #include <linux/serial.h> 00045 #include <linux/interrupt.h> 00046 #include <linux/string.h> 00047 #include <linux/spinlock.h> 00048 #include <linux/mtd/mtd.h> 00049 #include <linux/crypto.h> 00050 #include <asm/uaccess.h> 00051 #endif //_LINUX_KERNEL_H 00052 00053 #ifndef AXIS_H 00054 #include "axis.h" 00055 #endif //AXIS_H 00056 00057 #ifndef AXIS_HARDWARE_H 00058 #include "axis_hardware.h" 00059 #endif //AXIS_HARDWARE_H 00060 #ifndef AXIS_PCI_H 00061 #include "axis_pci.h" 00062 #endif //AXIS_pci_H 00063 00064 #include "axis_sram_config.h" 00065 #define AXIS_SRAM_ENABLE_OFFSET (0x0+CONTROL_OFFSET) 00066 00067 00068 int build_sram_config(struct axis_pci_device_entry * device); 00069 void delete_sram_config(struct axis_pci_device_entry * device); 00070 void create_proc_sram_entries(struct axis_pci_device_entry* device); 00071 void delete_proc_sram_entries(struct axis_pci_device_entry* device); 00072 00073 extern struct sram_config_entry axis_sram_config[] ; //defined in axis_sram_config.h 00074 extern struct file_operations ram_file_operations ; 00075 00076 #define LONG_SHIFT 4 00077 00084 struct access_control_entry 00085 { 00086 unsigned long access_mask[4] ; 00087 unsigned long access_control_length; 00088 unsigned long * access_control_address ; 00089 } ; 00090 00091 #define AXIS_READ_ENABLED (1<<0) 00092 #define AXIS_WRITE_ENABLED (1<<1) 00093 #define AXIS_AUTO_ACCESS (1<<2) 00094 00098 struct sram_access_control 00099 { 00100 struct access_control_entry read_access ; 00101 struct access_control_entry write_access ; 00102 unsigned int current_access ; 00103 } ; 00104 00105 00112 struct sram_block 00113 { 00114 struct list_head list; 00115 struct semaphore enable_lock ; 00116 unsigned long relative_start ; 00117 unsigned long physical_start ; 00118 unsigned char * virtual_start ; 00119 unsigned long length ; 00120 struct sram_access_control access_control ; 00121 struct axis_pci_device_entry * device ; 00122 struct sram_config_entry * config ; 00123 struct mtd_info sram_mtd_info ; 00124 unsigned minor_number ; 00125 int mtd_active ; 00126 char name [32 ] ; 00127 struct proc_dir_entry * proc_directory; 00128 } ; 00129 00130 00131 00132 00133 #endif //AXIS_SRAM_H 00134
1.3.6