home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1845 < prev    next >
Internet Message Format  |  1990-12-28  |  53KB

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