Content-type: text/html Man page of se_hdlc


Section: Devices (7D)
Updated: 1 Jan 1997
Index Return to Main Contents


se_hdlc - on-board high-performance serial HDLC interface  


se@bus_address:port_number[, hdlc]


The se_hdlc devices are a synchronous hdlc-framing interface for the se serial devices. Both built-in serial ports (port_number) on platforms which have the se serial devices, support synchronous data transfer at a maximum rate of 384 kbps. bus_address is the platform specific se device bus address. port_number is a single digit number (0-9).  


The se_hdlcn devices provide a data path which supports the transfer of data via read(2) and write(2) system calls, as well as ioctl(2) calls. Data path opens are exclusive in order to protect against injection or diversion of data by another process.

The se_hdlc device provides a separate control path for use by programs that need to configure or monitor a connection independent of any exclusive access restrictions imposed by data path opens. Up to three control paths may be active on a particular serial channel at any one time. Control path accesses are restricted to ioctl(2) calls only; no data transfer is possible.

When used in synchronous modes, the SAB 82532 ESCC supports several options for clock sourcing and data encolding. Both the transmit and receive clock sources can be set to be the external Transmit clock (TRxC), external Receive Clock (RTxC), the internal Baud Rate Generator (BRG), or the output of the ESCC 's Digital Phase-Lock Loop (DPLL).

The BRG is a programmable divisor that derives a clock frequency from the PCLK input signal to the ESCC. The programmed baud rate is translated into a floating point (6-bit mantissa, 4-bit exponent) number time constant that is stored in the ESCC.

A local loopback mode is available, primarily for use by syncloop(1M) for testing purposes, and should not be confused with SDLC loop mode, which is not supported on this interface. Also, an auto-echo feature may be selected that causes all incoming data to be routed to the transmit data line, allowing the port to act as the remote end of a digital loop. Neither of these options should be selected casually, or left in use when not needed.

The se driver keeps running totals of various hardware generated events for each channel. These include numbers of packets and characters sent and received, abort conditions detected by the receiver, receive CRC errors, transmit underruns, receive overruns, input errors and output errors, and message block allocation failures. Input errors are logged whenever an incoming message must be discarded, such as when an abort or CRC error is detected, a receive overrun occurs, or when no message block is available to store incoming data. Output errors are logged when the data must be discarded due to underruns, CTS drops during transmission, CTS timeouts, or excessive watchdog timeouts caused by a cable break.  


The se driver supports the following ioctl() commands.

S_IOCGETMODE Return a struct scc_mode containing parameters currently in use. These include the transmit and receive clock sources, boolean loopback and NRZI mode flags and the integer baud rate.

S_IOCSETMODE The argument is a struct scc_mode from which the ESCC channel will be programmed.

S_IOCGETSTATS Return a struct sl_stats containing the current totals of hardware-generated events.
 These include numbers of packets and characters sent and received by the driver, aborts and CRC errors detected, transmit underruns, and receive overruns.

S_IOCCLRSTATS Clear the hardware statistics for this channel.

S_IOCGETSPEED Returns the currently set baud rate as an integer. This may not reflect the actual data transfer rate if external clocks are used.

S_IOCGETMCTL Returns the current state of the CTS and DCD incoming modem interface signals as an integer.

The following structures are used with se hdlc ioctl() commands:

struct scc_mode {
 char sm_txclock;    /* transmit clock sources */
 char sm_rxclock;    /* receive clock sources */
 char sm_iflags;     /* data and clock inversion flags (non-zsh) */
 uchar_t sm_config;  /* boolean configuration options */
 int sm_baudrate;    /* real baud rate */
 int sm_retval;      /* reason codes for ioctl failures */
struct sl_stats {
 long   ipack;        /* input packets */
 long   opack;        /* output packets */
 long   ichar;        /* input bytes */
 long   ochar;        /* output bytes */
 long   abort;        /* abort received */
 long   crc;          /* CRC error */
 long   cts;          /* CTS timeouts */
 long   dcd;          /* Carrier drops */
 long   overrun;      /* receive overrun */
 long   underrun;     /* transmit underrun */
 long   ierror;       /* input error */
 long   oerror;       /* output error */
 long   nobuffers;    /* receive side memory allocation failure */



An open() will fail if a STREAMS message block cannot be allocated or under the following conditions:

ENXIO The unit being opened does not exist.

EBUSY The device is in use by another serial protocol.

An ioctl() will fail under the following conditions:

EINVAL An attempt was made to select an invalid clocking source.

EINVAL The baud rate specified for use with the baud rate generator would translate to a null time constant in the ESCC's registers.



/dev/se_hdlc[0-1], /dev/se_hdlc character-special devices

/usr/include/sys/ser_sync.h header file specifying synchronous serial communication definitions



See attributes(5) for descriptions of the following attributes:




syncinit(1M), syncloop(1M), syncstat(1M), ioctl(2), open(2), read(2), write(2), attributes(5), se(7D), zsh(7D)

Siemens ESCC2 SAB 82532 Enhanced Serial Communication Controller User's Manual  


se_hdlc clone open failed, no memory, rq=nnn

A kernel memory allocation failed for one of the private data structures. The value of nnn is the address of the read queue passed to open(2).

se_hdlc: clone device must be attached before use!

An operation was attempted through a control path before that path had been attached to a particular serial channel.

se_hdlcn: not initialized, can't send message

An M_DATA message was passed to the driver for a channel that had not been programmed at least once since the driver was loaded. The ESCC's registers were in an unknown state. The S_IOCSETMODE ioctl command performs the programming operation.

sen hdlc_start: Invalid message type d on write queue

driver received an invalid message type from streams.

se_hdlcn: transmit hung

The transmitter was not successfully restarted after the watchdog timer expired. This is usually caused by a bad or disconnected cable.




This document was created by man2html, using the manual pages.
Time: 02:39:59 GMT, October 02, 2010