Design

The MicroGate Serial API provides a serial communications Application Program Interface (API) for Linux (kernel versions 2.4 and later) using the SyncLink family of adapters. (PCI, PCI Express, PCMCIA, PC/104+) The API supports multiple serial protocols (when supported by specific adapter model), including SDLC, HDLC, BISYNC, MONOSYNC, asynchronous, and raw bit-synchronous. These protocols are used to build applications for networking, X.25, frame relay, IBM SDLC (SNA), satellite, radio and other serial communications. The MicroGate Serial API is designed for applications where direct control of the serial hardware is required. 

System calls are used to open a serial port, configure the port, manipulate serial interface signals, and send and receive data. 

The MicroGate Serial API is FREE and may be downloaded at any time from the MicroGate website..

HARDWARE SUPPORT

Hardware support for API features depends on the specific model. For example, the PCMCIA adapter only supports HDLC and asynchronous modes of operation. For a complete list of adapter specific support of each API feature, click here.

SOFTWARE

The MicroGate Serial API contains programming documentation, sample C programs, SyncLink device driver, and HDLC line discipline. Source is included for all provided software including the device driver and HDLC line discipline. SyncLink and its device driver are designed to support both single and multi-processor operation, as well as, 64-bits under x86_64 architecture when using Linux.

The sample C programs include:
 

mgslutil command line configuration utility
mgsltest diagnostics program
sample-hdlc SDLC/HDLC sample program
sample-async asynchronous sample program
sample-raw raw bit synchronous sample program
sample-bisync bisync sample program

SYSTEM CALLS

The MicroGate Serial API consists of system calls used for controlling and monitoring communications. Most operations act on a port (file descriptor) that is opened and closed with the open and close system calls. Data is exchanged with the write and read system calls. Port control and monitoring is accomplished with the ioctl system call using a mix of standard tty ioctl codes (prefix TIOC) and SyncLink specific ioctl codes (prefix MGSL).

API system calls by category:
 

Function Call
Description
Device Access
open() Open port
close() Close port
Device Configuration
ioctl(MGSL_IOCSPARAMS) Set adapter parameters
ioctl(MGSL_IOCGPARAMS) Get adapter parameters
Device Control and Status
ioctl(TIOCMSET) Explicitly set/clear all serial signals
ioctl(TIOCMBIS) Set (assert) individual serial signals
ioctl(TIOCMBIC) Clear (negate) individual serial signals
ioctl(TIOCMGET) Get serial signals
ioctl(TIOCMIWAIT) Wait for serial signal transition
ioctl(MGSL_IOCWAITEVENT) Wait for event (serial signal/hunt mode/idlereceived)
ioctl(TIOCGICOUNT) Get interrupt/event statistics
ioctl(MGSL_IOCGSTATS) Get communication statistics
Data Communications
write() Transmit frame
ioctl(MGSL_IOCTXENABLE) Enable/Disable transmitter
ioctl(MGSL_IOCSTXIDLE) Set transmit idle mode (flags/ones/zeros/mark/space/etc)
ioctl(MGSL_IOCGTXIDLE) Get current transmit idle mode
ioctl(MGSL_IOCTXABORT) Abort currently transmitting frame
read() Get received frame
ioctl(MGSL_IOCRXENABLE) Enable/Disable receiver
ioctl(MGSL_IOCLOOPTXDONE) Indicate transmit done in loop mode

 

PORT PARAMETERS

The ioctl(MGSL_IOCSPARAMS) call specifies options for a serial port. 
 

Parameter
Description
mode async, HDLC, BISYNC, MONOSYNC, RAW
loopback Internal loopback mode for diagnostics
flags Misc control options loop mode selection
encoding NRZ NRZ-L NRZB NRZI NRZ-M NRZ-S, BIPHASE, FM0, FM1, Manchester, differential biphase level
clock_speed internally generated clock speed
addr_filter SDLC/HDLC address
crc_type CCITT CRC16, CRC32, none
preamble_length Preamble length in bits (8 16 32 64)
preamble_patterm Preamble pattern

DEBUG LOGGING

For use in application debugging and for diagnosing communications problems, the SyncLink device driver has a configurable debug level (specified when loading the driver) that output varying levels of debug information to the system log. Debug levels include logging of complete data blocks, informational events, error events, system calls, and interrupt events.

OPTIONAL GENERAL PURPOSE I/O SIGNALS

The SyncLink GT family of serial adapters can be ordered with an optional header that provides general purpose digital (TTL) input/output signals. These signals can be configured (direction), controlled, and monitored through the serial API. Contact our sales department for ordering details.

AVAILABLE DOWNLOADS
linuxwan.tar.gz         Source Code/Drivers/Documentation

Linux support for out of production adapters and for kernel versions prior to 2.4 is located here.

PRODUCT CONFIGURATIONS

PCI Adapters
Product Code 
SyncLink GT single port Adapter for Linux/PCI/V.35
191193
SyncLink GT single port Adapter for Linux/PCI/RS-232
192193
SyncLink GT single port Adapter for Linux/PCI/RS-422/X.21
193193
 
SyncLink GT4 4-port Adapter for Linux/PCI/V.35/4p
491193
SyncLink GT4 4-port Adapter for Linux/PCI/RS-232/4p
492193
SyncLink GT4 4-port Adapter for Linux/PCI/RS-422/X.21/4p
493193
PCI Express Adapters
SyncLink GT2e 2-port Adapter for Linux/PCIe/V.35
201193
SyncLink GT2e 2-port Adapter for Linux/PCIe/RS-232
202193
SyncLink GT2e 2-port Adapter for Linux/PCIe/RS-422/X.21
203193
 
SyncLink GT4e 4-port Adapter for Linux/PCIe/V.35/4p
401193
SyncLink GT4e 4-port Adapter for Linux/PCIe/RS-232/4p
402193
SyncLink GT4e 4-port Adapter for Linux/PCIe/RS-422/X.21/4p
403193
PC/104+ Adapters
SyncLink GT PC/104+ Adapter for Linux/V.35
1P1193
SyncLink GT PC/104+ Adapter for Linux/RS-232
1P2193
SyncLink GT PC/104+ Adapter for Linux/RS-422/X.21
1P3193
 
SyncLink GT4 PC/104+ Adapter for Linux/RS-232
4P2193
 
PC Card Adapters
SyncLink Adapter for Linux/PCMCIA
P10193
Cables
V.35 cable
2534GT
RS-232 cable
CMF000
RS-449 cable
2537FM
RS-530 cable
CMF000
X.21 cable
2515FM
Hardware Manuals
SyncLink GT User's Manual and Specifications
SyncLink GT4 User's Manual and Specifications
SyncLink GT2e/GT4e User's Manual and Specifications

SyncLink GT PC/104+ User's Manual and Specifications

SyncLink GT4 PC/104+ User's Manual and Specifications

SyncLink PCMCIA User's Manual and Specifications