x25sn Special File

Purpose

Provides access to the X.25 Interface Co-Processor/2 adapters by way of the X.25 Interface Co-Processor/2 device handler.

Description

The x25sn character special file provides access to the X.25 Interface Co-Processor/2 device handler, which provides access to a X.25 packet switching network. The device handler supports up to four X.25 Interface Co-Processor/2 adapters.

Usage Considerations

When accessing the X.25 Interface Co-Processor/2 device handler, the following should be taken into account:

Item Description
Driver initialization and termination The device handler may be loaded and unloaded. The device handler supports the configuration calls to initialize and terminate itself.
Special file support Calls other than the open and close subroutines are discussed based on the mode in which the device handler is operating.

Subroutine Support

The X.25 Interface Co-Processor/2 device handler provides specific support for the open, close, read, write, and ioctl subroutines.

open and close Subroutines

The device handler supports the /dev/x25sn special file as a character-multiplex special file. The special file must be opened for both reading and writing (O_RDWR). There are no particular considerations for closing the special file. The special file name used in an open call differs depending upon how the device is to be opened. For each of the following types of special files, the value n is 0 <= n <= 7:

Item Description
/dev/x25sn Starts the device handler on the next available port.
/dev/x25sn/D Opens the device handler for the specified port in Diagnostic mode.
/dev/x25sn/M Opens the device handler for reading and writing data to the monitor facilities on the X.25 Interface Co-Processor/2.
/dev/x25sn/R Opens the device handler for updating the routing table.

read Subroutine

Can take the form of a read, readx, readv, or readvx subroutine. For this call, the device handler copies the data into the buffer specified by the caller.

write Subroutine

Can take the form of a write, writex, writev, or writevx subroutine. For this call, the device handler copies the user data into a kernel buffer and transmits the data on the network.

ioctl Subroutine

The device handler supports the following ioctl operations:

Item Description
CIO_DNLD Downloads a task.
CIO_GET_STAT Gets device statistics.
CIO_HALT Halts a session.
CIO_QUERY Queries a device.
CIO_START Starts a session.
IOCINFO Identifies a device.
X25_ADD_ROUTER_ID Adds a router ID.
X25_COUNTER_GET Gets a counter.
X25_COUNTER_READ Reads the contents of a counter.
X25_COUNTER_REMOVE Removes a counter from the system.
X25_COUNTER_WAIT Waits for the contents of counters to change.
X25_DELETE_ROUTER_ID Deletes a router ID.
X25_DIAG_IO_READ Reads to an I/O register on the X.25 Interface Co-Processor/2.
X25_DIAG_IO_WRITE Writes to an I/O register on the X.25 Interface Co-Processor/2.
X25_DIAG_MEM_READ Reads memory from the X.25 Interface Co-Processor/2 into a user's buffer.
X25_DIAG_MEM_WRITE Writes memory to the X.25 Interface Co-Processor/2 from a user's buffer.
X25_DIAG_TASK Provides the means to download the diagnostics task on to the card.
X25_LINK_CONNECT Connects a link.
X25_LINK_DISCONNECT Disconnects a link.
X25_LINK_STATUS Returns the status of the link.
X25_LOCAL_BUSY
Enables or disables receiving of data packets on a port.
X25_REJECT
Rejects a call.
X25_QUERY_ROUTER_ID
Queries a router ID.
X25_QUERY_SESSION
Queries a session.

Error Conditions

The following error conditions may be returned when accessing the device handler through the /dev/x25sn special file:

Item Description
EACCES Indicates that the call application does not have the required authority.
EAGAIN Indicates there were no packets to be read or the transmit queue is full, and the device was opened with the DNDELAY flag set.
EBUSY Indicates that the device was busy and could not accept the operation.
EFAULT Indicates that an invalid address was specified.
EIDRM Indicates that the counter has been removed.
EINTR Indicates that the subroutine call was interrupted.
EINVAL Indicates that an invalid parameter was passed to one of the subroutine calls.
EIO Indicates that an error has occurred. The status field in the status-control block contains more information.
EMSGSIZE Indicates that the data to be given to the user was greater than the length of the buffer specified. The data in the buffer is truncated.
ENOBUFS Indicates that no buffers are available.
ENODEV Indicates that the device requested does not exist.
ENOMEM Indicates that the X.25 device handler was unable to allocate space required for the open.
ENOSPC Indicates that there are no counters available to allocate.
ENXIO Indicates that the device was not completely configured. Initial configuration must be completed before any starts can be issued.
EPERM Indicates the user does not have permission to perform the requested operation.