⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fas.h

📁 一个通讯程序源码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* This file contains various defines for the FAS async driver.   If you change anything here you have to recompile the driver module.*//*+:EDITS:*//*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 *//*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA *//*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 *//*:06-04-1991-19:41-wht@n4hgf-add FASIC_SIP_CHANGE *//*:01-20-1991-16:17-wht@n4hgf-add fas_names *//*:01-20-1991-05:01-wht@n4hgf-changed buffer sizes *//* Alas, SCO idinstall has no -z (Define) option like ISC does */#if !defined(FASI)#define FASI#endif#if !defined(SCO)#define SCO#endif#if !defined (M_I286) && !defined(__STDC__)#ident	"@(#)fas.h	2.08"#endif/* Uncomment the following line if you need asyputchar and asygetchar.   This is only required if you link the kernel without the original   asy driver and these functions aren't provided by any other kernel   module.*/#if 0#define NEED_PUT_GETCHAR	#endif/* Uncomment the following line if you have VP/ix support in the   kernel.*/#if 0#define HAVE_VPIX	#endif/* Uncomment the following line if you need init8250. DosMerge needs   this function, but only if you link the kernel without the original   asy driver.*/#if 0#define NEED_INIT8250	#endif#if defined (VPIX)#undef VPIX#endif#if defined (HAVE_VPIX)#define VPIX#endif#if defined (XENIX)typedef unsigned char	unchar;typedef unsigned long	ulong;/***	Union for use by all device handler ioctl routines.*/union ioctl_arg {	struct termio	*stparg;	/* ptr to termio struct */	char		*cparg;		/* ptr to character */	char		carg;		/* character */	int		*iparg;		/* ptr to integer */	int		iarg;		/* integer */	long            *lparg;         /* ptr to long */	long            larg;           /* long */};#endif#if defined (TRUE)#undef TRUE#endif#define	TRUE	(1)#if defined (FALSE)#undef FALSE#endif#define FALSE	(0)/* Initial line control register.  Value will only be meaningful for   asyputchar and asygetchar and they are only meaningful if   NEED_PUT_GETCHAR is defined.*/#define	INITIAL_LINE_CONTROL	LC_WORDLEN_8/* Initial baud rate.  Value will only be meaningful for   asyputchar and asygetchar and they are only meaningful if   NEED_PUT_GETCHAR is defined.*/#define INITIAL_BAUD_RATE	(BAUD_BASE/9600)/* Initial modem control register.  This should probably not have to   be touched.  It is here because some terminals used as the console   require one or more of the modem signals set. It is only meaningful   for asyputchar and asygetchar and they are only meaningful if   NEED_PUT_GETCHAR is defined.*/#define INITIAL_MDM_CONTROL	0/****************************************************//* Nothing past this line should have to be changed *//****************************************************/#define NUM_INT_VECTORS	32	/* number of possible int vectors, but				   only the first eight are normally used				*/#define MAX_UNITS	16	/* we will only use that many units *//* Miscellaneous Constants */#define BAUD_BASE	(1843200 / 16)	/* 115200 bps */#define HANGUP_DELAY	500		/* in milli-seconds */#define HANGUP_TIME	1000		/* in milli-seconds */#define RECOVER_TIME	30		/* in seconds */#define BREAK_TIME	250		/* in milli-seconds */#define EVENT_TIME	20		/* in milli-seconds */#if defined (M_I286)#define	RECV_BUFF_SIZE	1000		/* receiver ring buffer size (MAX) */#define XMIT_BUFF_SIZE	500		/* transmitter ring buffer size */#else#if defined(FASI)	/* we'll make do with less */#define	RECV_BUFF_SIZE	3500	/* receiver ring buffer size (MAX) */#define XMIT_BUFF_SIZE	500	/* transmitter ring buffer size */#else	/* FASI */#define	RECV_BUFF_SIZE	5000	/* receiver ring buffer size (MAX) */#define XMIT_BUFF_SIZE	2500	/* transmitter ring buffer size */#endif	/* FASI */#endif	/* M_I286 */#define RBS RECV_BUFF_SIZE#define SW_LOW_WATER	((int)(RBS*0.5))	/* 50% MAX	sw flow control */#define SW_HIGH_WATER	((int)(RBS*0.8))	/* 80% MAX	 trigger levels */#if defined(FASI)	/* experiment */#define HW_LOW_WATER	(RBS-300)	/* MAX - 300	hw flow control */#define HW_HIGH_WATER	(RBS-100)	/* MAX - 100	 trigger levels */#else#define HW_LOW_WATER	(RBS-500)	/* MAX - 500	hw flow control */#define HW_HIGH_WATER	(RBS-300)	/* MAX - 300	 trigger levels */#endif#define MAX_UNIX_FILL	(TTYHOG)	/* read buffer max UNIX fill level */#define MAX_VPIX_FILL	64		/* read buffer max VP/ix fill level */#define MIN_READ_CHUNK	32		/* must be <= MAX_????_FILL/2 */#define MAX_MSI_CNT	1000		/* max modem status ints per second */#define READ_PORT	0x0100		/* read command for fas_init_seq */#define NO_FIFO		0x10000		/* force FIFOs off */#define SOFT_INIT	0		/* init registers if cflag changed */#define HARD_INIT	1		/* init registers w/o checking cflag */#if defined (XENIX)#define SPLWRK		spl5		/* SPL for character processing */#define SPLINT		spl7		/* SPL to disable FAS interrupts */#else#define SPLWRK		spl6		/* SPL for character processing */#define SPLINT		spltty		/* SPL to disable FAS interrupts */#endif#if ((EVENT_TIME) * (HZ) / 1000) == 0#undef EVENT_TIME#define EVENT_TIME	(1000 / (HZ))#endif#if (MAX_UNIX_FILL) > (TTYHOG)#undef MAX_UNIX_FILL#define MAX_UNIX_FILL	(TTYHOG)#endif#if (MAX_VPIX_FILL) > (TTYHOG)#undef MAX_VPIX_FILL#define MAX_VPIX_FILL	(TTYHOG)#endif#if (MIN_READ_CHUNK) > ((MAX_UNIX_FILL) / 2)#undef MIN_READ_CHUNK#define MIN_READ_CHUNK	((MAX_UNIX_FILL) / 2)#endif#if (MIN_READ_CHUNK) > ((MAX_VPIX_FILL) / 2)#undef MIN_READ_CHUNK#define MIN_READ_CHUNK	((MAX_VPIX_FILL) / 2)#endif#define MAX_INPUT_FIFO_SIZE	INPUT_NS_FIFO_SIZE#define MAX_OUTPUT_FIFO_SIZE	OUTPUT_NS_FIFO_SIZE/* Here are the modem control flags for the fas_modem array in space.c.   They are arranged in three 8-bit masks which are combined to a 32-bit   word. Each of these 32-bit words represents one entry in the fas_modem   array.   The lowest byte is used as a mask to manipulate the modem control   register for modem disable. Use the MC_* macros to build the mask.   The second lowest byte is used as a mask to manipulate the modem control   register for modem enable during dialout. Use the MC_* macros to build   the mask and shift them 8 bits to the left.   The second highest byte is used as a mask to manipulate the modem control   register for modem enable during dialin. Use the MC_* macros to build   the mask and shift them 16 bits to the left.   The highest byte is used to mask signals from the modem status   register that will be used as the carrier detect signal. Use the MS_*   macros to build the mask and shift them 24 bits to the left. If you use   more than one signal, carrier is considered on only when all signals   are on.   Here are some useful macros for the space.c file. You may create your   own macros if you have some special requirements not met by the   predefined ones.*//* modem disable (choose one) */#define DI_RTS			MC_SET_RTS	/* RTS disables modem */#define DI_DTR			MC_SET_DTR	/* DTR disables modem */#define DI_RTS_AND_DTR		(MC_SET_RTS | MC_SET_DTR)/* modem enable for dialout (choose one) */#define EO_RTS			(MC_SET_RTS << 8) /* RTS enables modem */#define EO_DTR			(MC_SET_DTR << 8) /* DTR enables modem */#define EO_RTS_AND_DTR		((MC_SET_RTS | MC_SET_DTR) << 8)/* modem enable for dialin (choose one) */#define EI_RTS			(MC_SET_RTS << 16) /* RTS enables modem */#define EI_DTR			(MC_SET_DTR << 16) /* DTR enables modem */#define EI_RTS_AND_DTR		((MC_SET_RTS | MC_SET_DTR) << 16)/* carrier detect signal (choose one) */#define CA_DCD			(MS_DCD_PRESENT << 24) /* DCD is carr. detect */#define CA_CTS			(MS_CTS_PRESENT << 24) /* CTS is carr. detect */#define CA_DSR			(MS_DSR_PRESENT << 24) /* DSR is carr. detect *//* Here are the hardware handshake flags for the fas_flow array in space.c.   They are arranged in three 8-bit masks which are combined to a 32-bit   word. Each of these 32-bit words represents one entry in the fas_flow   array.   The lowest byte is used as a mask to manipulate the modem control   register for input flow control. Use the MC_* macros to build the mask.   The second lowest byte is used to mask signals from the modem status   register that will be used for output flow control. Use the MS_* macros   to build the mask and shift them 8 bits to the left. If you use more   than one signal, output is allowed only when all signals are on.   The second highest byte is used to mask signals from the modem status   register that will be used to enable the output flow control selected   by the second lowest byte. Use the MS_* macros to build the mask and   shift them 16 bits to the left. If you use more than one signal, output   flow control is enabled only when all signals are on.   The highest byte is used as a mask to manipulate the modem control   register for output half duplex flow control. Use the MC_* macros to   build the mask and shift them 24 bits to the left.   Here are some useful macros for the space.c file. You may create your   own macros if you have some special requirements not met by the   predefined ones.*//* input flow control (choose one) */#define HI_RTS			MC_SET_RTS	/* RTS input flow ctrl */#define HI_DTR			MC_SET_DTR	/* DTR input flow ctrl */#define HI_RTS_AND_DTR		(MC_SET_RTS | MC_SET_DTR)/* output flow control (choose one) */#define HO_CTS			(MS_CTS_PRESENT << 8) /* CTS output flow ctrl */#define HO_DSR			(MS_DSR_PRESENT << 8) /* DSR output flow ctrl */#define HO_CTS_AND_DSR		((MS_CTS_PRESENT | MS_DSR_PRESENT) << 8)#define HO_CTS_ON_DSR		((MS_CTS_PRESENT << 8) | (MS_DSR_PRESENT << 16))#define HO_CTS_ON_DSR_AND_DCD	((MS_CTS_PRESENT << 8) \				| ((MS_DSR_PRESENT | MS_DCD_PRESENT) << 16))/* output hdx flow control (choose one) */#define HX_RTS			(MC_SET_RTS << 24) /* RTS hdx flow ctrl */#define HX_DTR			(MC_SET_DTR << 24) /* DTR hdx flow ctrl */#define HX_RTS_AND_DTR		((MC_SET_RTS | MC_SET_DTR) << 24)/* define the local open flags */#define OS_DEVICE_CLOSED	0x0000#define OS_OPEN_FOR_DIALOUT	0x0001#define OS_OPEN_FOR_GETTY	0x0002#define OS_WAIT_OPEN		0x0004#define OS_NO_DIALOUT		0x0008#define OS_FAKE_CARR_ON		0x0010#define OS_CLOCAL		0x0020#define OS_HWO_HANDSHAKE	0x0040#define OS_HWI_HANDSHAKE	0x0080#define OS_HDX_HANDSHAKE	0x0100#define OS_EXCLUSIVE_OPEN_1	0x0200#define OS_EXCLUSIVE_OPEN_2	0x0400	/* SYSV 3.2 Xenix compatibility */#define OS_OPEN_STATES		(OS_OPEN_FOR_DIALOUT | OS_OPEN_FOR_GETTY)#define OS_TEST_MASK		(OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \				| OS_FAKE_CARR_ON | OS_CLOCAL \				| OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \				| OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1 \				| OS_EXCLUSIVE_OPEN_2)#define OS_SU_TEST_MASK		(OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \				| OS_FAKE_CARR_ON | OS_CLOCAL \				| OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \				| OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1)/* define the device status flags */#define DF_DEVICE_CONFIGURED	0x0001	/* device is configured */#define DF_DEVICE_IS_NS16550A	0x0002	/* it's an NS16550A */#define DF_DEVICE_IS_I82510	0x0004	/* it's an I82510 */#define DF_CTL_FIRST		0x0008	/* write ctl port at first access */#define DF_CTL_EVERY		0x0010	/* write ctl port at every access */#define DF_DEVICE_OPEN		0x0020	/* physical device is open */#define DF_DEVICE_LOCKED	0x0040	/* physical device locked */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -