home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3535 < prev    next >
Encoding:
Internet Message Format  |  1991-06-24  |  59.1 KB

  1. From: gemini@geminix.in-berlin.de (Uwe Doering)
  2. Newsgroups: comp.unix.sysv386,comp.unix.xenix.sco,alt.sources
  3. Subject: FAS 2.09 async driver, part 4/4
  4. Message-ID: <7Q6RLQD@geminix.in-berlin.de>
  5. Date: 23 Jun 91 20:29:30 GMT
  6.  
  7. Submitted-by: gemini@geminix.in-berlin.de
  8. Archive-name: fas209/part04
  9.  
  10. #!/bin/sh
  11. # this is fas209.04 (part 4 of fas209)
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file fas.h continued
  14. #
  15. if test ! -r _shar_seq_.tmp; then
  16.     echo 'Please unpack part 1 first!'
  17.     exit 1
  18. fi
  19. (read Scheck
  20.  if test "$Scheck" != 4; then
  21.     echo Please unpack part "$Scheck" next!
  22.     exit 1
  23.  else
  24.     exit 0
  25.  fi
  26. ) < _shar_seq_.tmp || exit 1
  27. if test ! -f _shar_wnt_.tmp; then
  28.     echo 'x - still skipping fas.h'
  29. else
  30. echo 'x - continuing file fas.h'
  31. sed 's/^X//' << 'SHAR_EOF' >> 'fas.h' &&
  32. X#else
  33. X#define SPLWRK        spl6        /* SPL for character processing */
  34. X#define SPLINT        spltty        /* SPL to disable FAS interrupts */
  35. X#endif
  36. X
  37. X#if ((EVENT_TIME) * (HZ) / 1000) == 0
  38. X#undef EVENT_TIME
  39. X#define EVENT_TIME    (1000 / (HZ))
  40. X#endif
  41. X
  42. X#if (MAX_UNIX_FILL) > (TTYHOG)
  43. X#undef MAX_UNIX_FILL
  44. X#define MAX_UNIX_FILL    (TTYHOG)
  45. X#endif
  46. X
  47. X#if (MAX_VPIX_FILL) > (TTYHOG)
  48. X#undef MAX_VPIX_FILL
  49. X#define MAX_VPIX_FILL    (TTYHOG)
  50. X#endif
  51. X
  52. X#if (MIN_READ_CHUNK) > ((MAX_UNIX_FILL) / 2)
  53. X#undef MIN_READ_CHUNK
  54. X#define MIN_READ_CHUNK    ((MAX_UNIX_FILL) / 2)
  55. X#endif
  56. X
  57. X#if (MIN_READ_CHUNK) > ((MAX_VPIX_FILL) / 2)
  58. X#undef MIN_READ_CHUNK
  59. X#define MIN_READ_CHUNK    ((MAX_VPIX_FILL) / 2)
  60. X#endif
  61. X
  62. X#define MAX_INPUT_FIFO_SIZE    INPUT_NS_FIFO_SIZE
  63. X#define MAX_OUTPUT_FIFO_SIZE    OUTPUT_NS_FIFO_SIZE
  64. X
  65. X
  66. X/* Here are the modem control flags for the fas_modem array in space.c.
  67. X   They are arranged in three 8-bit masks which are combined to a 32-bit
  68. X   word. Each of these 32-bit words represents one entry in the fas_modem
  69. X   array.
  70. X
  71. X   The lowest byte is used as a mask to manipulate the modem control
  72. X   register for modem disable. Use the MC_* macros to build the mask.
  73. X
  74. X   The second lowest byte is used as a mask to manipulate the modem control
  75. X   register for modem enable during dialout. Use the MC_* macros to build
  76. X   the mask and shift them 8 bits to the left.
  77. X
  78. X   The second highest byte is used as a mask to manipulate the modem control
  79. X   register for modem enable during dialin. Use the MC_* macros to build
  80. X   the mask and shift them 16 bits to the left.
  81. X
  82. X   The highest byte is used to mask signals from the modem status
  83. X   register that will be used as the carrier detect signal. Use the MS_*
  84. X   macros to build the mask and shift them 24 bits to the left. If you use
  85. X   more than one signal, carrier is considered on only when all signals
  86. X   are on.
  87. X
  88. X   Here are some useful macros for the space.c file. You may create your
  89. X   own macros if you have some special requirements not met by the
  90. X   predefined ones.
  91. X*/
  92. X
  93. X/* modem disable (choose one) */
  94. X#define DI_RTS            ((ulong) MC_SET_RTS)
  95. X#define DI_DTR            ((ulong) MC_SET_DTR)
  96. X#define DI_RTS_AND_DTR        ((ulong) (MC_SET_RTS | MC_SET_DTR))
  97. X
  98. X/* modem enable for dialout (choose one) */
  99. X#define EO_RTS            ((ulong) MC_SET_RTS << 8)
  100. X#define EO_DTR            ((ulong) MC_SET_DTR << 8)
  101. X#define EO_RTS_AND_DTR        ((ulong) (MC_SET_RTS | MC_SET_DTR) << 8)
  102. X
  103. X/* modem enable for dialin (choose one) */
  104. X#define EI_RTS            ((ulong) MC_SET_RTS << 16)
  105. X#define EI_DTR            ((ulong) MC_SET_DTR << 16)
  106. X#define EI_RTS_AND_DTR        ((ulong) (MC_SET_RTS | MC_SET_DTR) << 16)
  107. X
  108. X/* carrier detect signal (choose one) */
  109. X#define CA_DCD            ((ulong) MS_DCD_PRESENT << 24)
  110. X#define CA_CTS            ((ulong) MS_CTS_PRESENT << 24)
  111. X#define CA_DSR            ((ulong) MS_DSR_PRESENT << 24)
  112. X
  113. X
  114. X/* Here are the hardware handshake flags for the fas_flow array in space.c.
  115. X   They are arranged in three 8-bit masks which are combined to a 32-bit
  116. X   word. Each of these 32-bit words represents one entry in the fas_flow
  117. X   array.
  118. X
  119. X   The lowest byte is used as a mask to manipulate the modem control
  120. X   register for input flow control. Use the MC_* macros to build the mask.
  121. X
  122. X   The second lowest byte is used to mask signals from the modem status
  123. X   register that will be used for output flow control. Use the MS_* macros
  124. X   to build the mask and shift them 8 bits to the left. If you use more
  125. X   than one signal, output is allowed only when all signals are on.
  126. X
  127. X   The second highest byte is used to mask signals from the modem status
  128. X   register that will be used to enable the output flow control selected
  129. X   by the second lowest byte. Use the MS_* macros to build the mask and
  130. X   shift them 16 bits to the left. If you use more than one signal, output
  131. X   flow control is enabled only when all signals are on.
  132. X
  133. X   The highest byte is used as a mask to manipulate the modem control
  134. X   register for output half duplex flow control. Use the MC_* macros to
  135. X   build the mask and shift them 24 bits to the left.
  136. X
  137. X   Here are some useful macros for the space.c file. You may create your
  138. X   own macros if you have some special requirements not met by the
  139. X   predefined ones.
  140. X*/
  141. X
  142. X/* input flow control (choose one) */
  143. X#define HI_RTS            ((ulong) MC_SET_RTS)
  144. X#define HI_DTR            ((ulong) MC_SET_DTR)
  145. X#define HI_RTS_AND_DTR        ((ulong) (MC_SET_RTS | MC_SET_DTR))
  146. X
  147. X/* output flow control (choose one) */
  148. X#define HO_CTS            ((ulong) MS_CTS_PRESENT << 8)
  149. X#define HO_DSR            ((ulong) MS_DSR_PRESENT << 8)
  150. X#define HO_CTS_AND_DSR        ((ulong) (MS_CTS_PRESENT | MS_DSR_PRESENT) \
  151. X                    << 8)
  152. X#define HO_CTS_ON_DSR        (((ulong) MS_CTS_PRESENT << 8) \
  153. X                | ((ulong) MS_DSR_PRESENT << 16))
  154. X#define HO_CTS_ON_DSR_AND_DCD    (((ulong) MS_CTS_PRESENT << 8) \
  155. X                | ((ulong) (MS_DSR_PRESENT | MS_DCD_PRESENT) \
  156. X                    << 16)) 
  157. X
  158. X/* output hdx flow control (choose one) */
  159. X#define HX_RTS            ((ulong) MC_SET_RTS << 24)
  160. X#define HX_DTR            ((ulong) MC_SET_DTR << 24)
  161. X#define HX_RTS_AND_DTR        ((ulong) (MC_SET_RTS | MC_SET_DTR) << 24)
  162. X
  163. X
  164. X/* define the local open flags */
  165. X
  166. X#define OS_DEVICE_CLOSED    0x0000
  167. X#define OS_OPEN_FOR_DIALOUT    0x0001
  168. X#define OS_OPEN_FOR_GETTY    0x0002
  169. X#define OS_WAIT_OPEN        0x0004
  170. X#define OS_NO_DIALOUT        0x0008
  171. X#define OS_FAKE_CARR_ON        0x0010
  172. X#define OS_CLOCAL        0x0020
  173. X#define OS_HWO_HANDSHAKE    0x0040
  174. X#define OS_HWI_HANDSHAKE    0x0080
  175. X#define OS_HDX_HANDSHAKE    0x0100
  176. X#define OS_EXCLUSIVE_OPEN_1    0x0200
  177. X#define OS_EXCLUSIVE_OPEN_2    0x0400    /* SYSV 3.2 Xenix compatibility */
  178. X
  179. X#define OS_OPEN_STATES        (OS_OPEN_FOR_DIALOUT | OS_OPEN_FOR_GETTY)
  180. X#define OS_TEST_MASK        (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \
  181. X                | OS_FAKE_CARR_ON | OS_CLOCAL \
  182. X                | OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \
  183. X                | OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1 \
  184. X                | OS_EXCLUSIVE_OPEN_2)
  185. X#define OS_SU_TEST_MASK        (OS_OPEN_FOR_DIALOUT | OS_NO_DIALOUT \
  186. X                | OS_FAKE_CARR_ON | OS_CLOCAL \
  187. X                | OS_HWO_HANDSHAKE | OS_HWI_HANDSHAKE \
  188. X                | OS_HDX_HANDSHAKE | OS_EXCLUSIVE_OPEN_1)
  189. X
  190. X/* define the device status flags */
  191. X
  192. X#define DF_DEVICE_CONFIGURED    0x0001    /* device is configured */
  193. X#define DF_DEVICE_IS_NS16550A    0x0002    /* it's an NS16550A */
  194. X#define DF_DEVICE_IS_I82510    0x0004    /* it's an I82510 */
  195. X#define DF_CTL_FIRST        0x0008    /* write ctl port at first access */
  196. X#define DF_CTL_EVERY        0x0010    /* write ctl port at every access */
  197. X#define DF_DEVICE_OPEN        0x0020    /* physical device is open */
  198. X#define DF_DEVICE_LOCKED    0x0040    /* physical device locked */
  199. X#define DF_MODEM_ENABLED    0x0080    /* modem enabled */
  200. X#define DF_XMIT_BUSY        0x0100    /* transmitter busy */
  201. X#define DF_XMIT_BREAK        0x0200    /* transmitter sends break */
  202. X#define DF_XMIT_LOCKED        0x0400    /* transmitter locked against output */
  203. X#define DF_DO_HANGUP        0x0800    /* delayed hangup request */
  204. X#define DF_DO_BREAK        0x1000    /* delayed break request */
  205. X#define DF_GUARD_TIMEOUT    0x2000    /* protect last char from corruption */
  206. X#define DF_NS16550A_DROP_MODE    0x4000    /* receiver trigger level is dropped */
  207. X#define DF_MSI_ENABLED        0x8000    /* modem status interrupts enabled */
  208. X
  209. X/* define the flow control status flags */
  210. X
  211. X#define FF_HWO_HANDSHAKE    0x0001    /* output hw handshake enabled */
  212. X#define FF_HWI_HANDSHAKE    0x0002    /* input hw handshake enabled */
  213. X#define FF_HDX_HANDSHAKE    0x0004    /* output hdx hw handshake enabled */
  214. X#define    FF_HWO_STOPPED        0x0008    /* output stopped by hw handshake */
  215. X#define FF_HWI_STOPPED        0x0010    /* input stopped by hw handshake */
  216. X#define FF_HDX_STARTED        0x0020    /* output buffer contains characters */
  217. X#define FF_SWO_STOPPED        0x0040    /* output stopped by sw flow control */
  218. X#define FF_SWI_STOPPED        0x0080    /* input stopped by sw flow control */
  219. X#define FF_SW_FC_REQ        0x0100    /* sw input flow control request */
  220. X#define FF_RXFER_STOPPED    0x0200    /* rxfer function stopped */
  221. X
  222. X/* define the scheduled events flags */
  223. X
  224. X#define EF_DO_RXFER        0x0001    /* rxfer function request */
  225. X#define EF_DO_XXFER        0x0002    /* xxfer function request */
  226. X#define EF_DO_BRKINT        0x0004    /* break int request */
  227. X#define EF_DO_MPROC        0x0008    /* mproc function request */
  228. X#define EF_SIGNAL_VPIX        0x0010    /* send pseudorupt to VP/ix */
  229. X#define EF_EMPTY_EVENT        0x0020    /* force execution of event_sched() */
  230. X
  231. X/* define an easy way to reference the port structures */
  232. X
  233. X#define RCV_DATA_PORT        (fip->port_0)
  234. X#define XMT_DATA_PORT        (fip->port_0)
  235. X#define INT_ENABLE_PORT        (fip->port_1)
  236. X#define INT_ID_PORT        (fip->port_2)
  237. X#define NS_FIFO_CTL_PORT    (fip->port_2)
  238. X#define I_BANK_PORT        (fip->port_2)
  239. X#define LINE_CTL_PORT        (fip->port_3)
  240. X#define MDM_CTL_PORT        (fip->port_4)
  241. X#define I_IDM_PORT        (fip->port_4)
  242. X#define LINE_STATUS_PORT    (fip->port_5)
  243. X#define I_RCM_PORT        (fip->port_5)
  244. X#define MDM_STATUS_PORT        (fip->port_6)
  245. X#define I_TCM_PORT        (fip->port_6)
  246. X#define DIVISOR_LSB_PORT    (fip->port_0)
  247. X#define DIVISOR_MSB_PORT    (fip->port_1)
  248. X#define CTL_PORT        (fip->ctl_port)
  249. X
  250. X/* modem control port */
  251. X
  252. X#define MC_SET_DTR        0x01
  253. X#define MC_SET_RTS        0x02
  254. X#define MC_SET_OUT1        0x04
  255. X#define MC_SET_OUT2        0x08    /* tristates int line when false */
  256. X#define MC_SET_LOOPBACK        0x10
  257. X
  258. X#define MC_ANY_CONTROL    (MC_SET_DTR | MC_SET_RTS)
  259. X
  260. X/* modem status port */
  261. X
  262. X#define MS_CTS_DELTA        0x01
  263. X#define MS_DSR_DELTA        0x02
  264. X#define MS_RING_TEDGE        0x04
  265. X#define MS_DCD_DELTA        0x08
  266. X#define MS_CTS_PRESENT        0x10
  267. X#define MS_DSR_PRESENT        0x20
  268. X#define MS_RING_PRESENT        0x40
  269. X#define MS_DCD_PRESENT        0x80
  270. X
  271. X#define MS_ANY_DELTA    (MS_CTS_DELTA | MS_DSR_DELTA | MS_RING_TEDGE \
  272. X                | MS_DCD_DELTA)
  273. X#define MS_ANY_PRESENT    (MS_CTS_PRESENT | MS_DSR_PRESENT | MS_RING_PRESENT \
  274. X                | MS_DCD_PRESENT)
  275. X
  276. X/* interrupt enable port */
  277. X
  278. X#define IE_NONE                0x00
  279. X#define    IE_RECV_DATA_AVAILABLE        0x01
  280. X#define    IE_XMIT_HOLDING_BUFFER_EMPTY    0x02
  281. X#define IE_LINE_STATUS            0x04
  282. X#define IE_MODEM_STATUS            0x08
  283. X
  284. X#define IE_INIT_MODE    (IE_RECV_DATA_AVAILABLE | IE_XMIT_HOLDING_BUFFER_EMPTY \
  285. X            | IE_LINE_STATUS)
  286. X
  287. X/* interrupt id port */
  288. X
  289. X#define II_NO_INTS_PENDING    0x01
  290. X#define II_CODE_MASK        0x07
  291. X#define II_MODEM_STATE        0x00
  292. X#define II_XMTD_CHAR        0x02
  293. X#define II_RCVD_CHAR        0x04
  294. X#define II_RCV_ERROR        0x06
  295. X#define II_NS_FIFO_TIMEOUT    0x08
  296. X#define II_NS_FIFO_ENABLED    0xC0
  297. X
  298. X/* line control port */
  299. X
  300. X#define    LC_WORDLEN_MASK        0x03
  301. X#define    LC_WORDLEN_5        0x00
  302. X#define    LC_WORDLEN_6        0x01
  303. X#define    LC_WORDLEN_7        0x02
  304. X#define    LC_WORDLEN_8        0x03
  305. X#define LC_STOPBITS_LONG    0x04
  306. X#define LC_ENABLE_PARITY    0x08
  307. X#define LC_EVEN_PARITY        0x10
  308. X#define LC_STICK_PARITY        0x20
  309. X#define LC_SET_BREAK_LEVEL    0x40
  310. X#define LC_ENABLE_DIVISOR    0x80
  311. X
  312. X/* line status port */
  313. X
  314. X#define LS_RCV_AVAIL        0x01
  315. X#define LS_OVERRUN        0x02
  316. X#define LS_PARITY_ERROR        0x04
  317. X#define LS_FRAMING_ERROR    0x08
  318. X#define LS_BREAK_DETECTED    0x10
  319. X#define LS_XMIT_AVAIL        0x20
  320. X#define LS_XMIT_COMPLETE    0x40
  321. X#define LS_ERROR_IN_NS_FIFO    0x80    /* NS16550A only */
  322. X#define LS_RCV_INT    (LS_RCV_AVAIL | LS_OVERRUN | LS_PARITY_ERROR \
  323. X            | LS_FRAMING_ERROR | LS_BREAK_DETECTED)
  324. X
  325. X/* fifo control port (NS16550A only) */
  326. X
  327. X#define    NS_FIFO_ENABLE        0x01
  328. X#define    NS_FIFO_CLR_RECV    0x02
  329. X#define    NS_FIFO_CLR_XMIT    0x04
  330. X#define    NS_FIFO_START_DMA    0x08
  331. X#define NS_FIFO_SIZE_1        0x00
  332. X#define NS_FIFO_SIZE_4        0x40
  333. X#define NS_FIFO_SIZE_8        0x80
  334. X#define NS_FIFO_SIZE_14        0xC0
  335. X#define NS_FIFO_SIZE_MASK    0xC0
  336. X
  337. X#define NS_FIFO_CLEAR_CMD    0
  338. X#define NS_FIFO_DROP_CMD    (NS_FIFO_SIZE_1 | NS_FIFO_ENABLE)
  339. X#define NS_FIFO_SETUP_CMD    (NS_FIFO_SIZE_4 | NS_FIFO_ENABLE)
  340. X#define NS_FIFO_INIT_CMD    (NS_FIFO_SETUP_CMD | NS_FIFO_CLR_RECV \
  341. X                | NS_FIFO_CLR_XMIT)
  342. X
  343. X#define INPUT_NS_FIFO_SIZE    16
  344. X#define OUTPUT_NS_FIFO_SIZE    16
  345. X
  346. X/* fifo control ports (i82510 only) */
  347. X
  348. X#define I_BANK_0        0x00
  349. X#define I_BANK_1        0x20
  350. X#define I_BANK_2        0x40
  351. X#define I_BANK_3        0x60
  352. X#define I_FIFO_ENABLE        0x08
  353. X#define I_FIFO_CLR_RECV        0x30
  354. X#define I_FIFO_CLR_XMIT        0x0c
  355. X
  356. X#define I_FIFO_CLEAR_CMD    0
  357. X#define I_FIFO_SETUP_CMD    I_FIFO_ENABLE
  358. X
  359. X#define INPUT_I_FIFO_SIZE    4
  360. X#define OUTPUT_I_FIFO_SIZE    4
  361. X
  362. X/* defines for ioctl calls (VP/ix) */
  363. X
  364. X#define AIOC            ('A'<<8)
  365. X#define AIOCINTTYPE        (AIOC|60)    /* set interrupt type */
  366. X#define AIOCDOSMODE        (AIOC|61)    /* set DOS mode */
  367. X#define AIOCNONDOSMODE        (AIOC|62)    /* reset DOS mode */
  368. X#define AIOCSERIALOUT        (AIOC|63)    /* serial device data write */
  369. X#define AIOCSERIALIN        (AIOC|64)    /* serial device data read */
  370. X#define AIOCSETSS        (AIOC|65)    /* set start/stop chars */
  371. X#define AIOCINFO        (AIOC|66)    /* tell us what device we are */
  372. X
  373. X/* ioctl alternate names used by VP/ix */
  374. X
  375. X#define VPC_SERIAL_DOS        AIOCDOSMODE
  376. X#define VPC_SERIAL_NONDOS    AIOCNONDOSMODE
  377. X#define VPC_SERIAL_INFO        AIOCINFO
  378. X#define VPC_SERIAL_OUT        AIOCSERIALOUT
  379. X#define VPC_SERIAL_IN        AIOCSERIALIN
  380. X
  381. X/* serial in/out requests */
  382. X
  383. X#define SO_DIVLLSB        1
  384. X#define SO_DIVLMSB        2
  385. X#define SO_LCR            3
  386. X#define SO_MCR            4
  387. X#define SI_MSR            1
  388. X#define SIO_MASK(x)        (1<<((x)-1))
  389. X
  390. X
  391. X/* This structure contains everything one would like to know about
  392. X   an open device.  There is one of it for each physical unit.
  393. X
  394. X   We use several unions to eliminate most integer type conversions
  395. X   at run-time. The standard UNIX V 3.X/386 C compiler forces all
  396. X   operands in expressions and all function parameters to type int.
  397. X   To save some time, with the means of unions we deliver type int
  398. X   at the proper locations while dealing with the original type
  399. X   wherever int would be slower.
  400. X
  401. X   This is highly compiler implementation specific. But for the sake
  402. X   of speed the end justifies the means.
  403. X
  404. X   Take care that the size of the area that contains the various
  405. X   structure fields (up to, but excluding the ring buffers)
  406. X   is <= 128 bytes. Otherwise a 4-byte offset is used to access
  407. X   some of the structure fields. For the first 128 bytes a 1-byte
  408. X   offset is used, which is faster.
  409. X*/
  410. X
  411. Xstruct    fas_info
  412. X{
  413. X    struct    tty    *tty;    /* the tty structure */
  414. X    struct    fas_info *prev_int_user;/* link to previous fas_info struct */
  415. X    struct    fas_info *next_int_user;/* link to next fas_info struct */
  416. X    int    timeout_idx;    /* timeout index for untimeout () */
  417. X    uint    iflag;        /* current terminal input flags */
  418. X    uint    cflag;        /* current terminal hardware control flags */
  419. X    union {            /* flags about the device state */
  420. X        ushort    s;
  421. X        uint    i;
  422. X    } device_flags;
  423. X    union {            /* flags about the flow control state */
  424. X        ushort    s;
  425. X        uint    i;
  426. X    } flow_flags;
  427. X    union {            /* flags about the scheduled events */
  428. X        ushort    s;
  429. X        uint    i;
  430. X    } event_flags;
  431. X    uint    o_state;    /* current open state */
  432. X    uint    po_state;    /* previous open state */
  433. X    union {            /* modem control masks */
  434. X        struct {
  435. X            unchar    di;    /* mask for modem disable */
  436. X            unchar    eo;    /* mask for modem enable (dialout) */
  437. X            unchar    ei;    /* mask for modem enable (dialin) */
  438. X            unchar    ca;    /* mask for carrier detect */
  439. X        } m;
  440. X        ulong    l;
  441. X    } modem;
  442. X    union {            /* hardware flow control masks */
  443. X        struct {
  444. X            unchar    ic;    /* control mask for inp. flow ctrl */
  445. X            unchar    oc;    /* control mask for outp. flow ctrl */
  446. X            unchar    oe;    /* enable mask for outp. flow ctrl */
  447. X            unchar    hc;    /* control mask for hdx flow ctrl */
  448. X        } m;
  449. X        ulong    l;
  450. X    } flow;
  451. X    unchar    msr;        /* modem status register value */
  452. X    unchar    new_msr;    /* new modem status register value */
  453. X    unchar    mcr;        /* modem control register value */
  454. X    unchar    lcr;        /* line control register value */
  455. X    unchar    ier;        /* interrupt enable register value */
  456. X    unchar    vec;        /* interrupt vector for this struct */
  457. X#if defined (HAVE_VPIX)
  458. X    unchar    v86_intmask;    /* VP/ix pseudorupt mask */
  459. X    v86_t    *v86_proc;    /* VP/ix v86proc pointer for pseudorupts */
  460. X    struct termss    v86_ss;    /* VP/ix start/stop characters */
  461. X#endif
  462. X    uint    ctl_port;    /* muliplexer control port */
  463. X    union {            /* uart port addresses and control values */
  464. X        uint    addr;
  465. X        struct {
  466. X            ushort    addr;
  467. X            unchar    ctl;
  468. X        } p;
  469. X    } port_0, port_1, port_2, port_3, port_4, port_5, port_6;
  470. X    uint    recv_ring_cnt;    /* receiver ring buffer counter */
  471. X    unchar    *recv_ring_put_ptr;    /* recv ring buf put ptr */
  472. X    unchar    *recv_ring_take_ptr;    /* recv ring buf take ptr */
  473. X    ushort    xmit_fifo_size;    /* transmitter FIFO size */
  474. X    ushort    xmit_ring_size;    /* transmitter ring buffer size */
  475. X    uint    xmit_ring_cnt;    /* transmitter ring buffer counter */
  476. X    unchar    *xmit_ring_put_ptr;    /* xmit ring buf put ptr */
  477. X    unchar    *xmit_ring_take_ptr;    /* xmit ring buf take ptr */
  478. X    unchar    recv_buffer [RECV_BUFF_SIZE];    /* recv ring buf */
  479. X    unchar    xmit_buffer [XMIT_BUFF_SIZE];    /* xmit ring buf */
  480. X};
  481. SHAR_EOF
  482. echo 'File fas.h is complete' &&
  483. true || echo 'restore of fas.h failed'
  484. rm -f _shar_wnt_.tmp
  485. fi
  486. # ============= i_fas-ast4 ==============
  487. if test -f 'i_fas-ast4' -a X"$1" != X"-c"; then
  488.     echo 'x - skipping i_fas-ast4 (File already exists)'
  489.     rm -f _shar_wnt_.tmp
  490. else
  491. > _shar_wnt_.tmp
  492. echo 'x - extracting i_fas-ast4 (Text)'
  493. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast4' &&
  494. XF0:23:off:/etc/getty ttyFM00 9600
  495. XF1:23:off:/etc/getty ttyFM01 9600
  496. XF2:23:off:/etc/getty ttyFM02 9600
  497. XF3:23:off:/etc/getty ttyFM03 9600
  498. SHAR_EOF
  499. true || echo 'restore of i_fas-ast4 failed'
  500. rm -f _shar_wnt_.tmp
  501. fi
  502. # ============= i_fas-ast4c12 ==============
  503. if test -f 'i_fas-ast4c12' -a X"$1" != X"-c"; then
  504.     echo 'x - skipping i_fas-ast4c12 (File already exists)'
  505.     rm -f _shar_wnt_.tmp
  506. else
  507. > _shar_wnt_.tmp
  508. echo 'x - extracting i_fas-ast4c12 (Text)'
  509. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast4c12' &&
  510. XF0:23:off:/etc/getty ttyFM00 9600
  511. XF1:23:off:/etc/getty ttyFM01 9600
  512. XF2:23:off:/etc/getty ttyFM02 9600
  513. XF3:23:off:/etc/getty ttyFM03 9600
  514. XF4:23:off:/etc/getty ttyFM04 9600
  515. XF5:23:off:/etc/getty ttyFM05 9600
  516. SHAR_EOF
  517. true || echo 'restore of i_fas-ast4c12 failed'
  518. rm -f _shar_wnt_.tmp
  519. fi
  520. # ============= i_fas-c1-2 ==============
  521. if test -f 'i_fas-c1-2' -a X"$1" != X"-c"; then
  522.     echo 'x - skipping i_fas-c1-2 (File already exists)'
  523.     rm -f _shar_wnt_.tmp
  524. else
  525. > _shar_wnt_.tmp
  526. echo 'x - extracting i_fas-c1-2 (Text)'
  527. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c1-2' &&
  528. XF0:23:off:/etc/getty ttyFM00 9600
  529. XF1:23:off:/etc/getty ttyFM01 9600
  530. SHAR_EOF
  531. true || echo 'restore of i_fas-c1-2 failed'
  532. rm -f _shar_wnt_.tmp
  533. fi
  534. # ============= i_fas-c1-3 ==============
  535. if test -f 'i_fas-c1-3' -a X"$1" != X"-c"; then
  536.     echo 'x - skipping i_fas-c1-3 (File already exists)'
  537.     rm -f _shar_wnt_.tmp
  538. else
  539. > _shar_wnt_.tmp
  540. echo 'x - extracting i_fas-c1-3 (Text)'
  541. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c1-3' &&
  542. XF0:23:off:/etc/getty ttyFM00 9600
  543. XF1:23:off:/etc/getty ttyFM01 9600
  544. XF2:23:off:/etc/getty ttyFM02 9600
  545. SHAR_EOF
  546. true || echo 'restore of i_fas-c1-3 failed'
  547. rm -f _shar_wnt_.tmp
  548. fi
  549. # ============= i_fas-hub6 ==============
  550. if test -f 'i_fas-hub6' -a X"$1" != X"-c"; then
  551.     echo 'x - skipping i_fas-hub6 (File already exists)'
  552.     rm -f _shar_wnt_.tmp
  553. else
  554. > _shar_wnt_.tmp
  555. echo 'x - extracting i_fas-hub6 (Text)'
  556. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-hub6' &&
  557. XF0:23:off:/etc/getty ttyFM00 9600
  558. XF1:23:off:/etc/getty ttyFM01 9600
  559. XF2:23:off:/etc/getty ttyFM02 9600
  560. XF3:23:off:/etc/getty ttyFM03 9600
  561. XF4:23:off:/etc/getty ttyFM04 9600
  562. XF5:23:off:/etc/getty ttyFM05 9600
  563. SHAR_EOF
  564. true || echo 'restore of i_fas-hub6 failed'
  565. rm -f _shar_wnt_.tmp
  566. fi
  567. # ============= n_fas-ast4 ==============
  568. if test -f 'n_fas-ast4' -a X"$1" != X"-c"; then
  569.     echo 'x - skipping n_fas-ast4 (File already exists)'
  570.     rm -f _shar_wnt_.tmp
  571. else
  572. > _shar_wnt_.tmp
  573. echo 'x - extracting n_fas-ast4 (Text)'
  574. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast4' &&
  575. Xfas    ttyF00    c    80
  576. Xfas    ttyF01    c    81
  577. Xfas    ttyF02    c    82
  578. Xfas    ttyF03    c    83
  579. Xfas    ttyFM00    c    208
  580. Xfas    ttyFM01    c    209
  581. Xfas    ttyFM02    c    210
  582. Xfas    ttyFM03    c    211
  583. SHAR_EOF
  584. true || echo 'restore of n_fas-ast4 failed'
  585. rm -f _shar_wnt_.tmp
  586. fi
  587. # ============= n_fas-ast4c12 ==============
  588. if test -f 'n_fas-ast4c12' -a X"$1" != X"-c"; then
  589.     echo 'x - skipping n_fas-ast4c12 (File already exists)'
  590.     rm -f _shar_wnt_.tmp
  591. else
  592. > _shar_wnt_.tmp
  593. echo 'x - extracting n_fas-ast4c12 (Text)'
  594. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast4c12' &&
  595. Xfas    ttyF00    c    80
  596. Xfas    ttyF01    c    81
  597. Xfas    ttyF02    c    82
  598. Xfas    ttyF03    c    83
  599. Xfas    ttyF04    c    84
  600. Xfas    ttyF05    c    85
  601. Xfas    ttyFM00    c    208
  602. Xfas    ttyFM01    c    209
  603. Xfas    ttyFM02    c    210
  604. Xfas    ttyFM03    c    211
  605. Xfas    ttyFM04    c    212
  606. Xfas    ttyFM05    c    213
  607. SHAR_EOF
  608. true || echo 'restore of n_fas-ast4c12 failed'
  609. rm -f _shar_wnt_.tmp
  610. fi
  611. # ============= n_fas-c1-2 ==============
  612. if test -f 'n_fas-c1-2' -a X"$1" != X"-c"; then
  613.     echo 'x - skipping n_fas-c1-2 (File already exists)'
  614.     rm -f _shar_wnt_.tmp
  615. else
  616. > _shar_wnt_.tmp
  617. echo 'x - extracting n_fas-c1-2 (Text)'
  618. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c1-2' &&
  619. Xfas    ttyF00    c    80
  620. Xfas    ttyF01    c    81
  621. Xfas    ttyFM00    c    208
  622. Xfas    ttyFM01    c    209
  623. SHAR_EOF
  624. true || echo 'restore of n_fas-c1-2 failed'
  625. rm -f _shar_wnt_.tmp
  626. fi
  627. # ============= n_fas-c1-3 ==============
  628. if test -f 'n_fas-c1-3' -a X"$1" != X"-c"; then
  629.     echo 'x - skipping n_fas-c1-3 (File already exists)'
  630.     rm -f _shar_wnt_.tmp
  631. else
  632. > _shar_wnt_.tmp
  633. echo 'x - extracting n_fas-c1-3 (Text)'
  634. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c1-3' &&
  635. Xfas    ttyF00    c    80
  636. Xfas    ttyF01    c    81
  637. Xfas    ttyF02    c    82
  638. Xfas    ttyFM00    c    208
  639. Xfas    ttyFM01    c    209
  640. Xfas    ttyFM02    c    210
  641. SHAR_EOF
  642. true || echo 'restore of n_fas-c1-3 failed'
  643. rm -f _shar_wnt_.tmp
  644. fi
  645. # ============= n_fas-hub6 ==============
  646. if test -f 'n_fas-hub6' -a X"$1" != X"-c"; then
  647.     echo 'x - skipping n_fas-hub6 (File already exists)'
  648.     rm -f _shar_wnt_.tmp
  649. else
  650. > _shar_wnt_.tmp
  651. echo 'x - extracting n_fas-hub6 (Text)'
  652. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-hub6' &&
  653. Xfas    ttyF00    c    80
  654. Xfas    ttyF01    c    81
  655. Xfas    ttyF02    c    82
  656. Xfas    ttyF03    c    83
  657. Xfas    ttyF04    c    84
  658. Xfas    ttyF05    c    85
  659. Xfas    ttyFM00    c    208
  660. Xfas    ttyFM01    c    209
  661. Xfas    ttyFM02    c    210
  662. Xfas    ttyFM03    c    211
  663. Xfas    ttyFM04    c    212
  664. Xfas    ttyFM05    c    213
  665. SHAR_EOF
  666. true || echo 'restore of n_fas-hub6 failed'
  667. rm -f _shar_wnt_.tmp
  668. fi
  669. # ============= s_fas-ast4 ==============
  670. if test -f 's_fas-ast4' -a X"$1" != X"-c"; then
  671.     echo 'x - skipping s_fas-ast4 (File already exists)'
  672.     rm -f _shar_wnt_.tmp
  673. else
  674. > _shar_wnt_.tmp
  675. echo 'x - extracting s_fas-ast4 (Text)'
  676. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast4' &&
  677. Xfas    Y    4    7    1    4    2a0    2bf    0    0
  678. SHAR_EOF
  679. true || echo 'restore of s_fas-ast4 failed'
  680. rm -f _shar_wnt_.tmp
  681. fi
  682. # ============= s_fas-ast4c12 ==============
  683. if test -f 's_fas-ast4c12' -a X"$1" != X"-c"; then
  684.     echo 'x - skipping s_fas-ast4c12 (File already exists)'
  685.     rm -f _shar_wnt_.tmp
  686. else
  687. > _shar_wnt_.tmp
  688. echo 'x - extracting s_fas-ast4c12 (Text)'
  689. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast4c12' &&
  690. Xfas    Y    4    7    1    9    2a0    2bf    0    0
  691. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  692. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  693. SHAR_EOF
  694. true || echo 'restore of s_fas-ast4c12 failed'
  695. rm -f _shar_wnt_.tmp
  696. fi
  697. # ============= s_fas-c1-2 ==============
  698. if test -f 's_fas-c1-2' -a X"$1" != X"-c"; then
  699.     echo 'x - skipping s_fas-c1-2 (File already exists)'
  700.     rm -f _shar_wnt_.tmp
  701. else
  702. > _shar_wnt_.tmp
  703. echo 'x - extracting s_fas-c1-2 (Text)'
  704. sed 's/^X//' << 'SHAR_EOF' > 's_fas-c1-2' &&
  705. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  706. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  707. SHAR_EOF
  708. true || echo 'restore of s_fas-c1-2 failed'
  709. rm -f _shar_wnt_.tmp
  710. fi
  711. # ============= s_fas-c1-3 ==============
  712. if test -f 's_fas-c1-3' -a X"$1" != X"-c"; then
  713.     echo 'x - skipping s_fas-c1-3 (File already exists)'
  714.     rm -f _shar_wnt_.tmp
  715. else
  716. > _shar_wnt_.tmp
  717. echo 'x - extracting s_fas-c1-3 (Text)'
  718. sed 's/^X//' << 'SHAR_EOF' > 's_fas-c1-3' &&
  719. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  720. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  721. Xfas    Y    1    7    1    9    3e8    3ef    0    0
  722. SHAR_EOF
  723. true || echo 'restore of s_fas-c1-3 failed'
  724. rm -f _shar_wnt_.tmp
  725. fi
  726. # ============= s_fas-hub6 ==============
  727. if test -f 's_fas-hub6' -a X"$1" != X"-c"; then
  728.     echo 'x - skipping s_fas-hub6 (File already exists)'
  729.     rm -f _shar_wnt_.tmp
  730. else
  731. > _shar_wnt_.tmp
  732. echo 'x - extracting s_fas-hub6 (Text)'
  733. sed 's/^X//' << 'SHAR_EOF' > 's_fas-hub6' &&
  734. Xfas    Y    6    7    1    3    302    308    0    0
  735. SHAR_EOF
  736. true || echo 'restore of s_fas-hub6 failed'
  737. rm -f _shar_wnt_.tmp
  738. fi
  739. # ============= space-ast4 ==============
  740. if test -f 'space-ast4' -a X"$1" != X"-c"; then
  741.     echo 'x - skipping space-ast4 (File already exists)'
  742.     rm -f _shar_wnt_.tmp
  743. else
  744. > _shar_wnt_.tmp
  745. echo 'x - extracting space-ast4 (Text)'
  746. sed 's/^X//' << 'SHAR_EOF' > 'space-ast4' &&
  747. X/* Async device configuration file for the FAS async driver. */
  748. X
  749. X/* This version is for the AST 4-port card in expanded mode.
  750. X*/
  751. X/* FAS was developed by
  752. XUwe Doering             INET : gemini@geminix.in-berlin.de
  753. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  754. X1000 Berlin 20
  755. XGermany
  756. X*/
  757. X
  758. X#if !defined (M_I286)
  759. X#ident    "@(#)space.c    2.09"
  760. X#endif
  761. X
  762. X#if defined (XENIX)
  763. X#include "fas.h"
  764. X#else
  765. X#include <sys/fas.h>
  766. X#endif
  767. X
  768. X/* This is the number of devices to be handled by this driver.
  769. X   You may define up to 16 devices.  If this number is changed
  770. X   the arrays below must be filled in accordingly.
  771. X*/
  772. X#define NUM_PHYSICAL_UNITS    4
  773. X
  774. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  775. X#undef NUM_PHYSICAL_UNITS
  776. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  777. X#endif
  778. X
  779. X/* let the driver know the number of devices */
  780. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  781. X
  782. X/* array of base port addresses
  783. X   If you deliberately want to force off the FIFOs of a UART you have
  784. X   to "or" the NO_FIFO macro to its base port address. This is useful
  785. X   for mouse devices where you need immediate response to the mouse
  786. X   movement.
  787. X*/
  788. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  789. X{
  790. X    0x2a0,    0x2a8,    0x2b0,    0x2b8
  791. X};
  792. X
  793. X/* array of interrupt vectors */
  794. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  795. X{
  796. X    0x4,    0x4,    0x4,    0x4
  797. X};
  798. X
  799. X/* initialization sequence for serial card
  800. X   This array contains pairs of values of the form:
  801. X
  802. X        portaddress, value,
  803. X              :
  804. X              :
  805. X        portaddress, value,
  806. X        0
  807. X
  808. X   For every line `value' will be written to `portaddress'. If
  809. X   `value' is replaced with the macro `READ_PORT' then a value
  810. X   is read from `portaddress' instead. The value itself will be
  811. X   discarded. Therefore, this makes only sense if the read access
  812. X   to the port has a side effect like setting or resetting
  813. X   certain flags.
  814. X
  815. X   NOTE: This array *must* be terminated with a value of 0
  816. X         in the portaddress column!
  817. X*/
  818. Xuint    fas_init_seq [] =
  819. X{
  820. X    0x2bf,    0x80,
  821. X    0
  822. X};
  823. X
  824. X/* initial modem control port info
  825. X   This value is ored into the modem control value for each UART. This is
  826. X   normaly used to force out2 which is used to enable the interrupts of
  827. X   the standard com1 and com2 ports. Several brands of cards have modes
  828. X   that allow them to work in compatible mode like com1 and com2 or as a
  829. X   shared interrupts card. One of these cards is the AST 4-port card. When
  830. X   this card is used in shared interrupts mode out2 must _not_ be set.
  831. X
  832. X   Note: This is one of the major trouble-spots with shared interrupts
  833. X   cards. Check your manual.
  834. X*/
  835. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  836. X{
  837. X    0,    0,    0,    0
  838. X};
  839. X
  840. X/* array of modem control flags
  841. X   You can choose which signals to use for modem control. See fas.h
  842. X   for possible names and values. Whether or not modem control is
  843. X   used is determined by the minor device number at open time.
  844. X*/
  845. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  846. X{
  847. X    EO_DTR | EI_DTR | CA_DCD,
  848. X    EO_DTR | EI_DTR | CA_DCD,
  849. X    EO_DTR | EI_DTR | CA_DCD,
  850. X    EO_DTR | EI_DTR | CA_DCD
  851. X};
  852. X
  853. X/* array of hardware flow control flags
  854. X   You can choose which signals to use for hardware handshake. See fas.h
  855. X   for possible names and values. Whether or not hardware handshake is
  856. X   used is determined by the minor device number at open time and by the
  857. X   RTSFLOW/CTSFLOW termio(7) flags.
  858. X*/
  859. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  860. X{
  861. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  862. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  863. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  864. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  865. X};
  866. X
  867. X/* array of control register addresses
  868. X   There are serial boards available that have all serial ports
  869. X   multiplexed to one address location in order to save I/O address
  870. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  871. X   by a special register that needs to be written to before the actual
  872. X   port registers can be accessed. This array contains the addresses
  873. X   of these special registers.
  874. X   Enter the addresses on a per unit base. An address of zero
  875. X   disables this feature.
  876. X*/
  877. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  878. X{
  879. X    0,    0,    0,    0
  880. X};
  881. X
  882. X/* array of control register values
  883. X   These values are written to the corresponding control register
  884. X   before the first access to the actual port registers. If not only
  885. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  886. X   single registers of the UART chips need to be multiplexed to one
  887. X   address you have to "or" a bit mask (shifted 8 times to the left)
  888. X   to the control register value. This mask determines at which bit
  889. X   locations the UART chip register number is "xored" into the control
  890. X   register value at runtime. This implies that you can also use
  891. X   negative logic by setting the bits in the control register value
  892. X   to 1 at the locations corresponding to the bit mask.
  893. X*/
  894. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  895. X{
  896. X    0,    0,    0,    0
  897. X};
  898. X
  899. X/* additional configurations for shared interrupts boards
  900. X   If you have a shared interrupts board, you may have to acknowledge
  901. X   interrupts by writing to a special register. The following arrays
  902. X   contain the special register addresses and the corresponding values
  903. X   that are written to them in response to an interrupt.
  904. X*/
  905. X
  906. X/* array of int ack register addresses
  907. X   These registers are written to every time after all interrupt
  908. X   sources in all of the UARTs that are tied to the corresponding
  909. X   interrupt vector have been cleared.
  910. X   Enter the addresses on a per vector base. An address of zero
  911. X   disables this feature.
  912. X*/
  913. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  914. X{
  915. X    0,    0,    0,    0,
  916. X    0,    0,    0,    0,
  917. X    0,    0,    0,    0,
  918. X    0,    0,    0,    0,
  919. X    0,    0,    0,    0,
  920. X    0,    0,    0,    0,
  921. X    0,    0,    0,    0,
  922. X    0,    0,    0,    0
  923. X};
  924. X
  925. X/* array of int ack values
  926. X   These values are written to the corresponding int ack register
  927. X   in response to an interrupt.
  928. X*/
  929. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  930. X{
  931. X    0,    0,    0,    0,
  932. X    0,    0,    0,    0,
  933. X    0,    0,    0,    0,
  934. X    0,    0,    0,    0,
  935. X    0,    0,    0,    0,
  936. X    0,    0,    0,    0,
  937. X    0,    0,    0,    0,
  938. X    0,    0,    0,    0
  939. X};
  940. X
  941. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  942. X   ============================================
  943. X*/
  944. X
  945. X/* array of structures to hold all info for a physical minor device */
  946. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  947. X
  948. X/* array of ttys for logical minor devices */
  949. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  950. X
  951. X/* array of pointers to fas_info structures
  952. X   this prevents time consuming multiplications for index calculation
  953. X*/
  954. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  955. X
  956. X/* array of pointers to fas_tty structures
  957. X   this prevents time consuming multiplications for index calculation
  958. X*/
  959. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  960. SHAR_EOF
  961. true || echo 'restore of space-ast4 failed'
  962. rm -f _shar_wnt_.tmp
  963. fi
  964. # ============= space-ast4c12 ==============
  965. if test -f 'space-ast4c12' -a X"$1" != X"-c"; then
  966.     echo 'x - skipping space-ast4c12 (File already exists)'
  967.     rm -f _shar_wnt_.tmp
  968. else
  969. > _shar_wnt_.tmp
  970. echo 'x - extracting space-ast4c12 (Text)'
  971. sed 's/^X//' << 'SHAR_EOF' > 'space-ast4c12' &&
  972. X/* Async device configuration file for the FAS async driver. */
  973. X
  974. X/* This version is for the AST 4-port card in expanded mode plus
  975. X   the standard COM1 and COM2 ports.
  976. X*/
  977. X/* FAS was developed by
  978. XUwe Doering             INET : gemini@geminix.in-berlin.de
  979. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  980. X1000 Berlin 20
  981. XGermany
  982. X*/
  983. X
  984. X#if !defined (M_I286)
  985. X#ident    "@(#)space.c    2.09"
  986. X#endif
  987. X
  988. X#if defined (XENIX)
  989. X#include "fas.h"
  990. X#else
  991. X#include <sys/fas.h>
  992. X#endif
  993. X
  994. X/* This is the number of devices to be handled by this driver.
  995. X   You may define up to 16 devices.  If this number is changed
  996. X   the arrays below must be filled in accordingly.
  997. X*/
  998. X#define NUM_PHYSICAL_UNITS    6
  999. X
  1000. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1001. X#undef NUM_PHYSICAL_UNITS
  1002. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1003. X#endif
  1004. X
  1005. X/* let the driver know the number of devices */
  1006. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1007. X
  1008. X/* array of base port addresses
  1009. X   If you deliberately want to force off the FIFOs of a UART you have
  1010. X   to "or" the NO_FIFO macro to its base port address. This is useful
  1011. X   for mouse devices where you need immediate response to the mouse
  1012. X   movement.
  1013. X*/
  1014. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  1015. X{
  1016. X    0x2a0,    0x2a8,    0x2b0,    0x2b8,
  1017. X    0x3f8,    0x2f8
  1018. X};
  1019. X
  1020. X/* array of interrupt vectors */
  1021. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  1022. X{
  1023. X    0x9,    0x9,    0x9,    0x9,
  1024. X    0x4,    0x3
  1025. X};
  1026. X
  1027. X/* initialization sequence for serial card
  1028. X   This array contains pairs of values of the form:
  1029. X
  1030. X        portaddress, value,
  1031. X              :
  1032. X              :
  1033. X        portaddress, value,
  1034. X        0
  1035. X
  1036. X   For every line `value' will be written to `portaddress'. If
  1037. X   `value' is replaced with the macro `READ_PORT' then a value
  1038. X   is read from `portaddress' instead. The value itself will be
  1039. X   discarded. Therefore, this makes only sense if the read access
  1040. X   to the port has a side effect like setting or resetting
  1041. X   certain flags.
  1042. X
  1043. X   NOTE: This array *must* be terminated with a value of 0
  1044. X         in the portaddress column!
  1045. X*/
  1046. Xuint    fas_init_seq [] =
  1047. X{
  1048. X    0x2bf,    0x80,
  1049. X    0
  1050. X};
  1051. X
  1052. X/* initial modem control port info
  1053. X   This value is ored into the modem control value for each UART. This is
  1054. X   normaly used to force out2 which is used to enable the interrupts of
  1055. X   the standard com1 and com2 ports. Several brands of cards have modes
  1056. X   that allow them to work in compatible mode like com1 and com2 or as a
  1057. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1058. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1059. X
  1060. X   Note: This is one of the major trouble-spots with shared interrupts
  1061. X   cards. Check your manual.
  1062. X*/
  1063. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1064. X{
  1065. X    0,    0,    0,    0,
  1066. X    MC_SET_OUT2,    MC_SET_OUT2
  1067. X};
  1068. X
  1069. X/* array of modem control flags
  1070. X   You can choose which signals to use for modem control. See fas.h
  1071. X   for possible names and values. Whether or not modem control is
  1072. X   used is determined by the minor device number at open time.
  1073. X*/
  1074. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1075. X{
  1076. X    EO_DTR | EI_DTR | CA_DCD,
  1077. X    EO_DTR | EI_DTR | CA_DCD,
  1078. X    EO_DTR | EI_DTR | CA_DCD,
  1079. X    EO_DTR | EI_DTR | CA_DCD,
  1080. X    EO_DTR | EI_DTR | CA_DCD,
  1081. X    EO_DTR | EI_DTR | CA_DCD
  1082. X};
  1083. X
  1084. X/* array of hardware flow control flags
  1085. X   You can choose which signals to use for hardware handshake. See fas.h
  1086. X   for possible names and values. Whether or not hardware handshake is
  1087. X   used is determined by the minor device number at open time and by the
  1088. X   RTSFLOW/CTSFLOW termio(7) flags.
  1089. X*/
  1090. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1091. X{
  1092. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1093. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1094. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1095. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1096. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1097. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1098. X};
  1099. X
  1100. X/* array of control register addresses
  1101. X   There are serial boards available that have all serial ports
  1102. X   multiplexed to one address location in order to save I/O address
  1103. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1104. X   by a special register that needs to be written to before the actual
  1105. X   port registers can be accessed. This array contains the addresses
  1106. X   of these special registers.
  1107. X   Enter the addresses on a per unit base. An address of zero
  1108. X   disables this feature.
  1109. X*/
  1110. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1111. X{
  1112. X    0,    0,    0,    0,
  1113. X    0,    0
  1114. X};
  1115. X
  1116. X/* array of control register values
  1117. X   These values are written to the corresponding control register
  1118. X   before the first access to the actual port registers. If not only
  1119. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1120. X   single registers of the UART chips need to be multiplexed to one
  1121. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1122. X   to the control register value. This mask determines at which bit
  1123. X   locations the UART chip register number is "xored" into the control
  1124. X   register value at runtime. This implies that you can also use
  1125. X   negative logic by setting the bits in the control register value
  1126. X   to 1 at the locations corresponding to the bit mask.
  1127. X*/
  1128. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1129. X{
  1130. X    0,    0,    0,    0,
  1131. X    0,    0
  1132. X};
  1133. X
  1134. X/* additional configurations for shared interrupts boards
  1135. X   If you have a shared interrupts board, you may have to acknowledge
  1136. X   interrupts by writing to a special register. The following arrays
  1137. X   contain the special register addresses and the corresponding values
  1138. X   that are written to them in response to an interrupt.
  1139. X*/
  1140. X
  1141. X/* array of int ack register addresses
  1142. X   These registers are written to every time after all interrupt
  1143. X   sources in all of the UARTs that are tied to the corresponding
  1144. X   interrupt vector have been cleared.
  1145. X   Enter the addresses on a per vector base. An address of zero
  1146. X   disables this feature.
  1147. X*/
  1148. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  1149. X{
  1150. X    0,    0,    0,    0,
  1151. X    0,    0,    0,    0,
  1152. X    0,    0,    0,    0,
  1153. X    0,    0,    0,    0,
  1154. X    0,    0,    0,    0,
  1155. X    0,    0,    0,    0,
  1156. X    0,    0,    0,    0,
  1157. X    0,    0,    0,    0
  1158. X};
  1159. X
  1160. X/* array of int ack values
  1161. X   These values are written to the corresponding int ack register
  1162. X   in response to an interrupt.
  1163. X*/
  1164. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  1165. X{
  1166. X    0,    0,    0,    0,
  1167. X    0,    0,    0,    0,
  1168. X    0,    0,    0,    0,
  1169. X    0,    0,    0,    0,
  1170. X    0,    0,    0,    0,
  1171. X    0,    0,    0,    0,
  1172. X    0,    0,    0,    0,
  1173. X    0,    0,    0,    0
  1174. X};
  1175. X
  1176. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1177. X   ============================================
  1178. X*/
  1179. X
  1180. X/* array of structures to hold all info for a physical minor device */
  1181. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  1182. X
  1183. X/* array of ttys for logical minor devices */
  1184. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1185. X
  1186. X/* array of pointers to fas_info structures
  1187. X   this prevents time consuming multiplications for index calculation
  1188. X*/
  1189. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  1190. X
  1191. X/* array of pointers to fas_tty structures
  1192. X   this prevents time consuming multiplications for index calculation
  1193. X*/
  1194. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1195. SHAR_EOF
  1196. true || echo 'restore of space-ast4c12 failed'
  1197. rm -f _shar_wnt_.tmp
  1198. fi
  1199. # ============= space-c1-2 ==============
  1200. if test -f 'space-c1-2' -a X"$1" != X"-c"; then
  1201.     echo 'x - skipping space-c1-2 (File already exists)'
  1202.     rm -f _shar_wnt_.tmp
  1203. else
  1204. > _shar_wnt_.tmp
  1205. echo 'x - extracting space-c1-2 (Text)'
  1206. sed 's/^X//' << 'SHAR_EOF' > 'space-c1-2' &&
  1207. X/* Async device configuration file for the FAS async driver. */
  1208. X
  1209. X/* This version is for the standard COM1 and COM2 ports.
  1210. X*/
  1211. X/* FAS was developed by
  1212. XUwe Doering             INET : gemini@geminix.in-berlin.de
  1213. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  1214. X1000 Berlin 20
  1215. XGermany
  1216. X*/
  1217. X
  1218. X#if !defined (M_I286)
  1219. X#ident    "@(#)space.c    2.09"
  1220. X#endif
  1221. X
  1222. X#if defined (XENIX)
  1223. X#include "fas.h"
  1224. X#else
  1225. X#include <sys/fas.h>
  1226. X#endif
  1227. X
  1228. X/* This is the number of devices to be handled by this driver.
  1229. X   You may define up to 16 devices.  If this number is changed
  1230. X   the arrays below must be filled in accordingly.
  1231. X*/
  1232. X#define NUM_PHYSICAL_UNITS    2
  1233. X
  1234. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1235. X#undef NUM_PHYSICAL_UNITS
  1236. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1237. X#endif
  1238. X
  1239. X/* let the driver know the number of devices */
  1240. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1241. X
  1242. X/* array of base port addresses
  1243. X   If you deliberately want to force off the FIFOs of a UART you have
  1244. X   to "or" the NO_FIFO macro to its base port address. This is useful
  1245. X   for mouse devices where you need immediate response to the mouse
  1246. X   movement.
  1247. X*/
  1248. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  1249. X{
  1250. X    0x3f8,    0x2f8
  1251. X};
  1252. X
  1253. X/* array of interrupt vectors */
  1254. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  1255. X{
  1256. X    0x4,    0x3
  1257. X};
  1258. X
  1259. X/* initialization sequence for serial card
  1260. X   This array contains pairs of values of the form:
  1261. X
  1262. X        portaddress, value,
  1263. X              :
  1264. X              :
  1265. X        portaddress, value,
  1266. X        0
  1267. X
  1268. X   For every line `value' will be written to `portaddress'. If
  1269. X   `value' is replaced with the macro `READ_PORT' then a value
  1270. X   is read from `portaddress' instead. The value itself will be
  1271. X   discarded. Therefore, this makes only sense if the read access
  1272. X   to the port has a side effect like setting or resetting
  1273. X   certain flags.
  1274. X
  1275. X   NOTE: This array *must* be terminated with a value of 0
  1276. X         in the portaddress column!
  1277. X*/
  1278. Xuint    fas_init_seq [] =
  1279. X{
  1280. X    0
  1281. X};
  1282. X
  1283. X/* initial modem control port info
  1284. X   This value is ored into the modem control value for each UART. This is
  1285. X   normaly used to force out2 which is used to enable the interrupts of
  1286. X   the standard com1 and com2 ports. Several brands of cards have modes
  1287. X   that allow them to work in compatible mode like com1 and com2 or as a
  1288. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1289. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1290. X
  1291. X   Note: This is one of the major trouble-spots with shared interrupts
  1292. X   cards. Check your manual.
  1293. X*/
  1294. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1295. X{
  1296. X    MC_SET_OUT2,    MC_SET_OUT2
  1297. X};
  1298. X
  1299. X/* array of modem control flags
  1300. X   You can choose which signals to use for modem control. See fas.h
  1301. X   for possible names and values. Whether or not modem control is
  1302. X   used is determined by the minor device number at open time.
  1303. X*/
  1304. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1305. X{
  1306. X    EO_DTR | EI_DTR | CA_DCD,
  1307. X    EO_DTR | EI_DTR | CA_DCD
  1308. X};
  1309. X
  1310. X/* array of hardware flow control flags
  1311. X   You can choose which signals to use for hardware handshake. See fas.h
  1312. X   for possible names and values. Whether or not hardware handshake is
  1313. X   used is determined by the minor device number at open time and by the
  1314. X   RTSFLOW/CTSFLOW termio(7) flags.
  1315. X*/
  1316. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1317. X{
  1318. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1319. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1320. X};
  1321. X
  1322. X/* array of control register addresses
  1323. X   There are serial boards available that have all serial ports
  1324. X   multiplexed to one address location in order to save I/O address
  1325. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1326. X   by a special register that needs to be written to before the actual
  1327. X   port registers can be accessed. This array contains the addresses
  1328. X   of these special registers.
  1329. X   Enter the addresses on a per unit base. An address of zero
  1330. X   disables this feature.
  1331. X*/
  1332. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1333. X{
  1334. X    0,    0
  1335. X};
  1336. X
  1337. X/* array of control register values
  1338. X   These values are written to the corresponding control register
  1339. X   before the first access to the actual port registers. If not only
  1340. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1341. X   single registers of the UART chips need to be multiplexed to one
  1342. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1343. X   to the control register value. This mask determines at which bit
  1344. X   locations the UART chip register number is "xored" into the control
  1345. X   register value at runtime. This implies that you can also use
  1346. X   negative logic by setting the bits in the control register value
  1347. X   to 1 at the locations corresponding to the bit mask.
  1348. X*/
  1349. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1350. X{
  1351. X    0,    0
  1352. X};
  1353. X
  1354. X/* additional configurations for shared interrupts boards
  1355. X   If you have a shared interrupts board, you may have to acknowledge
  1356. X   interrupts by writing to a special register. The following arrays
  1357. X   contain the special register addresses and the corresponding values
  1358. X   that are written to them in response to an interrupt.
  1359. X*/
  1360. X
  1361. X/* array of int ack register addresses
  1362. X   These registers are written to every time after all interrupt
  1363. X   sources in all of the UARTs that are tied to the corresponding
  1364. X   interrupt vector have been cleared.
  1365. X   Enter the addresses on a per vector base. An address of zero
  1366. X   disables this feature.
  1367. X*/
  1368. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  1369. X{
  1370. X    0,    0,    0,    0,
  1371. X    0,    0,    0,    0,
  1372. X    0,    0,    0,    0,
  1373. X    0,    0,    0,    0,
  1374. X    0,    0,    0,    0,
  1375. X    0,    0,    0,    0,
  1376. X    0,    0,    0,    0,
  1377. X    0,    0,    0,    0
  1378. X};
  1379. X
  1380. X/* array of int ack values
  1381. X   These values are written to the corresponding int ack register
  1382. X   in response to an interrupt.
  1383. X*/
  1384. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  1385. X{
  1386. X    0,    0,    0,    0,
  1387. X    0,    0,    0,    0,
  1388. X    0,    0,    0,    0,
  1389. X    0,    0,    0,    0,
  1390. X    0,    0,    0,    0,
  1391. X    0,    0,    0,    0,
  1392. X    0,    0,    0,    0,
  1393. X    0,    0,    0,    0
  1394. X};
  1395. X
  1396. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1397. X   ============================================
  1398. X*/
  1399. X
  1400. X/* array of structures to hold all info for a physical minor device */
  1401. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  1402. X
  1403. X/* array of ttys for logical minor devices */
  1404. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1405. X
  1406. X/* array of pointers to fas_info structures
  1407. X   this prevents time consuming multiplications for index calculation
  1408. X*/
  1409. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  1410. X
  1411. X/* array of pointers to fas_tty structures
  1412. X   this prevents time consuming multiplications for index calculation
  1413. X*/
  1414. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1415. SHAR_EOF
  1416. true || echo 'restore of space-c1-2 failed'
  1417. rm -f _shar_wnt_.tmp
  1418. fi
  1419. # ============= space-c1-3 ==============
  1420. if test -f 'space-c1-3' -a X"$1" != X"-c"; then
  1421.     echo 'x - skipping space-c1-3 (File already exists)'
  1422.     rm -f _shar_wnt_.tmp
  1423. else
  1424. > _shar_wnt_.tmp
  1425. echo 'x - extracting space-c1-3 (Text)'
  1426. sed 's/^X//' << 'SHAR_EOF' > 'space-c1-3' &&
  1427. X/* Async device configuration file for the FAS async driver. */
  1428. X
  1429. X/* This version is for the standard COM1 and COM2 and additional COM3
  1430. X   ports.
  1431. X*/
  1432. X/* FAS was developed by
  1433. XUwe Doering             INET : gemini@geminix.in-berlin.de
  1434. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  1435. X1000 Berlin 20
  1436. XGermany
  1437. X*/
  1438. X
  1439. X#if !defined (M_I286)
  1440. X#ident    "@(#)space.c    2.09"
  1441. X#endif
  1442. X
  1443. X#if defined (XENIX)
  1444. X#include "fas.h"
  1445. X#else
  1446. X#include <sys/fas.h>
  1447. X#endif
  1448. X
  1449. X/* This is the number of devices to be handled by this driver.
  1450. X   You may define up to 16 devices.  If this number is changed
  1451. X   the arrays below must be filled in accordingly.
  1452. X*/
  1453. X#define NUM_PHYSICAL_UNITS    3
  1454. X
  1455. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1456. X#undef NUM_PHYSICAL_UNITS
  1457. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1458. X#endif
  1459. X
  1460. X/* let the driver know the number of devices */
  1461. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1462. X
  1463. X/* array of base port addresses
  1464. X   If you deliberately want to force off the FIFOs of a UART you have
  1465. X   to "or" the NO_FIFO macro to its base port address. This is useful
  1466. X   for mouse devices where you need immediate response to the mouse
  1467. X   movement.
  1468. X*/
  1469. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  1470. X{
  1471. X    0x3f8,    0x2f8,    0x3e8
  1472. X};
  1473. X
  1474. X/* array of interrupt vectors */
  1475. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  1476. X{
  1477. X    0x4,    0x3,    0x9
  1478. X};
  1479. X
  1480. X/* initialization sequence for serial card
  1481. X   This array contains pairs of values of the form:
  1482. X
  1483. X        portaddress, value,
  1484. X              :
  1485. X              :
  1486. X        portaddress, value,
  1487. X        0
  1488. X
  1489. X   For every line `value' will be written to `portaddress'. If
  1490. X   `value' is replaced with the macro `READ_PORT' then a value
  1491. X   is read from `portaddress' instead. The value itself will be
  1492. X   discarded. Therefore, this makes only sense if the read access
  1493. X   to the port has a side effect like setting or resetting
  1494. X   certain flags.
  1495. X
  1496. X   NOTE: This array *must* be terminated with a value of 0
  1497. X         in the portaddress column!
  1498. X*/
  1499. Xuint    fas_init_seq [] =
  1500. X{
  1501. X    0
  1502. X};
  1503. X
  1504. X/* initial modem control port info
  1505. X   This value is ored into the modem control value for each UART. This is
  1506. X   normaly used to force out2 which is used to enable the interrupts of
  1507. X   the standard com1 and com2 ports. Several brands of cards have modes
  1508. X   that allow them to work in compatible mode like com1 and com2 or as a
  1509. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1510. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1511. X
  1512. X   Note: This is one of the major trouble-spots with shared interrupts
  1513. X   cards. Check your manual.
  1514. X*/
  1515. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1516. X{
  1517. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2
  1518. X};
  1519. X
  1520. X/* array of modem control flags
  1521. X   You can choose which signals to use for modem control. See fas.h
  1522. X   for possible names and values. Whether or not modem control is
  1523. X   used is determined by the minor device number at open time.
  1524. X*/
  1525. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1526. X{
  1527. X    EO_DTR | EI_DTR | CA_DCD,
  1528. X    EO_DTR | EI_DTR | CA_DCD,
  1529. X    EO_DTR | EI_DTR | CA_DCD
  1530. X};
  1531. X
  1532. X/* array of hardware flow control flags
  1533. X   You can choose which signals to use for hardware handshake. See fas.h
  1534. X   for possible names and values. Whether or not hardware handshake is
  1535. X   used is determined by the minor device number at open time and by the
  1536. X   RTSFLOW/CTSFLOW termio(7) flags.
  1537. X*/
  1538. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1539. X{
  1540. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1541. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1542. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1543. X};
  1544. X
  1545. X/* array of control register addresses
  1546. X   There are serial boards available that have all serial ports
  1547. X   multiplexed to one address location in order to save I/O address
  1548. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1549. X   by a special register that needs to be written to before the actual
  1550. X   port registers can be accessed. This array contains the addresses
  1551. X   of these special registers.
  1552. X   Enter the addresses on a per unit base. An address of zero
  1553. X   disables this feature.
  1554. X*/
  1555. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1556. X{
  1557. X    0,    0,    0
  1558. X};
  1559. X
  1560. X/* array of control register values
  1561. X   These values are written to the corresponding control register
  1562. X   before the first access to the actual port registers. If not only
  1563. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1564. X   single registers of the UART chips need to be multiplexed to one
  1565. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1566. X   to the control register value. This mask determines at which bit
  1567. X   locations the UART chip register number is "xored" into the control
  1568. X   register value at runtime. This implies that you can also use
  1569. X   negative logic by setting the bits in the control register value
  1570. X   to 1 at the locations corresponding to the bit mask.
  1571. X*/
  1572. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1573. X{
  1574. X    0,    0,    0
  1575. X};
  1576. X
  1577. X/* additional configurations for shared interrupts boards
  1578. X   If you have a shared interrupts board, you may have to acknowledge
  1579. X   interrupts by writing to a special register. The following arrays
  1580. X   contain the special register addresses and the corresponding values
  1581. X   that are written to them in response to an interrupt.
  1582. X*/
  1583. X
  1584. X/* array of int ack register addresses
  1585. X   These registers are written to every time after all interrupt
  1586. X   sources in all of the UARTs that are tied to the corresponding
  1587. X   interrupt vector have been cleared.
  1588. X   Enter the addresses on a per vector base. An address of zero
  1589. X   disables this feature.
  1590. X*/
  1591. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  1592. X{
  1593. X    0,    0,    0,    0,
  1594. X    0,    0,    0,    0,
  1595. X    0,    0,    0,    0,
  1596. X    0,    0,    0,    0,
  1597. X    0,    0,    0,    0,
  1598. X    0,    0,    0,    0,
  1599. X    0,    0,    0,    0,
  1600. X    0,    0,    0,    0
  1601. X};
  1602. X
  1603. X/* array of int ack values
  1604. X   These values are written to the corresponding int ack register
  1605. X   in response to an interrupt.
  1606. X*/
  1607. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  1608. X{
  1609. X    0,    0,    0,    0,
  1610. X    0,    0,    0,    0,
  1611. X    0,    0,    0,    0,
  1612. X    0,    0,    0,    0,
  1613. X    0,    0,    0,    0,
  1614. X    0,    0,    0,    0,
  1615. X    0,    0,    0,    0,
  1616. X    0,    0,    0,    0
  1617. X};
  1618. X
  1619. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1620. X   ============================================
  1621. X*/
  1622. X
  1623. X/* array of structures to hold all info for a physical minor device */
  1624. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  1625. X
  1626. X/* array of ttys for logical minor devices */
  1627. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1628. X
  1629. X/* array of pointers to fas_info structures
  1630. X   this prevents time consuming multiplications for index calculation
  1631. X*/
  1632. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  1633. X
  1634. X/* array of pointers to fas_tty structures
  1635. X   this prevents time consuming multiplications for index calculation
  1636. X*/
  1637. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1638. SHAR_EOF
  1639. true || echo 'restore of space-c1-3 failed'
  1640. rm -f _shar_wnt_.tmp
  1641. fi
  1642. # ============= space-hub6 ==============
  1643. if test -f 'space-hub6' -a X"$1" != X"-c"; then
  1644.     echo 'x - skipping space-hub6 (File already exists)'
  1645.     rm -f _shar_wnt_.tmp
  1646. else
  1647. > _shar_wnt_.tmp
  1648. echo 'x - extracting space-hub6 (Text)'
  1649. sed 's/^X//' << 'SHAR_EOF' > 'space-hub6' &&
  1650. X/* Async device configuration file for the FAS async driver. */
  1651. X
  1652. X/* This version is for the Bell Tech HUB-6 card.
  1653. X*/
  1654. X/* FAS was developed by
  1655. XUwe Doering             INET : gemini@geminix.in-berlin.de
  1656. XBillstedter Pfad 17 b   UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  1657. X1000 Berlin 20
  1658. XGermany
  1659. X*/
  1660. X
  1661. X#if !defined (M_I286)
  1662. X#ident    "@(#)space.c    2.09"
  1663. X#endif
  1664. X
  1665. X#if defined (XENIX)
  1666. X#include "fas.h"
  1667. X#else
  1668. X#include <sys/fas.h>
  1669. X#endif
  1670. X
  1671. X/* This is the number of devices to be handled by this driver.
  1672. X   You may define up to 16 devices.  If this number is changed
  1673. X   the arrays below must be filled in accordingly.
  1674. X*/
  1675. X#define NUM_PHYSICAL_UNITS    6
  1676. X
  1677. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1678. X#undef NUM_PHYSICAL_UNITS
  1679. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1680. X#endif
  1681. X
  1682. X/* let the driver know the number of devices */
  1683. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1684. X
  1685. X/* array of base port addresses
  1686. X   If you deliberately want to force off the FIFOs of a UART you have
  1687. X   to "or" the NO_FIFO macro to its base port address. This is useful
  1688. X   for mouse devices where you need immediate response to the mouse
  1689. X   movement.
  1690. X*/
  1691. Xulong    fas_port [NUM_PHYSICAL_UNITS] =
  1692. X{
  1693. X    0x303,    0x303,    0x303,    0x303,    0x303,    0x303
  1694. X};
  1695. X
  1696. X/* array of interrupt vectors */
  1697. Xuint    fas_vec [NUM_PHYSICAL_UNITS] =
  1698. X{
  1699. X    0x3,    0x3,    0x3,    0x3,    0x3,    0x3
  1700. X};
  1701. X
  1702. X/* initialization sequence for serial card
  1703. X   This array contains pairs of values of the form:
  1704. X
  1705. X        portaddress, value,
  1706. X              :
  1707. X              :
  1708. X        portaddress, value,
  1709. X        0
  1710. X
  1711. X   For every line `value' will be written to `portaddress'. If
  1712. X   `value' is replaced with the macro `READ_PORT' then a value
  1713. X   is read from `portaddress' instead. The value itself will be
  1714. X   discarded. Therefore, this makes only sense if the read access
  1715. X   to the port has a side effect like setting or resetting
  1716. X   certain flags.
  1717. X
  1718. X   NOTE: This array *must* be terminated with a value of 0
  1719. X         in the portaddress column!
  1720. X*/
  1721. Xuint    fas_init_seq [] =
  1722. X{
  1723. X    0
  1724. X};
  1725. X
  1726. X/* initial modem control port info
  1727. X   This value is ored into the modem control value for each UART. This is
  1728. X   normaly used to force out2 which is used to enable the interrupts of
  1729. X   the standard com1 and com2 ports. Several brands of cards have modes
  1730. X   that allow them to work in compatible mode like com1 and com2 or as a
  1731. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1732. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1733. X
  1734. X   Note: This is one of the major trouble-spots with shared interrupts
  1735. X   cards. Check your manual.
  1736. X*/
  1737. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1738. X{
  1739. X    0,    0,    0,    0,    0,    0
  1740. X};
  1741. X
  1742. X/* array of modem control flags
  1743. X   You can choose which signals to use for modem control. See fas.h
  1744. X   for possible names and values. Whether or not modem control is
  1745. X   used is determined by the minor device number at open time.
  1746. X*/
  1747. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1748. X{
  1749. X    EO_DTR | EI_DTR | CA_DCD,
  1750. X    EO_DTR | EI_DTR | CA_DCD,
  1751. X    EO_DTR | EI_DTR | CA_DCD,
  1752. X    EO_DTR | EI_DTR | CA_DCD,
  1753. X    EO_DTR | EI_DTR | CA_DCD,
  1754. X    EO_DTR | EI_DTR | CA_DCD
  1755. X};
  1756. X
  1757. X/* array of hardware flow control flags
  1758. X   You can choose which signals to use for hardware handshake. See fas.h
  1759. X   for possible names and values. Whether or not hardware handshake is
  1760. X   used is determined by the minor device number at open time and by the
  1761. X   RTSFLOW/CTSFLOW termio(7) flags.
  1762. X*/
  1763. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1764. X{
  1765. X    HI_RTS | HO_CTS | HX_RTS,
  1766. X    HI_RTS | HO_CTS | HX_RTS,
  1767. X    HI_RTS | HO_CTS | HX_RTS,
  1768. X    HI_RTS | HO_CTS | HX_RTS,
  1769. X    HI_RTS | HO_CTS | HX_RTS,
  1770. X    HI_RTS | HO_CTS | HX_RTS
  1771. X};
  1772. X
  1773. X/* array of control register addresses
  1774. X   There are serial boards available that have all serial ports
  1775. X   multiplexed to one address location in order to save I/O address
  1776. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1777. X   by a special register that needs to be written to before the actual
  1778. X   port registers can be accessed. This array contains the addresses
  1779. X   of these special registers.
  1780. X   Enter the addresses on a per unit base. An address of zero
  1781. X   disables this feature.
  1782. X*/
  1783. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1784. X{
  1785. X    0x302,    0x302,    0x302,    0x302,    0x302,    0x302
  1786. X};
  1787. X
  1788. X/* array of control register values
  1789. X   These values are written to the corresponding control register
  1790. X   before the first access to the actual port registers. If not only
  1791. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1792. X   single registers of the UART chips need to be multiplexed to one
  1793. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1794. X   to the control register value. This mask determines at which bit
  1795. X   locations the UART chip register number is "xored" into the control
  1796. X   register value at runtime. This implies that you can also use
  1797. X   negative logic by setting the bits in the control register value
  1798. X   to 1 at the locations corresponding to the bit mask.
  1799. X*/
  1800. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1801. X{
  1802. X    0x700,    0x708,    0x710,    0x718,    0x720,    0x728
  1803. X};
  1804. X
  1805. X/* additional configurations for shared interrupts boards
  1806. X   If you have a shared interrupts board, you may have to acknowledge
  1807. X   interrupts by writing to a special register. The following arrays
  1808. X   contain the special register addresses and the corresponding values
  1809. X   that are written to them in response to an interrupt.
  1810. X*/
  1811. X
  1812. X/* array of int ack register addresses
  1813. X   These registers are written to every time after all interrupt
  1814. X   sources in all of the UARTs that are tied to the corresponding
  1815. X   interrupt vector have been cleared.
  1816. X   Enter the addresses on a per vector base. An address of zero
  1817. X   disables this feature.
  1818. X*/
  1819. Xuint    fas_int_ack_port [NUM_INT_VECTORS] =
  1820. X{
  1821. X    0,    0,    0,    0,
  1822. X    0,    0,    0,    0,
  1823. X    0,    0,    0,    0,
  1824. X    0,    0,    0,    0,
  1825. X    0,    0,    0,    0,
  1826. X    0,    0,    0,    0,
  1827. X    0,    0,    0,    0,
  1828. X    0,    0,    0,    0
  1829. X};
  1830. X
  1831. X/* array of int ack values
  1832. X   These values are written to the corresponding int ack register
  1833. X   in response to an interrupt.
  1834. X*/
  1835. Xuint    fas_int_ack [NUM_INT_VECTORS] =
  1836. X{
  1837. X    0,    0,    0,    0,
  1838. X    0,    0,    0,    0,
  1839. X    0,    0,    0,    0,
  1840. X    0,    0,    0,    0,
  1841. X    0,    0,    0,    0,
  1842. X    0,    0,    0,    0,
  1843. X    0,    0,    0,    0,
  1844. X    0,    0,    0,    0
  1845. X};
  1846. X
  1847. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1848. X   ============================================
  1849. X*/
  1850. X
  1851. X/* array of structures to hold all info for a physical minor device */
  1852. Xstruct fas_info    fas_info [NUM_PHYSICAL_UNITS];
  1853. X
  1854. X/* array of ttys for logical minor devices */
  1855. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1856. X
  1857. X/* array of pointers to fas_info structures
  1858. X   this prevents time consuming multiplications for index calculation
  1859. X*/
  1860. Xstruct fas_info    *fas_info_ptr [NUM_PHYSICAL_UNITS];
  1861. X
  1862. X/* array of pointers to fas_tty structures
  1863. X   this prevents time consuming multiplications for index calculation
  1864. X*/
  1865. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1866. SHAR_EOF
  1867. true || echo 'restore of space-hub6 failed'
  1868. rm -f _shar_wnt_.tmp
  1869. fi
  1870. # ============= update_desc ==============
  1871. if test -f 'update_desc' -a X"$1" != X"-c"; then
  1872.     echo 'x - skipping update_desc (File already exists)'
  1873.     rm -f _shar_wnt_.tmp
  1874. else
  1875. > _shar_wnt_.tmp
  1876. echo 'x - extracting update_desc (Text)'
  1877. sed 's/^X//' << 'SHAR_EOF' > 'update_desc' &&
  1878. X# Update the kernel description file
  1879. X
  1880. Xgrep '^fas[     ]' $1 > /dev/null 2>&1
  1881. Xif [ $? -eq 1 ]
  1882. Xthen
  1883. X    echo 'fas     -    -     io     -             FAS Serial I/O Driver' >> $1
  1884. Xfi
  1885. SHAR_EOF
  1886. true || echo 'restore of update_desc failed'
  1887. rm -f _shar_wnt_.tmp
  1888. fi
  1889. rm -f _shar_seq_.tmp
  1890. echo You have unpacked the last part
  1891. exit 0
  1892. -- 
  1893. Uwe Doering  |  INET : gemini@geminix.in-berlin.de
  1894. Berlin       |----------------------------------------------------------------
  1895. Germany      |  UUCP : ...!unido!fub!geminix.in-berlin.de!gemini
  1896.