cons1x7(7) — SPECIAL FILES AND DEVICES
NAME
cons1x7 − hardware specific console driver for the MVME1X7 family
DESCRIPTION
This STREAMS-based driver provides console I/O when the system is running on an MVME1X7 CPU board. This driver is accessible only through the standard console device special files /dev/console (/dev/contty00), /dev/contty (/dev/contty01), /dev/contty02, /dev/contty03, and /dev/conctl.
The device special files eventually access the STREAMS-based console driver which, when used in conjunction with the STREAMS line discipline module ldterm, supports the termios(2) and termio(7) processing.
The configurable parameter C1X7_TXFIFO_MAX has a default of 8 and is located in the driver master.d file. This parameter describes the maximum number of bytes which should be written to the CD2400 transmit FIFO each time the FIFO is filled. Values 1 through 15 inclusive are valid. Increasing this parameter decreases the number of interrupts taken as a result of any of the serial data lines on the MVME1X7. The characters may be placed in the FIFO at an interrupt priority and may slow the response time of the system if large amounts of data are being sent through the onboard serial lines. If an invalid value is chosen for this parameter, it is reset to the default value and a warning message is printed to the system console.
In addition to the IOCTLs supported in termio(7), three other IOCTLs are supported. See the USAGE section for IOCTL details.
USAGE
STREAM Message Processing
In addition to the IOCTLs listed in termio(7), the following cons1x7-specific IOCTLs are supported. The optional ioctl system calls specified by termiox(7) are not supported. The definitions for the following IOCTLs are in the file /usr/include/sys/cd2400.h.
M_IOCTL
TIOCMBIS, TIOCMBIC, TIOCMGET and TIOCMSET view the port as DTE.
MSETHWHAND causes the driver to enable out-of-band flow control using CTS(Clear to Send). This causes character transmission to begin only after CTS is active(low). If a console port is in asynchronous mode, then when CTS goes inactive(high) after transmission has started, the channel stops transmitting after the current characters in the transmit hold register and shift register are transmitted. When in synchronous mode and CTS goes inactive, then the channel stops transmission after the current frame. Transmission restarts after CTS goes active. Also, MSETHWHAND sets a receive FIFO threshold of 10 characters. Automatic hardware flow control(DTR/DSR) activates when the FIFO threshold is reached.
MCLEARWHAND causes the driver to clear the flow controls set by MSETHWHAND. The hardware then returns to the no flow control state.
MGETHWHAND causes the driver to return the current status of CTS and DTR/DSR hardware flow control. The driver returns a data structure of type HWhandshake. HWhandshake is defined in the file /usr/include/sys/cd2400.h. HWhandshake.stat will equal HDFLOW_ENABLED if flow control is on and HDFLOW_DISABLED if it is off.
An example of code to implement each IOCTL is listed below:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termio.h>
#include <termios.h>
#include <sys/cd2400.h>
#include <stropts.h>
struct strioctl command ;
int sethwhandshake(int fd)
{
int err=0 ;
command.ic_cmd = MSETHWHAND ;
command.ic_len = 0 ;
command.ic_dp = NULL ;
if ( ioctl(fd, I_STR, &command) < 0 ) {
printf("ioctl error sending command to console driver") ;
err = -1 ;
}
return(err) ;
}
int clearhwhandshake(int fd)
{
int err=0 ;
command.ic_cmd = MCLEARHWHAND ;
command.ic_len = 0 ;
command.ic_dp = NULL ;
if ( ioctl(fd, I_STR, &command) < 0 ) {
printf("ioctl error sending command to console driver") ;
err = -1 ;
}
return(err) ;
}
int gethwhandshake(int fd)
{
int err=0 ;
HWhandshake shake;
command.ic_cmd = MGETHWHAND ;
command.ic_len = sizeof(shake) ;
command.ic_dp = (char ∗) &shake ;
if ( ioctl(fd, I_STR, &command) < 0 ) {
printf("ioctl error sending command to driver") ;
err = -1 ;
}
if (shake.stat == HDFLOW_DISABLED )
printf("Hardware handshake is DISABLED") ;
if (shake.stat == HDFLOW_ENABLED )
printf("Hardware handshake is ENABLED") ;
return(err) ;
}
BOOT TIME DIAGNOSTICS
The Software Discernible Field Replaceable Unit (SDFRU) is the CPU board.
Normal, Quick and Comprehensive diagnostic boot modes are the same.
Diagnostic output verbosity mode of DV_OFF produces no diagnostic output.
Diagnostic output verbosity mode of DV_LEVEL1 produces a single begin/end phase message pair.
Diagnostic output verbosity mode of DV_LEVEL2 produces messages for the following steps:
checking the CD240 chip revision
initializing pccchip2 tty interrupts
initializing global registers for each CD240
initializing each port
Also, for each port, a message indicating whether or not DCD and CTS were detected will be displayed. Note that "DCD" and "CTS" are named relative to the chip registers and may not map directly to the same signals on the connector.
Diagnostic output verbosity mode of DV_LEVEL3 produces no additional information.
FRU STATUS
A D_FRU_STATUS call to driverinfo(D2DK) will return information about the SDFRU — the CPU — and each port.
FILES
/dev/console
/dev/contty
/dev/contty??
/dev/conctl
/dev/edt/console
/usr/include/sys/cd2400.h
/usr/include/sys/cons1x7.h
SEE ALSO
dcon(1A), mvmecpu(1M), termios(2), console(7), iuart(7), ldterm(7), termio(7), gencon(7), driverinfo(D2Dk)