8 Link Protocol (リンクプロトコル)
8.6 Control Channel (コントロールチャンネル)
8.6.1 Control Transactions (コントロールトランザクション)
A control transaction is composed of transmitted command, the execution of that command, and finally an acknowledgment as shown schematically in Figure 18.
Start Completed
Figure 18 ― Control transaction – standard
コントロールトランザクションは図 18に示す送信コマンド,コマンド実行およびACKにて構成される。
図 18 ― コントロールトランザクション - 標準 Tx
デコード&
実行 ホスト
デバイス
開始 完了
待機 …
時間
Tx Ack Host Tx
Wait …
Decode &
Execute Device Tx
Ack Time
The Host shall implement the following rules for control transactions:
After completion of command transmission the Host shall not send a new command until it has received a final acknowledgment from the Device.
However if the Host does not receive an acknowledgment for more than 200ms (transmission timeout) the Host can resend the last command or can send a new command.
On receiving a tentative acknowledgment the Host shall reset the 200ms timeout and keep waiting for a final acknowledgment.
The only command the Host can send before receiving a final acknowledgment is a control channel reset.
ホストは以下の規則に従ってコントロールトランザクションを実装すること<SHALL>:
コマンド送信の完了後,ホストは ACK または NAK をデバイスから受け取るまで新しいコマンドを送信してはな らない<SHALL NOT>。
200ms 待って ACK が返ってこない場合(伝送のタイムアウト),ホストは最後に送ったコマンドを再送する
<CAN>か新しいコマンドを送信することができる<CAN>。
暫定 ACK を受信したときは 200ms のタイムアウトをリセットし,完了 ACK を受け取るまで待機する<SHALL>。
完了 ACK を受信する前にホストが送信可能なコマンドはコントロールチャンネルのリセットのみである。
The Device shall implement the following rules for control transactions:
On receiving a valid command the Device shall execute the command and transmit a final acknowledgment after command execution.
On receiving an invalid command the appropriate acknowledgment shall be transmitted immediately and the command shall be discarded.
Command execution time and the time required to transmit the final acknowledgment shall not exceed 200ms, which is the transmission timeout.
If the Device needs more than 200ms it shall transmit tentative acknowledgments spaced less than 200ms apart to inform the Host that the last command is still pending. The tentative acknowledgment scheme is illustrated in Figure 19.
Completed Start
Figure 19 ― Control transaction – tentative acknowledgment Tx
De- code Host
Device
reset timeout Wait …
Time
Tx
Execution Tx
Tx Ack reset
timeout
Wait … Wait …
tentative tentative
Comment: The tentative acknowledgments can be processed in the Host FPGA, allowing it (for instance) to raise an interrupt when a slow command completes, so avoiding the need for software polling of a status bit.
デバイスは以下の規則に従ってコントロールトランザクションを実装すること<SHALL>:
有効なコマンドを受け取ったときはデバイスはコマンドの内容を実行し,コマンド実行後に完了 ACK を返送す る<SHALL>。
無効なコマンドを受け取ったときは即座に適切な ACK を返し<SHALL>,コマンドは破棄する<SHALL>。
コマンド実行時間と完了 ACK を伝送するのに必要な時間は伝送のタイムアウトとなる 200ms を超えてはならな い<SHALL NOT>。
200ms 以上の時間が必要な場合はデバイスが暫定ACK を一定の間隔(200ms 未満,余裕をもたせること)で 返し,ホスト側が最後に送ったコマンドの処理中であることを知らせるようにする<SHALL>。暫定ACK の発行 システムを図 19に示す。
完了 開始
図 19 ― コントロール・トランザクション - 暫定ACK
コメント: 暫定 ACK をホスト側の FPGA で処理することで,(例えば)コマンド実行完了が遅いときに割り込み発生を許容し,
ステータスビットのポーリングをソフトウェアで行うことを省略することもできる<CAN>。
The Host can transmit a control channel reset message to try to regain control of a Device that is not responding correctly, or is stuck in a loop sending tentative acknowledgments. On receiving this message, the Device shall abort any control operation in process, reset its control channel logic, and send the unique success message.
Comment: Control channel reset needs to be used with care. Resetting the Device part way through (for instance) a flash memory update could render the Device unusable.
If the Device’s control channel is not working, it is quite possible that it will not respond to the control channel reset message, and the only recovery possible may be to power cycle the Device. See section 7.4.5
ホストは正常に返答しなかったり,暫定 ACK が返り続ける等スタック状態に陥ったりしているデバイスに対しコント ロールを復帰させるためのコントロールチャンネルリセットメッセージを送信することができる<CAN>。このメッセー
Tx
デ コード ホスト
デバイス
リセット タイムアウト 待機 …
時間
Tx
実行 Tx
Tx Ack リセット
タイムアウト
待機 … 待機 …
暫定 暫定
ジを受け取った場合,デバイスはあらゆるコントロール動作を中断してコントロールロジックをリセットし,ユニークな
「成功」メッセージを送信すること<SHALL>。
コメント: コントロールチャンネルのリセットを使うときは注意が必要である。デバイスの都合を無視してリセットを行うと,例え ばフラッシュメモリが書き換わりデバイスを使用不可能な状態にしてしまうなどの弊害が考えられる。
デバイスのコントロールチャンネルが機能しない場合,コントロールチャンネル・リセットメッセージに対する返答も不 可能となる。この場合の解決策は,デバイス電源の再投入のみとなる。セクション7.4.5を参照。
Control channel reset is the only command that a Host can send before receiving a final acknowledgment from the previous command.
Note that control channel reset is not a Device reset – it shall only reset the control channel, not the entire Device.
コントロールチャンネルのリセットはその前のコマンド発行から完了 ACK を受け取るまでのあいだにホストが発行 可能な唯一のコマンドである。
コントロールチャンネルのリセットはデバイスのリセットと無関係であることに注意する ― あくまでコントロールチャ ンネルのみをリセットするものとし<SHALL>,デバイス全体に適用してはならない<SHALL NOT>。