home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / fas-2.12.0 / part07 < prev    next >
Text File  |  1994-01-25  |  61KB  |  1,992 lines

  1. Newsgroups: comp.sources.unix
  2. From: fas@geminix.in-berlin.de (FAS Support Account)
  3. Subject: v27i204: fas-2.12.0 - asynch serial driver for System V, Part07/08
  4. References: <1.759531570.7983@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: fas@geminix.in-berlin.de (FAS Support Account)
  9. Posting-Number: Volume 27, Issue 204
  10. Archive-Name: fas-2.12.0/part07
  11.  
  12. #!/bin/sh
  13. # this is fas212pl0.07 (part 7 of a multipart archive)
  14. # do not concatenate these parts, unpack them in order with /bin/sh
  15. # file fas.h continued
  16. #
  17. if test ! -r _shar_seq_.tmp; then
  18.     echo 'Please unpack part 1 first!'
  19.     exit 1
  20. fi
  21. (read Scheck
  22.  if test "$Scheck" != 7; then
  23.     echo Please unpack part "$Scheck" next!
  24.     exit 1
  25.  else
  26.     exit 0
  27.  fi
  28. ) < _shar_seq_.tmp || exit 1
  29. if test ! -f _shar_wnt_.tmp; then
  30.     echo 'x - still skipping fas.h'
  31. else
  32. echo 'x - continuing file fas.h'
  33. sed 's/^X//' << 'SHAR_EOF' >> 'fas.h' &&
  34. X#define DF_MSI_ENABLED        0x0080    /* modem status interrupts enabled */
  35. X#define DF_RDI_ENABLED        0x0100    /* receiver data interrupts enabled */
  36. X#define DF_HUP_PROTECT        0x0200    /* protect device after hangup */
  37. X#define DF_NO_OVERRUN        0x0400    /* device is overrun protected */
  38. X#define DF_DEVICE_CONFIGURED    0x0800    /* device is configured */
  39. X#define DF_DEVICE_OPEN        0x1000    /* physical device is open */
  40. X#define DF_DEVICE_LOCKED    0x2000    /* physical device locked */
  41. X#define DF_DO_HANGUP        0x4000    /* delayed hangup request */
  42. X#define DF_DO_BREAK        0x8000    /* delayed break request */
  43. X
  44. X/* define the flow control status flags */
  45. X
  46. X#define FF_HWO_HANDSHAKE    0x0001    /* output hw handshake enabled */
  47. X#define FF_HWI_HANDSHAKE    0x0002    /* input hw handshake enabled */
  48. X#define FF_HDX_HANDSHAKE    0x0004    /* output hdx hw handshake enabled */
  49. X#define    FF_HWO_STOPPED        0x0008    /* output stopped by hw handshake */
  50. X#define FF_HWI_STARTED        0x0010    /* input started by hw handshake */
  51. X#define FF_HDX_STARTED        0x0020    /* output buffer contains characters */
  52. X#define FF_CARR_STOPPED        0x0040    /* output stopped by carrier detect */
  53. X#define FF_SWO_STOPPED        0x0080    /* output stopped by sw flow control */
  54. X#define FF_SWI_STOPPED        0x0100    /* input stopped by sw flow control */
  55. X#define FF_SW_FC_REQ        0x0200    /* sw input flow control request */
  56. X#define FF_RXFER_STOPPED    0x0400    /* rxfer function stopped */
  57. X#define FF_NEW_CTSRTS        0x0800    /* CTS/RTSFLOW do fdx hw handshake */
  58. X#define FF_DEF_HHO_LOW        0x1000    /* hw handshake outp. is low by deflt */
  59. X#define FF_OUTPUT_BUSY        0x2000    /* output buffers/circuits are busy */
  60. X#define FF_CD_ENABLED        0x4000    /* carrier detect enabled */
  61. X#define FF_CARRIER_ON        0x8000    /* carrier detect */
  62. X
  63. X/* define the scheduled events flags */
  64. X
  65. X#define EF_DO_RXFER        0x0001    /* rxfer function request */
  66. X#define EF_DO_XXFER        0x0002    /* xxfer function request */
  67. X#define EF_DO_BRKINT        0x0004    /* break int request */
  68. X#define EF_DO_MPROC        0x0008    /* mproc function request */
  69. X#define EF_RESET_DELTA_BITS    0x0010    /* reset accumulated msr delta bits */
  70. X#define EF_WAKEUP_VPIX        0x0020    /* wakeup VP/ix until rawq is empty */
  71. X
  72. X/* define the device types
  73. X   The symbolic constant for the device type that allows the lowest interrupt
  74. X   latency (usually a 16450) has the lowest numerical value. Devices that
  75. X   allow a higher interrupt latency have a higher numerical value. With this
  76. X   ordering the device type can be used as a priority indicator during the
  77. X   interrupt processing, that is, devices that can't hold the received
  78. X   characters for very long are serviced first while devices with FIFOs
  79. X   are serviced only after all devices with higher priority are done.
  80. X   Usually, the following rule applies: The longer the FIFOs, the higher
  81. X   the assigned device type value should be, and the lower the interrupt
  82. X   priority will be.
  83. X*/
  84. X
  85. X#define NUMBER_OF_TYPES        3    /* adjust this to the highest */
  86. X                    /* device type + 1 */
  87. X#define TYPE_NS16450        0
  88. X#define TYPE_I82510        1
  89. X#define TYPE_NS16550A        2
  90. X
  91. X/* modifier flags that can be set in fas_modify [] (`space.c') */
  92. X
  93. X#define NO_TEST        0x0001        /* don't test the UART */
  94. X#define NO_HUP_PROTECT    0x0002        /* don't protect device after hangup */
  95. X#define NO_OVERRUN    0x0004        /* device is overrun protected */
  96. X#define NEW_CTSRTS    0x0008        /* CTS/RTSFLOW do fdx hw handshake */
  97. X
  98. X/* read from port rather than write to it (for fas_init_seq [] and
  99. X   fas_int_ack_seq [] in `space.c')
  100. X*/
  101. X
  102. X#define READ_PORT    0x0100
  103. X
  104. X/* define the FIFO operating modes for the fas_fifo_ctl array in space.c
  105. X   (FIFO_POINTER_DEV and FIFO_TRIGGER_* apply to NS16550A UART, only)
  106. X*/
  107. X
  108. X#define FIFO_DEFAULT        0    /* default mode (OS dependent) */
  109. X#define FIFO_OFF        1    /* 16450 compatible mode */
  110. X#define FIFO_EMUL_NS16450    2    /* emulate 16450 in FIFO mode */
  111. X#define FIFO_POINTER_DEV    3    /* pointer device (mouse etc.) */
  112. X#define FIFO_TRIGGER_1        4    /* set trigger level to 1 char */
  113. X#define FIFO_TRIGGER_4        5    /* set trigger level to 4 chars */
  114. X#define FIFO_TRIGGER_8        6    /* set trigger level to 8 chars */
  115. X#define FIFO_TRIGGER_14        7    /* set trigger level to 14 chars */
  116. X
  117. X/* define an easy way to reference the port structures */
  118. X
  119. X#define RCV_DATA_PORT        (fip->port [0])
  120. X#define XMT_DATA_PORT        (fip->port [0])
  121. X#define INT_ENABLE_PORT        (fip->port [1])
  122. X#define INT_ID_PORT        (fip->port [2])
  123. X#define NS_FIFO_CTL_PORT    (fip->port [2])
  124. X#define I_BANK_PORT        (fip->port [2])
  125. X#define LINE_CTL_PORT        (fip->port [3])
  126. X#define MDM_CTL_PORT        (fip->port [4])
  127. X#define I_IDM_PORT        (fip->port [4])
  128. X#define LINE_STATUS_PORT    (fip->port [5])
  129. X#define I_RCM_PORT        (fip->port [5])
  130. X#define MDM_STATUS_PORT        (fip->port [6])
  131. X#define I_TCM_PORT        (fip->port [6])
  132. X#define DIVISOR_LSB_PORT    (fip->port [0])
  133. X#define DIVISOR_MSB_PORT    (fip->port [1])
  134. X#define CTL_PORT        (fip->ctl_port)
  135. X
  136. X/* UART related variables */
  137. X
  138. X#define BT_SELECT        (fip->port [0].p.val)
  139. X#define IER            (fip->port [1].p.val)
  140. X#define FCR            (fip->port [2].p.val)
  141. X#define LCR            (fip->port [3].p.val)
  142. X#define MCR            (fip->port [4].p.val)
  143. X#define NEW_MSR            (fip->port [5].p.val)
  144. X#define MSR            (fip->port [6].p.val)
  145. X#define DEVICE_TYPE        (fip->ctl_port.p.val1)
  146. X#define INT_PRIO        (fip->ctl_port.p.val2)
  147. X
  148. X/* ring buffer management */
  149. X
  150. X#define RECV_SW_LOW_WATER    (fip->recv_sw_low_water)
  151. X#define RECV_SW_HIGH_WATER    (fip->recv_sw_high_water)
  152. X#define RECV_HW_LOW_WATER    (fip->recv_hw_low_water)
  153. X#define RECV_HW_HIGH_WATER    (fip->recv_hw_high_water)
  154. X#if defined (M_I286)
  155. X#define RECV_BUFF_SIZE        RECV_BUFF_MAX_SIZE
  156. X#define RECV_BUFF_BEGIN        (&fip->recv_buffer [0])
  157. X#define RECV_BUFF_END        (&fip->recv_buffer [RECV_BUFF_MAX_SIZE])
  158. X#define XMIT_BUFF_SIZE        XMIT_BUFF_MAX_SIZE
  159. X#define XMIT_BUFF_BEGIN        (&fip->xmit_buffer [0])
  160. X#define XMIT_BUFF_END        (&fip->xmit_buffer [XMIT_BUFF_MAX_SIZE])
  161. X#else
  162. X#define RECV_BUFF_SIZE        (fip->recv_buff_size)
  163. X#define RECV_BUFF_BEGIN        (fip->recv_buff_begin)
  164. X#define RECV_BUFF_END        (fip->recv_buff_end)
  165. X#define XMIT_BUFF_SIZE        (fip->xmit_buff_size)
  166. X#define XMIT_BUFF_BEGIN        (fip->xmit_buff_begin)
  167. X#define XMIT_BUFF_END        (fip->xmit_buff_end)
  168. X#endif
  169. X
  170. X/* modem control port */
  171. X
  172. X#define MC_SET_DTR        0x01
  173. X#define MC_SET_RTS        0x02
  174. X#define MC_SET_OUT1        0x04
  175. X#define MC_SET_OUT2        0x08
  176. X#define MC_SET_LOOPBACK        0x10
  177. X
  178. X#define MC_ANY_CONTROL    (MC_SET_DTR | MC_SET_RTS | MC_SET_OUT1 | MC_SET_OUT2)
  179. X
  180. X/* modem status port */
  181. X
  182. X#define MS_CTS_DELTA        0x01
  183. X#define MS_DSR_DELTA        0x02
  184. X#define MS_RING_TEDGE        0x04
  185. X#define MS_DCD_DELTA        0x08
  186. X#define MS_CTS_PRESENT        0x10
  187. X#define MS_DSR_PRESENT        0x20
  188. X#define MS_RING_PRESENT        0x40
  189. X#define MS_DCD_PRESENT        0x80
  190. X
  191. X#define MS_ANY_DELTA    (MS_CTS_DELTA | MS_DSR_DELTA | MS_RING_TEDGE \
  192. X                | MS_DCD_DELTA)
  193. X#define MS_ANY_PRESENT    (MS_CTS_PRESENT | MS_DSR_PRESENT | MS_RING_PRESENT \
  194. X                | MS_DCD_PRESENT)
  195. X
  196. X/* interrupt enable port */
  197. X
  198. X#define IE_NONE                0x00
  199. X#define    IE_RECV_DATA_AVAILABLE        0x01
  200. X#define    IE_XMIT_HOLDING_BUFFER_EMPTY    0x02
  201. X#define IE_LINE_STATUS            0x04
  202. X#define IE_MODEM_STATUS            0x08
  203. X
  204. X/* interrupt id port */
  205. X
  206. X#define II_NO_INTS_PENDING    0x01
  207. X#define II_CODE_MASK        0x07
  208. X#define II_MODEM_STATE        0x00
  209. X#define II_XMTD_CHAR        0x02
  210. X#define II_RCVD_CHAR        0x04
  211. X#define II_RCV_ERROR        0x06
  212. X#define II_NS_FIFO_TIMEOUT    0x08
  213. X#define II_NS_FIFO_ENABLED    0xC0
  214. X
  215. X/* line control port */
  216. X
  217. X#define    LC_WORDLEN_MASK        0x03
  218. X#define    LC_WORDLEN_5        0x00
  219. X#define    LC_WORDLEN_6        0x01
  220. X#define    LC_WORDLEN_7        0x02
  221. X#define    LC_WORDLEN_8        0x03
  222. X#define LC_STOPBITS_LONG    0x04
  223. X#define LC_ENABLE_PARITY    0x08
  224. X#define LC_EVEN_PARITY        0x10
  225. X#define LC_STICK_PARITY        0x20
  226. X#define LC_SET_BREAK_LEVEL    0x40
  227. X#define LC_ENABLE_DIVISOR    0x80
  228. X
  229. X/* line status port */
  230. X
  231. X#define LS_RCV_AVAIL        0x01
  232. X#define LS_OVERRUN        0x02
  233. X#define LS_PARITY_ERROR        0x04
  234. X#define LS_FRAMING_ERROR    0x08
  235. X#define LS_BREAK_DETECTED    0x10
  236. X#define LS_XMIT_AVAIL        0x20
  237. X#define LS_XMIT_COMPLETE    0x40
  238. X#define LS_ERROR_IN_NS_FIFO    0x80    /* NS16550A only */
  239. X#define LS_RCV_INT    (LS_RCV_AVAIL | LS_OVERRUN | LS_PARITY_ERROR \
  240. X            | LS_FRAMING_ERROR | LS_BREAK_DETECTED)
  241. X
  242. X/* fifo control port (NS16550A only) */
  243. X
  244. X#define    NS_FIFO_ENABLE        0x01
  245. X#define    NS_FIFO_CLR_RECV    0x02
  246. X#define    NS_FIFO_CLR_XMIT    0x04
  247. X#define    NS_FIFO_START_DMA    0x08
  248. X#define NS_FIFO_SIZE_1        0x00
  249. X#define NS_FIFO_SIZE_4        0x40
  250. X#define NS_FIFO_SIZE_8        0x80
  251. X#define NS_FIFO_SIZE_14        0xC0
  252. X#define NS_FIFO_SIZE_MASK    0xC0
  253. X
  254. X#define NS_FIFO_CLEAR_CMD    0
  255. X#define NS_FIFO_INIT_CMD    (NS_FIFO_SIZE_1 | NS_FIFO_ENABLE \
  256. X                | NS_FIFO_CLR_RECV | NS_FIFO_CLR_XMIT)
  257. X
  258. X#define INPUT_NS_FIFO_SIZE    16
  259. X#define OUTPUT_NS_FIFO_SIZE    16
  260. X
  261. X/* fifo control ports (i82510 only) */
  262. X
  263. X#define I_BANK_0        0x00
  264. X#define I_BANK_1        0x20
  265. X#define I_BANK_2        0x40
  266. X#define I_BANK_3        0x60
  267. X#define I_FIFO_ENABLE        0x08
  268. X#define I_FIFO_CLR_RECV        0x30
  269. X#define I_FIFO_CLR_XMIT        0x0c
  270. X
  271. X#define I_FIFO_CLEAR_CMD    0
  272. X#define I_FIFO_SETUP_CMD    I_FIFO_ENABLE
  273. X
  274. X#define INPUT_I_FIFO_SIZE    4
  275. X#define OUTPUT_I_FIFO_SIZE    4
  276. X
  277. X/* defines for ioctl calls (VP/ix) */
  278. X
  279. X#define AIOC            ('A'<<8)
  280. X#define AIOCINTTYPE        (AIOC|60)    /* set interrupt type */
  281. X#define AIOCDOSMODE        (AIOC|61)    /* set DOS mode */
  282. X#define AIOCNONDOSMODE        (AIOC|62)    /* reset DOS mode */
  283. X#define AIOCSERIALOUT        (AIOC|63)    /* serial device data write */
  284. X#define AIOCSERIALIN        (AIOC|64)    /* serial device data read */
  285. X#define AIOCSETSS        (AIOC|65)    /* set start/stop chars */
  286. X#define AIOCINFO        (AIOC|66)    /* tell us what device we are */
  287. X
  288. X/* ioctl alternate names used by VP/ix */
  289. X
  290. X#define VPC_SERIAL_DOS        AIOCDOSMODE
  291. X#define VPC_SERIAL_NONDOS    AIOCNONDOSMODE
  292. X#define VPC_SERIAL_INFO        AIOCINFO
  293. X#define VPC_SERIAL_OUT        AIOCSERIALOUT
  294. X#define VPC_SERIAL_IN        AIOCSERIALIN
  295. X
  296. X/* serial in/out requests */
  297. X
  298. X#define SO_DIVLLSB        1
  299. X#define SO_DIVLMSB        2
  300. X#define SO_LCR            3
  301. X#define SO_MCR            4
  302. X#define SI_MSR            1
  303. X#define SIO_MASK(x)        (1<<((x)-1))
  304. X
  305. X
  306. X/* This structure contains baud rate dependent informations. */
  307. X
  308. Xstruct fas_speed
  309. X{
  310. X    union {
  311. X        uint    ctime;    /* kernel clock ticks until xmitter is empty */
  312. X        uint    max_rate;    /* max baud rate index */
  313. X    } i;
  314. X    union {            /* UART counter divisor value */
  315. X        struct {
  316. X            unchar    low;    /* low byte */
  317. X            unchar    high;    /* high byte */
  318. X        } b;
  319. X        ushort    val;
  320. X    } div;
  321. X    ushort    xbuf_size;    /* xmit buffer size that fits the baud rate */
  322. X};
  323. X
  324. X
  325. X/* This structure contains everything one would like to know about
  326. X   an open device.  There is one of it for each physical unit.
  327. X
  328. X   Take care that the size of the area that contains the various
  329. X   structure fields (up to, but excluding the ring buffers)
  330. X   is <= 128 bytes. Otherwise a 4-byte offset is used to access
  331. X   some of the structure fields. For the first 128 bytes a 1-byte
  332. X   offset is used, which is faster.
  333. X*/
  334. X
  335. Xstruct fas_internals
  336. X{
  337. X    struct tty    *tty;    /* the tty structure */
  338. X    struct fas_internals    *next_int_user;    /* link to next struct */
  339. X    struct fas_internals    *prev_int_user;    /* link to previous struct */
  340. X    uint    device_flags;    /* flags about the device state */
  341. X    uint    flow_flags;    /* flags about the flow control state */
  342. X    uint    event_flags;    /* flags about scheduled events */
  343. X    uint    o_state;    /* current open state */
  344. X    uint    po_state;    /* previous open state */
  345. X    uint    iflag;        /* current terminal input flags */
  346. X    uint    cflag;        /* current terminal hardware control flags */
  347. X    union {            /* modem control masks */
  348. X        struct {
  349. X            unchar    di;    /* mask for modem disable */
  350. X            unchar    eo;    /* mask for modem enable (dialout) */
  351. X            unchar    ei;    /* mask for modem enable (dialin) */
  352. X            unchar    ca;    /* mask for carrier detect */
  353. X        } m;
  354. X        ulong    l;
  355. X    } modem;
  356. X    union {            /* hardware flow control masks */
  357. X        struct {
  358. X            unchar    ic;    /* control mask for inp. flow ctrl */
  359. X            unchar    oc;    /* control mask for outp. flow ctrl */
  360. X            unchar    oe;    /* enable mask for outp. flow ctrl */
  361. X            unchar    hc;    /* control mask for hdx flow ctrl */
  362. X        } m;
  363. X        ulong    l;
  364. X    } flow;
  365. X    union {            /* muliplexer control port */
  366. X        uint    addr;
  367. X        struct {
  368. X            ushort    addr;
  369. X            unchar    val1;
  370. X            unchar    val2;
  371. X        } p;
  372. X    } ctl_port;
  373. X    union {            /* uart port addresses and control values */
  374. X        uint    addr;
  375. X        struct {
  376. X            ushort    addr;
  377. X            unchar    ctl;
  378. X            unchar    val;
  379. X        } p;
  380. X    } port [NUM_UART_REGS];
  381. X    int    timeout_idx;    /* timeout index for untimeout () */
  382. X    uint    rxfer_timeout;    /* timeout counter for recv char transfer */
  383. X    unchar    start_char;    /* start character for software flow control */
  384. X    unchar    stop_char;    /* stop character for software flow control */
  385. X#if defined (HAVE_VPIX)
  386. X    unchar    v86_intmask;    /* VP/ix pseudorupt mask */
  387. X    v86_t    *v86_proc;    /* VP/ix v86proc pointer for pseudorupts */
  388. X#endif
  389. X    uint    recv_ring_cnt;    /* receiver ring buffer counter */
  390. X    unchar    *recv_ring_put_ptr;    /* recv ring buf put ptr */
  391. X    unchar    *recv_ring_take_ptr;    /* recv ring buf take ptr */
  392. X    uint    xmit_fifo_size;    /* transmitter FIFO size */
  393. X    uint    xmit_ring_max;    /* transmitter ring buffer max fill level */
  394. X    uint    xmit_ring_cnt;    /* transmitter ring buffer counter */
  395. X    unchar    *xmit_ring_put_ptr;    /* xmit ring buf put ptr */
  396. X    unchar    *xmit_ring_take_ptr;    /* xmit ring buf take ptr */
  397. X    uint    recv_sw_low_water;    /* recv software fc low water level */
  398. X    uint    recv_sw_high_water;    /* recv software fc high water level */
  399. X    uint    recv_hw_low_water;    /* recv hardware fc low water level */
  400. X    uint    recv_hw_high_water;    /* recv hardware fc high water level */
  401. X#if defined (M_I286)
  402. X    unchar    recv_buffer [RECV_BUFF_MAX_SIZE];    /* recv ring buf */
  403. X    unchar    xmit_buffer [XMIT_BUFF_MAX_SIZE];    /* xmit ring buf */
  404. X#else
  405. X    uint    recv_buff_size;        /* recv ring buffer size */
  406. X    unchar    *recv_buff_begin;    /* recv ring buffer begin ptr */
  407. X    unchar    *recv_buff_end;        /* recv ring buffer end ptr */
  408. X    uint    xmit_buff_size;        /* xmit ring buffer size */
  409. X    unchar    *xmit_buff_begin;    /* xmit ring buffer begin ptr */
  410. X    unchar    *xmit_buff_end;        /* xmit ring buffer end ptr */
  411. X#endif
  412. X};
  413. SHAR_EOF
  414. echo 'File fas.h is complete' &&
  415. true || echo 'restore of fas.h failed'
  416. rm -f _shar_wnt_.tmp
  417. fi
  418. # ============= i_fas-ast4c12 ==============
  419. if test -f 'i_fas-ast4c12' -a X"$1" != X"-c"; then
  420.     echo 'x - skipping i_fas-ast4c12 (File already exists)'
  421.     rm -f _shar_wnt_.tmp
  422. else
  423. > _shar_wnt_.tmp
  424. echo 'x - extracting i_fas-ast4c12 (Text)'
  425. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast4c12' &&
  426. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  427. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  428. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  429. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  430. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  431. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  432. SHAR_EOF
  433. true || echo 'restore of i_fas-ast4c12 failed'
  434. rm -f _shar_wnt_.tmp
  435. fi
  436. # ============= i_fas-ast8c12 ==============
  437. if test -f 'i_fas-ast8c12' -a X"$1" != X"-c"; then
  438.     echo 'x - skipping i_fas-ast8c12 (File already exists)'
  439.     rm -f _shar_wnt_.tmp
  440. else
  441. > _shar_wnt_.tmp
  442. echo 'x - extracting i_fas-ast8c12 (Text)'
  443. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast8c12' &&
  444. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  445. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  446. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  447. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  448. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  449. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  450. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  451. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  452. XF8:23:off:/etc/getty -t 60 ttyFM08 9600
  453. XF9:23:off:/etc/getty -t 60 ttyFM09 9600
  454. SHAR_EOF
  455. true || echo 'restore of i_fas-ast8c12 failed'
  456. rm -f _shar_wnt_.tmp
  457. fi
  458. # ============= i_fas-c123 ==============
  459. if test -f 'i_fas-c123' -a X"$1" != X"-c"; then
  460.     echo 'x - skipping i_fas-c123 (File already exists)'
  461.     rm -f _shar_wnt_.tmp
  462. else
  463. > _shar_wnt_.tmp
  464. echo 'x - extracting i_fas-c123 (Text)'
  465. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c123' &&
  466. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  467. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  468. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  469. SHAR_EOF
  470. true || echo 'restore of i_fas-c123 failed'
  471. rm -f _shar_wnt_.tmp
  472. fi
  473. # ============= i_fas-gen8c12 ==============
  474. if test -f 'i_fas-gen8c12' -a X"$1" != X"-c"; then
  475.     echo 'x - skipping i_fas-gen8c12 (File already exists)'
  476.     rm -f _shar_wnt_.tmp
  477. else
  478. > _shar_wnt_.tmp
  479. echo 'x - extracting i_fas-gen8c12 (Text)'
  480. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-gen8c12' &&
  481. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  482. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  483. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  484. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  485. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  486. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  487. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  488. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  489. XF8:23:off:/etc/getty -t 60 ttyFM08 9600
  490. XF9:23:off:/etc/getty -t 60 ttyFM09 9600
  491. SHAR_EOF
  492. true || echo 'restore of i_fas-gen8c12 failed'
  493. rm -f _shar_wnt_.tmp
  494. fi
  495. # ============= i_fas-hub6c12 ==============
  496. if test -f 'i_fas-hub6c12' -a X"$1" != X"-c"; then
  497.     echo 'x - skipping i_fas-hub6c12 (File already exists)'
  498.     rm -f _shar_wnt_.tmp
  499. else
  500. > _shar_wnt_.tmp
  501. echo 'x - extracting i_fas-hub6c12 (Text)'
  502. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-hub6c12' &&
  503. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  504. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  505. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  506. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  507. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  508. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  509. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  510. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  511. SHAR_EOF
  512. true || echo 'restore of i_fas-hub6c12 failed'
  513. rm -f _shar_wnt_.tmp
  514. fi
  515. # ============= i_fas-use4c12 ==============
  516. if test -f 'i_fas-use4c12' -a X"$1" != X"-c"; then
  517.     echo 'x - skipping i_fas-use4c12 (File already exists)'
  518.     rm -f _shar_wnt_.tmp
  519. else
  520. > _shar_wnt_.tmp
  521. echo 'x - extracting i_fas-use4c12 (Text)'
  522. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-use4c12' &&
  523. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  524. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  525. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  526. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  527. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  528. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  529. SHAR_EOF
  530. true || echo 'restore of i_fas-use4c12 failed'
  531. rm -f _shar_wnt_.tmp
  532. fi
  533. # ============= m_fas ==============
  534. if test -f 'm_fas' -a X"$1" != X"-c"; then
  535.     echo 'x - skipping m_fas (File already exists)'
  536.     rm -f _shar_wnt_.tmp
  537. else
  538. > _shar_wnt_.tmp
  539. echo 'x - extracting m_fas (Text)'
  540. sed 's/^X//' << 'SHAR_EOF' > 'm_fas' &&
  541. Xfas    Iocrwi    iHct        fas    0    3    1    16    -1
  542. SHAR_EOF
  543. true || echo 'restore of m_fas failed'
  544. rm -f _shar_wnt_.tmp
  545. fi
  546. # ============= n_fas-ast4c12 ==============
  547. if test -f 'n_fas-ast4c12' -a X"$1" != X"-c"; then
  548.     echo 'x - skipping n_fas-ast4c12 (File already exists)'
  549.     rm -f _shar_wnt_.tmp
  550. else
  551. > _shar_wnt_.tmp
  552. echo 'x - extracting n_fas-ast4c12 (Text)'
  553. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast4c12' &&
  554. Xfas    ttyF00    c    80
  555. Xfas    ttyF01    c    81
  556. Xfas    ttyF02    c    82
  557. Xfas    ttyF03    c    83
  558. Xfas    ttyF04    c    84
  559. Xfas    ttyF05    c    85
  560. Xfas    ttyFM00    c    208
  561. Xfas    ttyFM01    c    209
  562. Xfas    ttyFM02    c    210
  563. Xfas    ttyFM03    c    211
  564. Xfas    ttyFM04    c    212
  565. Xfas    ttyFM05    c    213
  566. SHAR_EOF
  567. true || echo 'restore of n_fas-ast4c12 failed'
  568. rm -f _shar_wnt_.tmp
  569. fi
  570. # ============= n_fas-ast8c12 ==============
  571. if test -f 'n_fas-ast8c12' -a X"$1" != X"-c"; then
  572.     echo 'x - skipping n_fas-ast8c12 (File already exists)'
  573.     rm -f _shar_wnt_.tmp
  574. else
  575. > _shar_wnt_.tmp
  576. echo 'x - extracting n_fas-ast8c12 (Text)'
  577. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast8c12' &&
  578. Xfas    ttyF00    c    80
  579. Xfas    ttyF01    c    81
  580. Xfas    ttyF02    c    82
  581. Xfas    ttyF03    c    83
  582. Xfas    ttyF04    c    84
  583. Xfas    ttyF05    c    85
  584. Xfas    ttyF06    c    86
  585. Xfas    ttyF07    c    87
  586. Xfas    ttyF08    c    88
  587. Xfas    ttyF09    c    89
  588. Xfas    ttyFM00    c    208
  589. Xfas    ttyFM01    c    209
  590. Xfas    ttyFM02    c    210
  591. Xfas    ttyFM03    c    211
  592. Xfas    ttyFM04    c    212
  593. Xfas    ttyFM05    c    213
  594. Xfas    ttyFM06    c    214
  595. Xfas    ttyFM07    c    215
  596. Xfas    ttyFM08    c    216
  597. Xfas    ttyFM09    c    217
  598. SHAR_EOF
  599. true || echo 'restore of n_fas-ast8c12 failed'
  600. rm -f _shar_wnt_.tmp
  601. fi
  602. # ============= n_fas-c123 ==============
  603. if test -f 'n_fas-c123' -a X"$1" != X"-c"; then
  604.     echo 'x - skipping n_fas-c123 (File already exists)'
  605.     rm -f _shar_wnt_.tmp
  606. else
  607. > _shar_wnt_.tmp
  608. echo 'x - extracting n_fas-c123 (Text)'
  609. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c123' &&
  610. Xfas    ttyF00    c    80
  611. Xfas    ttyF01    c    81
  612. Xfas    ttyF02    c    82
  613. Xfas    ttyFM00    c    208
  614. Xfas    ttyFM01    c    209
  615. Xfas    ttyFM02    c    210
  616. SHAR_EOF
  617. true || echo 'restore of n_fas-c123 failed'
  618. rm -f _shar_wnt_.tmp
  619. fi
  620. # ============= n_fas-gen8c12 ==============
  621. if test -f 'n_fas-gen8c12' -a X"$1" != X"-c"; then
  622.     echo 'x - skipping n_fas-gen8c12 (File already exists)'
  623.     rm -f _shar_wnt_.tmp
  624. else
  625. > _shar_wnt_.tmp
  626. echo 'x - extracting n_fas-gen8c12 (Text)'
  627. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-gen8c12' &&
  628. Xfas    ttyF00    c    80
  629. Xfas    ttyF01    c    81
  630. Xfas    ttyF02    c    82
  631. Xfas    ttyF03    c    83
  632. Xfas    ttyF04    c    84
  633. Xfas    ttyF05    c    85
  634. Xfas    ttyF06    c    86
  635. Xfas    ttyF07    c    87
  636. Xfas    ttyF08    c    88
  637. Xfas    ttyF09    c    89
  638. Xfas    ttyFM00    c    208
  639. Xfas    ttyFM01    c    209
  640. Xfas    ttyFM02    c    210
  641. Xfas    ttyFM03    c    211
  642. Xfas    ttyFM04    c    212
  643. Xfas    ttyFM05    c    213
  644. Xfas    ttyFM06    c    214
  645. Xfas    ttyFM07    c    215
  646. Xfas    ttyFM08    c    216
  647. Xfas    ttyFM09    c    217
  648. SHAR_EOF
  649. true || echo 'restore of n_fas-gen8c12 failed'
  650. rm -f _shar_wnt_.tmp
  651. fi
  652. # ============= n_fas-hub6c12 ==============
  653. if test -f 'n_fas-hub6c12' -a X"$1" != X"-c"; then
  654.     echo 'x - skipping n_fas-hub6c12 (File already exists)'
  655.     rm -f _shar_wnt_.tmp
  656. else
  657. > _shar_wnt_.tmp
  658. echo 'x - extracting n_fas-hub6c12 (Text)'
  659. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-hub6c12' &&
  660. Xfas    ttyF00    c    80
  661. Xfas    ttyF01    c    81
  662. Xfas    ttyF02    c    82
  663. Xfas    ttyF03    c    83
  664. Xfas    ttyF04    c    84
  665. Xfas    ttyF05    c    85
  666. Xfas    ttyF06    c    86
  667. Xfas    ttyF07    c    87
  668. Xfas    ttyFM00    c    208
  669. Xfas    ttyFM01    c    209
  670. Xfas    ttyFM02    c    210
  671. Xfas    ttyFM03    c    211
  672. Xfas    ttyFM04    c    212
  673. Xfas    ttyFM05    c    213
  674. Xfas    ttyFM06    c    214
  675. Xfas    ttyFM07    c    215
  676. SHAR_EOF
  677. true || echo 'restore of n_fas-hub6c12 failed'
  678. rm -f _shar_wnt_.tmp
  679. fi
  680. # ============= n_fas-use4c12 ==============
  681. if test -f 'n_fas-use4c12' -a X"$1" != X"-c"; then
  682.     echo 'x - skipping n_fas-use4c12 (File already exists)'
  683.     rm -f _shar_wnt_.tmp
  684. else
  685. > _shar_wnt_.tmp
  686. echo 'x - extracting n_fas-use4c12 (Text)'
  687. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-use4c12' &&
  688. Xfas    ttyF00    c    80
  689. Xfas    ttyF01    c    81
  690. Xfas    ttyF02    c    82
  691. Xfas    ttyF03    c    83
  692. Xfas    ttyF04    c    84
  693. Xfas    ttyF05    c    85
  694. Xfas    ttyFM00    c    208
  695. Xfas    ttyFM01    c    209
  696. Xfas    ttyFM02    c    210
  697. Xfas    ttyFM03    c    211
  698. Xfas    ttyFM04    c    212
  699. Xfas    ttyFM05    c    213
  700. SHAR_EOF
  701. true || echo 'restore of n_fas-use4c12 failed'
  702. rm -f _shar_wnt_.tmp
  703. fi
  704. # ============= optim_att.awk ==============
  705. if test -f 'optim_att.awk' -a X"$1" != X"-c"; then
  706.     echo 'x - skipping optim_att.awk (File already exists)'
  707.     rm -f _shar_wnt_.tmp
  708. else
  709. > _shar_wnt_.tmp
  710. echo 'x - extracting optim_att.awk (Text)'
  711. sed 's/^X//' << 'SHAR_EOF' > 'optim_att.awk' &&
  712. X# optim_att.awk
  713. X#
  714. X# filter AT&T assembler file format
  715. X#
  716. X# Replace all calls to outb(), inb() and fas_mem_copy() with the necessary
  717. X# assembler mnemonics and do some optimizations for bit tests.
  718. X
  719. XBEGIN {
  720. X    nl = 0
  721. X    prevline = ""
  722. X}
  723. X
  724. X{
  725. X    if ($1 == "popl") {
  726. X        print prevline
  727. X        if ($2 == "%ecx" && split(prevline, argsp) > 0 \
  728. X            && argsp[1] == "call") {
  729. X        prevline = "\taddl\t$4,%esp"
  730. X        } else {
  731. X        prevline = $0
  732. X        }
  733. X        next
  734. X    } else if ($1 == "pushl") {
  735. X        if ($2 == "%eax" && split(prevline, argsp) == 2 \
  736. X            && argsp[1] == "movl" && argsp[2] == "%esp,%ebp") {
  737. X        print prevline
  738. X        prevline = "\tsubl\t$4,%esp"
  739. X        next
  740. X        }
  741. X        lines[nl++] = $0
  742. X        getline
  743. X        if ($1 == "pushl") {
  744. X        lines[nl++] = $0
  745. X        getline
  746. X        if ($1 == "call" && $2 == "outb") {
  747. X            lines[nl++] = $0
  748. X            getline
  749. X            if ($1 == "addl" && $2 == "$8,%esp") {
  750. X            split(lines[0], args0)
  751. X            split(lines[1], args1)
  752. X            if (args1[2] == "%eax") {
  753. X                print prevline
  754. X                if (args0[2] == "%edx") {
  755. X                print "\tmovl\t%eax,%ecx"
  756. X                print "\tmovl\t%edx,%eax"
  757. X                print "\tmovl\t%ecx,%edx"
  758. X                } else {
  759. X                print "\tmovl\t%eax,%edx"
  760. X                print "\tmovl\t" args0[2] ",%eax"
  761. X                }
  762. X            } else {
  763. X                if (args0[2] == "%eax") {
  764. X                res = 0
  765. X                if (prevline ~ /,%eax$/) {
  766. X                    argsline = substr(prevline, 1, \
  767. X                            length(prevline) - 5) \
  768. X                        " %eax"
  769. X                    split(argsline, argsp)
  770. X                    res = 1
  771. X                }
  772. X                if (res && argsp[3] == "%eax") {
  773. X                    if (argsp[1] == "movzbl" \
  774. X                        || argsp[1] == "movsbl") {
  775. X                    if (argsp[2] != "%al") {
  776. X                        print "\tmovb\t" argsp[2] ",%al"
  777. X                    }
  778. X                    } else if (argsp[1] == "movzwl" \
  779. X                        || argsp[1] == "movswl") {
  780. X                    if (argsp[2] != "%ax") {
  781. X                        if (argsp[2] ~ /^%/) {
  782. X                        print "\tmovw\t" argsp[2] ",%ax"
  783. X                        } else {
  784. X                        print "\tmovb\t" argsp[2] ",%al"
  785. X                        }
  786. X                    }
  787. X                    } else {
  788. X                    print prevline
  789. X                    }
  790. X                } else {
  791. X                    print prevline
  792. X                }
  793. X                } else {
  794. X                print prevline
  795. X                if (args0[2] ~ /^%/) {
  796. X                    print "\tmovl\t" args0[2] ",%eax"
  797. X                } else {
  798. X                    print "\tmovb\t" args0[2] ",%al"
  799. X                }
  800. X                }
  801. X                if (args1[2] != "%edx") {
  802. X                print "\tmovl\t" args1[2] ",%edx"
  803. X                }
  804. X            }
  805. X            prevline = "\toutb\t(%dx)"
  806. X            nl = 0
  807. X            next
  808. X            }
  809. X        } else if ($1 == "pushl") {
  810. X            lines[nl++] = $0
  811. X            getline
  812. X            if ($1 == "call" && $2 == "fas_mem_copy") {
  813. X            lines[nl++] = $0
  814. X            getline
  815. X            if ($1 == "addl" && $2 == "$12,%esp") {
  816. X                split(lines[0], args0)
  817. X                split(lines[1], args1)
  818. X                split(lines[2], args2)
  819. X                print prevline
  820. X                print "\tmovl\t" args2[2] ",%edi"
  821. X                print "\tmovl\t" args1[2] ",%esi"
  822. X                reg = ""
  823. X                if (args0[2] != "%ecx") {
  824. X                if (args0[2] ~ /^[%$]/) {
  825. X                    reg = args0[2]
  826. X                }
  827. X                print "\tmovl\t" args0[2] ",%ecx"
  828. X                }
  829. X                print "\tcld"
  830. X                if (reg == "") {
  831. X                reg = "%eax"
  832. X                print "\tmovl\t%ecx,%eax"
  833. X                }
  834. X                print "\tshrl\t$2,%ecx"
  835. X                print "\trep"
  836. X                print "\tmovsl"
  837. X                print "\tmovl\t" reg ",%ecx"
  838. X                print "\tandl\t$3,%ecx"
  839. X                print "\trep"
  840. X                prevline = "\tmovsb"
  841. X                nl = 0
  842. X                next
  843. X            }
  844. X            }
  845. X        }
  846. X        } else if ($1 == "call" && $2 == "inb") {
  847. X        lines[nl++] = $0
  848. X        getline
  849. X        if ($1 == "popl" || ($1 == "addl" && $2 == "$4,%esp")) {
  850. X            split(lines[0], args0)
  851. X            print prevline
  852. X            if (args0[2] != "%edx") {
  853. X            print "\tmovl\t" args0[2] ",%edx"
  854. X            }
  855. X            print "\txorl\t%eax,%eax"
  856. X            prevline = "\tinb\t(%dx)"
  857. X            nl = 0
  858. X            next
  859. X        }
  860. X        }
  861. X
  862. X        print prevline
  863. X        prevline = $0
  864. X
  865. X        for (i = 0; i < nl; i++) {
  866. X        print lines[i]
  867. X        }
  868. X        nl = 0
  869. X    } else {
  870. X        print prevline
  871. X        prevline = $0
  872. X    }
  873. X
  874. X    cmd = substr($1, 1, length($1) - 1)
  875. X    class = substr($1, length($1))
  876. X
  877. X    if (cmd == "test" && (class == "l" || class == "w") && $2 ~ /^\$/) {
  878. X        split($2, args, ",")
  879. X        args[2] = substr($2, length(args[1]) + 2)
  880. X        if (args[2] ~ /^%.*x$/) {
  881. X        reg = substr(args[2], length(args[2]) - 1, 1)
  882. X        } else {
  883. X        reg = ""
  884. X        }
  885. X        if (reg != "" || args[2] !~ /^%/) {
  886. X        val = substr(args[1], 2) + 0
  887. X        if (class == "w" && val <= -1 && val >= -65536) {
  888. X            val += 65536
  889. X        }
  890. X        if (val >= 0 && val <= 255) {
  891. X            if (reg != "") {
  892. X            prevline = "\t" cmd "b\t" args[1] ",%" reg "l"
  893. X            } else {
  894. X            prevline = "\t" cmd "b\t" args[1] "," args[2]
  895. X            }
  896. X        } else if (val >= 0 && val <= 65535 && (val % 256) == 0) {
  897. X            if (reg != "") {
  898. X            prevline = "\t" cmd "b\t$" val / 256 ",%" reg "h"
  899. X            } else if (args[2] ~ /^[-(]/) {
  900. X            prevline = "\t" cmd "b\t$" val / 256 ",1" args[2]
  901. X            } else {
  902. X            prevline = "\t" cmd "b\t$" val / 256 ",1+" args[2]
  903. X            }
  904. X        }
  905. X        }
  906. X    }
  907. X}
  908. X
  909. XEND {
  910. X        print prevline
  911. X}
  912. SHAR_EOF
  913. true || echo 'restore of optim_att.awk failed'
  914. rm -f _shar_wnt_.tmp
  915. fi
  916. # ============= os_dep_update ==============
  917. if test -f 'os_dep_update' -a X"$1" != X"-c"; then
  918.     echo 'x - skipping os_dep_update (File already exists)'
  919.     rm -f _shar_wnt_.tmp
  920. else
  921. > _shar_wnt_.tmp
  922. echo 'x - extracting os_dep_update (Text)'
  923. sed 's/^X//' << 'SHAR_EOF' > 'os_dep_update' &&
  924. X# update OS dependent defines
  925. X
  926. Xif [ $# -lt 1 ]
  927. Xthen
  928. X    echo 'illegal numer of parameters' >&2
  929. X    exit 1
  930. Xfi
  931. X
  932. Xfname=$1
  933. Xshift
  934. X
  935. Xfor flag in $*
  936. Xdo
  937. X    echo "#undef ${flag}"
  938. X    echo "#define ${flag}"
  939. Xdone > ${fname}.upd
  940. X
  941. Xsed -e '1,/@@OS_DEP_BEGIN@@/d;/@@OS_DEP_END@@/,$d' ${fname} > ${fname}.cur
  942. Xcmp -s ${fname}.cur ${fname}.upd
  943. Xres=$?
  944. X
  945. Xif [ ${res} -ne 1 ]
  946. Xthen
  947. X    rm -f ${fname}.cur ${fname}.upd
  948. X    exit ${res}
  949. Xfi
  950. X
  951. Xsed -e '1,/@@OS_DEP_BEGIN@@/{
  952. X        /@@OS_DEP_BEGIN@@/r '${fname}.upd'
  953. X        b
  954. X    }
  955. X    /@@OS_DEP_END@@/,$b
  956. X    d' ${fname} > ${fname}.tmp
  957. X
  958. Xmv -f ${fname}.tmp ${fname}
  959. Xrm -f ${fname}.cur ${fname}.upd
  960. X
  961. Xexit 0
  962. SHAR_EOF
  963. true || echo 'restore of os_dep_update failed'
  964. rm -f _shar_wnt_.tmp
  965. fi
  966. # ============= s_fas-ast4c12 ==============
  967. if test -f 's_fas-ast4c12' -a X"$1" != X"-c"; then
  968.     echo 'x - skipping s_fas-ast4c12 (File already exists)'
  969.     rm -f _shar_wnt_.tmp
  970. else
  971. > _shar_wnt_.tmp
  972. echo 'x - extracting s_fas-ast4c12 (Text)'
  973. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast4c12' &&
  974. Xfas    Y    4    7    1    5    2a0    2bf    0    0
  975. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  976. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  977. SHAR_EOF
  978. true || echo 'restore of s_fas-ast4c12 failed'
  979. rm -f _shar_wnt_.tmp
  980. fi
  981. # ============= s_fas-ast8c12 ==============
  982. if test -f 's_fas-ast8c12' -a X"$1" != X"-c"; then
  983.     echo 'x - skipping s_fas-ast8c12 (File already exists)'
  984.     rm -f _shar_wnt_.tmp
  985. else
  986. > _shar_wnt_.tmp
  987. echo 'x - extracting s_fas-ast8c12 (Text)'
  988. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast8c12' &&
  989. Xfas    Y    4    7    1    5    2a0    2bf    0    0
  990. Xfas    Y    4    7    1    9    1a0    1bf    0    0
  991. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  992. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  993. SHAR_EOF
  994. true || echo 'restore of s_fas-ast8c12 failed'
  995. rm -f _shar_wnt_.tmp
  996. fi
  997. # ============= s_fas-c123 ==============
  998. if test -f 's_fas-c123' -a X"$1" != X"-c"; then
  999.     echo 'x - skipping s_fas-c123 (File already exists)'
  1000.     rm -f _shar_wnt_.tmp
  1001. else
  1002. > _shar_wnt_.tmp
  1003. echo 'x - extracting s_fas-c123 (Text)'
  1004. sed 's/^X//' << 'SHAR_EOF' > 's_fas-c123' &&
  1005. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  1006. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  1007. Xfas    Y    1    7    1    5    3e8    3ef    0    0
  1008. SHAR_EOF
  1009. true || echo 'restore of s_fas-c123 failed'
  1010. rm -f _shar_wnt_.tmp
  1011. fi
  1012. # ============= s_fas-gen8c12 ==============
  1013. if test -f 's_fas-gen8c12' -a X"$1" != X"-c"; then
  1014.     echo 'x - skipping s_fas-gen8c12 (File already exists)'
  1015.     rm -f _shar_wnt_.tmp
  1016. else
  1017. > _shar_wnt_.tmp
  1018. echo 'x - extracting s_fas-gen8c12 (Text)'
  1019. sed 's/^X//' << 'SHAR_EOF' > 's_fas-gen8c12' &&
  1020. Xfas    Y    8    7    1    5    100    13f    0    0
  1021. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  1022. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  1023. SHAR_EOF
  1024. true || echo 'restore of s_fas-gen8c12 failed'
  1025. rm -f _shar_wnt_.tmp
  1026. fi
  1027. # ============= s_fas-hub6c12 ==============
  1028. if test -f 's_fas-hub6c12' -a X"$1" != X"-c"; then
  1029.     echo 'x - skipping s_fas-hub6c12 (File already exists)'
  1030.     rm -f _shar_wnt_.tmp
  1031. else
  1032. > _shar_wnt_.tmp
  1033. echo 'x - extracting s_fas-hub6c12 (Text)'
  1034. sed 's/^X//' << 'SHAR_EOF' > 's_fas-hub6c12' &&
  1035. Xfas    Y    6    7    1    5    302    308    0    0
  1036. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  1037. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  1038. SHAR_EOF
  1039. true || echo 'restore of s_fas-hub6c12 failed'
  1040. rm -f _shar_wnt_.tmp
  1041. fi
  1042. # ============= s_fas-use4c12 ==============
  1043. if test -f 's_fas-use4c12' -a X"$1" != X"-c"; then
  1044.     echo 'x - skipping s_fas-use4c12 (File already exists)'
  1045.     rm -f _shar_wnt_.tmp
  1046. else
  1047. > _shar_wnt_.tmp
  1048. echo 'x - extracting s_fas-use4c12 (Text)'
  1049. sed 's/^X//' << 'SHAR_EOF' > 's_fas-use4c12' &&
  1050. Xfas    Y    4    7    1    15    2c0    2df    0    0
  1051. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  1052. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  1053. SHAR_EOF
  1054. true || echo 'restore of s_fas-use4c12 failed'
  1055. rm -f _shar_wnt_.tmp
  1056. fi
  1057. # ============= space-ast4c12 ==============
  1058. if test -f 'space-ast4c12' -a X"$1" != X"-c"; then
  1059.     echo 'x - skipping space-ast4c12 (File already exists)'
  1060.     rm -f _shar_wnt_.tmp
  1061. else
  1062. > _shar_wnt_.tmp
  1063. echo 'x - extracting space-ast4c12 (Text)'
  1064. sed 's/^X//' << 'SHAR_EOF' > 'space-ast4c12' &&
  1065. X/* Device configuration file for the FAS async driver. */
  1066. X
  1067. X/* This version is for the AST 4-port card in shared interrupts mode plus
  1068. X   the standard COM1 and COM2 ports.
  1069. X*/
  1070. X/* FAS was developed by
  1071. XUwe Doering <fas@geminix.in-berlin.de>
  1072. XBillstedter Pfad 17 b
  1073. X13591 Berlin
  1074. XGermany
  1075. X*/
  1076. X
  1077. X#if !defined (M_I286)
  1078. X#ident    "@(#)space.c    2.12"
  1079. X#endif
  1080. X
  1081. X#if defined (LOCAL_INCLUDE)
  1082. X#include "fas.h"
  1083. X#else
  1084. X#include <sys/fas.h>
  1085. X#endif
  1086. X
  1087. X/* This is the number of devices to be handled by this driver.
  1088. X   If it is changed, make sure that the initializer parts of all arrays
  1089. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1090. X   entries. You may define up to 16 devices.
  1091. X*/
  1092. X#define NUM_PHYSICAL_UNITS    6
  1093. X
  1094. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1095. X#undef NUM_PHYSICAL_UNITS
  1096. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1097. X#endif
  1098. X
  1099. X/* array of base port addresses
  1100. X   These values are the base i/o addresses of the UART chips.
  1101. X*/
  1102. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1103. X{
  1104. X    0x2a0,    0x2a8,    0x2b0,    0x2b8,
  1105. X    0x3f8,    0x2f8
  1106. X};
  1107. X
  1108. X#if defined (SCO) || defined (XENIX)
  1109. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1110. X   FAS doesn't need informations about interrupt vectors during normal
  1111. X   operation. Therefore, the only function of these values is to be
  1112. X   displayed by the FAS boot message. So if you want vector infos at
  1113. X   boot time you can enter the vector numbers here. But make sure that
  1114. X   the values correspond with the entries in the kernel config files.
  1115. X   A value of `-1' means that no vector number is displayed for the
  1116. X   respective port.
  1117. X   Users of other UNIX flavors can savely ignore this array.
  1118. X*/
  1119. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1120. X{
  1121. X    -1,    -1,    -1,    -1,
  1122. X    -1,    -1
  1123. X};
  1124. X#endif
  1125. X
  1126. X/* array of modifier flags
  1127. X   You can modify certain features of each port. See fas.h for possible
  1128. X   names and values.
  1129. X*/
  1130. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1131. X{
  1132. X    0,    0,    0,    0,
  1133. X    0,    0
  1134. X};
  1135. X
  1136. X/* array of FIFO operating mode values
  1137. X   These values select the mode to which the UART FIFOs are set when
  1138. X   a port is activated. For device types that don't have FIFOs the
  1139. X   respective value is ignored, so you can set up this array for
  1140. X   FIFO operation now and add the FIFO UARTs later. There are several
  1141. X   operating modes predefined. See fas.h for possible names and values.
  1142. X*/
  1143. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1144. X{
  1145. X    FIFO_DEFAULT,
  1146. X    FIFO_DEFAULT,
  1147. X    FIFO_DEFAULT,
  1148. X    FIFO_DEFAULT,
  1149. X    FIFO_DEFAULT,
  1150. X    FIFO_DEFAULT
  1151. X};
  1152. X
  1153. X/* initialization sequence for serial cards
  1154. X   This array contains pairs of values of the form:
  1155. X
  1156. X        portaddress, value,
  1157. X              :
  1158. X              :
  1159. X        portaddress, value,
  1160. X        0
  1161. X
  1162. X   For every line `value' will be written to `portaddress'. If
  1163. X   `value' is replaced with the macro `READ_PORT' then a value
  1164. X   is read from `portaddress' instead. The value itself will be
  1165. X   discarded. Therefore, this makes only sense if the read access
  1166. X   to the port has a side effect like setting or resetting
  1167. X   certain flags.
  1168. X
  1169. X   NOTE: This array *must* be terminated with a value of 0
  1170. X         in the portaddress column!
  1171. X*/
  1172. Xuint    fas_init_seq [] =
  1173. X{
  1174. X    0x2bf,    0x80,
  1175. X    0
  1176. X};
  1177. X
  1178. X/* interrupt acknowledge sequence for serial cards
  1179. X   This sequence is executed by the fasintr () function after all pending
  1180. X   interrupts on all serial cards have been processed. The contents of this
  1181. X   array has the same form as in the fas_init_seq [] array above.
  1182. X*/
  1183. Xuint    fas_int_ack_seq [] =
  1184. X{
  1185. X    0
  1186. X};
  1187. X
  1188. X/* initial modem control port info
  1189. X   This value is ored into the modem control value for each UART. This is
  1190. X   normaly used to force out2 which is used to enable the interrupts of
  1191. X   the standard com1 and com2 ports. Several brands of cards have modes
  1192. X   that allow them to work in compatible mode like com1 and com2 or as a
  1193. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1194. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1195. X
  1196. X   Note: This is one of the major trouble-spots with shared interrupts
  1197. X   cards. Check your manual.
  1198. X*/
  1199. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1200. X{
  1201. X    0,    0,    0,    0,
  1202. X    MC_SET_OUT2,    MC_SET_OUT2
  1203. X};
  1204. X
  1205. X/* array of modem control flags
  1206. X   You can choose which signals to use for modem control. See fas.h
  1207. X   for possible names and values. Whether or not modem control is
  1208. X   used is determined by the minor device number at open time.
  1209. X*/
  1210. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1211. X{
  1212. X    EO_DTR | EI_DTR | CA_DCD,
  1213. X    EO_DTR | EI_DTR | CA_DCD,
  1214. X    EO_DTR | EI_DTR | CA_DCD,
  1215. X    EO_DTR | EI_DTR | CA_DCD,
  1216. X    EO_DTR | EI_DTR | CA_DCD,
  1217. X    EO_DTR | EI_DTR | CA_DCD
  1218. X};
  1219. X
  1220. X/* array of hardware flow control flags
  1221. X   You can choose which signals to use for hardware handshake. See fas.h
  1222. X   for possible names and values. Whether or not hardware handshake is
  1223. X   used is determined by the minor device number at open time and by the
  1224. X   RTSFLOW/CTSFLOW termio(7) flags.
  1225. X*/
  1226. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1227. X{
  1228. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1229. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1230. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1231. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1232. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1233. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1234. X};
  1235. X
  1236. X/* array of control register addresses
  1237. X   There are serial boards available that have all serial ports
  1238. X   multiplexed to one address location in order to save I/O address
  1239. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1240. X   by a special register that needs to be written to before the actual
  1241. X   port registers can be accessed. This array contains the addresses
  1242. X   of these special registers.
  1243. X   Enter the addresses on a per unit base. An address of zero
  1244. X   disables this feature.
  1245. X*/
  1246. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1247. X{
  1248. X    0,    0,    0,    0,
  1249. X    0,    0
  1250. X};
  1251. X
  1252. X/* array of control register values
  1253. X   These values are written to the corresponding control register
  1254. X   before the first access to the actual port registers. If not only
  1255. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1256. X   single registers of the UART chips need to be multiplexed to one
  1257. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1258. X   to the control register value. This mask determines at which bit
  1259. X   locations the UART chip register number is "xored" into the control
  1260. X   register value at runtime. This implies that you can also use
  1261. X   negative logic by setting the bits in the control register value
  1262. X   to 1 at the locations corresponding to the bit mask.
  1263. X*/
  1264. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1265. X{
  1266. X    0,    0,    0,    0,
  1267. X    0,    0
  1268. X};
  1269. X
  1270. X/* This is the number of available port layout tables.
  1271. X   If this number is changed the arrays below must be filled
  1272. X   in accordingly.
  1273. X*/
  1274. X#define NUM_PORT_LAYOUTS    1
  1275. X
  1276. X/* array of port layout table selection values
  1277. X   These values select the port layout table in fas_layout [] []
  1278. X   that is used for the respective port.
  1279. X*/
  1280. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  1281. X{
  1282. X    0,    0,    0,    0,
  1283. X    0,    0
  1284. X};
  1285. X
  1286. X/* array of port layout tables
  1287. X   This two-dimensional array contains the base port offsets of the
  1288. X   seven UART registers used by FAS. There are one or more port layout
  1289. X   tables that are selected by the values in fas_pl_select [].
  1290. X
  1291. X   Each port layout table is arranged like this (the position of the values
  1292. X   corresponds to the respective UART register acronym):
  1293. X
  1294. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  1295. X*/
  1296. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  1297. X{
  1298. X  {    /* table 0 */
  1299. X    0,    1,    2,    3,    4,    5,    6
  1300. X  }
  1301. X};
  1302. X
  1303. X/* This is the number of available baud rate tables.
  1304. X   You may define up to 256 tables.  If this number is changed
  1305. X   the arrays below must be filled in accordingly.
  1306. X*/
  1307. X#define NUM_BAUD_TABLES    2
  1308. X
  1309. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  1310. X#undef NUM_BAUD_TABLES
  1311. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  1312. X#endif
  1313. X
  1314. X/* array of baud rate table selection values
  1315. X   These values select the baud rate table in fas_baud [] []
  1316. X   that is used for the respective port.
  1317. X*/
  1318. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  1319. X{
  1320. X    0,    0,    0,    0,
  1321. X    0,    0
  1322. X};
  1323. X
  1324. X/* array of baud rate tables
  1325. X   This two-dimensional array contains the 15 possible UNIX baud rates
  1326. X   plus the baud rate base that these 15 baud rates are derived from. There
  1327. X   are one or more baud rate tables that are selected by the values in
  1328. X   fas_bt_select [].
  1329. X
  1330. X   The values in the baud rate tables are multiplied by ten to allow an
  1331. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  1332. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  1333. X   is also mutiplied by ten to make its scale match the scale of the baud
  1334. X   rate values.
  1335. X
  1336. X   Each baud rate table is arranged like this (the position of the values
  1337. X   corresponds to the respective baud rate symbol):
  1338. X
  1339. X    BASE,        B50,        B75,        B110,
  1340. X    B134,        B150,        B200,        B300,
  1341. X    B600,        B1200,        B1800,        B2400,
  1342. X    B4800,        B9600,        B19200,        B38400
  1343. X*/
  1344. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  1345. X{
  1346. X  {    /* table 0 */
  1347. X    1152000,    500,        750,        1100,
  1348. X    1345,        1500,        2000,        3000,
  1349. X    6000,        12000,        18000,        24000,
  1350. X    48000,        96000,        192000,        384000
  1351. X  },
  1352. X  {    /* table 1 */
  1353. X    1152000,    500,        750,        1100,
  1354. X    1345,        1500,        2000,        3000,
  1355. X    6000,        12000,        18000,        24000,
  1356. X    48000,        96000,        576000,        1152000
  1357. X  }
  1358. X};
  1359. X
  1360. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1361. X   ============================================
  1362. X*/
  1363. X
  1364. X/* let the driver know the number of devices */
  1365. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1366. X
  1367. X/* let the driver know the number of port layout tables */
  1368. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  1369. X
  1370. X/* let the driver know the number of baud rate tables */
  1371. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  1372. X
  1373. X/* array of structures to hold all info for a physical minor device */
  1374. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  1375. X
  1376. X/* array of tty structures for logical devices */
  1377. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1378. X
  1379. X/* array of fas_speed structure arrays that contain baud rate dependent
  1380. X   informations
  1381. X*/
  1382. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  1383. X
  1384. X/* array of pointers to fas_internals structures
  1385. X   this prevents time consuming multiplications for index calculation
  1386. X*/
  1387. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  1388. X
  1389. X/* array of pointers to tty structures
  1390. X   this prevents time consuming multiplications for index calculation
  1391. X*/
  1392. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1393. X
  1394. X/* array of pointers to fas_speed structure arrays
  1395. X   this prevents time consuming multiplications for index calculation
  1396. X*/
  1397. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  1398. X
  1399. X/* array of pointers to the baud rate tables in fas_baud [] []
  1400. X   this prevents time consuming multiplications for index calculation
  1401. X*/
  1402. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  1403. SHAR_EOF
  1404. true || echo 'restore of space-ast4c12 failed'
  1405. rm -f _shar_wnt_.tmp
  1406. fi
  1407. # ============= space-ast8c12 ==============
  1408. if test -f 'space-ast8c12' -a X"$1" != X"-c"; then
  1409.     echo 'x - skipping space-ast8c12 (File already exists)'
  1410.     rm -f _shar_wnt_.tmp
  1411. else
  1412. > _shar_wnt_.tmp
  1413. echo 'x - extracting space-ast8c12 (Text)'
  1414. sed 's/^X//' << 'SHAR_EOF' > 'space-ast8c12' &&
  1415. X/* Device configuration file for the FAS async driver. */
  1416. X
  1417. X/* This version is for two AST 4-port cards (or a card with two AST 4-port
  1418. X   blocks on a single PCB) in shared interrupts mode plus the standard COM1
  1419. X   and COM2 ports.
  1420. X*/
  1421. X/* FAS was developed by
  1422. XUwe Doering <fas@geminix.in-berlin.de>
  1423. XBillstedter Pfad 17 b
  1424. X13591 Berlin
  1425. XGermany
  1426. X*/
  1427. X
  1428. X#if !defined (M_I286)
  1429. X#ident    "@(#)space.c    2.12"
  1430. X#endif
  1431. X
  1432. X#if defined (LOCAL_INCLUDE)
  1433. X#include "fas.h"
  1434. X#else
  1435. X#include <sys/fas.h>
  1436. X#endif
  1437. X
  1438. X/* This is the number of devices to be handled by this driver.
  1439. X   If it is changed, make sure that the initializer parts of all arrays
  1440. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1441. X   entries. You may define up to 16 devices.
  1442. X*/
  1443. X#define NUM_PHYSICAL_UNITS    10
  1444. X
  1445. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1446. X#undef NUM_PHYSICAL_UNITS
  1447. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1448. X#endif
  1449. X
  1450. X/* array of base port addresses
  1451. X   These values are the base i/o addresses of the UART chips.
  1452. X*/
  1453. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1454. X{
  1455. X    0x2a0,    0x2a8,    0x2b0,    0x2b8,
  1456. X    0x1a0,    0x1a8,    0x1b0,    0x1b8,
  1457. X    0x3f8,    0x2f8
  1458. X};
  1459. X
  1460. X#if defined (SCO) || defined (XENIX)
  1461. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1462. X   FAS doesn't need informations about interrupt vectors during normal
  1463. X   operation. Therefore, the only function of these values is to be
  1464. X   displayed by the FAS boot message. So if you want vector infos at
  1465. X   boot time you can enter the vector numbers here. But make sure that
  1466. X   the values correspond with the entries in the kernel config files.
  1467. X   A value of `-1' means that no vector number is displayed for the
  1468. X   respective port.
  1469. X   Users of other UNIX flavors can savely ignore this array.
  1470. X*/
  1471. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1472. X{
  1473. X    -1,    -1,    -1,    -1,
  1474. X    -1,    -1,    -1,    -1,
  1475. X    -1,    -1
  1476. X};
  1477. X#endif
  1478. X
  1479. X/* array of modifier flags
  1480. X   You can modify certain features of each port. See fas.h for possible
  1481. X   names and values.
  1482. X*/
  1483. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1484. X{
  1485. X    0,    0,    0,    0,
  1486. X    0,    0,    0,    0,
  1487. X    0,    0
  1488. X};
  1489. X
  1490. X/* array of FIFO operating mode values
  1491. X   These values select the mode to which the UART FIFOs are set when
  1492. X   a port is activated. For device types that don't have FIFOs the
  1493. X   respective value is ignored, so you can set up this array for
  1494. X   FIFO operation now and add the FIFO UARTs later. There are several
  1495. X   operating modes predefined. See fas.h for possible names and values.
  1496. X*/
  1497. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1498. X{
  1499. X    FIFO_DEFAULT,
  1500. X    FIFO_DEFAULT,
  1501. X    FIFO_DEFAULT,
  1502. X    FIFO_DEFAULT,
  1503. X    FIFO_DEFAULT,
  1504. X    FIFO_DEFAULT,
  1505. X    FIFO_DEFAULT,
  1506. X    FIFO_DEFAULT,
  1507. X    FIFO_DEFAULT,
  1508. X    FIFO_DEFAULT
  1509. X};
  1510. X
  1511. X/* initialization sequence for serial cards
  1512. X   This array contains pairs of values of the form:
  1513. X
  1514. X        portaddress, value,
  1515. X              :
  1516. X              :
  1517. X        portaddress, value,
  1518. X        0
  1519. X
  1520. X   For every line `value' will be written to `portaddress'. If
  1521. X   `value' is replaced with the macro `READ_PORT' then a value
  1522. X   is read from `portaddress' instead. The value itself will be
  1523. X   discarded. Therefore, this makes only sense if the read access
  1524. X   to the port has a side effect like setting or resetting
  1525. X   certain flags.
  1526. X
  1527. X   NOTE: This array *must* be terminated with a value of 0
  1528. X         in the portaddress column!
  1529. X*/
  1530. Xuint    fas_init_seq [] =
  1531. X{
  1532. X    0x2bf,    0x80,
  1533. X    0x1bf,    0x80,
  1534. X    0
  1535. X};
  1536. X
  1537. X/* interrupt acknowledge sequence for serial cards
  1538. X   This sequence is executed by the fasintr () function after all pending
  1539. X   interrupts on all serial cards have been processed. The contents of this
  1540. X   array has the same form as in the fas_init_seq [] array above.
  1541. X*/
  1542. Xuint    fas_int_ack_seq [] =
  1543. X{
  1544. X    0
  1545. X};
  1546. X
  1547. X/* initial modem control port info
  1548. X   This value is ored into the modem control value for each UART. This is
  1549. X   normaly used to force out2 which is used to enable the interrupts of
  1550. X   the standard com1 and com2 ports. Several brands of cards have modes
  1551. X   that allow them to work in compatible mode like com1 and com2 or as a
  1552. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1553. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1554. X
  1555. X   Note: This is one of the major trouble-spots with shared interrupts
  1556. X   cards. Check your manual.
  1557. X*/
  1558. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1559. X{
  1560. X    0,    0,    0,    0,
  1561. X    0,    0,    0,    0,
  1562. X    MC_SET_OUT2,    MC_SET_OUT2
  1563. X};
  1564. X
  1565. X/* array of modem control flags
  1566. X   You can choose which signals to use for modem control. See fas.h
  1567. X   for possible names and values. Whether or not modem control is
  1568. X   used is determined by the minor device number at open time.
  1569. X*/
  1570. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1571. X{
  1572. X    EO_DTR | EI_DTR | CA_DCD,
  1573. X    EO_DTR | EI_DTR | CA_DCD,
  1574. X    EO_DTR | EI_DTR | CA_DCD,
  1575. X    EO_DTR | EI_DTR | CA_DCD,
  1576. X    EO_DTR | EI_DTR | CA_DCD,
  1577. X    EO_DTR | EI_DTR | CA_DCD,
  1578. X    EO_DTR | EI_DTR | CA_DCD,
  1579. X    EO_DTR | EI_DTR | CA_DCD,
  1580. X    EO_DTR | EI_DTR | CA_DCD,
  1581. X    EO_DTR | EI_DTR | CA_DCD
  1582. X};
  1583. X
  1584. X/* array of hardware flow control flags
  1585. X   You can choose which signals to use for hardware handshake. See fas.h
  1586. X   for possible names and values. Whether or not hardware handshake is
  1587. X   used is determined by the minor device number at open time and by the
  1588. X   RTSFLOW/CTSFLOW termio(7) flags.
  1589. X*/
  1590. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1591. X{
  1592. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1593. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1594. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1595. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1596. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1597. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1598. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1599. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1600. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1601. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1602. X};
  1603. X
  1604. X/* array of control register addresses
  1605. X   There are serial boards available that have all serial ports
  1606. X   multiplexed to one address location in order to save I/O address
  1607. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1608. X   by a special register that needs to be written to before the actual
  1609. X   port registers can be accessed. This array contains the addresses
  1610. X   of these special registers.
  1611. X   Enter the addresses on a per unit base. An address of zero
  1612. X   disables this feature.
  1613. X*/
  1614. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1615. X{
  1616. X    0,    0,    0,    0,
  1617. X    0,    0,    0,    0,
  1618. X    0,    0
  1619. X};
  1620. X
  1621. X/* array of control register values
  1622. X   These values are written to the corresponding control register
  1623. X   before the first access to the actual port registers. If not only
  1624. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1625. X   single registers of the UART chips need to be multiplexed to one
  1626. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1627. X   to the control register value. This mask determines at which bit
  1628. X   locations the UART chip register number is "xored" into the control
  1629. X   register value at runtime. This implies that you can also use
  1630. X   negative logic by setting the bits in the control register value
  1631. X   to 1 at the locations corresponding to the bit mask.
  1632. X*/
  1633. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1634. X{
  1635. X    0,    0,    0,    0,
  1636. X    0,    0,    0,    0,
  1637. X    0,    0
  1638. X};
  1639. X
  1640. X/* This is the number of available port layout tables.
  1641. X   If this number is changed the arrays below must be filled
  1642. X   in accordingly.
  1643. X*/
  1644. X#define NUM_PORT_LAYOUTS    1
  1645. X
  1646. X/* array of port layout table selection values
  1647. X   These values select the port layout table in fas_layout [] []
  1648. X   that is used for the respective port.
  1649. X*/
  1650. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  1651. X{
  1652. X    0,    0,    0,    0,
  1653. X    0,    0,    0,    0,
  1654. X    0,    0
  1655. X};
  1656. X
  1657. X/* array of port layout tables
  1658. X   This two-dimensional array contains the base port offsets of the
  1659. X   seven UART registers used by FAS. There are one or more port layout
  1660. X   tables that are selected by the values in fas_pl_select [].
  1661. X
  1662. X   Each port layout table is arranged like this (the position of the values
  1663. X   corresponds to the respective UART register acronym):
  1664. X
  1665. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  1666. X*/
  1667. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  1668. X{
  1669. X  {    /* table 0 */
  1670. X    0,    1,    2,    3,    4,    5,    6
  1671. X  }
  1672. X};
  1673. X
  1674. X/* This is the number of available baud rate tables.
  1675. X   You may define up to 256 tables.  If this number is changed
  1676. X   the arrays below must be filled in accordingly.
  1677. X*/
  1678. X#define NUM_BAUD_TABLES    2
  1679. X
  1680. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  1681. X#undef NUM_BAUD_TABLES
  1682. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  1683. X#endif
  1684. X
  1685. X/* array of baud rate table selection values
  1686. X   These values select the baud rate table in fas_baud [] []
  1687. X   that is used for the respective port.
  1688. X*/
  1689. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  1690. X{
  1691. X    0,    0,    0,    0,
  1692. X    0,    0,    0,    0,
  1693. X    0,    0
  1694. X};
  1695. X
  1696. X/* array of baud rate tables
  1697. X   This two-dimensional array contains the 15 possible UNIX baud rates
  1698. X   plus the baud rate base that these 15 baud rates are derived from. There
  1699. X   are one or more baud rate tables that are selected by the values in
  1700. X   fas_bt_select [].
  1701. X
  1702. X   The values in the baud rate tables are multiplied by ten to allow an
  1703. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  1704. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  1705. X   is also mutiplied by ten to make its scale match the scale of the baud
  1706. X   rate values.
  1707. X
  1708. X   Each baud rate table is arranged like this (the position of the values
  1709. X   corresponds to the respective baud rate symbol):
  1710. X
  1711. X    BASE,        B50,        B75,        B110,
  1712. X    B134,        B150,        B200,        B300,
  1713. X    B600,        B1200,        B1800,        B2400,
  1714. X    B4800,        B9600,        B19200,        B38400
  1715. X*/
  1716. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  1717. X{
  1718. X  {    /* table 0 */
  1719. X    1152000,    500,        750,        1100,
  1720. X    1345,        1500,        2000,        3000,
  1721. X    6000,        12000,        18000,        24000,
  1722. X    48000,        96000,        192000,        384000
  1723. X  },
  1724. X  {    /* table 1 */
  1725. X    1152000,    500,        750,        1100,
  1726. X    1345,        1500,        2000,        3000,
  1727. X    6000,        12000,        18000,        24000,
  1728. X    48000,        96000,        576000,        1152000
  1729. X  }
  1730. X};
  1731. X
  1732. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1733. X   ============================================
  1734. X*/
  1735. X
  1736. X/* let the driver know the number of devices */
  1737. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1738. X
  1739. X/* let the driver know the number of port layout tables */
  1740. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  1741. X
  1742. X/* let the driver know the number of baud rate tables */
  1743. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  1744. X
  1745. X/* array of structures to hold all info for a physical minor device */
  1746. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  1747. X
  1748. X/* array of tty structures for logical devices */
  1749. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1750. X
  1751. X/* array of fas_speed structure arrays that contain baud rate dependent
  1752. X   informations
  1753. X*/
  1754. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  1755. X
  1756. X/* array of pointers to fas_internals structures
  1757. X   this prevents time consuming multiplications for index calculation
  1758. X*/
  1759. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  1760. X
  1761. X/* array of pointers to tty structures
  1762. X   this prevents time consuming multiplications for index calculation
  1763. X*/
  1764. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1765. X
  1766. X/* array of pointers to fas_speed structure arrays
  1767. X   this prevents time consuming multiplications for index calculation
  1768. X*/
  1769. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  1770. X
  1771. X/* array of pointers to the baud rate tables in fas_baud [] []
  1772. X   this prevents time consuming multiplications for index calculation
  1773. X*/
  1774. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  1775. SHAR_EOF
  1776. true || echo 'restore of space-ast8c12 failed'
  1777. rm -f _shar_wnt_.tmp
  1778. fi
  1779. # ============= space-c123 ==============
  1780. if test -f 'space-c123' -a X"$1" != X"-c"; then
  1781.     echo 'x - skipping space-c123 (File already exists)'
  1782.     rm -f _shar_wnt_.tmp
  1783. else
  1784. > _shar_wnt_.tmp
  1785. echo 'x - extracting space-c123 (Text)'
  1786. sed 's/^X//' << 'SHAR_EOF' > 'space-c123' &&
  1787. X/* Device configuration file for the FAS async driver. */
  1788. X
  1789. X/* This version is for the standard COM1 and COM2 and additional COM3
  1790. X   ports.
  1791. X*/
  1792. X/* FAS was developed by
  1793. XUwe Doering <fas@geminix.in-berlin.de>
  1794. XBillstedter Pfad 17 b
  1795. X13591 Berlin
  1796. XGermany
  1797. X*/
  1798. X
  1799. X#if !defined (M_I286)
  1800. X#ident    "@(#)space.c    2.12"
  1801. X#endif
  1802. X
  1803. X#if defined (LOCAL_INCLUDE)
  1804. X#include "fas.h"
  1805. X#else
  1806. X#include <sys/fas.h>
  1807. X#endif
  1808. X
  1809. X/* This is the number of devices to be handled by this driver.
  1810. X   If it is changed, make sure that the initializer parts of all arrays
  1811. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1812. X   entries. You may define up to 16 devices.
  1813. X*/
  1814. X#define NUM_PHYSICAL_UNITS    3
  1815. X
  1816. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1817. X#undef NUM_PHYSICAL_UNITS
  1818. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1819. X#endif
  1820. X
  1821. X/* array of base port addresses
  1822. X   These values are the base i/o addresses of the UART chips.
  1823. X*/
  1824. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1825. X{
  1826. X    0x3f8,    0x2f8,    0x3e8
  1827. X};
  1828. X
  1829. X#if defined (SCO) || defined (XENIX)
  1830. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1831. X   FAS doesn't need informations about interrupt vectors during normal
  1832. X   operation. Therefore, the only function of these values is to be
  1833. X   displayed by the FAS boot message. So if you want vector infos at
  1834. X   boot time you can enter the vector numbers here. But make sure that
  1835. X   the values correspond with the entries in the kernel config files.
  1836. X   A value of `-1' means that no vector number is displayed for the
  1837. X   respective port.
  1838. X   Users of other UNIX flavors can savely ignore this array.
  1839. X*/
  1840. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1841. X{
  1842. X    -1,    -1,    -1
  1843. X};
  1844. X#endif
  1845. X
  1846. X/* array of modifier flags
  1847. X   You can modify certain features of each port. See fas.h for possible
  1848. X   names and values.
  1849. X*/
  1850. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1851. X{
  1852. X    0,    0,    0
  1853. X};
  1854. X
  1855. X/* array of FIFO operating mode values
  1856. X   These values select the mode to which the UART FIFOs are set when
  1857. X   a port is activated. For device types that don't have FIFOs the
  1858. X   respective value is ignored, so you can set up this array for
  1859. X   FIFO operation now and add the FIFO UARTs later. There are several
  1860. X   operating modes predefined. See fas.h for possible names and values.
  1861. X*/
  1862. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1863. X{
  1864. X    FIFO_DEFAULT,
  1865. X    FIFO_DEFAULT,
  1866. X    FIFO_DEFAULT
  1867. X};
  1868. X
  1869. X/* initialization sequence for serial cards
  1870. X   This array contains pairs of values of the form:
  1871. X
  1872. X        portaddress, value,
  1873. X              :
  1874. X              :
  1875. X        portaddress, value,
  1876. X        0
  1877. X
  1878. X   For every line `value' will be written to `portaddress'. If
  1879. X   `value' is replaced with the macro `READ_PORT' then a value
  1880. X   is read from `portaddress' instead. The value itself will be
  1881. X   discarded. Therefore, this makes only sense if the read access
  1882. X   to the port has a side effect like setting or resetting
  1883. X   certain flags.
  1884. X
  1885. X   NOTE: This array *must* be terminated with a value of 0
  1886. X         in the portaddress column!
  1887. X*/
  1888. Xuint    fas_init_seq [] =
  1889. X{
  1890. X    0
  1891. X};
  1892. X
  1893. X/* interrupt acknowledge sequence for serial cards
  1894. X   This sequence is executed by the fasintr () function after all pending
  1895. X   interrupts on all serial cards have been processed. The contents of this
  1896. X   array has the same form as in the fas_init_seq [] array above.
  1897. X*/
  1898. Xuint    fas_int_ack_seq [] =
  1899. X{
  1900. X    0
  1901. X};
  1902. X
  1903. X/* initial modem control port info
  1904. X   This value is ored into the modem control value for each UART. This is
  1905. X   normaly used to force out2 which is used to enable the interrupts of
  1906. X   the standard com1 and com2 ports. Several brands of cards have modes
  1907. X   that allow them to work in compatible mode like com1 and com2 or as a
  1908. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1909. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1910. X
  1911. X   Note: This is one of the major trouble-spots with shared interrupts
  1912. X   cards. Check your manual.
  1913. X*/
  1914. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1915. X{
  1916. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2
  1917. X};
  1918. X
  1919. X/* array of modem control flags
  1920. X   You can choose which signals to use for modem control. See fas.h
  1921. X   for possible names and values. Whether or not modem control is
  1922. X   used is determined by the minor device number at open time.
  1923. X*/
  1924. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1925. X{
  1926. X    EO_DTR | EI_DTR | CA_DCD,
  1927. X    EO_DTR | EI_DTR | CA_DCD,
  1928. X    EO_DTR | EI_DTR | CA_DCD
  1929. X};
  1930. X
  1931. X/* array of hardware flow control flags
  1932. X   You can choose which signals to use for hardware handshake. See fas.h
  1933. X   for possible names and values. Whether or not hardware handshake is
  1934. X   used is determined by the minor device number at open time and by the
  1935. X   RTSFLOW/CTSFLOW termio(7) flags.
  1936. X*/
  1937. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1938. X{
  1939. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1940. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1941. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1942. X};
  1943. X
  1944. X/* array of control register addresses
  1945. X   There are serial boards available that have all serial ports
  1946. X   multiplexed to one address location in order to save I/O address
  1947. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1948. X   by a special register that needs to be written to before the actual
  1949. X   port registers can be accessed. This array contains the addresses
  1950. X   of these special registers.
  1951. X   Enter the addresses on a per unit base. An address of zero
  1952. X   disables this feature.
  1953. X*/
  1954. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1955. X{
  1956. X    0,    0,    0
  1957. X};
  1958. X
  1959. X/* array of control register values
  1960. X   These values are written to the corresponding control register
  1961. X   before the first access to the actual port registers. If not only
  1962. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1963. X   single registers of the UART chips need to be multiplexed to one
  1964. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1965. X   to the control register value. This mask determines at which bit
  1966. X   locations the UART chip register number is "xored" into the control
  1967. X   register value at runtime. This implies that you can also use
  1968. X   negative logic by setting the bits in the control register value
  1969. X   to 1 at the locations corresponding to the bit mask.
  1970. X*/
  1971. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1972. X{
  1973. X    0,    0,    0
  1974. X};
  1975. X
  1976. X/* This is the number of available port layout tables.
  1977. X   If this number is changed the arrays below must be filled
  1978. X   in accordingly.
  1979. X*/
  1980. X#define NUM_PORT_LAYOUTS    1
  1981. SHAR_EOF
  1982. true || echo 'restore of space-c123 failed'
  1983. fi
  1984. echo 'End of  part 7'
  1985. echo 'File space-c123 is continued in part 8'
  1986. echo 8 > _shar_seq_.tmp
  1987. exit 0
  1988.