specified by the current CCW may be prefetched
and buffered. When data chaining during an output
operation, the channel may fetch the next CCW at
any time during the execution of the current CCW.
When the I/O operation uses data and CCWs from
locations near the end of the available storage, such
pre fetching may cause the channel to refer to loca­
tions that do not exist. Invalid addresses detected
during prefetching of data or CCWs do not affect
the execution of the operation and do not cause er­
ror indications until the I/O operation actually at­ tempts to use the information. If the operation is
concluded by the I/O device or by HALT I/O, HALT DEVICE, or CLEAR I/O before the invalid
information is needed, the condition is not brought
to the attention of the program.
The count field in the CCW can specify any num­ ber of bytes up to 65,535. Except for a CCW specify­ ing transfer in channel, where the count field is
ignored, the count field may not contain the value
zero. Whenever the count field in the CCW initially
contains a zero, the program-check condition is gen­
erated. When this occurs in the first CCW designat­
ed by the CAW, the operation is not initiated, and
the status portion of the CSW with the program­
check indication is stored during execution of ST ART I/O or START I/O FAST RELEASE being
executed as START I/O. When a count of zero is
detected during data chaining, the I/O device is sig­
naled to terminate the operation. Detection of a count of zero during command chaining or subse­ quent to the execution of ST ART I/O FAST RE­ LEASE suppresses initiation of the new operation
and generates an interruption condition.
Chaining
When the channel has performed the transfer of
information specified by a CCW, it can continue the
activity initiated by START I/O or START I/O FAST RELEASE by fetching a new CCW. Such
fetching of a new CCW is called chaining, and the
CCWs belonging to such a sequence are said to be
chained.
Chaining takes place CCWs located in
successive double word locations in storage. It pro­
ceeds in an ascending order of addresses; that is, the
address of the new CCW is obtained by adding eight
to the address of the current CCW. Two chains of
CCWs located in noncontiguous storage areas can
be coupled for chaining purposes by a transfer-in­
channel command. All CCW s in a chain apply to the I/O device specified in the original START I/O or
START I/O FAST RELEASE.
Two types of chaining are provided: chaining of
data and chaining of commands. Chaining is con-
trolled by the chain-data (CD) and chain-command
(CC) flags in conjunction with the suppress-length­
indication (SLI) flag in the CCW. These flags speci­
fy the action to be taken by the channel upon the
exhaustion of the current CCW and upon receipt of
ending status from the device, as shown in the ac­ companying table.
The specification of chaining is effectively propa­ gated through a transfer-in-channel command. When
in the process of chaining a transfer-in-channel com­ mand is fetched, the CCW designated by the trans­ fer in channel is used for the type of chaining speci­
fied in the CCW preceding the transfer-in-channel.
The CD and CC flags are ignored in the transfer­ in-channel command.
Data Chaining
During data chaining, the new CCW fetched by the
channel defines a new storage area for the original I/O operation. Execution of the operation at the I/O device is not affected. When all data designated
by the current CCW has been transferred to main
storage or to the device, data chaining causes the
operation to continue, using the storage area desig­ nated by the new CCW. The contents of the
command-code field of the new CCW are ignored,
unless they specify transfer in channel.
Data chaining is considered to occur immediately
after the last byte of data designated by the current
CCW has been transferred to main storage or to the
device. When the last byte of the transfer has been
placed in main storage or accepted by the device, the
new CCW takes over the control of the operation
and replaces the pertinent information in the sub­
channel. If the device sends channel end after ex­
hausting the count of the current CCW but before
transferring any data to or from the storage area
designated by the new CCW, the CSW associated
with the concluded operation pertains to the new
CCW.
If programming errors are detected in the new
CCW or during its fetching, the error indication is
generated, and the device is signaled to conclude the
operation when it attempts to transfer data designat­
ed by the new CCW. If the device signals the
channel-end condition before transferring any data
designated by the new CCW, program check or pro­ tection check is indicated in the CSW associated
with the termination. The contents of the CSW per­
tain to the new CCW unless the address of the new
CCW is invalid, the location is protected against
fetching, or programming errors are detected in an
intervening transfer-in-channel command. A data
Input/Output Operations 213
Flags in Current Action in Channel upon Exhaustion of Count or Receipt of Channel End CCW CD CC SLI 0 0 0 0 0 1 0 0 I mmediate Operation
End, -
End, - Stop,IL Stop, - Stop,IL Regular Operation
End, -
End,- II III End,IL End, - End,IL 0 Chain command Chain command Chain command Chain command Chain command Chain command 0 0 0 0 End, -
End, -
End, -
End, - Chain data Chain data Chain data Chain data Count exhausted, end of block at device not reached. II Count exhausted and channel end from device. III Count not exhausted and channel end from device.
End The operation is terminated. If the operation is immediate
and has been specified by the first CCW associated with a
START 1/0, a condition code 1 is set, and the status
portion of the CSW is stored as part of the execution of the
START 1/0. In all other cases an interruption condition
is generated in the subchannel. Stop The device is signaled to terminate data transfer, but the subchannel remains in the working state until channel end
is rec:eived; at this time an interruption condition is generated in the subchannel. I L Incorrect length is indicated with the interruption condition.
Channel Chaining Action
address referring to a nonexistent or protected area
causes an error indication only after the I/O device
has attempted to transfer data to or from the invalid
location.
Data chaining during an input operation causes
the new CCW to be fetched when all data designat­
ed by the current CCW has been placed in main
storage. On an output operation, the channel may
fetch the new CCW from main storage ahead of the
time data chaining occurs. Any programming errors
in the prefetched CCW, however, do not affect the
execution of the operation until all data designated
by the current CCW has been transferred to the I/O device. If the device concludes the operation before
all data de;signated by the current CCW has been
transferred, the conditions associated with the pre­
fetched CCW are not indicated to the program. Only one CCW describing a data area may be
prefetched and buffered in the channel. If the pre­
fetched CCW specifies transfer in channel, only one
more CC\V is fetched before the exhaustion of the
current CCW. 214 System/370 Principles of Operation End,IL End,IL End,IL End,IL I ncorrect length is not indicated. Chain The channel performs command chaining upon
command receipt of device end. Chain data The channel immediately fetches a new CCW for
the same operation.
The situation where the count is zero but data
chaining is indicated at the time the device
provides channel end cannot validly occur. When
data chaining is indicated, the channel fetches the
new CCW after transferring the last byte of data
designated by the current CCW but before the
device provides the next request for data or status
transfer. As a result, the channel recognizes the
channel end from the device only after it has
fetched the new CCW, which cannot contain a
count of zero unless a programming error has been
made. PTogranrumdng Data chaining may be used to rearrange information
as it is transferred between main storage and an I/O device. Data chaining permits blocks of information
to be transferred to or from noncontiguous areas of
storage, and, when used in conjunction with the
skipping function, data chaining enables the program
to place in main storage selected portions of a block
of data.
When, during an input operation, the program
specifies data chaining to a location into which data
has been placed under the control of the current
CCW, the channel, in fetching the next CCW, fetch­
es the new contents of the location. This is true even
if the location contains the last byte transferred un­
der the control of the current CCW. When a channel
program data-chains to a CCW placed in storage by
the CCW specifying data chaining, the input block is
said to be self -describing. A self -describing block
contains one or more CCWs that specify storage
locations and counts for subsequent data in the same
input block.
The use of self -describing blocks is equivalent to
the use of unchecked data. An I/O data-transfer
Previous Page Next Page