home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / fas-2.11.0 / part08 < prev    next >
Text File  |  1993-10-12  |  28KB  |  882 lines

  1. Newsgroups: comp.sources.unix
  2. From: fas@geminix.in-berlin.de (FAS Support Account)
  3. Subject: v27i074: FAS-2.11.0 - asynch serial driver for System V, Part08/08
  4. References: <1.750471074.20539@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 74
  10. Archive-Name: fas-2.11.0/part08
  11.  
  12. #!/bin/sh
  13. # this is fas211pl0.08 (part 8 of a multipart archive)
  14. # do not concatenate these parts, unpack them in order with /bin/sh
  15. # file space-gen8c12 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" != 8; 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 space-gen8c12'
  31. else
  32. echo 'x - continuing file space-gen8c12'
  33. sed 's/^X//' << 'SHAR_EOF' >> 'space-gen8c12' &&
  34. X
  35. X/* array of port layout tables
  36. X   This two-dimensional array contains the base port offsets of the
  37. X   seven UART registers used by FAS. There are one or more port layout
  38. X   tables that are selected by the values in fas_pl_select [].
  39. X
  40. X   Each port layout table is arranged like this (the position of the values
  41. X   corresponds to the respective UART register acronym):
  42. X
  43. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  44. X*/
  45. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  46. X{
  47. X  {    /* table 0 */
  48. X    0,    1,    2,    3,    4,    5,    6
  49. X  }
  50. X};
  51. X
  52. X/* This is the number of available baud rate tables.
  53. X   You may define up to 256 tables.  If this number is changed
  54. X   the arrays below must be filled in accordingly.
  55. X*/
  56. X#define NUM_BAUD_TABLES    2
  57. X
  58. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  59. X#undef NUM_BAUD_TABLES
  60. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  61. X#endif
  62. X
  63. X/* array of baud rate table selection values
  64. X   These values select the baud rate table in fas_baud [] []
  65. X   that is used for the respective port.
  66. X*/
  67. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  68. X{
  69. X    0,    0,    0,    0,
  70. X    0,    0,    0,    0,
  71. X    0,    0
  72. X};
  73. X
  74. X/* array of baud rate tables
  75. X   This two-dimensional array contains the 15 possible UNIX baud rates
  76. X   plus the baud rate base that these 15 baud rates are derived from. There
  77. X   are one or more baud rate tables that are selected by the values in
  78. X   fas_bt_select [].
  79. X
  80. X   The values in the baud rate tables are multiplied by ten to allow an
  81. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  82. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  83. X   is also mutiplied by ten to make its scale match the scale of the baud
  84. X   rate values.
  85. X
  86. X   Each baud rate table is arranged like this (the position of the values
  87. X   corresponds to the respective baud rate symbol):
  88. X
  89. X    BASE,        B50,        B75,        B110,
  90. X    B134,        B150,        B200,        B300,
  91. X    B600,        B1200,        B1800,        B2400,
  92. X    B4800,        B9600,        B19200,        B38400
  93. X*/
  94. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  95. X{
  96. X  {    /* table 0 */
  97. X    1152000,    500,        750,        1100,
  98. X    1345,        1500,        2000,        3000,
  99. X    6000,        12000,        18000,        24000,
  100. X    48000,        96000,        192000,        384000
  101. X  },
  102. X  {    /* table 1 */
  103. X    1152000,    500,        750,        1100,
  104. X    1345,        1500,        2000,        3000,
  105. X    6000,        12000,        18000,        24000,
  106. X    48000,        96000,        576000,        1152000
  107. X  }
  108. X};
  109. X
  110. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  111. X   ============================================
  112. X*/
  113. X
  114. X/* let the driver know the number of devices */
  115. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  116. X
  117. X/* let the driver know the number of port layout tables */
  118. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  119. X
  120. X/* let the driver know the number of baud rate tables */
  121. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  122. X
  123. X/* array of structures to hold all info for a physical minor device */
  124. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  125. X
  126. X/* array of tty structures for logical devices */
  127. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  128. X
  129. X/* array of fas_speed structure arrays that contain baud rate dependent
  130. X   informations
  131. X*/
  132. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  133. X
  134. X/* array of pointers to fas_internals structures
  135. X   this prevents time consuming multiplications for index calculation
  136. X*/
  137. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  138. X
  139. X/* array of pointers to tty structures
  140. X   this prevents time consuming multiplications for index calculation
  141. X*/
  142. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  143. X
  144. X/* array of pointers to fas_speed structure arrays
  145. X   this prevents time consuming multiplications for index calculation
  146. X*/
  147. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  148. X
  149. X/* array of pointers to the baud rate tables in fas_baud [] []
  150. X   this prevents time consuming multiplications for index calculation
  151. X*/
  152. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  153. SHAR_EOF
  154. echo 'File space-gen8c12 is complete' &&
  155. true || echo 'restore of space-gen8c12 failed'
  156. rm -f _shar_wnt_.tmp
  157. fi
  158. # ============= space-hub6c12 ==============
  159. if test -f 'space-hub6c12' -a X"$1" != X"-c"; then
  160.     echo 'x - skipping space-hub6c12 (File already exists)'
  161.     rm -f _shar_wnt_.tmp
  162. else
  163. > _shar_wnt_.tmp
  164. echo 'x - extracting space-hub6c12 (Text)'
  165. sed 's/^X//' << 'SHAR_EOF' > 'space-hub6c12' &&
  166. X/* Device configuration file for the FAS async driver. */
  167. X
  168. X/* This version is for the Bell Tech HUB-6 card plus the standard COM1
  169. X   and COM2 ports.
  170. X*/
  171. X/* FAS was developed by
  172. XUwe Doering <fas@geminix.in-berlin.de>
  173. XBillstedter Pfad 17 b
  174. X13591 Berlin
  175. XGermany
  176. X*/
  177. X
  178. X#if !defined (M_I286)
  179. X#ident    "@(#)space.c    2.11"
  180. X#endif
  181. X
  182. X#if defined (LOCAL_INCLUDE)
  183. X#include "fas.h"
  184. X#else
  185. X#include <sys/fas.h>
  186. X#endif
  187. X
  188. X/* This is the number of devices to be handled by this driver.
  189. X   If it is changed, make sure that the initializer parts of all arrays
  190. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  191. X   entries. You may define up to 16 devices.
  192. X*/
  193. X#define NUM_PHYSICAL_UNITS    8
  194. X
  195. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  196. X#undef NUM_PHYSICAL_UNITS
  197. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  198. X#endif
  199. X
  200. X/* array of base port addresses
  201. X   These values are the base i/o addresses of the UART chips.
  202. X*/
  203. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  204. X{
  205. X    0x303,    0x303,    0x303,    0x303,
  206. X    0x303,    0x303,    0x3f8,    0x2f8
  207. X};
  208. X
  209. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  210. X   FAS doesn't need informations about interrupt vectors during normal
  211. X   operation. Therefore, the only function of these values is to be
  212. X   displayed by the FAS boot message. So if you want vector infos at
  213. X   boot time you can enter the vector numbers here. But make sure that
  214. X   the values correspond with the entries in the kernel config files.
  215. X   A value of `-1' means that no vector number is displayed for the
  216. X   respective port.
  217. X   Users of other UNIX flavors can savely ignore this array.
  218. X*/
  219. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  220. X{
  221. X    -1,    -1,    -1,    -1,
  222. X    -1,    -1,    -1,    -1
  223. X};
  224. X
  225. X/* array of modifier flags
  226. X   You can modify certain features of each port. See fas.h for possible
  227. X   names and values.
  228. X*/
  229. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  230. X{
  231. X    0,    0,    0,    0,
  232. X    0,    0,    0,    0
  233. X};
  234. X
  235. X/* array of FIFO operating mode values
  236. X   These values select the mode to which the UART FIFOs are set when
  237. X   a port is activated. For device types that don't have FIFOs the
  238. X   respective value is ignored, so you can set up this array for
  239. X   FIFO operation now and add the FIFO UARTs later. There are several
  240. X   operating modes predefined. See fas.h for possible names and values.
  241. X*/
  242. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  243. X{
  244. X    FIFO_DEFAULT,
  245. X    FIFO_DEFAULT,
  246. X    FIFO_DEFAULT,
  247. X    FIFO_DEFAULT,
  248. X    FIFO_DEFAULT,
  249. X    FIFO_DEFAULT,
  250. X    FIFO_DEFAULT,
  251. X    FIFO_DEFAULT
  252. X};
  253. X
  254. X/* initialization sequence for serial cards
  255. X   This array contains pairs of values of the form:
  256. X
  257. X        portaddress, value,
  258. X              :
  259. X              :
  260. X        portaddress, value,
  261. X        0
  262. X
  263. X   For every line `value' will be written to `portaddress'. If
  264. X   `value' is replaced with the macro `READ_PORT' then a value
  265. X   is read from `portaddress' instead. The value itself will be
  266. X   discarded. Therefore, this makes only sense if the read access
  267. X   to the port has a side effect like setting or resetting
  268. X   certain flags.
  269. X
  270. X   NOTE: This array *must* be terminated with a value of 0
  271. X         in the portaddress column!
  272. X*/
  273. Xuint    fas_init_seq [] =
  274. X{
  275. X    0
  276. X};
  277. X
  278. X/* interrupt acknowledge sequence for serial cards
  279. X   This sequence is executed by the fasintr () function after all pending
  280. X   interrupts on all serial cards have been processed. The contents of this
  281. X   array has the same form as in the fas_init_seq [] array above.
  282. X*/
  283. Xuint    fas_int_ack_seq [] =
  284. X{
  285. X    0
  286. X};
  287. X
  288. X/* initial modem control port info
  289. X   This value is ored into the modem control value for each UART. This is
  290. X   normaly used to force out2 which is used to enable the interrupts of
  291. X   the standard com1 and com2 ports. Several brands of cards have modes
  292. X   that allow them to work in compatible mode like com1 and com2 or as a
  293. X   shared interrupts card. One of these cards is the AST 4-port card. When
  294. X   this card is used in shared interrupts mode out2 must _not_ be set.
  295. X
  296. X   Note: This is one of the major trouble-spots with shared interrupts
  297. X   cards. Check your manual.
  298. X*/
  299. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  300. X{
  301. X    0,    0,    0,    0,
  302. X    0,    0,    MC_SET_OUT2,    MC_SET_OUT2
  303. X};
  304. X
  305. X/* array of modem control flags
  306. X   You can choose which signals to use for modem control. See fas.h
  307. X   for possible names and values. Whether or not modem control is
  308. X   used is determined by the minor device number at open time.
  309. X*/
  310. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  311. X{
  312. X    EO_DTR | EI_DTR | CA_DCD,
  313. X    EO_DTR | EI_DTR | CA_DCD,
  314. X    EO_DTR | EI_DTR | CA_DCD,
  315. X    EO_DTR | EI_DTR | CA_DCD,
  316. X    EO_DTR | EI_DTR | CA_DCD,
  317. X    EO_DTR | EI_DTR | CA_DCD,
  318. X    EO_DTR | EI_DTR | CA_DCD,
  319. X    EO_DTR | EI_DTR | CA_DCD
  320. X};
  321. X
  322. X/* array of hardware flow control flags
  323. X   You can choose which signals to use for hardware handshake. See fas.h
  324. X   for possible names and values. Whether or not hardware handshake is
  325. X   used is determined by the minor device number at open time and by the
  326. X   RTSFLOW/CTSFLOW termio(7) flags.
  327. X*/
  328. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  329. X{
  330. X    HI_RTS | HO_CTS | HX_RTS,
  331. X    HI_RTS | HO_CTS | HX_RTS,
  332. X    HI_RTS | HO_CTS | HX_RTS,
  333. X    HI_RTS | HO_CTS | HX_RTS,
  334. X    HI_RTS | HO_CTS | HX_RTS,
  335. X    HI_RTS | HO_CTS | HX_RTS,
  336. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  337. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  338. X};
  339. X
  340. X/* array of control register addresses
  341. X   There are serial boards available that have all serial ports
  342. X   multiplexed to one address location in order to save I/O address
  343. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  344. X   by a special register that needs to be written to before the actual
  345. X   port registers can be accessed. This array contains the addresses
  346. X   of these special registers.
  347. X   Enter the addresses on a per unit base. An address of zero
  348. X   disables this feature.
  349. X*/
  350. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  351. X{
  352. X    0x302,    0x302,    0x302,    0x302,
  353. X    0x302,    0x302,    0,    0
  354. X};
  355. X
  356. X/* array of control register values
  357. X   These values are written to the corresponding control register
  358. X   before the first access to the actual port registers. If not only
  359. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  360. X   single registers of the UART chips need to be multiplexed to one
  361. X   address you have to "or" a bit mask (shifted 8 times to the left)
  362. X   to the control register value. This mask determines at which bit
  363. X   locations the UART chip register number is "xored" into the control
  364. X   register value at runtime. This implies that you can also use
  365. X   negative logic by setting the bits in the control register value
  366. X   to 1 at the locations corresponding to the bit mask.
  367. X*/
  368. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  369. X{
  370. X    0x700,    0x708,    0x710,    0x718,
  371. X    0x720,    0x728,    0,    0
  372. X};
  373. X
  374. X/* This is the number of available port layout tables.
  375. X   If this number is changed the arrays below must be filled
  376. X   in accordingly.
  377. X*/
  378. X#define NUM_PORT_LAYOUTS    1
  379. X
  380. X/* array of port layout table selection values
  381. X   These values select the port layout table in fas_layout [] []
  382. X   that is used for the respective port.
  383. X*/
  384. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  385. X{
  386. X    0,    0,    0,    0,
  387. X    0,    0,    0,    0
  388. X};
  389. X
  390. X/* array of port layout tables
  391. X   This two-dimensional array contains the base port offsets of the
  392. X   seven UART registers used by FAS. There are one or more port layout
  393. X   tables that are selected by the values in fas_pl_select [].
  394. X
  395. X   Each port layout table is arranged like this (the position of the values
  396. X   corresponds to the respective UART register acronym):
  397. X
  398. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  399. X*/
  400. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  401. X{
  402. X  {    /* table 0 */
  403. X    0,    1,    2,    3,    4,    5,    6
  404. X  }
  405. X};
  406. X
  407. X/* This is the number of available baud rate tables.
  408. X   You may define up to 256 tables.  If this number is changed
  409. X   the arrays below must be filled in accordingly.
  410. X*/
  411. X#define NUM_BAUD_TABLES    2
  412. X
  413. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  414. X#undef NUM_BAUD_TABLES
  415. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  416. X#endif
  417. X
  418. X/* array of baud rate table selection values
  419. X   These values select the baud rate table in fas_baud [] []
  420. X   that is used for the respective port.
  421. X*/
  422. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  423. X{
  424. X    0,    0,    0,    0,
  425. X    0,    0,    0,    0
  426. X};
  427. X
  428. X/* array of baud rate tables
  429. X   This two-dimensional array contains the 15 possible UNIX baud rates
  430. X   plus the baud rate base that these 15 baud rates are derived from. There
  431. X   are one or more baud rate tables that are selected by the values in
  432. X   fas_bt_select [].
  433. X
  434. X   The values in the baud rate tables are multiplied by ten to allow an
  435. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  436. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  437. X   is also mutiplied by ten to make its scale match the scale of the baud
  438. X   rate values.
  439. X
  440. X   Each baud rate table is arranged like this (the position of the values
  441. X   corresponds to the respective baud rate symbol):
  442. X
  443. X    BASE,        B50,        B75,        B110,
  444. X    B134,        B150,        B200,        B300,
  445. X    B600,        B1200,        B1800,        B2400,
  446. X    B4800,        B9600,        B19200,        B38400
  447. X*/
  448. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  449. X{
  450. X  {    /* table 0 */
  451. X    1152000,    500,        750,        1100,
  452. X    1345,        1500,        2000,        3000,
  453. X    6000,        12000,        18000,        24000,
  454. X    48000,        96000,        192000,        384000
  455. X  },
  456. X  {    /* table 1 */
  457. X    1152000,    500,        750,        1100,
  458. X    1345,        1500,        2000,        3000,
  459. X    6000,        12000,        18000,        24000,
  460. X    48000,        96000,        576000,        1152000
  461. X  }
  462. X};
  463. X
  464. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  465. X   ============================================
  466. X*/
  467. X
  468. X/* let the driver know the number of devices */
  469. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  470. X
  471. X/* let the driver know the number of port layout tables */
  472. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  473. X
  474. X/* let the driver know the number of baud rate tables */
  475. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  476. X
  477. X/* array of structures to hold all info for a physical minor device */
  478. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  479. X
  480. X/* array of tty structures for logical devices */
  481. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  482. X
  483. X/* array of fas_speed structure arrays that contain baud rate dependent
  484. X   informations
  485. X*/
  486. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  487. X
  488. X/* array of pointers to fas_internals structures
  489. X   this prevents time consuming multiplications for index calculation
  490. X*/
  491. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  492. X
  493. X/* array of pointers to tty structures
  494. X   this prevents time consuming multiplications for index calculation
  495. X*/
  496. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  497. X
  498. X/* array of pointers to fas_speed structure arrays
  499. X   this prevents time consuming multiplications for index calculation
  500. X*/
  501. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  502. X
  503. X/* array of pointers to the baud rate tables in fas_baud [] []
  504. X   this prevents time consuming multiplications for index calculation
  505. X*/
  506. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  507. SHAR_EOF
  508. true || echo 'restore of space-hub6c12 failed'
  509. rm -f _shar_wnt_.tmp
  510. fi
  511. # ============= space-use4c12 ==============
  512. if test -f 'space-use4c12' -a X"$1" != X"-c"; then
  513.     echo 'x - skipping space-use4c12 (File already exists)'
  514.     rm -f _shar_wnt_.tmp
  515. else
  516. > _shar_wnt_.tmp
  517. echo 'x - extracting space-use4c12 (Text)'
  518. sed 's/^X//' << 'SHAR_EOF' > 'space-use4c12' &&
  519. X/* Device configuration file for the FAS async driver. */
  520. X
  521. X/* This version is for the USENET II 4-port card in common interrupt
  522. X   mode plus the standard COM1 and COM2 ports.
  523. X*/
  524. X/* FAS was developed by
  525. XUwe Doering <fas@geminix.in-berlin.de>
  526. XBillstedter Pfad 17 b
  527. X13591 Berlin
  528. XGermany
  529. X*/
  530. X
  531. X#if !defined (M_I286)
  532. X#ident    "@(#)space.c    2.11"
  533. X#endif
  534. X
  535. X#if defined (LOCAL_INCLUDE)
  536. X#include "fas.h"
  537. X#else
  538. X#include <sys/fas.h>
  539. X#endif
  540. X
  541. X/* This is the number of devices to be handled by this driver.
  542. X   If it is changed, make sure that the initializer parts of all arrays
  543. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  544. X   entries. You may define up to 16 devices.
  545. X*/
  546. X#define NUM_PHYSICAL_UNITS    6
  547. X
  548. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  549. X#undef NUM_PHYSICAL_UNITS
  550. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  551. X#endif
  552. X
  553. X/* array of base port addresses
  554. X   These values are the base i/o addresses of the UART chips.
  555. X*/
  556. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  557. X{
  558. X    0x2c0,    0x2c8,    0x2d0,    0x2d8,
  559. X    0x3f8,    0x2f8
  560. X};
  561. X
  562. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  563. X   FAS doesn't need informations about interrupt vectors during normal
  564. X   operation. Therefore, the only function of these values is to be
  565. X   displayed by the FAS boot message. So if you want vector infos at
  566. X   boot time you can enter the vector numbers here. But make sure that
  567. X   the values correspond with the entries in the kernel config files.
  568. X   A value of `-1' means that no vector number is displayed for the
  569. X   respective port.
  570. X   Users of other UNIX flavors can savely ignore this array.
  571. X*/
  572. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  573. X{
  574. X    -1,    -1,    -1,    -1,
  575. X    -1,    -1
  576. X};
  577. X
  578. X/* array of modifier flags
  579. X   You can modify certain features of each port. See fas.h for possible
  580. X   names and values.
  581. X*/
  582. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  583. X{
  584. X    0,    0,    0,    0,
  585. X    0,    0
  586. X};
  587. X
  588. X/* array of FIFO operating mode values
  589. X   These values select the mode to which the UART FIFOs are set when
  590. X   a port is activated. For device types that don't have FIFOs the
  591. X   respective value is ignored, so you can set up this array for
  592. X   FIFO operation now and add the FIFO UARTs later. There are several
  593. X   operating modes predefined. See fas.h for possible names and values.
  594. X*/
  595. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  596. X{
  597. X    FIFO_DEFAULT,
  598. X    FIFO_DEFAULT,
  599. X    FIFO_DEFAULT,
  600. X    FIFO_DEFAULT,
  601. X    FIFO_DEFAULT,
  602. X    FIFO_DEFAULT
  603. X};
  604. X
  605. X/* initialization sequence for serial cards
  606. X   This array contains pairs of values of the form:
  607. X
  608. X        portaddress, value,
  609. X              :
  610. X              :
  611. X        portaddress, value,
  612. X        0
  613. X
  614. X   For every line `value' will be written to `portaddress'. If
  615. X   `value' is replaced with the macro `READ_PORT' then a value
  616. X   is read from `portaddress' instead. The value itself will be
  617. X   discarded. Therefore, this makes only sense if the read access
  618. X   to the port has a side effect like setting or resetting
  619. X   certain flags.
  620. X
  621. X   NOTE: This array *must* be terminated with a value of 0
  622. X         in the portaddress column!
  623. X*/
  624. Xuint    fas_init_seq [] =
  625. X{
  626. X    0
  627. X};
  628. X
  629. X/* interrupt acknowledge sequence for serial cards
  630. X   This sequence is executed by the fasintr () function after all pending
  631. X   interrupts on all serial cards have been processed. The contents of this
  632. X   array has the same form as in the fas_init_seq [] array above.
  633. X*/
  634. Xuint    fas_int_ack_seq [] =
  635. X{
  636. X    0
  637. X};
  638. X
  639. X/* initial modem control port info
  640. X   This value is ored into the modem control value for each UART. This is
  641. X   normaly used to force out2 which is used to enable the interrupts of
  642. X   the standard com1 and com2 ports. Several brands of cards have modes
  643. X   that allow them to work in compatible mode like com1 and com2 or as a
  644. X   shared interrupts card. One of these cards is the AST 4-port card. When
  645. X   this card is used in shared interrupts mode out2 must _not_ be set.
  646. X
  647. X   Note: This is one of the major trouble-spots with shared interrupts
  648. X   cards. Check your manual.
  649. X*/
  650. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  651. X{
  652. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,
  653. X    MC_SET_OUT2,    MC_SET_OUT2
  654. X};
  655. X
  656. X/* array of modem control flags
  657. X   You can choose which signals to use for modem control. See fas.h
  658. X   for possible names and values. Whether or not modem control is
  659. X   used is determined by the minor device number at open time.
  660. X*/
  661. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  662. X{
  663. X    EO_DTR | EI_DTR | CA_DCD,
  664. X    EO_DTR | EI_DTR | CA_DCD,
  665. X    EO_DTR | EI_DTR | CA_DCD,
  666. X    EO_DTR | EI_DTR | CA_DCD,
  667. X    EO_DTR | EI_DTR | CA_DCD,
  668. X    EO_DTR | EI_DTR | CA_DCD
  669. X};
  670. X
  671. X/* array of hardware flow control flags
  672. X   You can choose which signals to use for hardware handshake. See fas.h
  673. X   for possible names and values. Whether or not hardware handshake is
  674. X   used is determined by the minor device number at open time and by the
  675. X   RTSFLOW/CTSFLOW termio(7) flags.
  676. X*/
  677. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  678. X{
  679. X    HI_RTS | HO_CTS | HX_RTS,
  680. X    HI_RTS | HO_CTS | HX_RTS,
  681. X    HI_RTS | HO_CTS | HX_RTS,
  682. X    HI_RTS | HO_CTS | HX_RTS,
  683. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  684. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  685. X};
  686. X
  687. X/* array of control register addresses
  688. X   There are serial boards available that have all serial ports
  689. X   multiplexed to one address location in order to save I/O address
  690. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  691. X   by a special register that needs to be written to before the actual
  692. X   port registers can be accessed. This array contains the addresses
  693. X   of these special registers.
  694. X   Enter the addresses on a per unit base. An address of zero
  695. X   disables this feature.
  696. X*/
  697. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  698. X{
  699. X    0,    0,    0,    0,
  700. X    0,    0
  701. X};
  702. X
  703. X/* array of control register values
  704. X   These values are written to the corresponding control register
  705. X   before the first access to the actual port registers. If not only
  706. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  707. X   single registers of the UART chips need to be multiplexed to one
  708. X   address you have to "or" a bit mask (shifted 8 times to the left)
  709. X   to the control register value. This mask determines at which bit
  710. X   locations the UART chip register number is "xored" into the control
  711. X   register value at runtime. This implies that you can also use
  712. X   negative logic by setting the bits in the control register value
  713. X   to 1 at the locations corresponding to the bit mask.
  714. X*/
  715. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  716. X{
  717. X    0,    0,    0,    0,
  718. X    0,    0
  719. X};
  720. X
  721. X/* This is the number of available port layout tables.
  722. X   If this number is changed the arrays below must be filled
  723. X   in accordingly.
  724. X*/
  725. X#define NUM_PORT_LAYOUTS    1
  726. X
  727. X/* array of port layout table selection values
  728. X   These values select the port layout table in fas_layout [] []
  729. X   that is used for the respective port.
  730. X*/
  731. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  732. X{
  733. X    0,    0,    0,    0,
  734. X    0,    0
  735. X};
  736. X
  737. X/* array of port layout tables
  738. X   This two-dimensional array contains the base port offsets of the
  739. X   seven UART registers used by FAS. There are one or more port layout
  740. X   tables that are selected by the values in fas_pl_select [].
  741. X
  742. X   Each port layout table is arranged like this (the position of the values
  743. X   corresponds to the respective UART register acronym):
  744. X
  745. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  746. X*/
  747. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  748. X{
  749. X  {    /* table 0 */
  750. X    0,    1,    2,    3,    4,    5,    6
  751. X  }
  752. X};
  753. X
  754. X/* This is the number of available baud rate tables.
  755. X   You may define up to 256 tables.  If this number is changed
  756. X   the arrays below must be filled in accordingly.
  757. X*/
  758. X#define NUM_BAUD_TABLES    2
  759. X
  760. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  761. X#undef NUM_BAUD_TABLES
  762. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  763. X#endif
  764. X
  765. X/* array of baud rate table selection values
  766. X   These values select the baud rate table in fas_baud [] []
  767. X   that is used for the respective port.
  768. X*/
  769. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  770. X{
  771. X    0,    0,    0,    0,
  772. X    0,    0
  773. X};
  774. X
  775. X/* array of baud rate tables
  776. X   This two-dimensional array contains the 15 possible UNIX baud rates
  777. X   plus the baud rate base that these 15 baud rates are derived from. There
  778. X   are one or more baud rate tables that are selected by the values in
  779. X   fas_bt_select [].
  780. X
  781. X   The values in the baud rate tables are multiplied by ten to allow an
  782. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  783. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  784. X   is also mutiplied by ten to make its scale match the scale of the baud
  785. X   rate values.
  786. X
  787. X   Each baud rate table is arranged like this (the position of the values
  788. X   corresponds to the respective baud rate symbol):
  789. X
  790. X    BASE,        B50,        B75,        B110,
  791. X    B134,        B150,        B200,        B300,
  792. X    B600,        B1200,        B1800,        B2400,
  793. X    B4800,        B9600,        B19200,        B38400
  794. X*/
  795. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  796. X{
  797. X  {    /* table 0 */
  798. X    1152000,    500,        750,        1100,
  799. X    1345,        1500,        2000,        3000,
  800. X    6000,        12000,        18000,        24000,
  801. X    48000,        96000,        192000,        384000
  802. X  },
  803. X  {    /* table 1 */
  804. X    1152000,    500,        750,        1100,
  805. X    1345,        1500,        2000,        3000,
  806. X    6000,        12000,        18000,        24000,
  807. X    48000,        96000,        576000,        1152000
  808. X  }
  809. X};
  810. X
  811. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  812. X   ============================================
  813. X*/
  814. X
  815. X/* let the driver know the number of devices */
  816. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  817. X
  818. X/* let the driver know the number of port layout tables */
  819. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  820. X
  821. X/* let the driver know the number of baud rate tables */
  822. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  823. X
  824. X/* array of structures to hold all info for a physical minor device */
  825. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  826. X
  827. X/* array of tty structures for logical devices */
  828. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  829. X
  830. X/* array of fas_speed structure arrays that contain baud rate dependent
  831. X   informations
  832. X*/
  833. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  834. X
  835. X/* array of pointers to fas_internals structures
  836. X   this prevents time consuming multiplications for index calculation
  837. X*/
  838. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  839. X
  840. X/* array of pointers to tty structures
  841. X   this prevents time consuming multiplications for index calculation
  842. X*/
  843. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  844. X
  845. X/* array of pointers to fas_speed structure arrays
  846. X   this prevents time consuming multiplications for index calculation
  847. X*/
  848. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  849. X
  850. X/* array of pointers to the baud rate tables in fas_baud [] []
  851. X   this prevents time consuming multiplications for index calculation
  852. X*/
  853. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  854. SHAR_EOF
  855. true || echo 'restore of space-use4c12 failed'
  856. rm -f _shar_wnt_.tmp
  857. fi
  858. # ============= update_desc ==============
  859. if test -f 'update_desc' -a X"$1" != X"-c"; then
  860.     echo 'x - skipping update_desc (File already exists)'
  861.     rm -f _shar_wnt_.tmp
  862. else
  863. > _shar_wnt_.tmp
  864. echo 'x - extracting update_desc (Text)'
  865. sed 's/^X//' << 'SHAR_EOF' > 'update_desc' &&
  866. X# Update the kernel description file
  867. X
  868. Xgrep '^fas[     ]' $1 > /dev/null 2>&1
  869. Xif [ $? -eq 1 ]
  870. Xthen
  871. X    echo 'fas     -    -     io     -             FAS Serial I/O Driver' >> $1
  872. Xfi
  873. SHAR_EOF
  874. true || echo 'restore of update_desc failed'
  875. rm -f _shar_wnt_.tmp
  876. fi
  877. rm -f _shar_seq_.tmp
  878. echo You have unpacked the last part
  879. exit 0
  880.