/drivers/char/ip2/i2cmd.h

https://bitbucket.org/evzijst/gittest · C Header · 643 lines · 334 code · 101 blank · 208 comment · 0 complexity · 2fdfaaad4e342000e42ba2ad18c69b18 MD5 · raw file

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