//======================================================================== // // exser.h - EXAR serial driver settings and constants // // $Date: 2003/09/04 21:52:03 $ // $Revision: 1.4 $ // // // // HISTORY: // $Log: exser.h,v $ // Revision 1.4 2003/09/04 21:52:03 billf // added ioctl calls to set/reset port missing flags // removed exsar_log (not used) // // Revision 1.3 2003/04/25 16:40:51 billf // added #defines used by snmp // moves exser_log structure definition from exser.c to here (used by snmp routines) // // Revision 1.2 2003/04/11 13:20:12 billf // updated code // // Revision 1.1.1.1 2003/03/17 15:27:03 billf // Initial import // // // // //======================================================================== #ifndef _EXSER_DOT_H_ #define _EXSER_DOT_H_ #include "setups.h" #include "cs_hardware.h" #define EXAR_PORTS_PER_CHIP 8 /* Max. ports per chip */ #define EXAR_CHIPS 6 /* Max. chips */ #define EXAR_PORTS ((EXAR_PORTS_PER_CHIP * EXAR_CHIPS)) /* Max. ports */ #define EXAR_ISR_PASS_LIMIT 256 #if (EXAR_PORTS > PORT_ARRAY_SIZE) // you need to adjust setups.h #error __FILE__ too many ports defined #endif #define EXAR_XMIT_FIFO_SIZE 64 #define EXAR_UART_MCR_AFE 0x20 #define EXAR_UART_LSR_SPECIAL 0x1E #define EXAR_ERR_IOADDR -1 #define EXAR_ERR_IRQ -2 #define EXAR_ERR_IRQ_CONFLIT -3 #define EXAR_ERR_VECTOR -4 // extended registers used in the Exar 17c788 #define EXAR_UART_ISR 2 #define EXAR_UART_FCTR 8 #define EXAR_UART_EFR2 9 #define EXAR_UART_XOFF1 12 #define EXAR_UART_XON1 14 #define EXAR_UART_XOFF2 13 #define EXAR_UART_XON2 15 #define EXAR_UART_RXTRIG 11 // write only #define EXAR_UART_RFCNT 11 // read only #define EXAR_UART_TXTRIG 10 #define EXAR_UART_TFCNT 10 /* * EXAR ioctls */ #define EXAR 0x400 // should use ioctl.h macros //#define EXAR_GETDATACOUNT (EXAR + 23) #define EXAR_GET_CONF (EXAR + 35) #define EXAR_DIAGNOSE (EXAR + 50) #define EXAR_CHKPORTENABLE (EXAR + 60) #define EXAR_HighSpeedOn (EXAR + 61) #define EXAR_GET_MAJOR (EXAR + 63) #define EXAR_GET_CUMAJOR (EXAR + 64) #define EXAR_GETMSTATUS (EXAR + 65) #define EXAR_READ_REG (EXAR + 66) #define EXAR_WRITE_REG (EXAR + 67) #define READ_IO_PORT (EXAR + 68) #define RESET_MODULE_CNT (EXAR + 69) #define BUFFER_ENABLE (EXAR + 70) #define PARITY_MARK_SPACE (EXAR + 71) #define QUERY_BUFFER_ENABLE (EXAR + 72) #define QUERY_PARITY (EXAR + 73) #define RESET_RDWR_COUNT (EXAR + 74) #define QUERY_RDWR_COUNT (EXAR + 75) #define SET_PORT_TYPE (EXAR + 76) #define QUERY_PORT_TYPE (EXAR + 77) #define EXAR_SET_DTEDCE (EXAR + 78) #define EXAR_GET_DTEDCE (EXAR + 79) #define EXAR_CLEAR_BUFFER (EXAR + 80) #define EXAR_PORT_MISSING (EXAR + 81) // set port as missing (port no. starts at 1) #define EXAR_PORT_PRESENT (EXAR + 82) // set port as present (port no. starts at 1) #define EXAR_PORT_STATUS (EXAR + 83) // return 0 if port is missing (port no. starts at 1) #define EXAR_CONTROL_FILE "driver/exar" #define FULL_EXAR_CONTROL_FILE_PATH "/proc/"EXAR_CONTROL_FILE #define DEVICE_BUFFERS // create buffers and IOCTLS to setup properties #define BUFFER_SIZE (256L*1024L) // data received by the uart #define MONITOR_BUFFER_SIZE (2*1024) // another copy of received data, but smaller size #define PROC_BUFFER_ROOT DEFAULT_PROC_DIR_NAME // was CS_PROC_BUFFER_ROOT_NAME ==> port_buffers #define DIRECT_DEV_ROOT DEFAULT_DEVICE_NAME // ttyB #define CALLOUT_DEV_ROOT DEFAULT_CALLOUT_NAME #define MONITOR_DEV_ROOT DEFAULT_MONITOR_NAME_PREFIX #define EXAR_DIRECT_MAJOR 72 #define EXAR_CU_MAJOR 73 #define EXAR_MONITOR_MAJOR 74 #ifndef NO_BUFF_NODE #define BUFFER_DEV_ROOT DEFAULT_BUFFER_NAME_SUFFIX #define EXAR_BUFFER_MAJOR 74 #else #define BUFFER_DEV_ROOT DEFAULT_PROC_BUFFER_NAME #endif // these are used by the snmp routines (not by the exar driver itself) #define VAR_TICK 0 #define VAR_RXCNT 1 #define VAR_TXCNT 2 #define VAR_FRAMINGERRCNT 3 #define VAR_PARITYERRCNT 4 #define VAR_OVERRUNCNT 5 #define VAR_BREAKRXCNT 6 #define VAR_BREAKTXCNT 7 #define VAR_DSRCNT 8 #define VAR_DTRCNT 9 #define EXAR_IO_RANGE (0x100) struct EXAR_STRUCT_DTEDCE_MODE { int port_number; te_UART_DTEDCE port_mode; }; #if 0 //no longer used struct exser_log { unsigned int tick; unsigned int rxcnt[EXAR_PORTS]; unsigned int txcnt[EXAR_PORTS]; unsigned int framing_err_cnt[EXAR_PORTS]; unsigned int parity_err_cnt[EXAR_PORTS]; unsigned int overrun_err_cnt[EXAR_PORTS]; unsigned int break_rcv_cnt[EXAR_PORTS]; unsigned int break_xmit_cnt[EXAR_PORTS]; unsigned int rts_cnt[EXAR_PORTS]; // used in throttle/unthrottle unsigned int cts_cnt[EXAR_PORTS]; // need to enable ier bit 6 unsigned int dsr_cnt[EXAR_PORTS]; // need to enable ier bit 7 unsigned int dtr_cnt[EXAR_PORTS]; // we currently do not support DTR/DSR flow control }; #endif #endif