00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef AXIS_SERIAL_IO_H
00035 #define AXIS_SERIAL_IO_H
00036 #ifndef _LINUX_KERNEL_H
00037 #include <linux/kernel.h>
00038 #include <linux/sched.h>
00039 #include <linux/version.h>
00040 #include <linux/module.h>
00041 #include <linux/proc_fs.h>
00042 #include <linux/delay.h>
00043 #include <linux/pci.h>
00044 #include <linux/list.h>
00045 #include <linux/ioport.h>
00046 #include <linux/serial.h>
00047 #include <linux/interrupt.h>
00048 #include <linux/string.h>
00049 #include <linux/spinlock.h>
00050 #include <linux/mtd/mtd.h>
00051 #include <linux/crypto.h>
00052 #include <asm/uaccess.h>
00053 #endif //_LINUX_KERNEL_H
00054
00055
00056 #ifndef AXIS_HARDWARE_H
00057 #include "axis_hardware.h"
00058 #endif
00059
00060
00061 #define ROUTE_TO_RS232 0
00062 #define ROUTE_TO_TTL 1
00063 #define ROUTE_TO_CCTALK 2
00064 #define ROUTE_TO_RS485 3
00065 #define UART_ENABLE 4
00066 #define FPGA_UART_1_SHIFT 0
00067 #define FPGA_UART_2_SHIFT 3
00068 #define FPGA_UART_3_SHIFT 6
00069 #define FPGA_UART_4_SHIFT 9
00070 #define UART1_DEFAULT ((ROUTE_TO_RS232|UART_ENABLE)<<FPGA_UART_1_SHIFT)
00071 #define UART2_DEFAULT ((ROUTE_TO_CCTALK|UART_ENABLE)<<FPGA_UART_2_SHIFT)
00072 #define UART3_DEFAULT ((ROUTE_TO_RS232|UART_ENABLE)<<FPGA_UART_3_SHIFT)
00073 #define UART4_DEFAULT ((ROUTE_TO_RS485|UART_ENABLE)<<FPGA_UART_4_SHIFT)
00074
00075 #define RS232_A_ENABLE_OFFSET 16
00076 #define TTL_A_ENABLE_OFFSET 18
00077 #define CCTALK_A_ENABLE_OFFSET 20
00078 #define RS485_A_ENABLE_OFFSET 22
00079 #define RS232_B_ENABLE_OFFSET 17
00080 #define TTL_B_ENABLE_OFFSET 19
00081 #define CCTALK_B_ENABLE_OFFSET 21
00082 #define RS485_B_ENABLE_OFFSET 23
00083
00084 #define UARTA_ENABLE_DEFAULT ((1<<RS232_A_ENABLE_OFFSET)|(0<<TTL_A_ENABLE_OFFSET)|(1<<CCTALK_A_ENABLE_OFFSET)|(0<<RS485_A_ENABLE_OFFSET))
00085 #define UARTB_ENABLE_DEFAULT ((1<<RS232_B_ENABLE_OFFSET)|(0<<TTL_B_ENABLE_OFFSET)|(0<<CCTALK_B_ENABLE_OFFSET)|(1<<RS485_B_ENABLE_OFFSET))
00086 #define UART_ROUTING_DEFAULT (UART1_DEFAULT|UART2_DEFAULT|UART3_DEFAULT|UART4_DEFAULT|UARTA_ENABLE_DEFAULT|UARTB_ENABLE_DEFAULT)
00087 #define MAX_VALID_ROUTE_VALUE (ROUTE_TO_RS485)
00088 #define NUMBER_OF_ROUTABLE_UARTS 4
00089 #define NUMBER_OF_SERIAL_OUTPUTS (sizeof(serial_output_enable_table)/sizeof(serial_output_enable_table[0]))
00090
00091
00092 #define SMART_CARD_RESET (1<<12)
00093 #define SMART_CARD_CLOCK_ENABLE (1<<13)
00094
00105 struct text_to_int
00106 {
00107 const char * name ;
00108 unsigned long value ;
00109 } ;
00110
00111
00112
00113 void create_proc_smart_card_entries(struct axis_pci_device_entry* device);
00114 void delete_proc_smart_card_entries(struct axis_pci_device_entry* device);
00115 void create_proc_serial_entries(struct axis_pci_device_entry* device);
00116 void delete_proc_serial_entries(struct axis_pci_device_entry* device);
00117 void disable_uarts(struct axis_pci_device_entry * device);
00118 void enable_uarts(struct axis_pci_device_entry * device);
00119
00120 #endif //AXIS_SERIAL_IO_H