Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: dgap: Merge digi.h into dgap_driver.h

There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged
drivers are single source and header.

Signed-off-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mark Hounschell and committed by
Greg Kroah-Hartman
31f2a1b6 4c15e811

+349 -377
+349 -2
drivers/staging/dgap/dgap_driver.h
··· 31 31 #include <linux/tty.h> /* To pick up the various tty structs/defines */ 32 32 #include <linux/interrupt.h> /* For irqreturn_t type */ 33 33 34 - #include "digi.h" /* Digi specific ioctl header */ 35 - 36 34 #ifndef TRUE 37 35 # define TRUE 1 38 36 #endif ··· 856 858 #define SNIFF_WAIT_DATA 0x2 857 859 #define SNIFF_WAIT_SPACE 0x4 858 860 861 + 862 + /************************************************************************ 863 + *** Definitions for Digi ditty(1) command. 864 + ************************************************************************/ 865 + 866 + 867 + /* 868 + * Copyright (c) 1988-96 Digi International Inc., All Rights Reserved. 869 + */ 870 + 871 + /************************************************************************ 872 + * This module provides application access to special Digi 873 + * serial line enhancements which are not standard UNIX(tm) features. 874 + ************************************************************************/ 875 + 876 + #if !defined(TIOCMODG) 877 + 878 + #define TIOCMODG ('d'<<8) | 250 /* get modem ctrl state */ 879 + #define TIOCMODS ('d'<<8) | 251 /* set modem ctrl state */ 880 + 881 + #ifndef TIOCM_LE 882 + #define TIOCM_LE 0x01 /* line enable */ 883 + #define TIOCM_DTR 0x02 /* data terminal ready */ 884 + #define TIOCM_RTS 0x04 /* request to send */ 885 + #define TIOCM_ST 0x08 /* secondary transmit */ 886 + #define TIOCM_SR 0x10 /* secondary receive */ 887 + #define TIOCM_CTS 0x20 /* clear to send */ 888 + #define TIOCM_CAR 0x40 /* carrier detect */ 889 + #define TIOCM_RNG 0x80 /* ring indicator */ 890 + #define TIOCM_DSR 0x100 /* data set ready */ 891 + #define TIOCM_RI TIOCM_RNG /* ring (alternate) */ 892 + #define TIOCM_CD TIOCM_CAR /* carrier detect (alt) */ 893 + #endif 894 + 895 + #endif 896 + 897 + #if !defined(TIOCMSET) 898 + #define TIOCMSET ('d'<<8) | 252 /* set modem ctrl state */ 899 + #define TIOCMGET ('d'<<8) | 253 /* set modem ctrl state */ 900 + #endif 901 + 902 + #if !defined(TIOCMBIC) 903 + #define TIOCMBIC ('d'<<8) | 254 /* set modem ctrl state */ 904 + #define TIOCMBIS ('d'<<8) | 255 /* set modem ctrl state */ 905 + #endif 906 + 907 + 908 + #if !defined(TIOCSDTR) 909 + #define TIOCSDTR ('e'<<8) | 0 /* set DTR */ 910 + #define TIOCCDTR ('e'<<8) | 1 /* clear DTR */ 911 + #endif 912 + 913 + /************************************************************************ 914 + * Ioctl command arguments for DIGI parameters. 915 + ************************************************************************/ 916 + #define DIGI_GETA ('e'<<8) | 94 /* Read params */ 917 + 918 + #define DIGI_SETA ('e'<<8) | 95 /* Set params */ 919 + #define DIGI_SETAW ('e'<<8) | 96 /* Drain & set params */ 920 + #define DIGI_SETAF ('e'<<8) | 97 /* Drain, flush & set params */ 921 + 922 + #define DIGI_KME ('e'<<8) | 98 /* Read/Write Host */ 923 + /* Adapter Memory */ 924 + 925 + #define DIGI_GETFLOW ('e'<<8) | 99 /* Get startc/stopc flow */ 926 + /* control characters */ 927 + #define DIGI_SETFLOW ('e'<<8) | 100 /* Set startc/stopc flow */ 928 + /* control characters */ 929 + #define DIGI_GETAFLOW ('e'<<8) | 101 /* Get Aux. startc/stopc */ 930 + /* flow control chars */ 931 + #define DIGI_SETAFLOW ('e'<<8) | 102 /* Set Aux. startc/stopc */ 932 + /* flow control chars */ 933 + 934 + #define DIGI_GEDELAY ('d'<<8) | 246 /* Get edelay */ 935 + #define DIGI_SEDELAY ('d'<<8) | 247 /* Set edelay */ 936 + 937 + struct digiflow_t { 938 + unsigned char startc; /* flow cntl start char */ 939 + unsigned char stopc; /* flow cntl stop char */ 940 + }; 941 + 942 + 943 + #ifdef FLOW_2200 944 + #define F2200_GETA ('e'<<8) | 104 /* Get 2x36 flow cntl flags */ 945 + #define F2200_SETAW ('e'<<8) | 105 /* Set 2x36 flow cntl flags */ 946 + #define F2200_MASK 0x03 /* 2200 flow cntl bit mask */ 947 + #define FCNTL_2200 0x01 /* 2x36 terminal flow cntl */ 948 + #define PCNTL_2200 0x02 /* 2x36 printer flow cntl */ 949 + #define F2200_XON 0xf8 950 + #define P2200_XON 0xf9 951 + #define F2200_XOFF 0xfa 952 + #define P2200_XOFF 0xfb 953 + 954 + #define FXOFF_MASK 0x03 /* 2200 flow status mask */ 955 + #define RCVD_FXOFF 0x01 /* 2x36 Terminal XOFF rcvd */ 956 + #define RCVD_PXOFF 0x02 /* 2x36 Printer XOFF rcvd */ 957 + #endif 958 + 959 + /************************************************************************ 960 + * Values for digi_flags 961 + ************************************************************************/ 962 + #define DIGI_IXON 0x0001 /* Handle IXON in the FEP */ 963 + #define DIGI_FAST 0x0002 /* Fast baud rates */ 964 + #define RTSPACE 0x0004 /* RTS input flow control */ 965 + #define CTSPACE 0x0008 /* CTS output flow control */ 966 + #define DSRPACE 0x0010 /* DSR output flow control */ 967 + #define DCDPACE 0x0020 /* DCD output flow control */ 968 + #define DTRPACE 0x0040 /* DTR input flow control */ 969 + #define DIGI_COOK 0x0080 /* Cooked processing done in FEP */ 970 + #define DIGI_FORCEDCD 0x0100 /* Force carrier */ 971 + #define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */ 972 + #define DIGI_AIXON 0x0400 /* Aux flow control in fep */ 973 + #define DIGI_PRINTER 0x0800 /* Hold port open for flow cntrl*/ 974 + #define DIGI_PP_INPUT 0x1000 /* Change parallel port to input*/ 975 + #define DIGI_DTR_TOGGLE 0x2000 /* Support DTR Toggle */ 976 + #define DIGI_422 0x4000 /* for 422/232 selectable panel */ 977 + #define DIGI_RTS_TOGGLE 0x8000 /* Support RTS Toggle */ 978 + 979 + /************************************************************************ 980 + * These options are not supported on the comxi. 981 + ************************************************************************/ 982 + #define DIGI_COMXI (DIGI_FAST|DIGI_COOK|DSRPACE|DCDPACE|DTRPACE) 983 + 984 + #define DIGI_PLEN 28 /* String length */ 985 + #define DIGI_TSIZ 10 /* Terminal string len */ 986 + 987 + /************************************************************************ 988 + * Structure used with ioctl commands for DIGI parameters. 989 + ************************************************************************/ 990 + struct digi_t { 991 + unsigned short digi_flags; /* Flags (see above) */ 992 + unsigned short digi_maxcps; /* Max printer CPS */ 993 + unsigned short digi_maxchar; /* Max chars in print queue */ 994 + unsigned short digi_bufsize; /* Buffer size */ 995 + unsigned char digi_onlen; /* Length of ON string */ 996 + unsigned char digi_offlen; /* Length of OFF string */ 997 + char digi_onstr[DIGI_PLEN]; /* Printer on string */ 998 + char digi_offstr[DIGI_PLEN]; /* Printer off string */ 999 + char digi_term[DIGI_TSIZ]; /* terminal string */ 1000 + }; 1001 + 1002 + /************************************************************************ 1003 + * KME definitions and structures. 1004 + ************************************************************************/ 1005 + #define RW_IDLE 0 /* Operation complete */ 1006 + #define RW_READ 1 /* Read Concentrator Memory */ 1007 + #define RW_WRITE 2 /* Write Concentrator Memory */ 1008 + 1009 + struct rw_t { 1010 + unsigned char rw_req; /* Request type */ 1011 + unsigned char rw_board; /* Host Adapter board number */ 1012 + unsigned char rw_conc; /* Concentrator number */ 1013 + unsigned char rw_reserved; /* Reserved for expansion */ 1014 + unsigned long rw_addr; /* Address in concentrator */ 1015 + unsigned short rw_size; /* Read/write request length */ 1016 + unsigned char rw_data[128]; /* Data to read/write */ 1017 + }; 1018 + 1019 + /*********************************************************************** 1020 + * Shrink Buffer and Board Information definitions and structures. 1021 + 1022 + ************************************************************************/ 1023 + /* Board type return codes */ 1024 + #define PCXI_TYPE 1 /* Board type at the designated port is a PC/Xi */ 1025 + #define PCXM_TYPE 2 /* Board type at the designated port is a PC/Xm */ 1026 + #define PCXE_TYPE 3 /* Board type at the designated port is a PC/Xe */ 1027 + #define MCXI_TYPE 4 /* Board type at the designated port is a MC/Xi */ 1028 + #define COMXI_TYPE 5 /* Board type at the designated port is a COM/Xi */ 1029 + 1030 + /* Non-Zero Result codes. */ 1031 + #define RESULT_NOBDFND 1 /* A Digi product at that port is not config installed */ 1032 + #define RESULT_NODESCT 2 /* A memory descriptor was not obtainable */ 1033 + #define RESULT_NOOSSIG 3 /* FEP/OS signature was not detected on the board */ 1034 + #define RESULT_TOOSML 4 /* Too small an area to shrink. */ 1035 + #define RESULT_NOCHAN 5 /* Channel structure for the board was not found */ 1036 + 1037 + struct shrink_buf_struct { 1038 + unsigned long shrink_buf_vaddr; /* Virtual address of board */ 1039 + unsigned long shrink_buf_phys; /* Physical address of board */ 1040 + unsigned long shrink_buf_bseg; /* Amount of board memory */ 1041 + unsigned long shrink_buf_hseg; /* '186 Beginning of Dual-Port */ 1042 + 1043 + unsigned long shrink_buf_lseg; /* '186 Beginning of freed memory */ 1044 + unsigned long shrink_buf_mseg; /* Linear address from start of 1045 + dual-port were freed memory 1046 + begins, host viewpoint. */ 1047 + 1048 + unsigned long shrink_buf_bdparam; /* Parameter for xxmemon and 1049 + xxmemoff */ 1050 + 1051 + unsigned long shrink_buf_reserva; /* Reserved */ 1052 + unsigned long shrink_buf_reservb; /* Reserved */ 1053 + unsigned long shrink_buf_reservc; /* Reserved */ 1054 + unsigned long shrink_buf_reservd; /* Reserved */ 1055 + 1056 + unsigned char shrink_buf_result; /* Reason for call failing 1057 + Zero is Good return */ 1058 + unsigned char shrink_buf_init; /* Non-Zero if it caused an 1059 + xxinit call. */ 1060 + 1061 + unsigned char shrink_buf_anports; /* Number of async ports */ 1062 + unsigned char shrink_buf_snports; /* Number of sync ports */ 1063 + unsigned char shrink_buf_type; /* Board type 1 = PC/Xi, 1064 + 2 = PC/Xm, 1065 + 3 = PC/Xe 1066 + 4 = MC/Xi 1067 + 5 = COMX/i */ 1068 + unsigned char shrink_buf_card; /* Card number */ 1069 + 1070 + }; 1071 + 1072 + /************************************************************************ 1073 + * Structure to get driver status information 1074 + ************************************************************************/ 1075 + struct digi_dinfo { 1076 + unsigned long dinfo_nboards; /* # boards configured */ 1077 + char dinfo_reserved[12]; /* for future expansion */ 1078 + char dinfo_version[16]; /* driver version */ 1079 + }; 1080 + 1081 + #define DIGI_GETDD ('d'<<8) | 248 /* get driver info */ 1082 + 1083 + /************************************************************************ 1084 + * Structure used with ioctl commands for per-board information 1085 + * 1086 + * physsize and memsize differ when board has "windowed" memory 1087 + ************************************************************************/ 1088 + struct digi_info { 1089 + unsigned long info_bdnum; /* Board number (0 based) */ 1090 + unsigned long info_ioport; /* io port address */ 1091 + unsigned long info_physaddr; /* memory address */ 1092 + unsigned long info_physsize; /* Size of host mem window */ 1093 + unsigned long info_memsize; /* Amount of dual-port mem */ 1094 + /* on board */ 1095 + unsigned short info_bdtype; /* Board type */ 1096 + unsigned short info_nports; /* number of ports */ 1097 + char info_bdstate; /* board state */ 1098 + char info_reserved[7]; /* for future expansion */ 1099 + }; 1100 + 1101 + #define DIGI_GETBD ('d'<<8) | 249 /* get board info */ 1102 + 1103 + struct digi_stat { 1104 + unsigned int info_chan; /* Channel number (0 based) */ 1105 + unsigned int info_brd; /* Board number (0 based) */ 1106 + unsigned long info_cflag; /* cflag for channel */ 1107 + unsigned long info_iflag; /* iflag for channel */ 1108 + unsigned long info_oflag; /* oflag for channel */ 1109 + unsigned long info_mstat; /* mstat for channel */ 1110 + unsigned long info_tx_data; /* tx_data for channel */ 1111 + unsigned long info_rx_data; /* rx_data for channel */ 1112 + unsigned long info_hflow; /* hflow for channel */ 1113 + unsigned long info_reserved[8]; /* for future expansion */ 1114 + }; 1115 + 1116 + #define DIGI_GETSTAT ('d'<<8) | 244 /* get board info */ 1117 + /************************************************************************ 1118 + * 1119 + * Structure used with ioctl commands for per-channel information 1120 + * 1121 + ************************************************************************/ 1122 + struct digi_ch { 1123 + unsigned long info_bdnum; /* Board number (0 based) */ 1124 + unsigned long info_channel; /* Channel index number */ 1125 + unsigned long info_ch_cflag; /* Channel cflag */ 1126 + unsigned long info_ch_iflag; /* Channel iflag */ 1127 + unsigned long info_ch_oflag; /* Channel oflag */ 1128 + unsigned long info_chsize; /* Channel structure size */ 1129 + unsigned long info_sleep_stat; /* sleep status */ 1130 + dev_t info_dev; /* device number */ 1131 + unsigned char info_initstate; /* Channel init state */ 1132 + unsigned char info_running; /* Channel running state */ 1133 + long reserved[8]; /* reserved for future use */ 1134 + }; 1135 + 1136 + /* 1137 + * This structure is used with the DIGI_FEPCMD ioctl to 1138 + * tell the driver which port to send the command for. 1139 + */ 1140 + struct digi_cmd { 1141 + int cmd; 1142 + int word; 1143 + int ncmds; 1144 + int chan; /* channel index (zero based) */ 1145 + int bdid; /* board index (zero based) */ 1146 + }; 1147 + 1148 + /* 1149 + * info_sleep_stat defines 1150 + */ 1151 + #define INFO_RUNWAIT 0x0001 1152 + #define INFO_WOPEN 0x0002 1153 + #define INFO_TTIOW 0x0004 1154 + #define INFO_CH_RWAIT 0x0008 1155 + #define INFO_CH_WEMPTY 0x0010 1156 + #define INFO_CH_WLOW 0x0020 1157 + #define INFO_XXBUF_BUSY 0x0040 1158 + 1159 + #define DIGI_GETCH ('d'<<8) | 245 /* get board info */ 1160 + 1161 + /* Board type definitions */ 1162 + 1163 + #define SUBTYPE 0007 1164 + #define T_PCXI 0000 1165 + #define T_PCXM 0001 1166 + #define T_PCXE 0002 1167 + #define T_PCXR 0003 1168 + #define T_SP 0004 1169 + #define T_SP_PLUS 0005 1170 + # define T_HERC 0000 1171 + # define T_HOU 0001 1172 + # define T_LON 0002 1173 + # define T_CHA 0003 1174 + #define FAMILY 0070 1175 + #define T_COMXI 0000 1176 + #define T_PCXX 0010 1177 + #define T_CX 0020 1178 + #define T_EPC 0030 1179 + #define T_PCLITE 0040 1180 + #define T_SPXX 0050 1181 + #define T_AVXX 0060 1182 + #define T_DXB 0070 1183 + #define T_A2K_4_8 0070 1184 + #define BUSTYPE 0700 1185 + #define T_ISABUS 0000 1186 + #define T_MCBUS 0100 1187 + #define T_EISABUS 0200 1188 + #define T_PCIBUS 0400 1189 + 1190 + /* Board State Definitions */ 1191 + 1192 + #define BD_RUNNING 0x0 1193 + #define BD_REASON 0x7f 1194 + #define BD_NOTFOUND 0x1 1195 + #define BD_NOIOPORT 0x2 1196 + #define BD_NOMEM 0x3 1197 + #define BD_NOBIOS 0x4 1198 + #define BD_NOFEP 0x5 1199 + #define BD_FAILED 0x6 1200 + #define BD_ALLOCATED 0x7 1201 + #define BD_TRIBOOT 0x8 1202 + #define BD_BADKME 0x80 1203 + 1204 + #define DIGI_LOOPBACK ('d'<<8) | 252 /* Enable/disable UART internal loopback */ 1205 + #define DIGI_SPOLL ('d'<<8) | 254 /* change poller rate */ 1206 + 1207 + #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */ 1208 + #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */ 1209 + #define DIGI_RESET_PORT ('e'<<8) | 93 /* Reset port */ 859 1210 860 1211 /************************************************************************ 861 1212 * Channel information structure.
-375
drivers/staging/dgap/digi.h
··· 1 - /* 2 - * Copyright 2003 Digi International (www.digi.com) 3 - * Scott H Kilau <Scott_Kilau at digi dot com> 4 - * 5 - * This program is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License as published by 7 - * the Free Software Foundation; either version 2, or (at your option) 8 - * any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the 12 - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 13 - * PURPOSE. See the GNU General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, write to the Free Software 17 - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 - * 19 - * 20 - * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!! 21 - */ 22 - 23 - #ifndef __DIGI_H 24 - #define __DIGI_H 25 - 26 - /************************************************************************ 27 - *** Definitions for Digi ditty(1) command. 28 - ************************************************************************/ 29 - 30 - 31 - /* 32 - * Copyright (c) 1988-96 Digi International Inc., All Rights Reserved. 33 - */ 34 - 35 - /************************************************************************ 36 - * This module provides application access to special Digi 37 - * serial line enhancements which are not standard UNIX(tm) features. 38 - ************************************************************************/ 39 - 40 - #if !defined(TIOCMODG) 41 - 42 - #define TIOCMODG ('d'<<8) | 250 /* get modem ctrl state */ 43 - #define TIOCMODS ('d'<<8) | 251 /* set modem ctrl state */ 44 - 45 - #ifndef TIOCM_LE 46 - #define TIOCM_LE 0x01 /* line enable */ 47 - #define TIOCM_DTR 0x02 /* data terminal ready */ 48 - #define TIOCM_RTS 0x04 /* request to send */ 49 - #define TIOCM_ST 0x08 /* secondary transmit */ 50 - #define TIOCM_SR 0x10 /* secondary receive */ 51 - #define TIOCM_CTS 0x20 /* clear to send */ 52 - #define TIOCM_CAR 0x40 /* carrier detect */ 53 - #define TIOCM_RNG 0x80 /* ring indicator */ 54 - #define TIOCM_DSR 0x100 /* data set ready */ 55 - #define TIOCM_RI TIOCM_RNG /* ring (alternate) */ 56 - #define TIOCM_CD TIOCM_CAR /* carrier detect (alt) */ 57 - #endif 58 - 59 - #endif 60 - 61 - #if !defined(TIOCMSET) 62 - #define TIOCMSET ('d'<<8) | 252 /* set modem ctrl state */ 63 - #define TIOCMGET ('d'<<8) | 253 /* set modem ctrl state */ 64 - #endif 65 - 66 - #if !defined(TIOCMBIC) 67 - #define TIOCMBIC ('d'<<8) | 254 /* set modem ctrl state */ 68 - #define TIOCMBIS ('d'<<8) | 255 /* set modem ctrl state */ 69 - #endif 70 - 71 - 72 - #if !defined(TIOCSDTR) 73 - #define TIOCSDTR ('e'<<8) | 0 /* set DTR */ 74 - #define TIOCCDTR ('e'<<8) | 1 /* clear DTR */ 75 - #endif 76 - 77 - /************************************************************************ 78 - * Ioctl command arguments for DIGI parameters. 79 - ************************************************************************/ 80 - #define DIGI_GETA ('e'<<8) | 94 /* Read params */ 81 - 82 - #define DIGI_SETA ('e'<<8) | 95 /* Set params */ 83 - #define DIGI_SETAW ('e'<<8) | 96 /* Drain & set params */ 84 - #define DIGI_SETAF ('e'<<8) | 97 /* Drain, flush & set params */ 85 - 86 - #define DIGI_KME ('e'<<8) | 98 /* Read/Write Host */ 87 - /* Adapter Memory */ 88 - 89 - #define DIGI_GETFLOW ('e'<<8) | 99 /* Get startc/stopc flow */ 90 - /* control characters */ 91 - #define DIGI_SETFLOW ('e'<<8) | 100 /* Set startc/stopc flow */ 92 - /* control characters */ 93 - #define DIGI_GETAFLOW ('e'<<8) | 101 /* Get Aux. startc/stopc */ 94 - /* flow control chars */ 95 - #define DIGI_SETAFLOW ('e'<<8) | 102 /* Set Aux. startc/stopc */ 96 - /* flow control chars */ 97 - 98 - #define DIGI_GEDELAY ('d'<<8) | 246 /* Get edelay */ 99 - #define DIGI_SEDELAY ('d'<<8) | 247 /* Set edelay */ 100 - 101 - struct digiflow_t { 102 - unsigned char startc; /* flow cntl start char */ 103 - unsigned char stopc; /* flow cntl stop char */ 104 - }; 105 - 106 - 107 - #ifdef FLOW_2200 108 - #define F2200_GETA ('e'<<8) | 104 /* Get 2x36 flow cntl flags */ 109 - #define F2200_SETAW ('e'<<8) | 105 /* Set 2x36 flow cntl flags */ 110 - #define F2200_MASK 0x03 /* 2200 flow cntl bit mask */ 111 - #define FCNTL_2200 0x01 /* 2x36 terminal flow cntl */ 112 - #define PCNTL_2200 0x02 /* 2x36 printer flow cntl */ 113 - #define F2200_XON 0xf8 114 - #define P2200_XON 0xf9 115 - #define F2200_XOFF 0xfa 116 - #define P2200_XOFF 0xfb 117 - 118 - #define FXOFF_MASK 0x03 /* 2200 flow status mask */ 119 - #define RCVD_FXOFF 0x01 /* 2x36 Terminal XOFF rcvd */ 120 - #define RCVD_PXOFF 0x02 /* 2x36 Printer XOFF rcvd */ 121 - #endif 122 - 123 - /************************************************************************ 124 - * Values for digi_flags 125 - ************************************************************************/ 126 - #define DIGI_IXON 0x0001 /* Handle IXON in the FEP */ 127 - #define DIGI_FAST 0x0002 /* Fast baud rates */ 128 - #define RTSPACE 0x0004 /* RTS input flow control */ 129 - #define CTSPACE 0x0008 /* CTS output flow control */ 130 - #define DSRPACE 0x0010 /* DSR output flow control */ 131 - #define DCDPACE 0x0020 /* DCD output flow control */ 132 - #define DTRPACE 0x0040 /* DTR input flow control */ 133 - #define DIGI_COOK 0x0080 /* Cooked processing done in FEP */ 134 - #define DIGI_FORCEDCD 0x0100 /* Force carrier */ 135 - #define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */ 136 - #define DIGI_AIXON 0x0400 /* Aux flow control in fep */ 137 - #define DIGI_PRINTER 0x0800 /* Hold port open for flow cntrl*/ 138 - #define DIGI_PP_INPUT 0x1000 /* Change parallel port to input*/ 139 - #define DIGI_DTR_TOGGLE 0x2000 /* Support DTR Toggle */ 140 - #define DIGI_422 0x4000 /* for 422/232 selectable panel */ 141 - #define DIGI_RTS_TOGGLE 0x8000 /* Support RTS Toggle */ 142 - 143 - /************************************************************************ 144 - * These options are not supported on the comxi. 145 - ************************************************************************/ 146 - #define DIGI_COMXI (DIGI_FAST|DIGI_COOK|DSRPACE|DCDPACE|DTRPACE) 147 - 148 - #define DIGI_PLEN 28 /* String length */ 149 - #define DIGI_TSIZ 10 /* Terminal string len */ 150 - 151 - /************************************************************************ 152 - * Structure used with ioctl commands for DIGI parameters. 153 - ************************************************************************/ 154 - struct digi_t { 155 - unsigned short digi_flags; /* Flags (see above) */ 156 - unsigned short digi_maxcps; /* Max printer CPS */ 157 - unsigned short digi_maxchar; /* Max chars in print queue */ 158 - unsigned short digi_bufsize; /* Buffer size */ 159 - unsigned char digi_onlen; /* Length of ON string */ 160 - unsigned char digi_offlen; /* Length of OFF string */ 161 - char digi_onstr[DIGI_PLEN]; /* Printer on string */ 162 - char digi_offstr[DIGI_PLEN]; /* Printer off string */ 163 - char digi_term[DIGI_TSIZ]; /* terminal string */ 164 - }; 165 - 166 - /************************************************************************ 167 - * KME definitions and structures. 168 - ************************************************************************/ 169 - #define RW_IDLE 0 /* Operation complete */ 170 - #define RW_READ 1 /* Read Concentrator Memory */ 171 - #define RW_WRITE 2 /* Write Concentrator Memory */ 172 - 173 - struct rw_t { 174 - unsigned char rw_req; /* Request type */ 175 - unsigned char rw_board; /* Host Adapter board number */ 176 - unsigned char rw_conc; /* Concentrator number */ 177 - unsigned char rw_reserved; /* Reserved for expansion */ 178 - unsigned long rw_addr; /* Address in concentrator */ 179 - unsigned short rw_size; /* Read/write request length */ 180 - unsigned char rw_data[128]; /* Data to read/write */ 181 - }; 182 - 183 - /*********************************************************************** 184 - * Shrink Buffer and Board Information definitions and structures. 185 - 186 - ************************************************************************/ 187 - /* Board type return codes */ 188 - #define PCXI_TYPE 1 /* Board type at the designated port is a PC/Xi */ 189 - #define PCXM_TYPE 2 /* Board type at the designated port is a PC/Xm */ 190 - #define PCXE_TYPE 3 /* Board type at the designated port is a PC/Xe */ 191 - #define MCXI_TYPE 4 /* Board type at the designated port is a MC/Xi */ 192 - #define COMXI_TYPE 5 /* Board type at the designated port is a COM/Xi */ 193 - 194 - /* Non-Zero Result codes. */ 195 - #define RESULT_NOBDFND 1 /* A Digi product at that port is not config installed */ 196 - #define RESULT_NODESCT 2 /* A memory descriptor was not obtainable */ 197 - #define RESULT_NOOSSIG 3 /* FEP/OS signature was not detected on the board */ 198 - #define RESULT_TOOSML 4 /* Too small an area to shrink. */ 199 - #define RESULT_NOCHAN 5 /* Channel structure for the board was not found */ 200 - 201 - struct shrink_buf_struct { 202 - unsigned long shrink_buf_vaddr; /* Virtual address of board */ 203 - unsigned long shrink_buf_phys; /* Physical address of board */ 204 - unsigned long shrink_buf_bseg; /* Amount of board memory */ 205 - unsigned long shrink_buf_hseg; /* '186 Beginning of Dual-Port */ 206 - 207 - unsigned long shrink_buf_lseg; /* '186 Beginning of freed memory */ 208 - unsigned long shrink_buf_mseg; /* Linear address from start of 209 - dual-port were freed memory 210 - begins, host viewpoint. */ 211 - 212 - unsigned long shrink_buf_bdparam; /* Parameter for xxmemon and 213 - xxmemoff */ 214 - 215 - unsigned long shrink_buf_reserva; /* Reserved */ 216 - unsigned long shrink_buf_reservb; /* Reserved */ 217 - unsigned long shrink_buf_reservc; /* Reserved */ 218 - unsigned long shrink_buf_reservd; /* Reserved */ 219 - 220 - unsigned char shrink_buf_result; /* Reason for call failing 221 - Zero is Good return */ 222 - unsigned char shrink_buf_init; /* Non-Zero if it caused an 223 - xxinit call. */ 224 - 225 - unsigned char shrink_buf_anports; /* Number of async ports */ 226 - unsigned char shrink_buf_snports; /* Number of sync ports */ 227 - unsigned char shrink_buf_type; /* Board type 1 = PC/Xi, 228 - 2 = PC/Xm, 229 - 3 = PC/Xe 230 - 4 = MC/Xi 231 - 5 = COMX/i */ 232 - unsigned char shrink_buf_card; /* Card number */ 233 - 234 - }; 235 - 236 - /************************************************************************ 237 - * Structure to get driver status information 238 - ************************************************************************/ 239 - struct digi_dinfo { 240 - unsigned long dinfo_nboards; /* # boards configured */ 241 - char dinfo_reserved[12]; /* for future expansion */ 242 - char dinfo_version[16]; /* driver version */ 243 - }; 244 - 245 - #define DIGI_GETDD ('d'<<8) | 248 /* get driver info */ 246 - 247 - /************************************************************************ 248 - * Structure used with ioctl commands for per-board information 249 - * 250 - * physsize and memsize differ when board has "windowed" memory 251 - ************************************************************************/ 252 - struct digi_info { 253 - unsigned long info_bdnum; /* Board number (0 based) */ 254 - unsigned long info_ioport; /* io port address */ 255 - unsigned long info_physaddr; /* memory address */ 256 - unsigned long info_physsize; /* Size of host mem window */ 257 - unsigned long info_memsize; /* Amount of dual-port mem */ 258 - /* on board */ 259 - unsigned short info_bdtype; /* Board type */ 260 - unsigned short info_nports; /* number of ports */ 261 - char info_bdstate; /* board state */ 262 - char info_reserved[7]; /* for future expansion */ 263 - }; 264 - 265 - #define DIGI_GETBD ('d'<<8) | 249 /* get board info */ 266 - 267 - struct digi_stat { 268 - unsigned int info_chan; /* Channel number (0 based) */ 269 - unsigned int info_brd; /* Board number (0 based) */ 270 - unsigned long info_cflag; /* cflag for channel */ 271 - unsigned long info_iflag; /* iflag for channel */ 272 - unsigned long info_oflag; /* oflag for channel */ 273 - unsigned long info_mstat; /* mstat for channel */ 274 - unsigned long info_tx_data; /* tx_data for channel */ 275 - unsigned long info_rx_data; /* rx_data for channel */ 276 - unsigned long info_hflow; /* hflow for channel */ 277 - unsigned long info_reserved[8]; /* for future expansion */ 278 - }; 279 - 280 - #define DIGI_GETSTAT ('d'<<8) | 244 /* get board info */ 281 - /************************************************************************ 282 - * 283 - * Structure used with ioctl commands for per-channel information 284 - * 285 - ************************************************************************/ 286 - struct digi_ch { 287 - unsigned long info_bdnum; /* Board number (0 based) */ 288 - unsigned long info_channel; /* Channel index number */ 289 - unsigned long info_ch_cflag; /* Channel cflag */ 290 - unsigned long info_ch_iflag; /* Channel iflag */ 291 - unsigned long info_ch_oflag; /* Channel oflag */ 292 - unsigned long info_chsize; /* Channel structure size */ 293 - unsigned long info_sleep_stat; /* sleep status */ 294 - dev_t info_dev; /* device number */ 295 - unsigned char info_initstate; /* Channel init state */ 296 - unsigned char info_running; /* Channel running state */ 297 - long reserved[8]; /* reserved for future use */ 298 - }; 299 - 300 - /* 301 - * This structure is used with the DIGI_FEPCMD ioctl to 302 - * tell the driver which port to send the command for. 303 - */ 304 - struct digi_cmd { 305 - int cmd; 306 - int word; 307 - int ncmds; 308 - int chan; /* channel index (zero based) */ 309 - int bdid; /* board index (zero based) */ 310 - }; 311 - 312 - /* 313 - * info_sleep_stat defines 314 - */ 315 - #define INFO_RUNWAIT 0x0001 316 - #define INFO_WOPEN 0x0002 317 - #define INFO_TTIOW 0x0004 318 - #define INFO_CH_RWAIT 0x0008 319 - #define INFO_CH_WEMPTY 0x0010 320 - #define INFO_CH_WLOW 0x0020 321 - #define INFO_XXBUF_BUSY 0x0040 322 - 323 - #define DIGI_GETCH ('d'<<8) | 245 /* get board info */ 324 - 325 - /* Board type definitions */ 326 - 327 - #define SUBTYPE 0007 328 - #define T_PCXI 0000 329 - #define T_PCXM 0001 330 - #define T_PCXE 0002 331 - #define T_PCXR 0003 332 - #define T_SP 0004 333 - #define T_SP_PLUS 0005 334 - # define T_HERC 0000 335 - # define T_HOU 0001 336 - # define T_LON 0002 337 - # define T_CHA 0003 338 - #define FAMILY 0070 339 - #define T_COMXI 0000 340 - #define T_PCXX 0010 341 - #define T_CX 0020 342 - #define T_EPC 0030 343 - #define T_PCLITE 0040 344 - #define T_SPXX 0050 345 - #define T_AVXX 0060 346 - #define T_DXB 0070 347 - #define T_A2K_4_8 0070 348 - #define BUSTYPE 0700 349 - #define T_ISABUS 0000 350 - #define T_MCBUS 0100 351 - #define T_EISABUS 0200 352 - #define T_PCIBUS 0400 353 - 354 - /* Board State Definitions */ 355 - 356 - #define BD_RUNNING 0x0 357 - #define BD_REASON 0x7f 358 - #define BD_NOTFOUND 0x1 359 - #define BD_NOIOPORT 0x2 360 - #define BD_NOMEM 0x3 361 - #define BD_NOBIOS 0x4 362 - #define BD_NOFEP 0x5 363 - #define BD_FAILED 0x6 364 - #define BD_ALLOCATED 0x7 365 - #define BD_TRIBOOT 0x8 366 - #define BD_BADKME 0x80 367 - 368 - #define DIGI_LOOPBACK ('d'<<8) | 252 /* Enable/disable UART internal loopback */ 369 - #define DIGI_SPOLL ('d'<<8) | 254 /* change poller rate */ 370 - 371 - #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */ 372 - #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */ 373 - #define DIGI_RESET_PORT ('e'<<8) | 93 /* Reset port */ 374 - 375 - #endif /* DIGI_H */