home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume27
/
fas-2.11.0
/
part08
< prev
next >
Wrap
Text File
|
1993-10-12
|
28KB
|
882 lines
Newsgroups: comp.sources.unix
From: fas@geminix.in-berlin.de (FAS Support Account)
Subject: v27i074: FAS-2.11.0 - asynch serial driver for System V, Part08/08
References: <1.750471074.20539@gw.home.vix.com>
Sender: unix-sources-moderator@gw.home.vix.com
Approved: vixie@gw.home.vix.com
Submitted-By: fas@geminix.in-berlin.de (FAS Support Account)
Posting-Number: Volume 27, Issue 74
Archive-Name: fas-2.11.0/part08
#!/bin/sh
# this is fas211pl0.08 (part 8 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file space-gen8c12 continued
#
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 8; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping space-gen8c12'
else
echo 'x - continuing file space-gen8c12'
sed 's/^X//' << 'SHAR_EOF' >> 'space-gen8c12' &&
X
X/* array of port layout tables
X This two-dimensional array contains the base port offsets of the
X seven UART registers used by FAS. There are one or more port layout
X tables that are selected by the values in fas_pl_select [].
X
X Each port layout table is arranged like this (the position of the values
X corresponds to the respective UART register acronym):
X
X RBR/THR, IER, IIR/FCR, LCR, MCR, LSR, MSR
X*/
Xuint fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
X{
X { /* table 0 */
X 0, 1, 2, 3, 4, 5, 6
X }
X};
X
X/* This is the number of available baud rate tables.
X You may define up to 256 tables. If this number is changed
X the arrays below must be filled in accordingly.
X*/
X#define NUM_BAUD_TABLES 2
X
X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
X#undef NUM_BAUD_TABLES
X#define NUM_BAUD_TABLES MAX_BAUD_TABLES
X#endif
X
X/* array of baud rate table selection values
X These values select the baud rate table in fas_baud [] []
X that is used for the respective port.
X*/
Xuint fas_bt_select [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* array of baud rate tables
X This two-dimensional array contains the 15 possible UNIX baud rates
X plus the baud rate base that these 15 baud rates are derived from. There
X are one or more baud rate tables that are selected by the values in
X fas_bt_select [].
X
X The values in the baud rate tables are multiplied by ten to allow an
X accuracy of 0.1 baud. The baud rate base can be computed by dividing the
X external oscillator frequency (fed to the UART) by 16, and afterwards it
X is also mutiplied by ten to make its scale match the scale of the baud
X rate values.
X
X Each baud rate table is arranged like this (the position of the values
X corresponds to the respective baud rate symbol):
X
X BASE, B50, B75, B110,
X B134, B150, B200, B300,
X B600, B1200, B1800, B2400,
X B4800, B9600, B19200, B38400
X*/
Xulong fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
X{
X { /* table 0 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 192000, 384000
X },
X { /* table 1 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 576000, 1152000
X }
X};
X
X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
X ============================================
X*/
X
X/* let the driver know the number of devices */
Xuint fas_physical_units = NUM_PHYSICAL_UNITS;
X
X/* let the driver know the number of port layout tables */
Xuint fas_port_layouts = NUM_PORT_LAYOUTS;
X
X/* let the driver know the number of baud rate tables */
Xuint fas_baud_tables = NUM_BAUD_TABLES;
X
X/* array of structures to hold all info for a physical minor device */
Xstruct fas_internals fas_internals [NUM_PHYSICAL_UNITS];
X
X/* array of tty structures for logical devices */
Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2];
X
X/* array of fas_speed structure arrays that contain baud rate dependent
X informations
X*/
Xstruct fas_speed fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
X
X/* array of pointers to fas_internals structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_internals *fas_internals_ptr [NUM_PHYSICAL_UNITS];
X
X/* array of pointers to tty structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
X
X/* array of pointers to fas_speed structure arrays
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_speed *fas_speed_ptr [NUM_BAUD_TABLES];
X
X/* array of pointers to the baud rate tables in fas_baud [] []
X this prevents time consuming multiplications for index calculation
X*/
Xulong *fas_baud_ptr [NUM_BAUD_TABLES];
SHAR_EOF
echo 'File space-gen8c12 is complete' &&
true || echo 'restore of space-gen8c12 failed'
rm -f _shar_wnt_.tmp
fi
# ============= space-hub6c12 ==============
if test -f 'space-hub6c12' -a X"$1" != X"-c"; then
echo 'x - skipping space-hub6c12 (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting space-hub6c12 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'space-hub6c12' &&
X/* Device configuration file for the FAS async driver. */
X
X/* This version is for the Bell Tech HUB-6 card plus the standard COM1
X and COM2 ports.
X*/
X
X/* FAS was developed by
XUwe Doering <fas@geminix.in-berlin.de>
XBillstedter Pfad 17 b
X13591 Berlin
XGermany
X*/
X
X#if !defined (M_I286)
X#ident "@(#)space.c 2.11"
X#endif
X
X#if defined (LOCAL_INCLUDE)
X#include "fas.h"
X#else
X#include <sys/fas.h>
X#endif
X
X/* This is the number of devices to be handled by this driver.
X If it is changed, make sure that the initializer parts of all arrays
X dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
X entries. You may define up to 16 devices.
X*/
X#define NUM_PHYSICAL_UNITS 8
X
X#if NUM_PHYSICAL_UNITS > MAX_UNITS
X#undef NUM_PHYSICAL_UNITS
X#define NUM_PHYSICAL_UNITS MAX_UNITS
X#endif
X
X/* array of base port addresses
X These values are the base i/o addresses of the UART chips.
X*/
Xuint fas_port [NUM_PHYSICAL_UNITS] =
X{
X 0x303, 0x303, 0x303, 0x303,
X 0x303, 0x303, 0x3f8, 0x2f8
X};
X
X/* array of interrupt vectors (SCO UNIX and Xenix, only)
X FAS doesn't need informations about interrupt vectors during normal
X operation. Therefore, the only function of these values is to be
X displayed by the FAS boot message. So if you want vector infos at
X boot time you can enter the vector numbers here. But make sure that
X the values correspond with the entries in the kernel config files.
X A value of `-1' means that no vector number is displayed for the
X respective port.
X Users of other UNIX flavors can savely ignore this array.
X*/
Xint fas_vec [NUM_PHYSICAL_UNITS] =
X{
X -1, -1, -1, -1,
X -1, -1, -1, -1
X};
X
X/* array of modifier flags
X You can modify certain features of each port. See fas.h for possible
X names and values.
X*/
Xuint fas_modify [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0, 0, 0
X};
X
X/* array of FIFO operating mode values
X These values select the mode to which the UART FIFOs are set when
X a port is activated. For device types that don't have FIFOs the
X respective value is ignored, so you can set up this array for
X FIFO operation now and add the FIFO UARTs later. There are several
X operating modes predefined. See fas.h for possible names and values.
X*/
Xuint fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
X{
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT
X};
X
X/* initialization sequence for serial cards
X This array contains pairs of values of the form:
X
X portaddress, value,
X :
X :
X portaddress, value,
X 0
X
X For every line `value' will be written to `portaddress'. If
X `value' is replaced with the macro `READ_PORT' then a value
X is read from `portaddress' instead. The value itself will be
X discarded. Therefore, this makes only sense if the read access
X to the port has a side effect like setting or resetting
X certain flags.
X
X NOTE: This array *must* be terminated with a value of 0
X in the portaddress column!
X*/
Xuint fas_init_seq [] =
X{
X 0
X};
X
X/* interrupt acknowledge sequence for serial cards
X This sequence is executed by the fasintr () function after all pending
X interrupts on all serial cards have been processed. The contents of this
X array has the same form as in the fas_init_seq [] array above.
X*/
Xuint fas_int_ack_seq [] =
X{
X 0
X};
X
X/* initial modem control port info
X This value is ored into the modem control value for each UART. This is
X normaly used to force out2 which is used to enable the interrupts of
X the standard com1 and com2 ports. Several brands of cards have modes
X that allow them to work in compatible mode like com1 and com2 or as a
X shared interrupts card. One of these cards is the AST 4-port card. When
X this card is used in shared interrupts mode out2 must _not_ be set.
X
X Note: This is one of the major trouble-spots with shared interrupts
X cards. Check your manual.
X*/
Xuint fas_mcb [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0, MC_SET_OUT2, MC_SET_OUT2
X};
X
X/* array of modem control flags
X You can choose which signals to use for modem control. See fas.h
X for possible names and values. Whether or not modem control is
X used is determined by the minor device number at open time.
X*/
Xulong fas_modem [NUM_PHYSICAL_UNITS] =
X{
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD
X};
X
X/* array of hardware flow control flags
X You can choose which signals to use for hardware handshake. See fas.h
X for possible names and values. Whether or not hardware handshake is
X used is determined by the minor device number at open time and by the
X RTSFLOW/CTSFLOW termio(7) flags.
X*/
Xulong fas_flow [NUM_PHYSICAL_UNITS] =
X{
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
X HI_RTS | HO_CTS_ON_DSR | HX_RTS
X};
X
X/* array of control register addresses
X There are serial boards available that have all serial ports
X multiplexed to one address location in order to save I/O address
X space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
X by a special register that needs to be written to before the actual
X port registers can be accessed. This array contains the addresses
X of these special registers.
X Enter the addresses on a per unit base. An address of zero
X disables this feature.
X*/
Xuint fas_ctl_port [NUM_PHYSICAL_UNITS] =
X{
X 0x302, 0x302, 0x302, 0x302,
X 0x302, 0x302, 0, 0
X};
X
X/* array of control register values
X These values are written to the corresponding control register
X before the first access to the actual port registers. If not only
X entire UART chips (blocks of 8 contiguous addresses) but even the
X single registers of the UART chips need to be multiplexed to one
X address you have to "or" a bit mask (shifted 8 times to the left)
X to the control register value. This mask determines at which bit
X locations the UART chip register number is "xored" into the control
X register value at runtime. This implies that you can also use
X negative logic by setting the bits in the control register value
X to 1 at the locations corresponding to the bit mask.
X*/
Xuint fas_ctl_val [NUM_PHYSICAL_UNITS] =
X{
X 0x700, 0x708, 0x710, 0x718,
X 0x720, 0x728, 0, 0
X};
X
X/* This is the number of available port layout tables.
X If this number is changed the arrays below must be filled
X in accordingly.
X*/
X#define NUM_PORT_LAYOUTS 1
X
X/* array of port layout table selection values
X These values select the port layout table in fas_layout [] []
X that is used for the respective port.
X*/
Xuint fas_pl_select [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0, 0, 0
X};
X
X/* array of port layout tables
X This two-dimensional array contains the base port offsets of the
X seven UART registers used by FAS. There are one or more port layout
X tables that are selected by the values in fas_pl_select [].
X
X Each port layout table is arranged like this (the position of the values
X corresponds to the respective UART register acronym):
X
X RBR/THR, IER, IIR/FCR, LCR, MCR, LSR, MSR
X*/
Xuint fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
X{
X { /* table 0 */
X 0, 1, 2, 3, 4, 5, 6
X }
X};
X
X/* This is the number of available baud rate tables.
X You may define up to 256 tables. If this number is changed
X the arrays below must be filled in accordingly.
X*/
X#define NUM_BAUD_TABLES 2
X
X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
X#undef NUM_BAUD_TABLES
X#define NUM_BAUD_TABLES MAX_BAUD_TABLES
X#endif
X
X/* array of baud rate table selection values
X These values select the baud rate table in fas_baud [] []
X that is used for the respective port.
X*/
Xuint fas_bt_select [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0, 0, 0
X};
X
X/* array of baud rate tables
X This two-dimensional array contains the 15 possible UNIX baud rates
X plus the baud rate base that these 15 baud rates are derived from. There
X are one or more baud rate tables that are selected by the values in
X fas_bt_select [].
X
X The values in the baud rate tables are multiplied by ten to allow an
X accuracy of 0.1 baud. The baud rate base can be computed by dividing the
X external oscillator frequency (fed to the UART) by 16, and afterwards it
X is also mutiplied by ten to make its scale match the scale of the baud
X rate values.
X
X Each baud rate table is arranged like this (the position of the values
X corresponds to the respective baud rate symbol):
X
X BASE, B50, B75, B110,
X B134, B150, B200, B300,
X B600, B1200, B1800, B2400,
X B4800, B9600, B19200, B38400
X*/
Xulong fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
X{
X { /* table 0 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 192000, 384000
X },
X { /* table 1 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 576000, 1152000
X }
X};
X
X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
X ============================================
X*/
X
X/* let the driver know the number of devices */
Xuint fas_physical_units = NUM_PHYSICAL_UNITS;
X
X/* let the driver know the number of port layout tables */
Xuint fas_port_layouts = NUM_PORT_LAYOUTS;
X
X/* let the driver know the number of baud rate tables */
Xuint fas_baud_tables = NUM_BAUD_TABLES;
X
X/* array of structures to hold all info for a physical minor device */
Xstruct fas_internals fas_internals [NUM_PHYSICAL_UNITS];
X
X/* array of tty structures for logical devices */
Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2];
X
X/* array of fas_speed structure arrays that contain baud rate dependent
X informations
X*/
Xstruct fas_speed fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
X
X/* array of pointers to fas_internals structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_internals *fas_internals_ptr [NUM_PHYSICAL_UNITS];
X
X/* array of pointers to tty structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
X
X/* array of pointers to fas_speed structure arrays
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_speed *fas_speed_ptr [NUM_BAUD_TABLES];
X
X/* array of pointers to the baud rate tables in fas_baud [] []
X this prevents time consuming multiplications for index calculation
X*/
Xulong *fas_baud_ptr [NUM_BAUD_TABLES];
SHAR_EOF
true || echo 'restore of space-hub6c12 failed'
rm -f _shar_wnt_.tmp
fi
# ============= space-use4c12 ==============
if test -f 'space-use4c12' -a X"$1" != X"-c"; then
echo 'x - skipping space-use4c12 (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting space-use4c12 (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'space-use4c12' &&
X/* Device configuration file for the FAS async driver. */
X
X/* This version is for the USENET II 4-port card in common interrupt
X mode plus the standard COM1 and COM2 ports.
X*/
X
X/* FAS was developed by
XUwe Doering <fas@geminix.in-berlin.de>
XBillstedter Pfad 17 b
X13591 Berlin
XGermany
X*/
X
X#if !defined (M_I286)
X#ident "@(#)space.c 2.11"
X#endif
X
X#if defined (LOCAL_INCLUDE)
X#include "fas.h"
X#else
X#include <sys/fas.h>
X#endif
X
X/* This is the number of devices to be handled by this driver.
X If it is changed, make sure that the initializer parts of all arrays
X dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
X entries. You may define up to 16 devices.
X*/
X#define NUM_PHYSICAL_UNITS 6
X
X#if NUM_PHYSICAL_UNITS > MAX_UNITS
X#undef NUM_PHYSICAL_UNITS
X#define NUM_PHYSICAL_UNITS MAX_UNITS
X#endif
X
X/* array of base port addresses
X These values are the base i/o addresses of the UART chips.
X*/
Xuint fas_port [NUM_PHYSICAL_UNITS] =
X{
X 0x2c0, 0x2c8, 0x2d0, 0x2d8,
X 0x3f8, 0x2f8
X};
X
X/* array of interrupt vectors (SCO UNIX and Xenix, only)
X FAS doesn't need informations about interrupt vectors during normal
X operation. Therefore, the only function of these values is to be
X displayed by the FAS boot message. So if you want vector infos at
X boot time you can enter the vector numbers here. But make sure that
X the values correspond with the entries in the kernel config files.
X A value of `-1' means that no vector number is displayed for the
X respective port.
X Users of other UNIX flavors can savely ignore this array.
X*/
Xint fas_vec [NUM_PHYSICAL_UNITS] =
X{
X -1, -1, -1, -1,
X -1, -1
X};
X
X/* array of modifier flags
X You can modify certain features of each port. See fas.h for possible
X names and values.
X*/
Xuint fas_modify [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* array of FIFO operating mode values
X These values select the mode to which the UART FIFOs are set when
X a port is activated. For device types that don't have FIFOs the
X respective value is ignored, so you can set up this array for
X FIFO operation now and add the FIFO UARTs later. There are several
X operating modes predefined. See fas.h for possible names and values.
X*/
Xuint fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
X{
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT,
X FIFO_DEFAULT
X};
X
X/* initialization sequence for serial cards
X This array contains pairs of values of the form:
X
X portaddress, value,
X :
X :
X portaddress, value,
X 0
X
X For every line `value' will be written to `portaddress'. If
X `value' is replaced with the macro `READ_PORT' then a value
X is read from `portaddress' instead. The value itself will be
X discarded. Therefore, this makes only sense if the read access
X to the port has a side effect like setting or resetting
X certain flags.
X
X NOTE: This array *must* be terminated with a value of 0
X in the portaddress column!
X*/
Xuint fas_init_seq [] =
X{
X 0
X};
X
X/* interrupt acknowledge sequence for serial cards
X This sequence is executed by the fasintr () function after all pending
X interrupts on all serial cards have been processed. The contents of this
X array has the same form as in the fas_init_seq [] array above.
X*/
Xuint fas_int_ack_seq [] =
X{
X 0
X};
X
X/* initial modem control port info
X This value is ored into the modem control value for each UART. This is
X normaly used to force out2 which is used to enable the interrupts of
X the standard com1 and com2 ports. Several brands of cards have modes
X that allow them to work in compatible mode like com1 and com2 or as a
X shared interrupts card. One of these cards is the AST 4-port card. When
X this card is used in shared interrupts mode out2 must _not_ be set.
X
X Note: This is one of the major trouble-spots with shared interrupts
X cards. Check your manual.
X*/
Xuint fas_mcb [NUM_PHYSICAL_UNITS] =
X{
X MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2, MC_SET_OUT2,
X MC_SET_OUT2, MC_SET_OUT2
X};
X
X/* array of modem control flags
X You can choose which signals to use for modem control. See fas.h
X for possible names and values. Whether or not modem control is
X used is determined by the minor device number at open time.
X*/
Xulong fas_modem [NUM_PHYSICAL_UNITS] =
X{
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD,
X EO_DTR | EI_DTR | CA_DCD
X};
X
X/* array of hardware flow control flags
X You can choose which signals to use for hardware handshake. See fas.h
X for possible names and values. Whether or not hardware handshake is
X used is determined by the minor device number at open time and by the
X RTSFLOW/CTSFLOW termio(7) flags.
X*/
Xulong fas_flow [NUM_PHYSICAL_UNITS] =
X{
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS | HX_RTS,
X HI_RTS | HO_CTS_ON_DSR | HX_RTS,
X HI_RTS | HO_CTS_ON_DSR | HX_RTS
X};
X
X/* array of control register addresses
X There are serial boards available that have all serial ports
X multiplexed to one address location in order to save I/O address
X space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
X by a special register that needs to be written to before the actual
X port registers can be accessed. This array contains the addresses
X of these special registers.
X Enter the addresses on a per unit base. An address of zero
X disables this feature.
X*/
Xuint fas_ctl_port [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* array of control register values
X These values are written to the corresponding control register
X before the first access to the actual port registers. If not only
X entire UART chips (blocks of 8 contiguous addresses) but even the
X single registers of the UART chips need to be multiplexed to one
X address you have to "or" a bit mask (shifted 8 times to the left)
X to the control register value. This mask determines at which bit
X locations the UART chip register number is "xored" into the control
X register value at runtime. This implies that you can also use
X negative logic by setting the bits in the control register value
X to 1 at the locations corresponding to the bit mask.
X*/
Xuint fas_ctl_val [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* This is the number of available port layout tables.
X If this number is changed the arrays below must be filled
X in accordingly.
X*/
X#define NUM_PORT_LAYOUTS 1
X
X/* array of port layout table selection values
X These values select the port layout table in fas_layout [] []
X that is used for the respective port.
X*/
Xuint fas_pl_select [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* array of port layout tables
X This two-dimensional array contains the base port offsets of the
X seven UART registers used by FAS. There are one or more port layout
X tables that are selected by the values in fas_pl_select [].
X
X Each port layout table is arranged like this (the position of the values
X corresponds to the respective UART register acronym):
X
X RBR/THR, IER, IIR/FCR, LCR, MCR, LSR, MSR
X*/
Xuint fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
X{
X { /* table 0 */
X 0, 1, 2, 3, 4, 5, 6
X }
X};
X
X/* This is the number of available baud rate tables.
X You may define up to 256 tables. If this number is changed
X the arrays below must be filled in accordingly.
X*/
X#define NUM_BAUD_TABLES 2
X
X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
X#undef NUM_BAUD_TABLES
X#define NUM_BAUD_TABLES MAX_BAUD_TABLES
X#endif
X
X/* array of baud rate table selection values
X These values select the baud rate table in fas_baud [] []
X that is used for the respective port.
X*/
Xuint fas_bt_select [NUM_PHYSICAL_UNITS] =
X{
X 0, 0, 0, 0,
X 0, 0
X};
X
X/* array of baud rate tables
X This two-dimensional array contains the 15 possible UNIX baud rates
X plus the baud rate base that these 15 baud rates are derived from. There
X are one or more baud rate tables that are selected by the values in
X fas_bt_select [].
X
X The values in the baud rate tables are multiplied by ten to allow an
X accuracy of 0.1 baud. The baud rate base can be computed by dividing the
X external oscillator frequency (fed to the UART) by 16, and afterwards it
X is also mutiplied by ten to make its scale match the scale of the baud
X rate values.
X
X Each baud rate table is arranged like this (the position of the values
X corresponds to the respective baud rate symbol):
X
X BASE, B50, B75, B110,
X B134, B150, B200, B300,
X B600, B1200, B1800, B2400,
X B4800, B9600, B19200, B38400
X*/
Xulong fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
X{
X { /* table 0 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 192000, 384000
X },
X { /* table 1 */
X 1152000, 500, 750, 1100,
X 1345, 1500, 2000, 3000,
X 6000, 12000, 18000, 24000,
X 48000, 96000, 576000, 1152000
X }
X};
X
X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
X ============================================
X*/
X
X/* let the driver know the number of devices */
Xuint fas_physical_units = NUM_PHYSICAL_UNITS;
X
X/* let the driver know the number of port layout tables */
Xuint fas_port_layouts = NUM_PORT_LAYOUTS;
X
X/* let the driver know the number of baud rate tables */
Xuint fas_baud_tables = NUM_BAUD_TABLES;
X
X/* array of structures to hold all info for a physical minor device */
Xstruct fas_internals fas_internals [NUM_PHYSICAL_UNITS];
X
X/* array of tty structures for logical devices */
Xstruct tty fas_tty [NUM_PHYSICAL_UNITS * 2];
X
X/* array of fas_speed structure arrays that contain baud rate dependent
X informations
X*/
Xstruct fas_speed fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
X
X/* array of pointers to fas_internals structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_internals *fas_internals_ptr [NUM_PHYSICAL_UNITS];
X
X/* array of pointers to tty structures
X this prevents time consuming multiplications for index calculation
X*/
Xstruct tty *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
X
X/* array of pointers to fas_speed structure arrays
X this prevents time consuming multiplications for index calculation
X*/
Xstruct fas_speed *fas_speed_ptr [NUM_BAUD_TABLES];
X
X/* array of pointers to the baud rate tables in fas_baud [] []
X this prevents time consuming multiplications for index calculation
X*/
Xulong *fas_baud_ptr [NUM_BAUD_TABLES];
SHAR_EOF
true || echo 'restore of space-use4c12 failed'
rm -f _shar_wnt_.tmp
fi
# ============= update_desc ==============
if test -f 'update_desc' -a X"$1" != X"-c"; then
echo 'x - skipping update_desc (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting update_desc (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'update_desc' &&
X# Update the kernel description file
X
Xgrep '^fas[ ]' $1 > /dev/null 2>&1
Xif [ $? -eq 1 ]
Xthen
X echo 'fas - - io - FAS Serial I/O Driver' >> $1
Xfi
SHAR_EOF
true || echo 'restore of update_desc failed'
rm -f _shar_wnt_.tmp
fi
rm -f _shar_seq_.tmp
echo You have unpacked the last part
exit 0