| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /******************************************************************************* | 
|  | 2 | * | 
|  | 3 | *   (c) 1999 by Computone Corporation | 
|  | 4 | * | 
|  | 5 | ******************************************************************************** | 
|  | 6 | * | 
|  | 7 | * | 
|  | 8 | *   PACKAGE:     Linux tty Device Driver for IntelliPort II family of multiport | 
|  | 9 | *                serial I/O controllers. | 
|  | 10 | * | 
|  | 11 | *   DESCRIPTION: Definitions and support for In-line and Bypass commands. | 
|  | 12 | *                Applicable only when the standard loadware is active. | 
|  | 13 | * | 
|  | 14 | *******************************************************************************/ | 
|  | 15 | //------------------------------------------------------------------------------ | 
|  | 16 | // Revision History: | 
|  | 17 | // | 
|  | 18 | // 10 October 1991   MAG First Draft | 
|  | 19 | //  7 November 1991  MAG Reflects some new commands | 
|  | 20 | // 20 February 1992  MAG CMD_HOTACK corrected: no argument. | 
|  | 21 | // 24 February 1992  MAG Support added for new commands for 1.4.x loadware. | 
|  | 22 | // 11 March 1992     MAG Additional commands. | 
|  | 23 | // 16 March 1992     MAG Additional commands. | 
|  | 24 | // 30 March 1992     MAG Additional command: CMD_DSS_NOW | 
|  | 25 | // 18 May   1992     MAG Changed CMD_OPOST | 
|  | 26 | // | 
|  | 27 | //------------------------------------------------------------------------------ | 
|  | 28 | #ifndef I2CMD_H      // To prevent multiple includes | 
|  | 29 | #define I2CMD_H   1 | 
|  | 30 |  | 
|  | 31 | #include "ip2types.h" | 
|  | 32 |  | 
|  | 33 | // This module is designed to provide a uniform method of sending commands to | 
|  | 34 | // the board through command packets. The difficulty is, some commands take | 
|  | 35 | // parameters, others do not. Furthermore, it is often useful to send several | 
|  | 36 | // commands to the same channel as part of the same packet. (See also i2pack.h.) | 
|  | 37 | // | 
|  | 38 | // This module is designed so that the caller should not be responsible for | 
|  | 39 | // remembering the exact syntax of each command, or at least so that the | 
|  | 40 | // compiler could check things somewhat. I'll explain as we go... | 
|  | 41 | // | 
|  | 42 | // First, a structure which can embody the syntax of each type of command. | 
|  | 43 | // | 
|  | 44 | typedef struct _cmdSyntax | 
|  | 45 | { | 
|  | 46 | UCHAR length;   // Number of bytes in the command | 
|  | 47 | UCHAR flags;    // Information about the command (see below) | 
|  | 48 |  | 
|  | 49 | // The command and its parameters, which may be of arbitrary length. Don't | 
|  | 50 | // worry yet how the parameters will be initialized; macros later take care | 
|  | 51 | // of it. Also, don't worry about the arbitrary length issue; this structure | 
|  | 52 | // is never used to allocate space (see i2cmd.c). | 
|  | 53 | UCHAR cmd[2]; | 
|  | 54 | } cmdSyntax, *cmdSyntaxPtr; | 
|  | 55 |  | 
|  | 56 | // Bit assignments for flags | 
|  | 57 |  | 
|  | 58 | #define INL 1           // Set if suitable for inline commands | 
|  | 59 | #define BYP 2           // Set if suitable for bypass commands | 
|  | 60 | #define BTH (INL|BYP)   // suitable for either! | 
|  | 61 | #define END 4           // Set if this must be the last command in a block | 
|  | 62 | #define VIP 8           // Set if this command is special in some way and really | 
|  | 63 | // should only be sent from the library-level and not | 
|  | 64 | // directly from user-level | 
|  | 65 | #define VAR 0x10        // This command is of variable length! | 
|  | 66 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | // Declarations for the global arrays used to bear the commands and their | 
|  | 68 | // arguments. | 
|  | 69 | // | 
|  | 70 | // Note: Since these are globals and the arguments might change, it is important | 
|  | 71 | // that the library routine COPY these into buffers from whence they would be | 
|  | 72 | // sent, rather than merely storing the pointers. In multi-threaded | 
|  | 73 | // environments, important that the copy should obtain before any context switch | 
|  | 74 | // is allowed. Also, for parameterized commands, DO NOT ISSUE THE SAME COMMAND | 
|  | 75 | // MORE THAN ONCE WITH THE SAME PARAMETERS in the same call. | 
|  | 76 | // | 
|  | 77 | static UCHAR ct02[]; | 
|  | 78 | static UCHAR ct03[]; | 
|  | 79 | static UCHAR ct04[]; | 
|  | 80 | static UCHAR ct05[]; | 
|  | 81 | static UCHAR ct06[]; | 
|  | 82 | static UCHAR ct07[]; | 
|  | 83 | static UCHAR ct08[]; | 
|  | 84 | static UCHAR ct09[]; | 
|  | 85 | static UCHAR ct10[]; | 
|  | 86 | static UCHAR ct11[]; | 
|  | 87 | static UCHAR ct12[]; | 
|  | 88 | static UCHAR ct13[]; | 
|  | 89 | static UCHAR ct14[]; | 
|  | 90 | static UCHAR ct15[]; | 
|  | 91 | static UCHAR ct16[]; | 
|  | 92 | static UCHAR ct17[]; | 
|  | 93 | static UCHAR ct18[]; | 
|  | 94 | static UCHAR ct19[]; | 
|  | 95 | static UCHAR ct20[]; | 
|  | 96 | static UCHAR ct21[]; | 
|  | 97 | static UCHAR ct22[]; | 
|  | 98 | static UCHAR ct23[]; | 
|  | 99 | static UCHAR ct24[]; | 
|  | 100 | static UCHAR ct25[]; | 
|  | 101 | static UCHAR ct26[]; | 
|  | 102 | static UCHAR ct27[]; | 
|  | 103 | static UCHAR ct28[]; | 
|  | 104 | static UCHAR ct29[]; | 
|  | 105 | static UCHAR ct30[]; | 
|  | 106 | static UCHAR ct31[]; | 
|  | 107 | static UCHAR ct32[]; | 
|  | 108 | static UCHAR ct33[]; | 
|  | 109 | static UCHAR ct34[]; | 
|  | 110 | static UCHAR ct35[]; | 
|  | 111 | static UCHAR ct36[]; | 
|  | 112 | static UCHAR ct36a[]; | 
|  | 113 | static UCHAR ct41[]; | 
|  | 114 | static UCHAR ct42[]; | 
|  | 115 | static UCHAR ct43[]; | 
|  | 116 | static UCHAR ct44[]; | 
|  | 117 | static UCHAR ct45[]; | 
|  | 118 | static UCHAR ct46[]; | 
|  | 119 | static UCHAR ct48[]; | 
|  | 120 | static UCHAR ct49[]; | 
|  | 121 | static UCHAR ct50[]; | 
|  | 122 | static UCHAR ct51[]; | 
|  | 123 | static UCHAR ct52[]; | 
|  | 124 | static UCHAR ct56[]; | 
|  | 125 | static UCHAR ct57[]; | 
|  | 126 | static UCHAR ct58[]; | 
|  | 127 | static UCHAR ct59[]; | 
|  | 128 | static UCHAR ct60[]; | 
|  | 129 | static UCHAR ct61[]; | 
|  | 130 | static UCHAR ct62[]; | 
|  | 131 | static UCHAR ct63[]; | 
|  | 132 | static UCHAR ct64[]; | 
|  | 133 | static UCHAR ct65[]; | 
|  | 134 | static UCHAR ct66[]; | 
|  | 135 | static UCHAR ct67[]; | 
|  | 136 | static UCHAR ct68[]; | 
|  | 137 | static UCHAR ct69[]; | 
|  | 138 | static UCHAR ct70[]; | 
|  | 139 | static UCHAR ct71[]; | 
|  | 140 | static UCHAR ct72[]; | 
|  | 141 | static UCHAR ct73[]; | 
|  | 142 | static UCHAR ct74[]; | 
|  | 143 | static UCHAR ct75[]; | 
|  | 144 | static UCHAR ct76[]; | 
|  | 145 | static UCHAR ct77[]; | 
|  | 146 | static UCHAR ct78[]; | 
|  | 147 | static UCHAR ct79[]; | 
|  | 148 | static UCHAR ct80[]; | 
|  | 149 | static UCHAR ct81[]; | 
|  | 150 | static UCHAR ct82[]; | 
|  | 151 | static UCHAR ct83[]; | 
|  | 152 | static UCHAR ct84[]; | 
|  | 153 | static UCHAR ct85[]; | 
|  | 154 | static UCHAR ct86[]; | 
|  | 155 | static UCHAR ct87[]; | 
|  | 156 | static UCHAR ct88[]; | 
|  | 157 | static UCHAR ct89[]; | 
|  | 158 | static UCHAR ct90[]; | 
|  | 159 | static UCHAR ct91[]; | 
|  | 160 | static UCHAR cc01[]; | 
|  | 161 | static UCHAR cc02[]; | 
|  | 162 |  | 
|  | 163 | // Now, refer to i2cmd.c, and see the character arrays defined there. They are | 
|  | 164 | // cast here to cmdSyntaxPtr. | 
|  | 165 | // | 
|  | 166 | // There are library functions for issuing bypass or inline commands. These | 
|  | 167 | // functions take one or more arguments of the type cmdSyntaxPtr. The routine | 
|  | 168 | // then can figure out how long each command is supposed to be and easily add it | 
|  | 169 | // to the list. | 
|  | 170 | // | 
|  | 171 | // For ease of use, we define manifests which return pointers to appropriate | 
|  | 172 | // cmdSyntaxPtr things. But some commands also take arguments. If a single | 
|  | 173 | // argument is used, we define a macro which performs the single assignment and | 
|  | 174 | // (through the expedient of a comma expression) references the appropriate | 
|  | 175 | // pointer. For commands requiring several arguments, we actually define a | 
|  | 176 | // function to perform the assignments. | 
|  | 177 |  | 
|  | 178 | #define CMD_DTRUP	(cmdSyntaxPtr)(ct02)	// Raise DTR | 
|  | 179 | #define CMD_DTRDN	(cmdSyntaxPtr)(ct03)	// Lower DTR | 
|  | 180 | #define CMD_RTSUP	(cmdSyntaxPtr)(ct04)	// Raise RTS | 
|  | 181 | #define CMD_RTSDN	(cmdSyntaxPtr)(ct05)	// Lower RTS | 
|  | 182 | #define CMD_STARTFL	(cmdSyntaxPtr)(ct06)	// Start Flushing Data | 
|  | 183 |  | 
|  | 184 | #define CMD_DTRRTS_UP (cmdSyntaxPtr)(cc01)	// Raise DTR and RTS | 
|  | 185 | #define CMD_DTRRTS_DN (cmdSyntaxPtr)(cc02)	// Lower DTR and RTS | 
|  | 186 |  | 
|  | 187 | // Set Baud Rate for transmit and receive | 
|  | 188 | #define CMD_SETBAUD(arg) \ | 
|  | 189 | (((cmdSyntaxPtr)(ct07))->cmd[1] = (arg),(cmdSyntaxPtr)(ct07)) | 
|  | 190 |  | 
|  | 191 | #define CBR_50       1 | 
|  | 192 | #define CBR_75       2 | 
|  | 193 | #define CBR_110      3 | 
|  | 194 | #define CBR_134      4 | 
|  | 195 | #define CBR_150      5 | 
|  | 196 | #define CBR_200      6 | 
|  | 197 | #define CBR_300      7 | 
|  | 198 | #define CBR_600      8 | 
|  | 199 | #define CBR_1200     9 | 
|  | 200 | #define CBR_1800     10 | 
|  | 201 | #define CBR_2400     11 | 
|  | 202 | #define CBR_4800     12 | 
|  | 203 | #define CBR_9600     13 | 
|  | 204 | #define CBR_19200    14 | 
|  | 205 | #define CBR_38400    15 | 
|  | 206 | #define CBR_2000     16 | 
|  | 207 | #define CBR_3600     17 | 
|  | 208 | #define CBR_7200     18 | 
|  | 209 | #define CBR_56000    19 | 
|  | 210 | #define CBR_57600    20 | 
|  | 211 | #define CBR_64000    21 | 
|  | 212 | #define CBR_76800    22 | 
|  | 213 | #define CBR_115200   23 | 
|  | 214 | #define CBR_C1       24    // Custom baud rate 1 | 
|  | 215 | #define CBR_C2       25    // Custom baud rate 2 | 
|  | 216 | #define CBR_153600   26 | 
|  | 217 | #define CBR_230400   27 | 
|  | 218 | #define CBR_307200   28 | 
|  | 219 | #define CBR_460800   29 | 
|  | 220 | #define CBR_921600   30 | 
|  | 221 |  | 
|  | 222 | // Set Character size | 
|  | 223 | // | 
|  | 224 | #define CMD_SETBITS(arg) \ | 
|  | 225 | (((cmdSyntaxPtr)(ct08))->cmd[1] = (arg),(cmdSyntaxPtr)(ct08)) | 
|  | 226 |  | 
|  | 227 | #define CSZ_5  0 | 
|  | 228 | #define CSZ_6  1 | 
|  | 229 | #define CSZ_7  2 | 
|  | 230 | #define CSZ_8  3 | 
|  | 231 |  | 
|  | 232 | // Set number of stop bits | 
|  | 233 | // | 
|  | 234 | #define CMD_SETSTOP(arg) \ | 
|  | 235 | (((cmdSyntaxPtr)(ct09))->cmd[1] = (arg),(cmdSyntaxPtr)(ct09)) | 
|  | 236 |  | 
|  | 237 | #define CST_1  0 | 
|  | 238 | #define CST_15 1  // 1.5 stop bits | 
|  | 239 | #define CST_2  2 | 
|  | 240 |  | 
|  | 241 | // Set parity option | 
|  | 242 | // | 
|  | 243 | #define CMD_SETPAR(arg) \ | 
|  | 244 | (((cmdSyntaxPtr)(ct10))->cmd[1] = (arg),(cmdSyntaxPtr)(ct10)) | 
|  | 245 |  | 
|  | 246 | #define CSP_NP 0  // no parity | 
|  | 247 | #define CSP_OD 1  // odd parity | 
|  | 248 | #define CSP_EV 2  // Even parity | 
|  | 249 | #define CSP_SP 3  // Space parity | 
|  | 250 | #define CSP_MK 4  // Mark parity | 
|  | 251 |  | 
|  | 252 | // Define xon char for transmitter flow control | 
|  | 253 | // | 
|  | 254 | #define CMD_DEF_IXON(arg) \ | 
|  | 255 | (((cmdSyntaxPtr)(ct11))->cmd[1] = (arg),(cmdSyntaxPtr)(ct11)) | 
|  | 256 |  | 
|  | 257 | // Define xoff char for transmitter flow control | 
|  | 258 | // | 
|  | 259 | #define CMD_DEF_IXOFF(arg) \ | 
|  | 260 | (((cmdSyntaxPtr)(ct12))->cmd[1] = (arg),(cmdSyntaxPtr)(ct12)) | 
|  | 261 |  | 
|  | 262 | #define CMD_STOPFL   (cmdSyntaxPtr)(ct13) // Stop Flushing data | 
|  | 263 |  | 
|  | 264 | // Acknowledge receipt of hotkey signal | 
|  | 265 | // | 
|  | 266 | #define CMD_HOTACK   (cmdSyntaxPtr)(ct14) | 
|  | 267 |  | 
|  | 268 | // Define irq level to use. Should actually be sent by library-level code, not | 
|  | 269 | // directly from user... | 
|  | 270 | // | 
|  | 271 | #define CMDVALUE_IRQ 15 // For library use at initialization. Until this command | 
|  | 272 | // is sent, board processing doesn't really start. | 
|  | 273 | #define CMD_SET_IRQ(arg) \ | 
|  | 274 | (((cmdSyntaxPtr)(ct15))->cmd[1] = (arg),(cmdSyntaxPtr)(ct15)) | 
|  | 275 |  | 
|  | 276 | #define CIR_POLL  0  // No IRQ - Poll | 
|  | 277 | #define CIR_3     3  // IRQ 3 | 
|  | 278 | #define CIR_4     4  // IRQ 4 | 
|  | 279 | #define CIR_5     5  // IRQ 5 | 
|  | 280 | #define CIR_7     7  // IRQ 7 | 
|  | 281 | #define CIR_10    10 // IRQ 10 | 
|  | 282 | #define CIR_11    11 // IRQ 11 | 
|  | 283 | #define CIR_12    12 // IRQ 12 | 
|  | 284 | #define CIR_15    15 // IRQ 15 | 
|  | 285 |  | 
|  | 286 | // Select transmit flow xon/xoff options | 
|  | 287 | // | 
|  | 288 | #define CMD_IXON_OPT(arg) \ | 
|  | 289 | (((cmdSyntaxPtr)(ct16))->cmd[1] = (arg),(cmdSyntaxPtr)(ct16)) | 
|  | 290 |  | 
|  | 291 | #define CIX_NONE  0  // Incoming Xon/Xoff characters not special | 
|  | 292 | #define CIX_XON   1  // Xoff disable, Xon enable | 
|  | 293 | #define CIX_XANY  2  // Xoff disable, any key enable | 
|  | 294 |  | 
|  | 295 | // Select receive flow xon/xoff options | 
|  | 296 | // | 
|  | 297 | #define CMD_OXON_OPT(arg) \ | 
|  | 298 | (((cmdSyntaxPtr)(ct17))->cmd[1] = (arg),(cmdSyntaxPtr)(ct17)) | 
|  | 299 |  | 
|  | 300 | #define COX_NONE  0  // Don't send Xon/Xoff | 
|  | 301 | #define COX_XON   1  // Send xon/xoff to start/stop incoming data | 
|  | 302 |  | 
|  | 303 |  | 
|  | 304 | #define CMD_CTS_REP  (cmdSyntaxPtr)(ct18) // Enable  CTS reporting | 
|  | 305 | #define CMD_CTS_NREP (cmdSyntaxPtr)(ct19) // Disable CTS reporting | 
|  | 306 |  | 
|  | 307 | #define CMD_DCD_REP  (cmdSyntaxPtr)(ct20) // Enable  DCD reporting | 
|  | 308 | #define CMD_DCD_NREP (cmdSyntaxPtr)(ct21) // Disable DCD reporting | 
|  | 309 |  | 
|  | 310 | #define CMD_DSR_REP  (cmdSyntaxPtr)(ct22) // Enable  DSR reporting | 
|  | 311 | #define CMD_DSR_NREP (cmdSyntaxPtr)(ct23) // Disable DSR reporting | 
|  | 312 |  | 
|  | 313 | #define CMD_RI_REP   (cmdSyntaxPtr)(ct24) // Enable  RI  reporting | 
|  | 314 | #define CMD_RI_NREP  (cmdSyntaxPtr)(ct25) // Disable RI  reporting | 
|  | 315 |  | 
|  | 316 | // Enable break reporting and select style | 
|  | 317 | // | 
|  | 318 | #define CMD_BRK_REP(arg) \ | 
|  | 319 | (((cmdSyntaxPtr)(ct26))->cmd[1] = (arg),(cmdSyntaxPtr)(ct26)) | 
|  | 320 |  | 
|  | 321 | #define CBK_STAT     0x00  // Report breaks as a status (exception,irq) | 
|  | 322 | #define CBK_NULL     0x01  // Report breaks as a good null | 
|  | 323 | #define CBK_STAT_SEQ 0x02  // Report breaks as a status AND as in-band character | 
|  | 324 | //  sequence FFh, 01h, 10h | 
|  | 325 | #define CBK_SEQ      0x03  // Report breaks as the in-band | 
|  | 326 | //sequence FFh, 01h, 10h ONLY. | 
|  | 327 | #define CBK_FLSH     0x04  // if this bit set also flush input data | 
|  | 328 | #define CBK_POSIX    0x08  // if this bit set report as FF,0,0 sequence | 
|  | 329 | #define CBK_SINGLE   0x10  // if this bit set with CBK_SEQ or CBK_STAT_SEQ | 
|  | 330 | //then reports single null instead of triple | 
|  | 331 |  | 
|  | 332 | #define CMD_BRK_NREP (cmdSyntaxPtr)(ct27) // Disable break reporting | 
|  | 333 |  | 
|  | 334 | // Specify maximum block size for received data | 
|  | 335 | // | 
|  | 336 | #define CMD_MAX_BLOCK(arg) \ | 
|  | 337 | (((cmdSyntaxPtr)(ct28))->cmd[1] = (arg),(cmdSyntaxPtr)(ct28)) | 
|  | 338 |  | 
|  | 339 | // -- COMMAND 29 is reserved -- | 
|  | 340 |  | 
|  | 341 | #define CMD_CTSFL_ENAB  (cmdSyntaxPtr)(ct30) // Enable  CTS flow control | 
|  | 342 | #define CMD_CTSFL_DSAB  (cmdSyntaxPtr)(ct31) // Disable CTS flow control | 
|  | 343 | #define CMD_RTSFL_ENAB  (cmdSyntaxPtr)(ct32) // Enable  RTS flow control | 
|  | 344 | #define CMD_RTSFL_DSAB  (cmdSyntaxPtr)(ct33) // Disable RTS flow control | 
|  | 345 |  | 
|  | 346 | // Specify istrip option | 
|  | 347 | // | 
|  | 348 | #define CMD_ISTRIP_OPT(arg) \ | 
|  | 349 | (((cmdSyntaxPtr)(ct34))->cmd[1] = (arg),(cmdSyntaxPtr)(ct34)) | 
|  | 350 |  | 
|  | 351 | #define CIS_NOSTRIP  0  // Strip characters to character size | 
|  | 352 | #define CIS_STRIP    1  // Strip any 8-bit characters to 7 bits | 
|  | 353 |  | 
|  | 354 | // Send a break of arg milliseconds | 
|  | 355 | // | 
|  | 356 | #define CMD_SEND_BRK(arg) \ | 
|  | 357 | (((cmdSyntaxPtr)(ct35))->cmd[1] = (arg),(cmdSyntaxPtr)(ct35)) | 
|  | 358 |  | 
|  | 359 | // Set error reporting mode | 
|  | 360 | // | 
|  | 361 | #define CMD_SET_ERROR(arg) \ | 
|  | 362 | (((cmdSyntaxPtr)(ct36))->cmd[1] = (arg),(cmdSyntaxPtr)(ct36)) | 
|  | 363 |  | 
|  | 364 | #define CSE_ESTAT 0  // Report error in a status packet | 
|  | 365 | #define CSE_NOREP 1  // Treat character as though it were good | 
|  | 366 | #define CSE_DROP  2  // Discard the character | 
|  | 367 | #define CSE_NULL  3  // Replace with a null | 
|  | 368 | #define CSE_MARK  4  // Replace with a 3-character sequence (as Unix) | 
|  | 369 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | #define CSE_REPLACE  0x8	// Replace the errored character with the | 
|  | 371 | // replacement character defined here | 
|  | 372 |  | 
|  | 373 | #define CSE_STAT_REPLACE   0x18	// Replace the errored character with the | 
|  | 374 | // replacement character defined here AND | 
|  | 375 | // report the error as a status packet (as in | 
|  | 376 | // CSE_ESTAT). | 
|  | 377 |  | 
|  | 378 |  | 
|  | 379 | // COMMAND 37, to send flow control packets, is handled only by low-level | 
|  | 380 | // library code in response to data movement and shouldn't ever be sent by the | 
|  | 381 | // user code. See i2pack.h and the body of i2lib.c for details. | 
|  | 382 |  | 
|  | 383 | // Enable on-board post-processing, using options given in oflag argument. | 
|  | 384 | // Formerly, this command was automatically preceded by a CMD_OPOST_OFF command | 
|  | 385 | // because the loadware does not permit sending back-to-back CMD_OPOST_ON | 
|  | 386 | // commands without an intervening CMD_OPOST_OFF. BUT, WE LEARN 18 MAY 92, that | 
|  | 387 | // CMD_OPOST_ON and CMD_OPOST_OFF must each be at the end of a packet (or in a | 
|  | 388 | // solo packet). This means the caller must specify separately CMD_OPOST_OFF, | 
|  | 389 | // CMD_OPOST_ON(parm) when he calls i2QueueCommands(). That function will ensure | 
|  | 390 | // each gets a separate packet. Extra CMD_OPOST_OFF's are always ok. | 
|  | 391 | // | 
|  | 392 | #define CMD_OPOST_ON(oflag)   \ | 
|  | 393 | (*(USHORT *)(((cmdSyntaxPtr)(ct39))->cmd[1]) = (oflag), \ | 
|  | 394 | (cmdSyntaxPtr)(ct39)) | 
|  | 395 |  | 
|  | 396 | #define CMD_OPOST_OFF   (cmdSyntaxPtr)(ct40) // Disable on-board post-proc | 
|  | 397 |  | 
|  | 398 | #define CMD_RESUME   (cmdSyntaxPtr)(ct41)	// Resume: behave as though an XON | 
|  | 399 | // were received; | 
|  | 400 |  | 
|  | 401 | // Set Transmit baud rate (see command 7 for arguments) | 
|  | 402 | // | 
|  | 403 | #define CMD_SETBAUD_TX(arg) \ | 
|  | 404 | (((cmdSyntaxPtr)(ct42))->cmd[1] = (arg),(cmdSyntaxPtr)(ct42)) | 
|  | 405 |  | 
|  | 406 | // Set Receive baud rate (see command 7 for arguments) | 
|  | 407 | // | 
|  | 408 | #define CMD_SETBAUD_RX(arg) \ | 
|  | 409 | (((cmdSyntaxPtr)(ct43))->cmd[1] = (arg),(cmdSyntaxPtr)(ct43)) | 
|  | 410 |  | 
|  | 411 | // Request interrupt from board each arg milliseconds. Interrupt will specify | 
|  | 412 | // "received data", even though there may be no data present. If arg == 0, | 
|  | 413 | // disables any such interrupts. | 
|  | 414 | // | 
|  | 415 | #define CMD_PING_REQ(arg) \ | 
|  | 416 | (((cmdSyntaxPtr)(ct44))->cmd[1] = (arg),(cmdSyntaxPtr)(ct44)) | 
|  | 417 |  | 
|  | 418 | #define CMD_HOT_ENAB (cmdSyntaxPtr)(ct45) // Enable Hot-key checking | 
|  | 419 | #define CMD_HOT_DSAB (cmdSyntaxPtr)(ct46) // Disable Hot-key checking | 
|  | 420 |  | 
| Adrian Bunk | 995c6ed | 2005-06-25 14:59:16 -0700 | [diff] [blame] | 421 | #if 0 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 422 | // COMMAND 47: Send Protocol info via Unix flags: | 
|  | 423 | // iflag = Unix tty t_iflag | 
|  | 424 | // cflag = Unix tty t_cflag | 
|  | 425 | // lflag = Unix tty t_lflag | 
|  | 426 | // See System V Unix/Xenix documentation for the meanings of the bit fields | 
|  | 427 | // within these flags | 
|  | 428 | // | 
|  | 429 | #define CMD_UNIX_FLAGS(iflag,cflag,lflag) i2cmdUnixFlags(iflag,cflag,lflag) | 
| Adrian Bunk | 995c6ed | 2005-06-25 14:59:16 -0700 | [diff] [blame] | 430 | #endif  /*  0  */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 431 |  | 
|  | 432 | #define CMD_DSRFL_ENAB  (cmdSyntaxPtr)(ct48) // Enable  DSR receiver ctrl | 
|  | 433 | #define CMD_DSRFL_DSAB  (cmdSyntaxPtr)(ct49) // Disable DSR receiver ctrl | 
|  | 434 | #define CMD_DTRFL_ENAB  (cmdSyntaxPtr)(ct50) // Enable  DTR flow control | 
|  | 435 | #define CMD_DTRFL_DSAB  (cmdSyntaxPtr)(ct51) // Disable DTR flow control | 
|  | 436 | #define CMD_BAUD_RESET  (cmdSyntaxPtr)(ct52) // Reset baudrate table | 
|  | 437 |  | 
|  | 438 | // COMMAND 54: Define custom rate #1 | 
|  | 439 | // rate = (short) 1/10 of the desired baud rate | 
|  | 440 | // | 
|  | 441 | #define CMD_BAUD_DEF1(rate) i2cmdBaudDef(1,rate) | 
|  | 442 |  | 
|  | 443 | // COMMAND 55: Define custom rate #2 | 
|  | 444 | // rate = (short) 1/10 of the desired baud rate | 
|  | 445 | // | 
|  | 446 | #define CMD_BAUD_DEF2(rate) i2cmdBaudDef(2,rate) | 
|  | 447 |  | 
|  | 448 | // Pause arg hundredths of seconds. (Note, this is NOT milliseconds.) | 
|  | 449 | // | 
|  | 450 | #define CMD_PAUSE(arg) \ | 
|  | 451 | (((cmdSyntaxPtr)(ct56))->cmd[1] = (arg),(cmdSyntaxPtr)(ct56)) | 
|  | 452 |  | 
|  | 453 | #define CMD_SUSPEND     (cmdSyntaxPtr)(ct57) // Suspend output | 
|  | 454 | #define CMD_UNSUSPEND   (cmdSyntaxPtr)(ct58) // Un-Suspend output | 
|  | 455 |  | 
|  | 456 | // Set parity-checking options | 
|  | 457 | // | 
|  | 458 | #define CMD_PARCHK(arg) \ | 
|  | 459 | (((cmdSyntaxPtr)(ct59))->cmd[1] = (arg),(cmdSyntaxPtr)(ct59)) | 
|  | 460 |  | 
|  | 461 | #define CPK_ENAB  0     // Enable parity checking on input | 
|  | 462 | #define CPK_DSAB  1     // Disable parity checking on input | 
|  | 463 |  | 
|  | 464 | #define CMD_BMARK_REQ   (cmdSyntaxPtr)(ct60) // Bookmark request | 
|  | 465 |  | 
|  | 466 |  | 
|  | 467 | // Enable/Disable internal loopback mode | 
|  | 468 | // | 
|  | 469 | #define CMD_INLOOP(arg) \ | 
|  | 470 | (((cmdSyntaxPtr)(ct61))->cmd[1] = (arg),(cmdSyntaxPtr)(ct61)) | 
|  | 471 |  | 
|  | 472 | #define CIN_DISABLE  0  // Normal operation (default) | 
|  | 473 | #define CIN_ENABLE   1  // Internal (local) loopback | 
|  | 474 | #define CIN_REMOTE   2  // Remote loopback | 
|  | 475 |  | 
|  | 476 | // Specify timeout for hotkeys: Delay will be (arg x 10) milliseconds, arg == 0 | 
|  | 477 | // --> no timeout: wait forever. | 
|  | 478 | // | 
|  | 479 | #define CMD_HOT_TIME(arg) \ | 
|  | 480 | (((cmdSyntaxPtr)(ct62))->cmd[1] = (arg),(cmdSyntaxPtr)(ct62)) | 
|  | 481 |  | 
|  | 482 |  | 
|  | 483 | // Define (outgoing) xon for receive flow control | 
|  | 484 | // | 
|  | 485 | #define CMD_DEF_OXON(arg) \ | 
|  | 486 | (((cmdSyntaxPtr)(ct63))->cmd[1] = (arg),(cmdSyntaxPtr)(ct63)) | 
|  | 487 |  | 
|  | 488 | // Define (outgoing) xoff for receiver flow control | 
|  | 489 | // | 
|  | 490 | #define CMD_DEF_OXOFF(arg) \ | 
|  | 491 | (((cmdSyntaxPtr)(ct64))->cmd[1] = (arg),(cmdSyntaxPtr)(ct64)) | 
|  | 492 |  | 
|  | 493 | // Enable/Disable RTS on transmit (1/2 duplex-style) | 
|  | 494 | // | 
|  | 495 | #define CMD_RTS_XMIT(arg) \ | 
|  | 496 | (((cmdSyntaxPtr)(ct65))->cmd[1] = (arg),(cmdSyntaxPtr)(ct65)) | 
|  | 497 |  | 
|  | 498 | #define CHD_DISABLE  0 | 
|  | 499 | #define CHD_ENABLE   1 | 
|  | 500 |  | 
|  | 501 | // Set high-water-mark level (debugging use only) | 
|  | 502 | // | 
|  | 503 | #define CMD_SETHIGHWAT(arg) \ | 
|  | 504 | (((cmdSyntaxPtr)(ct66))->cmd[1] = (arg),(cmdSyntaxPtr)(ct66)) | 
|  | 505 |  | 
|  | 506 | // Start flushing tagged data (tag = 0-14) | 
|  | 507 | // | 
|  | 508 | #define CMD_START_SELFL(tag) \ | 
|  | 509 | (((cmdSyntaxPtr)(ct67))->cmd[1] = (tag),(cmdSyntaxPtr)(ct67)) | 
|  | 510 |  | 
|  | 511 | // End flushing tagged data (tag = 0-14) | 
|  | 512 | // | 
|  | 513 | #define CMD_END_SELFL(tag) \ | 
|  | 514 | (((cmdSyntaxPtr)(ct68))->cmd[1] = (tag),(cmdSyntaxPtr)(ct68)) | 
|  | 515 |  | 
|  | 516 | #define CMD_HWFLOW_OFF  (cmdSyntaxPtr)(ct69) // Disable HW TX flow control | 
|  | 517 | #define CMD_ODSRFL_ENAB (cmdSyntaxPtr)(ct70) // Enable DSR output f/c | 
|  | 518 | #define CMD_ODSRFL_DSAB (cmdSyntaxPtr)(ct71) // Disable DSR output f/c | 
|  | 519 | #define CMD_ODCDFL_ENAB (cmdSyntaxPtr)(ct72) // Enable DCD output f/c | 
|  | 520 | #define CMD_ODCDFL_DSAB (cmdSyntaxPtr)(ct73) // Disable DCD output f/c | 
|  | 521 |  | 
|  | 522 | // Set transmit interrupt load level. Count should be an even value 2-12 | 
|  | 523 | // | 
|  | 524 | #define CMD_LOADLEVEL(count) \ | 
|  | 525 | (((cmdSyntaxPtr)(ct74))->cmd[1] = (count),(cmdSyntaxPtr)(ct74)) | 
|  | 526 |  | 
|  | 527 | // If reporting DSS changes, map to character sequence FFh, 2, MSR | 
|  | 528 | // | 
|  | 529 | #define CMD_STATDATA(arg) \ | 
|  | 530 | (((cmdSyntaxPtr)(ct75))->cmd[1] = (arg),(cmdSyntaxPtr)(ct75)) | 
|  | 531 |  | 
|  | 532 | #define CSTD_DISABLE// Report DSS changes as status packets only (default) | 
|  | 533 | #define CSTD_ENABLE	// Report DSS changes as in-band data sequence as well as | 
|  | 534 | // by status packet. | 
|  | 535 |  | 
|  | 536 | #define CMD_BREAK_ON    (cmdSyntaxPtr)(ct76)// Set break and stop xmit | 
|  | 537 | #define CMD_BREAK_OFF   (cmdSyntaxPtr)(ct77)// End break and restart xmit | 
|  | 538 | #define CMD_GETFC       (cmdSyntaxPtr)(ct78)// Request for flow control packet | 
|  | 539 | // from board. | 
|  | 540 |  | 
|  | 541 | // Transmit this character immediately | 
|  | 542 | // | 
|  | 543 | #define CMD_XMIT_NOW(ch) \ | 
|  | 544 | (((cmdSyntaxPtr)(ct79))->cmd[1] = (ch),(cmdSyntaxPtr)(ct79)) | 
|  | 545 |  | 
|  | 546 | // Set baud rate via "divisor latch" | 
|  | 547 | // | 
|  | 548 | #define CMD_DIVISOR_LATCH(which,value) \ | 
|  | 549 | (((cmdSyntaxPtr)(ct80))->cmd[1] = (which), \ | 
|  | 550 | *(USHORT *)(((cmdSyntaxPtr)(ct80))->cmd[2]) = (value), \ | 
|  | 551 | (cmdSyntaxPtr)(ct80)) | 
|  | 552 |  | 
|  | 553 | #define CDL_RX 1	// Set receiver rate | 
|  | 554 | #define CDL_TX 2	// Set transmit rate | 
|  | 555 | // (CDL_TX | CDL_RX) Set both rates | 
|  | 556 |  | 
|  | 557 | // Request for special diagnostic status pkt from the board. | 
|  | 558 | // | 
|  | 559 | #define CMD_GET_STATUS (cmdSyntaxPtr)(ct81) | 
|  | 560 |  | 
|  | 561 | // Request time-stamped transmit character count packet. | 
|  | 562 | // | 
|  | 563 | #define CMD_GET_TXCNT  (cmdSyntaxPtr)(ct82) | 
|  | 564 |  | 
|  | 565 | // Request time-stamped receive character count packet. | 
|  | 566 | // | 
|  | 567 | #define CMD_GET_RXCNT  (cmdSyntaxPtr)(ct83) | 
|  | 568 |  | 
|  | 569 | // Request for box/board I.D. packet. | 
|  | 570 | #define CMD_GET_BOXIDS (cmdSyntaxPtr)(ct84) | 
|  | 571 |  | 
|  | 572 | // Enable or disable multiple channels according to bit-mapped ushorts box 1-4 | 
|  | 573 | // | 
|  | 574 | #define CMD_ENAB_MULT(enable, box1, box2, box3, box4)    \ | 
|  | 575 | (((cmdSytaxPtr)(ct85))->cmd[1] = (enable),            \ | 
|  | 576 | *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[2]) = (box1), \ | 
|  | 577 | *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[4]) = (box2), \ | 
|  | 578 | *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[6]) = (box3), \ | 
|  | 579 | *(USHORT *)(((cmdSyntaxPtr)(ct85))->cmd[8]) = (box4), \ | 
|  | 580 | (cmdSyntaxPtr)(ct85)) | 
|  | 581 |  | 
|  | 582 | #define CEM_DISABLE  0 | 
|  | 583 | #define CEM_ENABLE   1 | 
|  | 584 |  | 
|  | 585 | // Enable or disable receiver or receiver interrupts (default both enabled) | 
|  | 586 | // | 
|  | 587 | #define CMD_RCV_ENABLE(ch) \ | 
|  | 588 | (((cmdSyntaxPtr)(ct86))->cmd[1] = (ch),(cmdSyntaxPtr)(ct86)) | 
|  | 589 |  | 
|  | 590 | #define CRE_OFF      0  // Disable the receiver | 
|  | 591 | #define CRE_ON       1  // Enable the receiver | 
|  | 592 | #define CRE_INTOFF   2  // Disable receiver interrupts (to loadware) | 
|  | 593 | #define CRE_INTON    3  // Enable receiver interrupts (to loadware) | 
|  | 594 |  | 
|  | 595 | // Starts up a hardware test process, which runs transparently, and sends a | 
|  | 596 | // STAT_HWFAIL packet in case a hardware failure is detected. | 
|  | 597 | // | 
|  | 598 | #define CMD_HW_TEST  (cmdSyntaxPtr)(ct87) | 
|  | 599 |  | 
|  | 600 | // Change receiver threshold and timeout value: | 
|  | 601 | // Defaults: timeout = 20mS | 
|  | 602 | // threshold count = 8 when DTRflow not in use, | 
|  | 603 | // threshold count = 5 when DTRflow in use. | 
|  | 604 | // | 
|  | 605 | #define CMD_RCV_THRESHOLD(count,ms) \ | 
|  | 606 | (((cmdSyntaxPtr)(ct88))->cmd[1] = (count), \ | 
|  | 607 | ((cmdSyntaxPtr)(ct88))->cmd[2] = (ms), \ | 
|  | 608 | (cmdSyntaxPtr)(ct88)) | 
|  | 609 |  | 
|  | 610 | // Makes the loadware report DSS signals for this channel immediately. | 
|  | 611 | // | 
|  | 612 | #define CMD_DSS_NOW (cmdSyntaxPtr)(ct89) | 
|  | 613 |  | 
|  | 614 | // Set the receive silo parameters | 
|  | 615 | // 	timeout is ms idle wait until delivery       (~VTIME) | 
|  | 616 | // 	threshold is max characters cause interrupt  (~VMIN) | 
|  | 617 | // | 
|  | 618 | #define CMD_SET_SILO(timeout,threshold) \ | 
|  | 619 | (((cmdSyntaxPtr)(ct90))->cmd[1] = (timeout), \ | 
|  | 620 | ((cmdSyntaxPtr)(ct90))->cmd[2]  = (threshold), \ | 
|  | 621 | (cmdSyntaxPtr)(ct90)) | 
|  | 622 |  | 
|  | 623 | // Set timed break in decisecond (1/10s) | 
|  | 624 | // | 
|  | 625 | #define CMD_LBREAK(ds) \ | 
|  | 626 | (((cmdSyntaxPtr)(ct91))->cmd[1] = (ds),(cmdSyntaxPtr)(ct66)) | 
|  | 627 |  | 
|  | 628 |  | 
|  | 629 |  | 
|  | 630 | #endif // I2CMD_H |