User guide

6: ICP Software
DC 900-1338I 107
6.2.2 SPS/ISR Interface for Transmit Messages
When the protocol task receives a transmit data block message on a links server-to-
board queue, it moves the message to the links board-to-link queue to await transmis-
sion. The board-to-link queue is processed in the
chkloq subroutine according to the
mode of communication.
The
lct_flags field in the link control table is cleared by the protocol task when it initiates
a transmission and is set by the interrupt service routine when the transmission is fin-
ished. A transmission can be initiated only when the link is in the IDLE state. The pro-
tocol task points the transmit data block message on the head of the board-to-link
queue, calls the appropriate preprocess routine for the protocol to prepare the data for
transmission, and calls the subroutine
xmton to set up the hardware devices for trans-
mission of the data.
Xmton clears the flags field in the buffers headers and clears the
lct_flags and states in the link control table. When the transmit completes, the interrupt
service routine sets
flags in the buffers headers, initializes the lct_flags and states in the
link control table, and resumes the protocol task. The protocol task releases the com-
pleted buffer and starts the transmission of the next message on the queue.
6.2.3 SPS/ISR Interface for Received Messages
When a link is enabled, the rcvstr subroutine for the requested protocol (located in
asydev.c, bscdev.c, and sdlcdev.c) is called, which calls restock to obtain PREALLO-
CATE
data buffers from the data buffer partition and posts them to the link-to-board
queue. The
lct_frbuf field in the link control table is set to the address of the first buffer
on the queue.
When a frame is received, the buffer is filled, and the interrupt service routine updates
lct_frbuf to the next buffer on the queue using the sb_nxte field in the system buffer
header. (The interrupt service routine does not unlink the filled buffer from the queue).
In the
chkliq subroutine, the protocol task determines whether the buffer at the head of
the queue has been completed (a block has been received). If the receive is finished, and