dgap.h 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  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. * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
  20. *
  21. *************************************************************************
  22. *
  23. * Driver includes
  24. *
  25. *************************************************************************/
  26. #ifndef __DGAP_DRIVER_H
  27. #define __DGAP_DRIVER_H
  28. #include <linux/types.h> /* To pick up the varions Linux types */
  29. #include <linux/tty.h> /* To pick up the various tty structs/defines */
  30. #include <linux/interrupt.h> /* For irqreturn_t type */
  31. #ifndef TRUE
  32. # define TRUE 1
  33. #endif
  34. #ifndef FALSE
  35. # define FALSE 0
  36. #endif
  37. #if !defined(TTY_FLIPBUF_SIZE)
  38. # define TTY_FLIPBUF_SIZE 512
  39. #endif
  40. /*************************************************************************
  41. *
  42. * Driver defines
  43. *
  44. *************************************************************************/
  45. /*
  46. * Driver identification
  47. */
  48. #define DG_NAME "dgap-1.3-16"
  49. #define DG_PART "40002347_C"
  50. #define DRVSTR "dgap"
  51. /*
  52. * defines from dgap_pci.h
  53. */
  54. #define PCIMAX 32 /* maximum number of PCI boards */
  55. #define DIGI_VID 0x114F
  56. #define PCI_DEV_EPC_DID 0x0002
  57. #define PCI_DEV_XEM_DID 0x0004
  58. #define PCI_DEV_XR_DID 0x0005
  59. #define PCI_DEV_CX_DID 0x0006
  60. #define PCI_DEV_XRJ_DID 0x0009 /* PLX-based Xr adapter */
  61. #define PCI_DEV_XR_IBM_DID 0x0011 /* IBM 8-port Async Adapter */
  62. #define PCI_DEV_XR_BULL_DID 0x0013 /* BULL 8-port Async Adapter */
  63. #define PCI_DEV_XR_SAIP_DID 0x001c /* SAIP card - Xr adapter */
  64. #define PCI_DEV_XR_422_DID 0x0012 /* Xr-422 */
  65. #define PCI_DEV_920_2_DID 0x0034 /* XR-Plus 920 K, 2 port */
  66. #define PCI_DEV_920_4_DID 0x0026 /* XR-Plus 920 K, 4 port */
  67. #define PCI_DEV_920_8_DID 0x0027 /* XR-Plus 920 K, 8 port */
  68. #define PCI_DEV_EPCJ_DID 0x000a /* PLX 9060 chip for PCI */
  69. #define PCI_DEV_CX_IBM_DID 0x001b /* IBM 128-port Async Adapter */
  70. #define PCI_DEV_920_8_HP_DID 0x0058 /* HP XR-Plus 920 K, 8 port */
  71. #define PCI_DEV_XEM_HP_DID 0x0059 /* HP Xem PCI */
  72. #define PCI_DEV_XEM_NAME "AccelePort XEM"
  73. #define PCI_DEV_CX_NAME "AccelePort CX"
  74. #define PCI_DEV_XR_NAME "AccelePort Xr"
  75. #define PCI_DEV_XRJ_NAME "AccelePort Xr (PLX)"
  76. #define PCI_DEV_XR_SAIP_NAME "AccelePort Xr (SAIP)"
  77. #define PCI_DEV_920_2_NAME "AccelePort Xr920 2 port"
  78. #define PCI_DEV_920_4_NAME "AccelePort Xr920 4 port"
  79. #define PCI_DEV_920_8_NAME "AccelePort Xr920 8 port"
  80. #define PCI_DEV_XR_422_NAME "AccelePort Xr 422"
  81. #define PCI_DEV_EPCJ_NAME "AccelePort EPC (PLX)"
  82. #define PCI_DEV_XR_BULL_NAME "AccelePort Xr (BULL)"
  83. #define PCI_DEV_XR_IBM_NAME "AccelePort Xr (IBM)"
  84. #define PCI_DEV_CX_IBM_NAME "AccelePort CX (IBM)"
  85. #define PCI_DEV_920_8_HP_NAME "AccelePort Xr920 8 port (HP)"
  86. #define PCI_DEV_XEM_HP_NAME "AccelePort XEM (HP)"
  87. /*
  88. * On the PCI boards, there is no IO space allocated
  89. * The I/O registers will be in the first 3 bytes of the
  90. * upper 2MB of the 4MB memory space. The board memory
  91. * will be mapped into the low 2MB of the 4MB memory space
  92. */
  93. /* Potential location of PCI Bios from E0000 to FFFFF*/
  94. #define PCI_BIOS_SIZE 0x00020000
  95. /* Size of Memory and I/O for PCI (4MB) */
  96. #define PCI_RAM_SIZE 0x00400000
  97. /* Size of Memory (2MB) */
  98. #define PCI_MEM_SIZE 0x00200000
  99. /* Max PCI Window Size (2MB) */
  100. #define PCI_WIN_SIZE 0x00200000
  101. #define PCI_WIN_SHIFT 21 /* 21 bits max */
  102. /* Offset of I/0 in Memory (2MB) */
  103. #define PCI_IO_OFFSET 0x00200000
  104. /* Size of IO (2MB) */
  105. #define PCI_IO_SIZE 0x00200000
  106. /* Number of boards we support at once. */
  107. #define MAXBOARDS 32
  108. #define MAXPORTS 224
  109. #define MAXTTYNAMELEN 200
  110. /* Our 3 magic numbers for our board, channel and unit structs */
  111. #define DGAP_BOARD_MAGIC 0x5c6df104
  112. #define DGAP_CHANNEL_MAGIC 0x6c6df104
  113. #define DGAP_UNIT_MAGIC 0x7c6df104
  114. /* Serial port types */
  115. #define DGAP_SERIAL 0
  116. #define DGAP_PRINT 1
  117. #define SERIAL_TYPE_NORMAL 1
  118. /* 4 extra for alignment play space */
  119. #define WRITEBUFLEN ((4096) + 4)
  120. #define MYFLIPLEN N_TTY_BUF_SIZE
  121. #define SBREAK_TIME 0x25
  122. #define U2BSIZE 0x400
  123. #define dgap_jiffies_from_ms(a) (((a) * HZ) / 1000)
  124. /*
  125. * Our major for the mgmt devices.
  126. *
  127. * We can use 22, because Digi was allocated 22 and 23 for the epca driver.
  128. * 22 has now become obsolete now that the "cu" devices have
  129. * been removed from 2.6.
  130. * Also, this *IS* the epca driver, just PCI only now.
  131. */
  132. #ifndef DIGI_DGAP_MAJOR
  133. # define DIGI_DGAP_MAJOR 22
  134. #endif
  135. /*
  136. * The parameters we use to define the periods of the moving averages.
  137. */
  138. #define MA_PERIOD (HZ / 10)
  139. #define SMA_DUR (1 * HZ)
  140. #define EMA_DUR (1 * HZ)
  141. #define SMA_NPERIODS (SMA_DUR / MA_PERIOD)
  142. #define EMA_NPERIODS (EMA_DUR / MA_PERIOD)
  143. /*
  144. * Define a local default termios struct. All ports will be created
  145. * with this termios initially. This is the same structure that is defined
  146. * as the default in tty_io.c with the same settings overriden as in serial.c
  147. *
  148. * In short, this should match the internal serial ports' defaults.
  149. */
  150. #define DEFAULT_IFLAGS (ICRNL | IXON)
  151. #define DEFAULT_OFLAGS (OPOST | ONLCR)
  152. #define DEFAULT_CFLAGS (B9600 | CS8 | CREAD | HUPCL | CLOCAL)
  153. #define DEFAULT_LFLAGS (ISIG | ICANON | ECHO | ECHOE | ECHOK | \
  154. ECHOCTL | ECHOKE | IEXTEN)
  155. #ifndef _POSIX_VDISABLE
  156. #define _POSIX_VDISABLE ('\0')
  157. #endif
  158. #define SNIFF_MAX 65536 /* Sniff buffer size (2^n) */
  159. #define SNIFF_MASK (SNIFF_MAX - 1) /* Sniff wrap mask */
  160. #define VPDSIZE (512)
  161. /************************************************************************
  162. * FEP memory offsets
  163. ************************************************************************/
  164. #define START 0x0004L /* Execution start address */
  165. #define CMDBUF 0x0d10L /* Command (cm_t) structure offset */
  166. #define CMDSTART 0x0400L /* Start of command buffer */
  167. #define CMDMAX 0x0800L /* End of command buffer */
  168. #define EVBUF 0x0d18L /* Event (ev_t) structure */
  169. #define EVSTART 0x0800L /* Start of event buffer */
  170. #define EVMAX 0x0c00L /* End of event buffer */
  171. #define FEP5_PLUS 0x0E40 /* ASCII '5' and ASCII 'A' is here */
  172. #define ECS_SEG 0x0E44 /* Segment of the extended */
  173. /* channel structure */
  174. #define LINE_SPEED 0x10 /* Offset into ECS_SEG for line */
  175. /* speed if the fep has extended */
  176. /* capabilities */
  177. /* BIOS MAGIC SPOTS */
  178. #define ERROR 0x0C14L /* BIOS error code */
  179. #define SEQUENCE 0x0C12L /* BIOS sequence indicator */
  180. #define POSTAREA 0x0C00L /* POST complete message area */
  181. /* FEP MAGIC SPOTS */
  182. #define FEPSTAT POSTAREA /* OS here when FEP comes up */
  183. #define NCHAN 0x0C02L /* number of ports FEP sees */
  184. #define PANIC 0x0C10L /* PANIC area for FEP */
  185. #define KMEMEM 0x0C30L /* Memory for KME use */
  186. #define CONFIG 0x0CD0L /* Concentrator configuration info */
  187. #define CONFIGSIZE 0x0030 /* configuration info size */
  188. #define DOWNREQ 0x0D00 /* Download request buffer pointer */
  189. #define CHANBUF 0x1000L /* Async channel (bs_t) structs */
  190. #define FEPOSSIZE 0x1FFF /* 8K FEPOS */
  191. #define XEMPORTS 0xC02 /*
  192. * Offset in board memory where FEP5 stores
  193. * how many ports it has detected.
  194. * NOTE: FEP5 reports 64 ports when the user
  195. * has the cable in EBI OUT instead of EBI IN.
  196. */
  197. #define FEPCLR 0x00
  198. #define FEPMEM 0x02
  199. #define FEPRST 0x04
  200. #define FEPINT 0x08
  201. #define FEPMASK 0x0e
  202. #define FEPWIN 0x80
  203. #define LOWMEM 0x0100
  204. #define HIGHMEM 0x7f00
  205. #define FEPTIMEOUT 200000
  206. #define ENABLE_INTR 0x0e04 /* Enable interrupts flag */
  207. #define FEPPOLL_MIN 1 /* minimum of 1 millisecond */
  208. #define FEPPOLL_MAX 20 /* maximum of 20 milliseconds */
  209. #define FEPPOLL 0x0c26 /* Fep event poll interval */
  210. #define IALTPIN 0x0080 /* Input flag to swap DSR <-> DCD */
  211. /************************************************************************
  212. * FEP supported functions
  213. ************************************************************************/
  214. #define SRLOW 0xe0 /* Set receive low water */
  215. #define SRHIGH 0xe1 /* Set receive high water */
  216. #define FLUSHTX 0xe2 /* Flush transmit buffer */
  217. #define PAUSETX 0xe3 /* Pause data transmission */
  218. #define RESUMETX 0xe4 /* Resume data transmission */
  219. #define SMINT 0xe5 /* Set Modem Interrupt */
  220. #define SAFLOWC 0xe6 /* Set Aux. flow control chars */
  221. #define SBREAK 0xe8 /* Send break */
  222. #define SMODEM 0xe9 /* Set 8530 modem control lines */
  223. #define SIFLAG 0xea /* Set UNIX iflags */
  224. #define SFLOWC 0xeb /* Set flow control characters */
  225. #define STLOW 0xec /* Set transmit low water mark */
  226. #define RPAUSE 0xee /* Pause receive */
  227. #define RRESUME 0xef /* Resume receive */
  228. #define CHRESET 0xf0 /* Reset Channel */
  229. #define BUFSETALL 0xf2 /* Set Tx & Rx buffer size avail*/
  230. #define SOFLAG 0xf3 /* Set UNIX oflags */
  231. #define SHFLOW 0xf4 /* Set hardware handshake */
  232. #define SCFLAG 0xf5 /* Set UNIX cflags */
  233. #define SVNEXT 0xf6 /* Set VNEXT character */
  234. #define SPINTFC 0xfc /* Reserved */
  235. #define SCOMMODE 0xfd /* Set RS232/422 mode */
  236. /************************************************************************
  237. * Modes for SCOMMODE
  238. ************************************************************************/
  239. #define MODE_232 0x00
  240. #define MODE_422 0x01
  241. /************************************************************************
  242. * Event flags.
  243. ************************************************************************/
  244. #define IFBREAK 0x01 /* Break received */
  245. #define IFTLW 0x02 /* Transmit low water */
  246. #define IFTEM 0x04 /* Transmitter empty */
  247. #define IFDATA 0x08 /* Receive data present */
  248. #define IFMODEM 0x20 /* Modem status change */
  249. /************************************************************************
  250. * Modem flags
  251. ************************************************************************/
  252. # define DM_RTS 0x02 /* Request to send */
  253. # define DM_CD 0x80 /* Carrier detect */
  254. # define DM_DSR 0x20 /* Data set ready */
  255. # define DM_CTS 0x10 /* Clear to send */
  256. # define DM_RI 0x40 /* Ring indicator */
  257. # define DM_DTR 0x01 /* Data terminal ready */
  258. /*
  259. * defines from dgap_conf.h
  260. */
  261. #define NULLNODE 0 /* header node, not used */
  262. #define BNODE 1 /* Board node */
  263. #define LNODE 2 /* Line node */
  264. #define CNODE 3 /* Concentrator node */
  265. #define MNODE 4 /* EBI Module node */
  266. #define TNODE 5 /* tty name prefix node */
  267. #define CUNODE 6 /* cu name prefix (non-SCO) */
  268. #define PNODE 7 /* trans. print prefix node */
  269. #define JNODE 8 /* maJor number node */
  270. #define ANODE 9 /* altpin */
  271. #define TSNODE 10 /* tty structure size */
  272. #define CSNODE 11 /* channel structure size */
  273. #define BSNODE 12 /* board structure size */
  274. #define USNODE 13 /* unit schedule structure size */
  275. #define FSNODE 14 /* f2200 structure size */
  276. #define VSNODE 15 /* size of VPIX structures */
  277. #define INTRNODE 16 /* enable interrupt */
  278. /* Enumeration of tokens */
  279. #define BEGIN 1
  280. #define END 2
  281. #define BOARD 10
  282. #define EPCFS 11 /* start of EPC family definitions */
  283. #define ICX 11
  284. #define MCX 13
  285. #define PCX 14
  286. #define IEPC 15
  287. #define EEPC 16
  288. #define MEPC 17
  289. #define IPCM 18
  290. #define EPCM 19
  291. #define MPCM 20
  292. #define PEPC 21
  293. #define PPCM 22
  294. #ifdef CP
  295. #define ICP 23
  296. #define ECP 24
  297. #define MCP 25
  298. #endif
  299. #define EPCFE 25 /* end of EPC family definitions */
  300. #define PC2E 26
  301. #define PC4E 27
  302. #define PC4E8K 28
  303. #define PC8E 29
  304. #define PC8E8K 30
  305. #define PC16E 31
  306. #define MC2E8K 34
  307. #define MC4E8K 35
  308. #define MC8E8K 36
  309. #define AVANFS 42 /* start of Avanstar family definitions */
  310. #define A8P 42
  311. #define A16P 43
  312. #define AVANFE 43 /* end of Avanstar family definitions */
  313. #define DA2000FS 44 /* start of AccelePort 2000 family definitions */
  314. #define DA22 44 /* AccelePort 2002 */
  315. #define DA24 45 /* AccelePort 2004 */
  316. #define DA28 46 /* AccelePort 2008 */
  317. #define DA216 47 /* AccelePort 2016 */
  318. #define DAR4 48 /* AccelePort RAS 4 port */
  319. #define DAR8 49 /* AccelePort RAS 8 port */
  320. #define DDR24 50 /* DataFire RAS 24 port */
  321. #define DDR30 51 /* DataFire RAS 30 port */
  322. #define DDR48 52 /* DataFire RAS 48 port */
  323. #define DDR60 53 /* DataFire RAS 60 port */
  324. #define DA2000FE 53 /* end of AccelePort 2000/RAS family definitions */
  325. #define PCXRFS 106 /* start of PCXR family definitions */
  326. #define APORT4 106
  327. #define APORT8 107
  328. #define PAPORT4 108
  329. #define PAPORT8 109
  330. #define APORT4_920I 110
  331. #define APORT8_920I 111
  332. #define APORT4_920P 112
  333. #define APORT8_920P 113
  334. #define APORT2_920P 114
  335. #define PCXRFE 117 /* end of PCXR family definitions */
  336. #define LINE 82
  337. #ifdef T1
  338. #define T1M 83
  339. #define E1M 84
  340. #endif
  341. #define CONC 64
  342. #define CX 65
  343. #define EPC 66
  344. #define MOD 67
  345. #define PORTS 68
  346. #define METHOD 69
  347. #define CUSTOM 70
  348. #define BASIC 71
  349. #define STATUS 72
  350. #define MODEM 73
  351. /* The following tokens can appear in multiple places */
  352. #define SPEED 74
  353. #define NPORTS 75
  354. #define ID 76
  355. #define CABLE 77
  356. #define CONNECT 78
  357. #define IO 79
  358. #define MEM 80
  359. #define DPSZ 81
  360. #define TTYN 90
  361. #define CU 91
  362. #define PRINT 92
  363. #define XPRINT 93
  364. #define CMAJOR 94
  365. #define ALTPIN 95
  366. #define STARTO 96
  367. #define USEINTR 97
  368. #define PCIINFO 98
  369. #define TTSIZ 100
  370. #define CHSIZ 101
  371. #define BSSIZ 102
  372. #define UNTSIZ 103
  373. #define F2SIZ 104
  374. #define VPSIZ 105
  375. #define TOTAL_BOARD 2
  376. #define CURRENT_BRD 4
  377. #define BOARD_TYPE 6
  378. #define IO_ADDRESS 8
  379. #define MEM_ADDRESS 10
  380. #define FIELDS_PER_PAGE 18
  381. #define TB_FIELD 1
  382. #define CB_FIELD 3
  383. #define BT_FIELD 5
  384. #define IO_FIELD 7
  385. #define ID_FIELD 8
  386. #define ME_FIELD 9
  387. #define TTY_FIELD 11
  388. #define CU_FIELD 13
  389. #define PR_FIELD 15
  390. #define MPR_FIELD 17
  391. #define MAX_FIELD 512
  392. #define INIT 0
  393. #define NITEMS 128
  394. #define MAX_ITEM 512
  395. #define DSCRINST 1
  396. #define DSCRNUM 3
  397. #define ALTPINQ 5
  398. #define SSAVE 7
  399. #define DSCR "32"
  400. #define ONETONINE "123456789"
  401. #define ALL "1234567890"
  402. /*
  403. * All the possible states the driver can be while being loaded.
  404. */
  405. enum {
  406. DRIVER_INITIALIZED = 0,
  407. DRIVER_READY
  408. };
  409. /*
  410. * All the possible states the board can be while booting up.
  411. */
  412. enum {
  413. BOARD_FAILED = 0,
  414. BOARD_READY
  415. };
  416. /*
  417. * All the possible states that a requested concentrator image can be in.
  418. */
  419. enum {
  420. NO_PENDING_CONCENTRATOR_REQUESTS = 0,
  421. NEED_CONCENTRATOR,
  422. REQUESTED_CONCENTRATOR
  423. };
  424. /*
  425. * Modem line constants are defined as macros because DSR and
  426. * DCD are swapable using the ditty altpin option.
  427. */
  428. #define D_CD(ch) ch->ch_cd /* Carrier detect */
  429. #define D_DSR(ch) ch->ch_dsr /* Data set ready */
  430. #define D_RTS(ch) DM_RTS /* Request to send */
  431. #define D_CTS(ch) DM_CTS /* Clear to send */
  432. #define D_RI(ch) DM_RI /* Ring indicator */
  433. #define D_DTR(ch) DM_DTR /* Data terminal ready */
  434. /*************************************************************************
  435. *
  436. * Structures and closely related defines.
  437. *
  438. *************************************************************************/
  439. /*
  440. * A structure to hold a statistics counter. We also
  441. * compute moving averages for this counter.
  442. */
  443. struct macounter {
  444. u32 cnt; /* Total count */
  445. ulong accum; /* Acuumulator per period */
  446. ulong sma; /* Simple moving average */
  447. ulong ema; /* Exponential moving average */
  448. };
  449. /************************************************************************
  450. * Device flag definitions for bd_flags.
  451. ************************************************************************/
  452. #define BD_FEP5PLUS 0x0001 /* Supports FEP5 Plus commands */
  453. #define BD_HAS_VPD 0x0002 /* Board has VPD info available */
  454. /*
  455. * Per-board information
  456. */
  457. struct board_t {
  458. int magic; /* Board Magic number. */
  459. int boardnum; /* Board number: 0-3 */
  460. int type; /* Type of board */
  461. char *name; /* Product Name */
  462. struct pci_dev *pdev; /* Pointer to the pci_dev struct */
  463. u16 vendor; /* PCI vendor ID */
  464. u16 device; /* PCI device ID */
  465. u16 subvendor; /* PCI subsystem vendor ID */
  466. u16 subdevice; /* PCI subsystem device ID */
  467. u8 rev; /* PCI revision ID */
  468. uint pci_bus; /* PCI bus value */
  469. uint pci_slot; /* PCI slot value */
  470. u16 maxports; /* MAX ports this board can handle */
  471. u8 vpd[VPDSIZE]; /* VPD of board, if found */
  472. u32 bd_flags; /* Board flags */
  473. spinlock_t bd_lock; /* Used to protect board */
  474. u32 state; /* State of card. */
  475. wait_queue_head_t state_wait; /* Place to sleep on for state change */
  476. struct tasklet_struct helper_tasklet; /* Poll helper tasklet */
  477. u32 wait_for_bios;
  478. u32 wait_for_fep;
  479. struct cnode *bd_config; /* Config of board */
  480. u16 nasync; /* Number of ports on card */
  481. ulong irq; /* Interrupt request number */
  482. ulong intr_count; /* Count of interrupts */
  483. u32 intr_used; /* Non-zero if using interrupts */
  484. u32 intr_running; /* Non-zero if FEP knows its doing */
  485. /* interrupts */
  486. ulong port; /* Start of base io port of the card */
  487. ulong port_end; /* End of base io port of the card */
  488. ulong membase; /* Start of base memory of the card */
  489. ulong membase_end; /* End of base memory of the card */
  490. u8 __iomem *re_map_port; /* Remapped io port of the card */
  491. u8 __iomem *re_map_membase;/* Remapped memory of the card */
  492. u8 inhibit_poller; /* Tells the poller to leave us alone */
  493. struct channel_t *channels[MAXPORTS]; /* array of pointers to our */
  494. /* channels. */
  495. struct tty_driver *serial_driver;
  496. struct tty_port *serial_ports;
  497. char serial_name[200];
  498. struct tty_driver *print_driver;
  499. struct tty_port *printer_ports;
  500. char print_name[200];
  501. u32 dgap_serial_major;
  502. u32 dgap_transparent_print_major;
  503. struct bs_t __iomem *bd_bs; /* Base structure pointer */
  504. char *flipbuf; /* Our flip buffer, alloced if */
  505. /* board is found */
  506. char *flipflagbuf; /* Our flip flag buffer, alloced */
  507. /* if board is found */
  508. u16 dpatype; /* The board "type", as defined */
  509. /* by DPA */
  510. u16 dpastatus; /* The board "status", as defined */
  511. /* by DPA */
  512. u32 conc_dl_status; /* Status of any pending conc */
  513. /* download */
  514. };
  515. /************************************************************************
  516. * Unit flag definitions for un_flags.
  517. ************************************************************************/
  518. #define UN_ISOPEN 0x0001 /* Device is open */
  519. #define UN_CLOSING 0x0002 /* Line is being closed */
  520. #define UN_IMM 0x0004 /* Service immediately */
  521. #define UN_BUSY 0x0008 /* Some work this channel */
  522. #define UN_BREAKI 0x0010 /* Input break received */
  523. #define UN_PWAIT 0x0020 /* Printer waiting for terminal */
  524. #define UN_TIME 0x0040 /* Waiting on time */
  525. #define UN_EMPTY 0x0080 /* Waiting output queue empty */
  526. #define UN_LOW 0x0100 /* Waiting output low water mark*/
  527. #define UN_EXCL_OPEN 0x0200 /* Open for exclusive use */
  528. #define UN_WOPEN 0x0400 /* Device waiting for open */
  529. #define UN_WIOCTL 0x0800 /* Device waiting for open */
  530. #define UN_HANGUP 0x8000 /* Carrier lost */
  531. struct device;
  532. /************************************************************************
  533. * Structure for terminal or printer unit.
  534. ************************************************************************/
  535. struct un_t {
  536. int magic; /* Unit Magic Number. */
  537. struct channel_t *un_ch;
  538. u32 un_time;
  539. u32 un_type;
  540. int un_open_count; /* Counter of opens to port */
  541. struct tty_struct *un_tty;/* Pointer to unit tty structure */
  542. u32 un_flags; /* Unit flags */
  543. wait_queue_head_t un_flags_wait; /* Place to sleep to wait on unit */
  544. u32 un_dev; /* Minor device number */
  545. tcflag_t un_oflag; /* oflags being done on board */
  546. tcflag_t un_lflag; /* lflags being done on board */
  547. struct device *un_sysfs;
  548. };
  549. /************************************************************************
  550. * Device flag definitions for ch_flags.
  551. ************************************************************************/
  552. #define CH_PRON 0x0001 /* Printer on string */
  553. #define CH_OUT 0x0002 /* Dial-out device open */
  554. #define CH_STOP 0x0004 /* Output is stopped */
  555. #define CH_STOPI 0x0008 /* Input is stopped */
  556. #define CH_CD 0x0010 /* Carrier is present */
  557. #define CH_FCAR 0x0020 /* Carrier forced on */
  558. #define CH_RXBLOCK 0x0080 /* Enable rx blocked flag */
  559. #define CH_WLOW 0x0100 /* Term waiting low event */
  560. #define CH_WEMPTY 0x0200 /* Term waiting empty event */
  561. #define CH_RENABLE 0x0400 /* Buffer just emptied */
  562. #define CH_RACTIVE 0x0800 /* Process active in xxread() */
  563. #define CH_RWAIT 0x1000 /* Process waiting in xxread() */
  564. #define CH_BAUD0 0x2000 /* Used for checking B0 transitions */
  565. #define CH_HANGUP 0x8000 /* Hangup received */
  566. /*
  567. * Definitions for ch_sniff_flags
  568. */
  569. #define SNIFF_OPEN 0x1
  570. #define SNIFF_WAIT_DATA 0x2
  571. #define SNIFF_WAIT_SPACE 0x4
  572. /************************************************************************
  573. *** Definitions for Digi ditty(1) command.
  574. ************************************************************************/
  575. /************************************************************************
  576. * This module provides application access to special Digi
  577. * serial line enhancements which are not standard UNIX(tm) features.
  578. ************************************************************************/
  579. #if !defined(TIOCMODG)
  580. #define TIOCMODG (('d'<<8) | 250) /* get modem ctrl state */
  581. #define TIOCMODS (('d'<<8) | 251) /* set modem ctrl state */
  582. #ifndef TIOCM_LE
  583. #define TIOCM_LE 0x01 /* line enable */
  584. #define TIOCM_DTR 0x02 /* data terminal ready */
  585. #define TIOCM_RTS 0x04 /* request to send */
  586. #define TIOCM_ST 0x08 /* secondary transmit */
  587. #define TIOCM_SR 0x10 /* secondary receive */
  588. #define TIOCM_CTS 0x20 /* clear to send */
  589. #define TIOCM_CAR 0x40 /* carrier detect */
  590. #define TIOCM_RNG 0x80 /* ring indicator */
  591. #define TIOCM_DSR 0x100 /* data set ready */
  592. #define TIOCM_RI TIOCM_RNG /* ring (alternate) */
  593. #define TIOCM_CD TIOCM_CAR /* carrier detect (alt) */
  594. #endif
  595. #endif
  596. #if !defined(TIOCMSET)
  597. #define TIOCMSET (('d'<<8) | 252) /* set modem ctrl state */
  598. #define TIOCMGET (('d'<<8) | 253) /* set modem ctrl state */
  599. #endif
  600. #if !defined(TIOCMBIC)
  601. #define TIOCMBIC (('d'<<8) | 254) /* set modem ctrl state */
  602. #define TIOCMBIS (('d'<<8) | 255) /* set modem ctrl state */
  603. #endif
  604. #if !defined(TIOCSDTR)
  605. #define TIOCSDTR (('e'<<8) | 0) /* set DTR */
  606. #define TIOCCDTR (('e'<<8) | 1) /* clear DTR */
  607. #endif
  608. /************************************************************************
  609. * Ioctl command arguments for DIGI parameters.
  610. ************************************************************************/
  611. #define DIGI_GETA (('e'<<8) | 94) /* Read params */
  612. #define DIGI_SETA (('e'<<8) | 95) /* Set params */
  613. #define DIGI_SETAW (('e'<<8) | 96) /* Drain & set params */
  614. #define DIGI_SETAF (('e'<<8) | 97) /* Drain, flush & set params */
  615. #define DIGI_KME (('e'<<8) | 98) /* Read/Write Host */
  616. /* Adapter Memory */
  617. #define DIGI_GETFLOW (('e'<<8) | 99) /* Get startc/stopc flow */
  618. /* control characters */
  619. #define DIGI_SETFLOW (('e'<<8) | 100) /* Set startc/stopc flow */
  620. /* control characters */
  621. #define DIGI_GETAFLOW (('e'<<8) | 101) /* Get Aux. startc/stopc */
  622. /* flow control chars */
  623. #define DIGI_SETAFLOW (('e'<<8) | 102) /* Set Aux. startc/stopc */
  624. /* flow control chars */
  625. #define DIGI_GEDELAY (('d'<<8) | 246) /* Get edelay */
  626. #define DIGI_SEDELAY (('d'<<8) | 247) /* Set edelay */
  627. struct digiflow_t {
  628. unsigned char startc; /* flow cntl start char */
  629. unsigned char stopc; /* flow cntl stop char */
  630. };
  631. #ifdef FLOW_2200
  632. #define F2200_GETA (('e'<<8) | 104) /* Get 2x36 flow cntl flags */
  633. #define F2200_SETAW (('e'<<8) | 105) /* Set 2x36 flow cntl flags */
  634. #define F2200_MASK 0x03 /* 2200 flow cntl bit mask */
  635. #define FCNTL_2200 0x01 /* 2x36 terminal flow cntl */
  636. #define PCNTL_2200 0x02 /* 2x36 printer flow cntl */
  637. #define F2200_XON 0xf8
  638. #define P2200_XON 0xf9
  639. #define F2200_XOFF 0xfa
  640. #define P2200_XOFF 0xfb
  641. #define FXOFF_MASK 0x03 /* 2200 flow status mask */
  642. #define RCVD_FXOFF 0x01 /* 2x36 Terminal XOFF rcvd */
  643. #define RCVD_PXOFF 0x02 /* 2x36 Printer XOFF rcvd */
  644. #endif
  645. /************************************************************************
  646. * Values for digi_flags
  647. ************************************************************************/
  648. #define DIGI_IXON 0x0001 /* Handle IXON in the FEP */
  649. #define DIGI_FAST 0x0002 /* Fast baud rates */
  650. #define RTSPACE 0x0004 /* RTS input flow control */
  651. #define CTSPACE 0x0008 /* CTS output flow control */
  652. #define DSRPACE 0x0010 /* DSR output flow control */
  653. #define DCDPACE 0x0020 /* DCD output flow control */
  654. #define DTRPACE 0x0040 /* DTR input flow control */
  655. #define DIGI_COOK 0x0080 /* Cooked processing done in FEP */
  656. #define DIGI_FORCEDCD 0x0100 /* Force carrier */
  657. #define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */
  658. #define DIGI_AIXON 0x0400 /* Aux flow control in fep */
  659. #define DIGI_PRINTER 0x0800 /* Hold port open for flow cntrl*/
  660. #define DIGI_PP_INPUT 0x1000 /* Change parallel port to input*/
  661. #define DIGI_DTR_TOGGLE 0x2000 /* Support DTR Toggle */
  662. #define DIGI_422 0x4000 /* for 422/232 selectable panel */
  663. #define DIGI_RTS_TOGGLE 0x8000 /* Support RTS Toggle */
  664. /************************************************************************
  665. * These options are not supported on the comxi.
  666. ************************************************************************/
  667. #define DIGI_COMXI (DIGI_FAST|DIGI_COOK|DSRPACE|DCDPACE|DTRPACE)
  668. #define DIGI_PLEN 28 /* String length */
  669. #define DIGI_TSIZ 10 /* Terminal string len */
  670. /************************************************************************
  671. * Structure used with ioctl commands for DIGI parameters.
  672. ************************************************************************/
  673. struct digi_t {
  674. unsigned short digi_flags; /* Flags (see above) */
  675. unsigned short digi_maxcps; /* Max printer CPS */
  676. unsigned short digi_maxchar; /* Max chars in print queue */
  677. unsigned short digi_bufsize; /* Buffer size */
  678. unsigned char digi_onlen; /* Length of ON string */
  679. unsigned char digi_offlen; /* Length of OFF string */
  680. char digi_onstr[DIGI_PLEN]; /* Printer on string */
  681. char digi_offstr[DIGI_PLEN]; /* Printer off string */
  682. char digi_term[DIGI_TSIZ]; /* terminal string */
  683. };
  684. /************************************************************************
  685. * KME definitions and structures.
  686. ************************************************************************/
  687. #define RW_IDLE 0 /* Operation complete */
  688. #define RW_READ 1 /* Read Concentrator Memory */
  689. #define RW_WRITE 2 /* Write Concentrator Memory */
  690. struct rw_t {
  691. unsigned char rw_req; /* Request type */
  692. unsigned char rw_board; /* Host Adapter board number */
  693. unsigned char rw_conc; /* Concentrator number */
  694. unsigned char rw_reserved; /* Reserved for expansion */
  695. unsigned long rw_addr; /* Address in concentrator */
  696. unsigned short rw_size; /* Read/write request length */
  697. unsigned char rw_data[128]; /* Data to read/write */
  698. };
  699. /************************************************************************
  700. * Structure to get driver status information
  701. ************************************************************************/
  702. struct digi_dinfo {
  703. unsigned long dinfo_nboards; /* # boards configured */
  704. char dinfo_reserved[12]; /* for future expansion */
  705. char dinfo_version[16]; /* driver version */
  706. };
  707. #define DIGI_GETDD (('d'<<8) | 248) /* get driver info */
  708. /************************************************************************
  709. * Structure used with ioctl commands for per-board information
  710. *
  711. * physsize and memsize differ when board has "windowed" memory
  712. ************************************************************************/
  713. struct digi_info {
  714. unsigned long info_bdnum; /* Board number (0 based) */
  715. unsigned long info_ioport; /* io port address */
  716. unsigned long info_physaddr; /* memory address */
  717. unsigned long info_physsize; /* Size of host mem window */
  718. unsigned long info_memsize; /* Amount of dual-port mem */
  719. /* on board */
  720. unsigned short info_bdtype; /* Board type */
  721. unsigned short info_nports; /* number of ports */
  722. char info_bdstate; /* board state */
  723. char info_reserved[7]; /* for future expansion */
  724. };
  725. #define DIGI_GETBD (('d'<<8) | 249) /* get board info */
  726. struct digi_stat {
  727. unsigned int info_chan; /* Channel number (0 based) */
  728. unsigned int info_brd; /* Board number (0 based) */
  729. unsigned long info_cflag; /* cflag for channel */
  730. unsigned long info_iflag; /* iflag for channel */
  731. unsigned long info_oflag; /* oflag for channel */
  732. unsigned long info_mstat; /* mstat for channel */
  733. unsigned long info_tx_data; /* tx_data for channel */
  734. unsigned long info_rx_data; /* rx_data for channel */
  735. unsigned long info_hflow; /* hflow for channel */
  736. unsigned long info_reserved[8]; /* for future expansion */
  737. };
  738. #define DIGI_GETSTAT (('d'<<8) | 244) /* get board info */
  739. /************************************************************************
  740. *
  741. * Structure used with ioctl commands for per-channel information
  742. *
  743. ************************************************************************/
  744. struct digi_ch {
  745. unsigned long info_bdnum; /* Board number (0 based) */
  746. unsigned long info_channel; /* Channel index number */
  747. unsigned long info_ch_cflag; /* Channel cflag */
  748. unsigned long info_ch_iflag; /* Channel iflag */
  749. unsigned long info_ch_oflag; /* Channel oflag */
  750. unsigned long info_chsize; /* Channel structure size */
  751. unsigned long info_sleep_stat; /* sleep status */
  752. dev_t info_dev; /* device number */
  753. unsigned char info_initstate; /* Channel init state */
  754. unsigned char info_running; /* Channel running state */
  755. long reserved[8]; /* reserved for future use */
  756. };
  757. /*
  758. * This structure is used with the DIGI_FEPCMD ioctl to
  759. * tell the driver which port to send the command for.
  760. */
  761. struct digi_cmd {
  762. int cmd;
  763. int word;
  764. int ncmds;
  765. int chan; /* channel index (zero based) */
  766. int bdid; /* board index (zero based) */
  767. };
  768. /*
  769. * info_sleep_stat defines
  770. */
  771. #define INFO_RUNWAIT 0x0001
  772. #define INFO_WOPEN 0x0002
  773. #define INFO_TTIOW 0x0004
  774. #define INFO_CH_RWAIT 0x0008
  775. #define INFO_CH_WEMPTY 0x0010
  776. #define INFO_CH_WLOW 0x0020
  777. #define INFO_XXBUF_BUSY 0x0040
  778. #define DIGI_GETCH (('d'<<8) | 245) /* get board info */
  779. /* Board type definitions */
  780. #define SUBTYPE 0007
  781. #define T_PCXI 0000
  782. #define T_PCXM 0001
  783. #define T_PCXE 0002
  784. #define T_PCXR 0003
  785. #define T_SP 0004
  786. #define T_SP_PLUS 0005
  787. # define T_HERC 0000
  788. # define T_HOU 0001
  789. # define T_LON 0002
  790. # define T_CHA 0003
  791. #define FAMILY 0070
  792. #define T_COMXI 0000
  793. #define T_PCXX 0010
  794. #define T_CX 0020
  795. #define T_EPC 0030
  796. #define T_PCLITE 0040
  797. #define T_SPXX 0050
  798. #define T_AVXX 0060
  799. #define T_DXB 0070
  800. #define T_A2K_4_8 0070
  801. #define BUSTYPE 0700
  802. #define T_ISABUS 0000
  803. #define T_MCBUS 0100
  804. #define T_EISABUS 0200
  805. #define T_PCIBUS 0400
  806. /* Board State Definitions */
  807. #define BD_RUNNING 0x0
  808. #define BD_REASON 0x7f
  809. #define BD_NOTFOUND 0x1
  810. #define BD_NOIOPORT 0x2
  811. #define BD_NOMEM 0x3
  812. #define BD_NOBIOS 0x4
  813. #define BD_NOFEP 0x5
  814. #define BD_FAILED 0x6
  815. #define BD_ALLOCATED 0x7
  816. #define BD_TRIBOOT 0x8
  817. #define BD_BADKME 0x80
  818. #define DIGI_LOOPBACK (('d'<<8) | 252) /* Enable/disable UART */
  819. /* internal loopback */
  820. #define DIGI_SPOLL (('d'<<8) | 254) /* change poller rate */
  821. #define DIGI_SETCUSTOMBAUD _IOW('e', 106, int) /* Set integer baud rate */
  822. #define DIGI_GETCUSTOMBAUD _IOR('e', 107, int) /* Get integer baud rate */
  823. #define DIGI_RESET_PORT (('e'<<8) | 93) /* Reset port */
  824. /************************************************************************
  825. * Channel information structure.
  826. ************************************************************************/
  827. struct channel_t {
  828. int magic; /* Channel Magic Number */
  829. struct bs_t __iomem *ch_bs; /* Base structure pointer */
  830. struct cm_t __iomem *ch_cm; /* Command queue pointer */
  831. struct board_t *ch_bd; /* Board structure pointer */
  832. u8 __iomem *ch_vaddr; /* FEP memory origin */
  833. u8 __iomem *ch_taddr; /* Write buffer origin */
  834. u8 __iomem *ch_raddr; /* Read buffer origin */
  835. struct digi_t ch_digi; /* Transparent Print structure */
  836. struct un_t ch_tun; /* Terminal unit info */
  837. struct un_t ch_pun; /* Printer unit info */
  838. spinlock_t ch_lock; /* provide for serialization */
  839. wait_queue_head_t ch_flags_wait;
  840. u32 pscan_state;
  841. u8 pscan_savechar;
  842. u32 ch_portnum; /* Port number, 0 offset. */
  843. u32 ch_open_count; /* open count */
  844. u32 ch_flags; /* Channel flags */
  845. u32 ch_cpstime; /* Time for CPS calculations */
  846. tcflag_t ch_c_iflag; /* channel iflags */
  847. tcflag_t ch_c_cflag; /* channel cflags */
  848. tcflag_t ch_c_oflag; /* channel oflags */
  849. tcflag_t ch_c_lflag; /* channel lflags */
  850. u16 ch_fepiflag; /* FEP tty iflags */
  851. u16 ch_fepcflag; /* FEP tty cflags */
  852. u16 ch_fepoflag; /* FEP tty oflags */
  853. u16 ch_wopen; /* Waiting for open process cnt */
  854. u16 ch_tstart; /* Transmit buffer start */
  855. u16 ch_tsize; /* Transmit buffer size */
  856. u16 ch_rstart; /* Receive buffer start */
  857. u16 ch_rsize; /* Receive buffer size */
  858. u16 ch_rdelay; /* Receive delay time */
  859. u16 ch_tlw; /* Our currently set low water mark */
  860. u16 ch_cook; /* Output character mask */
  861. u8 ch_card; /* Card channel is on */
  862. u8 ch_stopc; /* Stop character */
  863. u8 ch_startc; /* Start character */
  864. u8 ch_mostat; /* FEP output modem status */
  865. u8 ch_mistat; /* FEP input modem status */
  866. u8 ch_mforce; /* Modem values to be forced */
  867. u8 ch_mval; /* Force values */
  868. u8 ch_fepstopc; /* FEP stop character */
  869. u8 ch_fepstartc; /* FEP start character */
  870. u8 ch_astopc; /* Auxiliary Stop character */
  871. u8 ch_astartc; /* Auxiliary Start character */
  872. u8 ch_fepastopc; /* Auxiliary FEP stop char */
  873. u8 ch_fepastartc; /* Auxiliary FEP start char */
  874. u8 ch_hflow; /* FEP hardware handshake */
  875. u8 ch_dsr; /* stores real dsr value */
  876. u8 ch_cd; /* stores real cd value */
  877. u8 ch_tx_win; /* channel tx buffer window */
  878. u8 ch_rx_win; /* channel rx buffer window */
  879. uint ch_custom_speed; /* Custom baud, if set */
  880. uint ch_baud_info; /* Current baud info for /proc output */
  881. ulong ch_rxcount; /* total of data received so far */
  882. ulong ch_txcount; /* total of data transmitted so far */
  883. ulong ch_err_parity; /* Count of parity errors on channel */
  884. ulong ch_err_frame; /* Count of framing errors on channel */
  885. ulong ch_err_break; /* Count of breaks on channel */
  886. ulong ch_err_overrun; /* Count of overruns on channel */
  887. };
  888. /************************************************************************
  889. * Command structure definition.
  890. ************************************************************************/
  891. struct cm_t {
  892. unsigned short cm_head; /* Command buffer head offset */
  893. unsigned short cm_tail; /* Command buffer tail offset */
  894. unsigned short cm_start; /* start offset of buffer */
  895. unsigned short cm_max; /* last offset of buffer */
  896. };
  897. /************************************************************************
  898. * Event structure definition.
  899. ************************************************************************/
  900. struct ev_t {
  901. unsigned short ev_head; /* Command buffer head offset */
  902. unsigned short ev_tail; /* Command buffer tail offset */
  903. unsigned short ev_start; /* start offset of buffer */
  904. unsigned short ev_max; /* last offset of buffer */
  905. };
  906. /************************************************************************
  907. * Download buffer structure.
  908. ************************************************************************/
  909. struct downld_t {
  910. u8 dl_type; /* Header */
  911. u8 dl_seq; /* Download sequence */
  912. ushort dl_srev; /* Software revision number */
  913. ushort dl_lrev; /* Low revision number */
  914. ushort dl_hrev; /* High revision number */
  915. ushort dl_seg; /* Start segment address */
  916. ushort dl_size; /* Number of bytes to download */
  917. u8 dl_data[1024]; /* Download data */
  918. };
  919. /************************************************************************
  920. * Per channel buffer structure
  921. ************************************************************************
  922. * Base Structure Entries Usage Meanings to Host *
  923. * *
  924. * W = read write R = read only *
  925. * C = changed by commands only *
  926. * U = unknown (may be changed w/o notice) *
  927. ************************************************************************/
  928. struct bs_t {
  929. unsigned short tp_jmp; /* Transmit poll jump */
  930. unsigned short tc_jmp; /* Cooked procedure jump */
  931. unsigned short ri_jmp; /* Not currently used */
  932. unsigned short rp_jmp; /* Receive poll jump */
  933. unsigned short tx_seg; /* W Tx segment */
  934. unsigned short tx_head; /* W Tx buffer head offset */
  935. unsigned short tx_tail; /* R Tx buffer tail offset */
  936. unsigned short tx_max; /* W Tx buffer size - 1 */
  937. unsigned short rx_seg; /* W Rx segment */
  938. unsigned short rx_head; /* W Rx buffer head offset */
  939. unsigned short rx_tail; /* R Rx buffer tail offset */
  940. unsigned short rx_max; /* W Rx buffer size - 1 */
  941. unsigned short tx_lw; /* W Tx buffer low water mark */
  942. unsigned short rx_lw; /* W Rx buffer low water mark */
  943. unsigned short rx_hw; /* W Rx buffer high water mark*/
  944. unsigned short incr; /* W Increment to next channel*/
  945. unsigned short fepdev; /* U SCC device base address */
  946. unsigned short edelay; /* W Exception delay */
  947. unsigned short blen; /* W Break length */
  948. unsigned short btime; /* U Break complete time */
  949. unsigned short iflag; /* C UNIX input flags */
  950. unsigned short oflag; /* C UNIX output flags */
  951. unsigned short cflag; /* C UNIX control flags */
  952. unsigned short wfill[13]; /* U Reserved for expansion */
  953. unsigned char num; /* U Channel number */
  954. unsigned char ract; /* U Receiver active counter */
  955. unsigned char bstat; /* U Break status bits */
  956. unsigned char tbusy; /* W Transmit busy */
  957. unsigned char iempty; /* W Transmit empty event */
  958. /* enable */
  959. unsigned char ilow; /* W Transmit low-water event */
  960. /* enable */
  961. unsigned char idata; /* W Receive data interrupt */
  962. /* enable */
  963. unsigned char eflag; /* U Host event flags */
  964. unsigned char tflag; /* U Transmit flags */
  965. unsigned char rflag; /* U Receive flags */
  966. unsigned char xmask; /* U Transmit ready flags */
  967. unsigned char xval; /* U Transmit ready value */
  968. unsigned char m_stat; /* RC Modem status bits */
  969. unsigned char m_change; /* U Modem bits which changed */
  970. unsigned char m_int; /* W Modem interrupt enable */
  971. /* bits */
  972. unsigned char m_last; /* U Last modem status */
  973. unsigned char mtran; /* C Unreported modem trans */
  974. unsigned char orun; /* C Buffer overrun occurred */
  975. unsigned char astartc; /* W Auxiliary Xon char */
  976. unsigned char astopc; /* W Auxiliary Xoff char */
  977. unsigned char startc; /* W Xon character */
  978. unsigned char stopc; /* W Xoff character */
  979. unsigned char vnextc; /* W Vnext character */
  980. unsigned char hflow; /* C Software flow control */
  981. unsigned char fillc; /* U Delay Fill character */
  982. unsigned char ochar; /* U Saved output character */
  983. unsigned char omask; /* U Output character mask */
  984. unsigned char bfill[13]; /* U Reserved for expansion */
  985. unsigned char scc[16]; /* U SCC registers */
  986. };
  987. struct cnode {
  988. struct cnode *next;
  989. int type;
  990. int numbrd;
  991. union {
  992. struct {
  993. char type; /* Board Type */
  994. long port; /* I/O Address */
  995. char *portstr; /* I/O Address in string */
  996. long addr; /* Memory Address */
  997. char *addrstr; /* Memory Address in string */
  998. long pcibus; /* PCI BUS */
  999. char *pcibusstr; /* PCI BUS in string */
  1000. long pcislot; /* PCI SLOT */
  1001. char *pcislotstr; /* PCI SLOT in string */
  1002. long nport; /* Number of Ports */
  1003. char *id; /* tty id */
  1004. long start; /* start of tty counting */
  1005. char *method; /* Install method */
  1006. char v_port;
  1007. char v_addr;
  1008. char v_pcibus;
  1009. char v_pcislot;
  1010. char v_nport;
  1011. char v_id;
  1012. char v_start;
  1013. char v_method;
  1014. char line1;
  1015. char line2;
  1016. char conc1; /* total concs in line1 */
  1017. char conc2; /* total concs in line2 */
  1018. char module1; /* total modules for line1 */
  1019. char module2; /* total modules for line2 */
  1020. char *status; /* config status */
  1021. char *dimstatus; /* Y/N */
  1022. int status_index; /* field pointer */
  1023. } board;
  1024. struct {
  1025. char *cable;
  1026. char v_cable;
  1027. long speed;
  1028. char v_speed;
  1029. } line;
  1030. struct {
  1031. char type;
  1032. char *connect;
  1033. long speed;
  1034. long nport;
  1035. char *id;
  1036. char *idstr;
  1037. long start;
  1038. char v_connect;
  1039. char v_speed;
  1040. char v_nport;
  1041. char v_id;
  1042. char v_start;
  1043. } conc;
  1044. struct {
  1045. char type;
  1046. long nport;
  1047. char *id;
  1048. char *idstr;
  1049. long start;
  1050. char v_nport;
  1051. char v_id;
  1052. char v_start;
  1053. } module;
  1054. char *ttyname;
  1055. char *cuname;
  1056. char *printname;
  1057. long majornumber;
  1058. long altpin;
  1059. long ttysize;
  1060. long chsize;
  1061. long bssize;
  1062. long unsize;
  1063. long f2size;
  1064. long vpixsize;
  1065. long useintr;
  1066. } u;
  1067. };
  1068. #endif