Physical Layer

In the OSI layered protocol model, a physical layer is responsible for transmitting an arbitrary bit stream across a physical medium.

Function Mapping

Function Mapping
ConnectRequest Enables the line and raises both DTR and RTS signals. When DSR and CTS signals come up, data transfer state is entered. If DSR and CTS does not come up before the connect timer expires, returns to the open state.
ConnectAccept Not used.
ConnectReject Not used.
Listen Enables the line and watches DSR and CTS. If DSR and CTS signals come up, DTR and RTS are raised and data transfer state is entered.
DisconnectRequest DTR and RTS signals are dropped. The open state is entered when DSR drops or the disconnect timer expires.
DisconnectConfirm Not used.
Write Data buffer is queued to the hardware.
Write Special Not used.
Xoff RTS signal is dropped.
Xon RTS signal is raised.
Reset Request RTS signal is raised and CTS is monitored. If CTS is up, the layer is in data transfer xon state, if not it is in data transfer xoff state.
Reopen Immediately returns the physical layer to the open state. Drops DTR and RTS and disables the line, but does not wait for any response.

Configuration Profile

Parameter Explanation
Clock Mode The source of the clock signal for transmitting and receiving.
 0 Sink
 1 Source
 2 Symmetric
 3 Sink from Rx
 4 Sink from Tx
 5 Sink with Noise Suppression
 6 NRZI
 7 FM0
 8 FM1
 9 Manchester
10 NRZ from Data
  • Sink uses the external clock for both receiving and transmitting.
  • Source uses the internal clock for both receiving and transmitting.
  • Symmetric uses the external for receiving and the internal clock for transmitting.
  • Sink from Rx uses the external receive clock for both receiving and transmitting.
  • Sink from Tx uses the external transmit clock for both receiving and transmitting.
  • Sink with Noise Suppression is the same as Sink with noise suppression enabled on receiving.
  • NRZI, FM0, FM1 and Manchester encode the clock signal in the data signal.
  • NRZ from Data uses the internal clock for transmitting and decodes the receive clock signal from the data signal.
See LayGO Clock Modes for details on clock routing for each clock mode.

Not all clock modes are available on every board. Contact technical support at Advanced Relay Corporation for details.
Baud Rate Desired bits-per-second. Only effective if this end is configured to be the clock source.
Line Protocol The following line protocols are supported:
 0 SDLC
 1 Asynchronous
 2 Monosynchronous
 3 Bisynchronous
 4 Transparent
Line Interface The following line interfaces are supported:
 0 RS-232
 1 RS-422
 2 RS-449
 3 RS-485
 4 EIA-530
 5 V.35
SYN Character Character(s) to synchronize on in monosynchronous and bisynchronous modes
Line Idle Mode The following line idle modes are supported (in monosynchronous and bisynchronous modes) :
 0 Flag
 1 Mark
 2 Space
Driver Specific Flags Special driver flags, seldomly used.
Loopback Mode? TRUE to use internal hardware loopback mode is for testing. The Clock Mode must also be set to 1 (Source).
Transmit Queue Size Number of transmit buffers to queue for the hardware at one time. If the stack contains a protocol which uses a sliding window, such as LAPB, this parameter may be set to 2 or 3.
Receive Queue Size Number of buffers that can be received before the stack must be serviced (activated by the timer).
Input Signals The physical input signals available.
 1 CTS
 2 DCD
 4 DSR
 8 SDLC flags
Individual signal values are added together to get the final result.

These signals determine whether the physical line is connected or disconnected and if a signal is available for hardware flow-control (see below).

Output Signals The physical output signals available.
32 RTS
64 DTR
Individual signal values are added together to get the final result.

These signals will be used to initiate and terminate connections on the physical line and/or for flow-control (see below).

User Signals The physical input and output signals which are to be used by the application, not the X.21 bis layer.
 1 CTS
 2 DCD
 4 DSR
 8 SDLC flags
32 RTS
64 DTR
Individual signal values are added together to get the final result.

These signals will not be used to initiate and terminate connections on the physical line, to determine whether the physical line is connected or disconnected or for flow-control. Any signal specified as a user signal must not be specified as either an input or output signal. The state of user signals can be queried and changed using Ioctl functions.

Use hardware flow-control? If true and CTS is configured as an input signal, transmission will stop whenever CTS drops. If CTS drops while a frame is being transmitted, the transmission will be aborted.
If true and RTS is configured as an output signal, RTS will be dropped when no data should be received or no buffer is currently available to receive data into.
Tap Mode The LayGO stack may send monitoring events to a LayGO DLM server. A special version of the stack dll is required. The following modes are supported:
 0 Tap Disabled
 1 Tap Enabled
 
Connect Timer Time to wait after a connect request before indicating a connect timeout.
Disconnect Timer Time to wait after a disconnect request before indicating a disconnect timeout.
Reset Timer Time to wait during a reset attempt (some, but not all, physical signals drop) before indicating a reset timeout.
Reconnect Timer Time to wait when all signals drop before indicating that the connection has terminated. Setting this timer to 0 means an immediate disconnect should be indicated when the physical input signals drop.
Idle Timer Time to wait after the last frame was received before checking the status of the hardware.

Ioctl Functions

Function Explanation
Switch Lines Switches physical lines. The device must be in the open state. The parameter is a 32-bit value representing the line number to switch to. The call will fail if the new line cannot be allocated.
Modem Control Send a synchronous message to the attached modem and return the response as a data packet.
Get Signals Retrieves a 32-bit mask showing which of the physical signals are on (high) and which are configured. Configured signals which are not on are off (low).
Set Signals Set one or more user signals to on (high). The input is a 32-bit mask containing a 1 bit for each signal to be set. Permitted values are RTS (0x0020) and DTR (0x0040).
Clear Signals Set one or more user signals to off (low). The input is a 32-bit mask containing a 1 bit for each signal to be set. Permitted values are RTS (0x0020) and DTR (0x0040).

User Signals

The signals configured as user signals must be disjoint with the signals configured as input and output signals. If either CTS or RTS is configured as a user signal, hardware flow control must be turned off. The following X.21 bis configuration designates DTR, RTS, DSR, and CTS for user control:

      8 : Input signals <1=CTS 2=DCD 4=DSR 8=Flag RI=16>
      0 : Output signals <32=RTS 64=DTR>
    101 : User signals <1=CTS 2=DCD 4=DSR 8=Flag RI=16 32=RTS 64=DTR>
  False : Use hardware flow control <RTS/CTS>?

Using this configuration, the X.21 bis layer will indicate a connection when the Flags are detected. It will not change the state of DTR or RTS. It will detect changes in DSR and CTS, but not change state because of the changes.

The user can set the state of DTR and RTS using lgo_Ioctl() with the functions phys_IOCTL_SET_SIGNAL and phys_IOCTL_CLEAR_SIGNAL. The user can query the state of the signals using phys_IOCTL_GET_SIGNALS. The functions phys_IOCTL_SET_SIGNAL and phys_IOCTL_CLEAR_SIGNAL will fail if the CID is in lgo_STATE_OPEN, since the hardware is disabled in that state.