Programming Note
Bit position 39 of the CCW, which pres­
ently must be set to zero, may in the
future be assigned to the control of new
functions. It is recommended,
therefore, that this bit position not be
set to one for the purpose of obtaining
an intentional program-check indication. COMMAND CODE The command code, bit positions 0-7 of
the CCW, specifies to the channel and
the I/O device the operation to be
performed. A detailed description of
each command appears under "Commands." The two rightmost bits or, when these
bits are 00, the four rightmost bits of
the command code identify the operation
to the channel. The channel distin­
guishes among the following four oper­
ations:
Output forward (write, control)
Input forward (read, sense)
Input backward (read backward)
Branching (transfer in channel)
The channel ignores the leftmost bits of
the command code. Commands that initiate I/O operations
(write, read, read backward, control,
sense, and sense ID) cause all eight
bits of the command code to be trans­
ferred to the I/O device. In these
command codes, the leftmost bit posi­
tions contain modifier bits. The
modifier bits specify to the device how
the command is to be executed. They may, for example, cause the device to
compare data received during a write
operation with data previously recorded, and they may specify such information as
recording density and parity. For the
control command, the modifier bits may
contain the order code specifying the
control function to be performed. The
meaning of the modifier bits depends on
the type of I/O device and is specified
in the SL publication for the device.
The command-code assignment is listed in
the following table. The symbol X indi­
cates that the bit position is ignoredi
M identifies a modifier bit. Code Command XXXX 0000 Invalid
MMMM MM01 Write
MMMM MMIO Read MMMM 1100 Read Backward
MMMM MM11 Control MMMM 0100 Sense 1110 0100 Sense ID
XXX X 1000 Transfer in Channel Whenever the channel detects an invalid
command code during the initiation of a
command, a program check is generated.
When the first CCW designated by the CAW contains an invalid command code, the
status portion of the CSW with the
program-check indication is stored
during execution of START I/O or START I/O FAST RELEASE being executed as START I/O. When the invalid code is detected
during command chaining or subsequent to
the execution of START I/O FAST RELEASE,
the new operation is not initiated, and
an interruption condition is generated.
The command code is ignored during data
chaining, unless it specifies transfer
in channel.
DESIGNATION OF STORAGE AREA
The storage area associated with an I/O operation is defined by one or more CCWs. A CCW defines an area by specify­
ing the address of the first byte to be
transferred and the number of consec­
utive bytes contained in the area. The
address of the first byte appears in the
data-address field of the CCW, except
when channel indirect data addressing is
specified. (See the section "Channel Indirect Data Addressing" later in this
chapter.) The number of bytes contained
in the storage area is specified in the
count field.
In write, read, control, and sense oper­
ations, storage locations are used in
ascending order of addresses. As infor­
mation is transferred to or from
storage, the address from the address
field is incremented, and the count from
the count field is decremented. The
read-backward operation places data in
storage in a descending order of
addresses, and both the count and the
address are decremented. When the count
reaches zero, the storage area defined
by the CCW is exhausted.
Some channels do not perform address
wraparound. Depending on the model, a
program check may be generated if an
address by the channel to
transfer data 1S incremented past
16,777,215 or is decremented past o.
Any available storage location can be used in the transfer of data to or from Chapter 13. Input/Output Operations 13-39
an I/O device if the location is not
protected against the type of reference. Similarly, a CCW can be located in any
available storage location (in the first
16M-byte block of storage) if the
location is not protected against a
fetch-type reference.
When the first CCW designated by the CAW is in a storage location that is not
available, the I/O operation is not
initiated, and the status portion of the CSW with the program-check indication is
stored during the execution of START I/O or START I/O FAST RELEASE being executed
as START I/O. When, subsequently,
during the operation or chain of oper­
ations, the channel refers to a storage
location that is not provided, an inter­
ruption condition indicating program
check is generated, and the device is
signaled to terminate the operation.
When the first CCW designated by the CAW is in a storage location that is
protected against a fetch-type
reference, the I/O operation is not
initiated, and the status portion of the CSW with the protection-check indication
is stored during the execution of START I/O or START I/O FAST RELEASE being
executed as START I/O. When, subse­
quently, during the I/O operation or
chain of operations, the channel refers
to a protected storage location, an
interruption condition indicating
protection check is generated, and the
device is signaled to terminate the
operation.
During an output operation, the channel
may fetch data from storage before the
time the I/O device requests the data.
Any number of bytes specified by the
current CCW may thus be prefetched.
When data chaining during an output
operation, the channel may prefetch the
next CCW and the data and IDAWs associ­
ated with the prefetched CCW (as
specified by the data-address and count
field of the CCW or the data addresses
from the IDAWs and the count field of
the CCW) at any time during the
execution of the current CCW. Prefetching may cause the channel to
refer to storage locations that are
protected or not available. Such errors
detected during prefetching of data, CCWs, or IDAWs, do not affect the
execution of the operation and do not
cause error indications until the I/O operation actuallY attempts to use the
data or until the CCW or IDAW takes
control. If the operation is concluded
by the channel, by the I/O device, or by
the HIO, HDV, CLRCH, or CLRIO function
before the invalid information is
needed, no program check or protection
check is generated.
The count field in the CCW can specify
any number of bytes from one to '5,535. Except for a CCW specifying transfer in 13-40 System/370 Principles of Operation channel, which has no count field, the
count field may not contain the value
zero. Whenever the count field in the CCW initially contains a zero, a program
check is generated. When this occurs in
the first CCW designated 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 START 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
signaled to terminate the operation.
Detection of a count of zero during
command chaining or subsequent to the
execution of START I/O FAST RELEASE
suppresses initiation of the new opera­
tion and generates an interruption
condition. CHAINING When the channel has performed the
transfer of information specified by a CCW, it can continue the activity initi­
ated 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 between CCWs located in successive doubleword
locations in storage. It proceeds in an
ascending order of addresses; that is,
the address of the new CCW is obtained
by adding 8 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 CCWs in a chain apply to the I/O device spec­
ified in the original START I/O or START I/O FAST RELEASE. Depending on the
model, the address used to fetch a CCW may wrap from 16,777,208 to 0, or a
program check may be generated when that CCW takes control of the operation.
Two types of chaining are provided:
chaining of data and chaining of
commands. Chaining is controlled by the
chain-data (CD) and chain-command (CC) flags in conjunction with the suppress­
length-indication (SLI) flag in the CCW. These flags specify 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 figure "Channel-Chaining Action."
The specification of chaining is effec­
tively propagated through a transfer­
in-channel command. When in the process
of chaining, a transfer-in-channel
command is fetched, the CCW designated
by the transfer in channel is used for
the type of chaining specified in the CCW preceding the transfer in channel.
Previous Page Next Page