JP3606145B2 - Data transfer control device and electronic device - Google Patents

Data transfer control device and electronic device Download PDF

Info

Publication number
JP3606145B2
JP3606145B2 JP37050199A JP37050199A JP3606145B2 JP 3606145 B2 JP3606145 B2 JP 3606145B2 JP 37050199 A JP37050199 A JP 37050199A JP 37050199 A JP37050199 A JP 37050199A JP 3606145 B2 JP3606145 B2 JP 3606145B2
Authority
JP
Japan
Prior art keywords
packet
queue
received packet
reset
received
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP37050199A
Other languages
Japanese (ja)
Other versions
JP2001186146A (en
Inventor
浩輔 松永
裕之 金井
信一郎 藤田
朱美 吐合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP37050199A priority Critical patent/JP3606145B2/en
Publication of JP2001186146A publication Critical patent/JP2001186146A/en
Application granted granted Critical
Publication of JP3606145B2 publication Critical patent/JP3606145B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、データ転送制御装置及び電子機器に関し、特に、バスに接続される複数のノード間でIEEE1394などの規格に準じたデータ転送を行うためのデータ転送制御装置及び電子機器に関する。
【0002】
【背景技術及び発明が解決しようとする課題】
近年、IEEE1394と呼ばれるインターフェース規格が脚光を浴びている。このIEEE1394は、次世代のマルチメディアにも対応可能な高速シリアルバスインターフェースを規格化したものである。このIEEE1394によれば、動画像などのリアルタイム性が要求されるデータも扱うことができる。また、IEEE1394のバスには、プリンタ、スキャナ、CD−RWドライブ、ハードディスクドライブなどのコンピュータの周辺機器のみならず、ビデオカメラ、VTR、TVなどの家庭用電化製品も接続できる。このため、電子機器のデジタル化を飛躍的に促進できるものとして期待されている。
【0003】
さて、IEEE1394の上位プロトコルとして規格化されているSBP−2(Serial Bus Protocol−2)では、エージェントリセット、ターゲットリセット、リセットスタートなどのリセットが定義されている。即ち、ターゲット(プリンタ、スキャナ、CD−RW等)に何らかのエラーが発生し、データ転送処理を継続できないと判断した場合に、イニシエータ(パーソナルコンピュータ等)は、上記のリセットを要求する。そして、このようなリセットが要求された場合、リセットにより不要になる受信パケットについては破棄する必要がある。
【0004】
また、IEEE1394においては、バスに電子機器が新たに接続されたり、バスから電子機器が取り外されたりして、バスに接続されるノードが増減すると、いわゆるバスリセットが発生する。そして、バスリセットが発生するとノードのトポロジ情報がクリアされ、未完了のトランザクションは全てキャンセルされるため、バスリセット発生前に受信したパケットは全て無効になる。
【0005】
しかしながら、パケットを処理するファームウェアは、一般的に、処理速度の低いCPU上で動作している場合が多い。従って、受信パケットに対する処理は、そのパケットの受信後、所与の時間が経過してから行われるようになる。このため、多数の未処理のパケットが常にターゲットのデータバッファ上に存在することになる。従って、データバッファ上に存在する多数の受信パケットの中から、リセット(エージェントリセット、バスリセット等)により不要になる受信パケットを探し出す処理に多くの時間を要してしまう。このため、リセット処理に長時間を要してしまいシステム全体の処理がストールしてしまったり、ファームウェアの処理負担が過大になるなどの問題が生じる。
【0006】
本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、リセット処理に要する時間の短縮化と処理負担の軽減化を図れるデータ転送制御装置及び電子機器を提供することにある。
【0007】
【課題を解決するための手段】
上記課題を解決するために本発明は、バスに接続される複数のノード間でのデータ転送のためのデータ転送制御装置であって、自ノードのデータバッファに書き込まれた受信パケットを解析し、解析した受信パケットをキューに格納し、データバッファ上の受信パケットが無くなるまで受信パケットの解析及びキューへの格納を繰り返すパケット解析手段と、データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットを処理するパケット処理手段と、処理した受信パケットがリセットを指示するパケットであった場合には、キューに格納された受信パケットのうち前記リセットにより不要になる受信パケットを破棄するパケット破棄手段とを含むことを特徴とする。
【0008】
本発明によれば、解析した受信パケットが直ぐには処理されずに、キューに格納される。そして、データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットの処理が開始される。そして、受信パケットがリセットを指示するパケットであった場合には、リセットにより不要になる受信パケットが破棄される。このようにすれば、リセットにより不要になる受信パケット(リセットの影響を受ける受信パケット)に対して、無駄なパケット処理が行われるのを防止でき、リセット処理に要する時間を大幅に短縮化できる。
【0009】
なお、キューは複数設けることが望ましいが、1つでもよい。また、パケット処理手段が行う受信パケットの処理としては、例えば、後段の処理手段(要求実行手段等)に受信パケットを渡すなどの処理が考えられる。また、不要な受信パケットを破棄する処理としては、キューをクリアする処理等が考えられるが、受信パケットを個別的に破棄してもよい。
【0010】
また本発明は、前記キューとして複数のキューが用意され、前記パケット解析手段が、解析した受信パケットを前記複数のキューの中のいずれかのキューに格納し、前記パケット破棄手段が、処理した受信パケットがリセットを指示するパケットであった場合には、リセットにより不要になる受信パケットが格納されているキューをクリアすることを特徴とする。
【0011】
このようにすれば、リセットにより不要になる受信パケットをひとまとめに破棄できるため、受信パケットを破棄する処理を大幅に効率化できる。
【0012】
なお、複数のキューとしては、その各々が、受信パケットを渡す後段の処理手段(要求実行手段等)に対応したキューを設けることが望ましい。
【0013】
また本発明は、前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行する第1の要求実行手段と、前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行すると共に、前記第1の要求実行手段がリセットされると自身もリセットされる関係にある第2の要求実行手段とを含み、前記パケット解析手段が、前記第1の要求実行手段に渡すべき受信パケットについては第1のキューに格納し、前記第2の要求実行手段に渡すべき受信パケットについては第2のキューに格納し、前記パケット処理手段が、前記第1のキューに格納されている受信パケットを、前記第2のキューに格納されている受信パケットよりも優先して処理することを特徴とする。
【0014】
このようにすれば、第1の要求実行手段に渡すべき受信パケットが優先的に処理されるようになる。従って、第1の要求実行手段がリセットされるとリセットされる関係にある第2の要求実行手段の受信パケットが、無駄に処理されてしまう事態を防止でき、リセット処理に要する時間を短縮化できる。
【0015】
なお、第1、第2の要求実行手段としては例えばSBP−2におけるマネージメントエージェントやフェッチエージェントが考えられるが、本発明は、これに限定されない。
【0016】
また本発明は、前記パケット破棄手段が、処理した受信パケットが前記第1の要求実行手段のリセットを指示するパケットであった場合には、前記第1、第2のキューの両方をクリアすることを特徴とする。
【0017】
このようにすれば、処理が不要な第2の要求実行手段の受信パケットが、ひとまとめに破棄されるようになるため、処理の効率化を図れる。
【0018】
また本発明は、前記第2の要求実行手段が、上層のデバイスのコマンド制御要求を実行する第3の要求実行手段と、データ転送要求を実行する第4の要求実行手段とを含み、前記パケット解析手段が、前記第3の要求実行手段に渡すべき受信パケットについては第3のキューに格納し、前記第4の要求実行手段に渡すべき受信パケットについては第4のキューに格納し、前記パケット処理手段が、前記第3のキューに格納されている受信パケットを、前記第4のキューに格納されている受信パケットよりも優先して処理することを特徴とする。
【0019】
このようにすれば、第3の要求実行手段に渡すべき受信パケットを優先的に処理できるようになり、データ転送処理中に、デバイスのコマンド制御要求を割り込ませることが可能になる。
【0020】
また本発明は、バスに接続される複数のノード間でのデータ転送のためのデータ転送制御装置であって、自ノードのデータバッファに書き込まれた受信パケットを解析し、解析した受信パケットをキューに格納し、データバッファ上の受信パケットが無くなるまで受信パケットの解析及びキューへの格納を繰り返すパケット解析手段と、データバッファ上の受信パケットが無くなったところでキューに格納された受信パケットを処理するパケット処理手段と、ノードのトポロジ情報をクリアするリセットが発生した場合には、前記リセットの発生前の受信パケットを破棄するパケット破棄手段とを含むことを特徴とする。
【0021】
本発明によれば、解析した受信パケットが直ぐには処理されずに、キューに格納される。そして、データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットの処理が開始される。そして、ノードのトポロジ情報をクリアするリセットが発生すると、リセットの発生前の受信パケットが破棄される。従って、リセット発生前に受信したパケットに対して、無駄なパケット処理が行われるのを防止でき、リセット処理に要する時間を大幅に短縮化できる。
【0022】
また本発明は、前記パケット破棄手段が、ノードのトポロジ情報をクリアするリセットが発生した場合には、受信パケットが格納されているキューをクリアすることを特徴とする。
【0023】
このようにすれば、リセット発生前の受信パケットをひとまとめに破棄できるため、処理の効率化を図れる。
【0024】
なお、キューをクリアするか否かの判断は、キューに受信パケットを格納する毎に行ってもよいし、全ての受信パケットがキューに格納された後に行ってもよい。
【0025】
なお、ノードのトポロジ情報をクリアする前記リセットは、IEEE1394の規格において定義されるバスリセットであることが望ましい。
【0026】
また本発明では、IEEE1394の規格に準拠したデータ転送を行うことが望ましい。
【0027】
また本発明に係る電子機器は、上記のいずれかのデータ転送制御装置と、前記データ転送制御装置及びバスを介して相手ノードから受信したデータに所与の処理を施す装置と、処理が施されたデータを出力又は記憶するための装置とを含むことを特徴とする。また本発明に係る電子機器は、上記のいずれかのデータ転送制御装置と、前記データ転送制御装置及びバスを介して相手ノードに送信するデータに所与の処理を施す装置と、処理が施されるデータを取り込むための装置とを含むことを特徴とする。
【0028】
本発明によれば、データ転送を制御するファームウェア等の処理負担を軽減できるため、電子機器の低コスト化、処理の高速化などを図ることができる。また、リセットの発生によりシステム全体の処理がストールしてしまうなどの事態を防止できるため、電子機器の信頼性を高めることができる。
【0029】
【発明の実施の形態】
以下、本発明の好適な実施形態について図面を用いて詳細に説明する。
【0030】
1.IEEE1394
まず、IEEE1394について簡単に説明する。
【0031】
1.1 概要
IEEE1394(IEEE1394−1995、P1394.a)では100〜400Mbpsの高速なデータ転送が可能となっている(P1394.bでは800〜3200Mbps)。また、転送速度が異なるノードをバスに接続することも許される。
【0032】
各ノードはツリー状に接続されており、1つのバスに最大で63個のノードが接続可能になっている。なお、バスブリッジを利用すれば約64000個のノードを接続することも可能である。
【0033】
IEEE1394では、パケットの転送方式として非同期転送とアイソクロナス転送が用意されている。ここで非同期転送は、信頼性が要求されるデータの転送に好適な転送方式であり、アイソクロナス転送は、リアルタイム性が要求される動画像や音声などのデータの転送に好適な転送方式である。
【0034】
1.2 層構造
IEEE1394の層構造(プロトコル構成)を図1に示す。
【0035】
IEEE1394のプロトコルは、トランザクション層、リンク層、物理層により構成される。また、シリアルバスマネージメントは、トランザクション層、リンク層、物理層をモニターしたり制御したりするものであり、ノードの制御やバスのリソース管理のための種々の機能を提供する。
【0036】
トランザクション層は、上位層にトランザクション単位のインターフェース(サービス)を提供し、下層のリンク層が提供するインターフェースを通して、リードトランザクション、ライトトランザクション、ロックトランザクション等のトランザクションを実施する。
【0037】
ここで、リードトランザクションでは、応答ノードから要求ノードにデータが転送される。一方、ライトトランザクションでは、要求ノードから応答ノードにデータが転送される。またロックトランザクションでは、要求ノードから応答ノードにデータが転送され、応答ノードがそのデータに処理を施して要求ノードに返信する。
【0038】
リンク層は、アドレッシング、データチェック、パケット送受信のためのデータフレーミング、アイソクロナス転送のためのサイクル制御などを提供する。
【0039】
物理層は、リンク層により使用されるロジカルシンボルの電気信号への変換や、バスの調停や、バスの物理的インターフェースを提供する。
【0040】
1.3 SBP−2
さて、図2に示すように、IEEE1394のトランザクション層の一部の機能を含む上位のプロトコルとして、SBP−2(Serial Bus Protocol−2)と呼ばれるプロトコルが提案されている。
【0041】
ここでSBP−2は、SCSIのコマンドセットをIEEE1394のプロトコル上で利用可能にするために提案されたものである。このSBP−2を用いれば、既存のSCSI規格の電子機器で使用されていたSCSIのコマンドセットに最小限の変更を加えて、IEEE1394規格の電子機器に使用できるようになる。従って、電子機器の設計や開発を容易化できる。また、SCSIのコマンドだけではなく、デバイス固有のコマンドもカプセル化して利用できるため、非常に汎用性が高い。
【0042】
図3に示すようにSBP−2では、まず、イニシエータ(例えばパーソナルコンピュータ)により作成されたログインORB(Operation Request Block)を用いてログイン処理が行われる(ステップT1)。次に、ダミーORBを用いてフェッチエージェントの初期化が行われる(ステップT2)。そして、コマンドブロックORB(ノーマルコマンドORB)を用いてコマンド処理が行われ(ステップT3)、最後に、ログアウトORBを用いてログアウト処理が行われる(ステップT4)。
【0043】
ここで、ステップT3のコマンド処理においては、図4のA1に示すように、イニシエータがライト要求パケットを転送して(ライト要求トランザクションを発行して)、ターゲットのドアベルレジスタをリングする。すると、A2に示すように、ターゲットがリード要求パケットを転送し、イニシエータが対応するリード応答パケットを返す。これにより、イニシエータが作成したORB(コマンドブロックORB)が、ターゲットのデータバッファにフェッチされる。そして、ターゲットは、フェッチされたORBに含まれるコマンドを解析する。
【0044】
そして、ORBに含まれるコマンドがSCSIのライトコマンドであった場合には、A3に示すように、ターゲットがリード要求パケットをイニシエータに転送し、イニシエータが対応するリード応答パケットを返す。これにより、イニシエータのデータバッファに格納されているデータがターゲットに転送される。そして、例えばターゲットがプリンタであった場合には、転送されたデータがプリンタエンジンにより印刷される。
【0045】
一方、ORBに含まれるコマンドがSCSIのリードコマンドであった場合には、図5のB1に示すように、ターゲットは、一連のライト要求パケットをイニシエータに転送する。これにより、例えばターゲットがスキャナであった場合には、スキャナエンジンにより取得されたスキャンデータが、イニシエータのデータバッファに転送されることになる。
【0046】
このSBP−2によれば、ターゲットは、自身が都合の良いときに要求パケットを転送して(トランザクションを発行して)、データを送受信できる。従って、イニシエータとターゲットが同期して動く必要がなくなるため、データ転送効率を高めることができる。
【0047】
なお、IEEE1394の上位プロトコルとしては、SBP−2以外にも、FCP(Function Control Protocol)と呼ばれるプロトコルなども提案されている。
【0048】
1.4 バスリセット
IEEE1394では、電源が投入されたり、途中でデバイスの抜き差しが発生すると、バスリセットが発生する。即ち、各ノードは、ポートの電圧変化を監視している。そして、バスに新たなノードが接続されるなどしてポートの電圧に変化が生じると、この変化を検知したノードは、バス上の他のノードに対して、バスリセットが発生したことを知らせる。また、各ノードの物理層は、バスリセットが発生したことをリンク層に伝える。
【0049】
そして、このようにバスリセットが発生すると、ノードIDなどのトポロジ情報がクリアされる。そして、その後、トポロジ情報が自動的に再設定される。即ち、バスリセット後、ツリー識別、自己識別が行われる。その後、アイソクロナスリソースマネージャ、サイクルマスタ、バスマネージャ等の管理ノードが決定される。そして、通常のパケット転送が再開される。
【0050】
このようにIEEE1394では、バスリセット後にトポロジ情報が自動的に再設定されるため、電子機器のケーブルを自由に抜き差しできるようになり、いわゆるホットプラグを実現できる。
【0051】
なお、トランザクションの途中でバスリセットが発生した場合には、そのトランザクションはキャンセルされる。そして、キャンセルされたトランザクションを発行した要求ノードは、トポロジ情報が再設定された後に、要求パケットを再度転送する。また、応答ノードは、バスリセットによりキャンセルされたトランザクションの応答パケットを要求ノードに返送してはならない。
【0052】
2.全体構成
次に、本実施形態のデータ転送制御装置の全体構成例について図6を用いて説明する。なお、以下では、イニシエータ(相手ノード)との間でデータ転送を行うターゲット(自ノード)がプリンタである場合について例にとり説明するが、本発明はこれに限定されない。
【0053】
本実施形態のデータ転送制御装置10は、PHYデバイス12(物理層のデバイス)、リンクデバイス14(リンク層のデバイス)、CPU16(プロセッサ)、データバッファ18(記憶手段)、ファームウェア20(処理手段)を含む。なお、PHYデバイス12、リンクデバイス14、CPU16、データバッファ18は、任意の構成要素であり、本実施形態のデータ転送制御装置10は、これらの構成要素を全て含む必要はない。
【0054】
PHYデバイス12は、図1の物理層のプロトコルをハードウェアにより実現するための回路であり、リンクデバイス14により使用されるロジカルシンボルを電気信号に変換する機能を有する。
【0055】
リンクデバイス14は、図1のリンク層のプロトコルやトランザクション層のプロトコルの一部をハードウェアにより実現するための回路であり、ノード間でのパケット転送のための各種サービスを提供する。
【0056】
CPU16は、装置全体の制御やデータ転送の制御を行うものである。
【0057】
データバッファ18は、転送データ(パケット)を一時的に格納するバッファであり、SRAM、SDRAM、或いはDRAMなどのハードウェアにより構成される。なお、本実施形態では、データバッファ18は、特には限定されないがランダムアクセス可能なパケット記憶手段として機能する。
【0058】
ファームウェア20は、CPU16上で動作する種々の処理ルーチン(処理モジュール)を含むプログラムであり、トランザクション層のプロトコルは、このファームウェア20と、ハードウェアであるCPU16等により実現される。
【0059】
なお、イニシエータであるパーソナルコンピュータ100が含むデバイスドライバ102は、周辺機器を管理制御するための種々の処理ルーチンを含むプログラムである。このプログラムは、情報記憶媒体110(FD、CD−ROM、DVD、ROM)を利用してパーソナルコンピュータ100にインストールされる。
【0060】
ここで、デバイスドライバ102のプログラムは、ホストシステムが有する情報記憶媒体(ハードディスク、磁気テープ等)からインターネットなどのネットワークを介してダウンロードし、パーソナルコンピュータ100にインストールするようにしてもよい。
【0061】
ファームウェア20(F/W)は、コミュニケーション部30(COM)、マネージメントエージェント40(MNG)、フェッチエージェント50(FCH1)、フェッチエージェント60(FCH2)、プリントタスク部70(PRT)を含む。
【0062】
ここで、コミュニケーション部30は、リンクデバイス14などのハードウェアとの間のインターフェースとして機能する処理モジュールである。
【0063】
マネージメントエージェント40(第1の要求実行手段)は、ログイン、リコネクト、ログアウト、リセット等の管理を行う処理モジュールである。例えばイニシエータがターゲットにログインを要求した場合には、まず、このマネージメントエージェント40が、このログイン要求を受け付けることになる。
【0064】
フェッチエージェント50、60(コマンドブロックエージェント。第2の要求実行手段)は、イニシエータからの要求を実行するための処理モジュールであり、より具体的には、コマンドブロックORBが含むコマンドを実行する。フェッチエージェント50、60は、単一の要求しか扱うことができないマネージメントエージェント40と異なり、イニシエータからの要求により自身がフェッチしたORBのリンクリストも扱うことができる。
【0065】
プリンタスク部70は、プリンタエンジンやスキャナエンジン(上層のデバイス)との間でDMA転送を行うための処理モジュールである。
【0066】
なお、フェッチエージェント50(第3(第2)の要求実行手段)は、後段のプリンタエンジンやスキャナエンジン(上層のデバイス)のコマンド制御のための処理モジュールであり、フェッチエージェント60(第4(第2)の要求実行手段)は、後段のプリンタエンジンやスキャナエンジンとの間のデータ転送のための処理モジュールである。
【0067】
例えばプリンタエンジンとのデータ転送中にインク残量を調べたい場合に、フェッチエージェントが1つしかないと、ORBのリンクリストによるデータ転送が全て完了するまで、インク残量をチェックできない。
【0068】
本実施形態では、互いに独立なフェッチエージェントを2つ設けている(3つ以上でもよい)。そして、コマンド制御用のフェッチエージェント50の処理の優先度を、データ転送用のフェッチエージェント60の処理の優先度よりも高くしている。より具体的には、後述するように、コマンド制御用のフェッチエージェント50に渡す受信パケットを、データ転送用のフェッチエージェント60に渡す受信パケットよりも優先して処理するようにしている。
【0069】
このようにすることで、ORBのリンクリストによるデータ転送処理の間に、インク残量チェックなどのプリンタのコマンド制御処理を割り込ませることできる。従って、データ転送処理が終わるのを長時間待つことなく、インク残量をチェックできるようになり、データ転送に影響を与えることなく、デバイスのコマンド制御ができるようになる。
【0070】
さて、コミュニケーション部30は、パケット解析部32、パケット処理部34、パケット破棄部36を含む。
【0071】
ここで、パケット解析部32は、パーソナルコンピュータ100からIEEE1394バス、PHYデバイス12、リンクデバイス14を介してデータバッファ18に書き込まれた受信パケットを解析する。そして、解析した受信パケットをキューに格納する。
【0072】
なお、このキューは、例えばCPU16のローカルメモリ上に確保することができる。また、後述するように複数のキューがある場合には、パケット解析部32は、解析結果に応じたキューに受信パケットを格納する。
【0073】
そして、パケット解析部32は、受信パケットをキューに格納すると、次の受信パケットを解析する。そして、データバッファ18上の受信パケットが無くなるまで、受信パケットの解析及びキューへの格納を繰り返す。
【0074】
パケット処理部34は、データバッファ18上の受信パケットが無くなったところで、キューに格納された受信パケットを処理する。より具体的には、キューに格納された受信パケットをマネージメントエージェント40(MNG)、フェッチエージェント50(FCH1)、或いはフェッチエージェント60(FCH2)に渡す。例えば、MNG用のキュー、FCH1用のキュー、FCH2用のキューというように複数のキューがある場合には、MNG用のキューに格納される受信パケットについてはマネージメントエージェント40に渡す。また、FCH1用、FCH2用のキューに格納される受信パケットについては、各々、フェッチエージェント50、60に渡す。
【0075】
パケット破棄部36は、パケット処理部34により処理された受信パケットが、エージェントリセット、ターゲットリセット、リセットスタートなどのリセットを指示するパケットであった場合には、キューに格納された受信パケットのうちリセットにより不要になる受信パケット(リセットの影響を受ける受信パケット)を破棄する処理を行う。そして、例えばキューが複数ある場合には、リセットされるエージェントのキューをクリアすることで、受信パケットをひとまとめに破棄する。
【0076】
また、パケット破棄部36は、バスリセット(広義にはノードのトポロジ情報をクリアするリセット)が発生した場合には、バスリセット発生前に受信したパケットを破棄する処理を行う。
【0077】
3.本実施形態の特徴
3.1 リセット時の不要パケットの破棄
さて、SBP−2においては、ターゲットにエラーが発生した場合に、イニシエータはターゲットに対してリセットを指示するパケット(以下、リセットパケットと呼ぶ)を転送できる。そして、この場合に、SBP−2ではレベルの異なる種々のリセットが用意されている。例えば、リセットスタートは最も強いレベルのリセットであり、ノード状態が全てリセットされる。また、アボートタスクやアボートタスクセットでは、タスクやタスクのセットがリセットされ、ターゲットリセットではターゲットがリセットされる。また、エージェントリセットでは、フェッチエージェントのみがリセットされる。
【0078】
なお、リセットスタート、エージェントリセットは、イニシエータが所定のレジスタに所定の情報をライトすることによりターゲットに伝えられ、アボートタスク、アボートタスクセット、ターゲットリセットは、イニシエータから転送されるマネージメントORBを用いてターゲットに伝えられる。
【0079】
このように、イニシエータからリセットパケットが転送されてくると、リセットにより不要になるパケットについては破棄する必要がある。そして、この場合に、図7の比較例では、受信パケットを解析した後に直ぐにパケット処理(エージェントに受信パケットを渡す処理等)を行う(ステップT1、T2)。次に、受信パケットがリセットパケットか否かを判断し、リセットパケットであれば受信パケットを破棄する処理を行う(ステップT3、T4)。そして、以上の処理を、受信パケットが無くなるまで繰り返す(ステップT5)。
【0080】
しかしながら、この比較例では、リセットにより破棄される運命にある受信パケットに対しても、パケット処理が行われてしまう。従って、リセット処理が非常に非効率になる。
【0081】
特に、プリンタやスキャナやCD−RWなどの周辺機器に本実施形態のデータ転送制御装置を組み込んだ場合、製品コストの制約から、安価で処理能力が低いCPUが使用される場合が多い、従って、そのCPU上で動作するファームウェアもその制約の影響を受けて、処理速度が遅くなってしまう。このため、受信パケットの処理が間に合わなくなり、多数の未処理の受信パケットが自ノード(ターゲット)のデータバッファ上に存在するようになる。従って、リセット処理時間の増加の問題は更に深刻なものになる。
【0082】
そこで本実施形態では図8のC1、C2に示すように、ターゲットのデータバッファに書き込まれた受信パケットを解析した後、解析した受信パケットを直ぐには処理せずにキューに格納する。そして、C3に示すように、データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットを処理する。そして、C4に示すように、処理した受信パケットがエージェントリセット等のリセットパケットであった場合には、リセットにより不要になる受信パケット(リセットの影響を受ける受信パケット)を破棄する。
【0083】
このようにすれば、リセットにより、パケット処理を行うまでもなく不要になる受信パケットについては、パケット処理を行わないで済むようになる。従って、全ての受信パケットに対してパケット処理が行われる図7の比較例に比べて、リセット処理に要する時間を大幅に短縮化できる。この結果、システム全体の処理がリセット処理によりストールしてしまう事態を防止できると共に、ファームウェアの処理負担も軽減化できる。
【0084】
更に、本実施形態では、受信パケットを格納するキューを複数用意し、解析した受信パケットを、複数のキューの中のいずれかに仕分けして格納する。そしてリセットが発生した場合には、リセットにより不要になる受信パケットが格納されているキューをクリアする。
【0085】
より具体的には、図9(A)に示すように、マネージメントエージェントに渡す受信パケットを格納するためのMNGキューと、フェッチエージェントに渡す受信パケットを格納するためのFCHキューを用意する。そして、図9(A)、(B)に示すように、受信パケットの解析結果に応じたキューに受信パケットを格納する。即ち、マネージメントエージェントに渡すパケットについてはMNGキューに格納し、フェッチエージェントに渡すパケットについてはFCHキューに格納する。
【0086】
そして、図9(C)に示すように、例えば受信パケットがエージェントリセットであると判明した場合(エージェントリセットレジスタへのライトパケットであると判明した場合)には、FCHキューをクリアする。即ち、FCHキューに格納されている受信パケットは、フェッチエージェントに渡すパケットであり、エージェントリセットにより不要になるパケットである。従って、エージェントキュー自体をクリアすることで、これらの不要パケットをひとまとめにして破棄できる。
【0087】
このように、キューのクリアにより受信パケットを破棄するようにすれば、不要な受信パケットをひとまとめに破棄できるようになり、受信パケットを破棄する処理を大幅に効率化できる。これにより、リセット処理を更に高速化できるようになる。
【0088】
また、本実施形態では、第1のエージェントがリセットされると第2のエージェントがリセットされるという関係がある場合に、第1のエージェント用のキューに格納されている受信パケットを、第2のエージェント用のキューに格納されている受信パケットよりも優先して処理するようにしている。
【0089】
より具体的には、図10(A)に示すように、マネージメントエージェント(第1の要求実行手段)用のMNGキューと、フェッチエージェント(第2の要求実行手段)用のFCHキューがある場合には、MNGキューに格納される受信パケットを優先的に処理する(フェッチエージェントは、マネージメントエージェントがリセットされると自身もリセットされる関係にある)。即ち、MNGキューに格納されている全ての受信パケットについてのパケット処理(マネージメントエージェントにパケットを渡す等の処理)が完了した後に、図10(B)に示すように、FCHキューに格納されている受信パケットのパケット処理を開始する。
【0090】
このようにすれば、図10(C)に示すように、例えばMNGキューに格納される受信パケットの中にリセットスタートを指示するパケットがあった場合に、MNGキューとFCHキューの両方をクリアできる。これにより、FCHキューに格納される受信パケットは破棄され、これらの受信パケットに対して無駄なパケット処理を行わなくて済むようになる。この結果、リセット処理の更なる効率化を図れ、リセット処理を高速に完了できるようになる。
【0091】
なお、本実施形態では図11(A)に示すように、フェッチエージェント(第2の要求実行手段)として、コマンド制御用のフェッチエージェントFCH1(第3の要求実行手段)とデータ転送用のフェッチエージェントFCH2(第4の要求実行手段)を用意している。そして、コマンド制御用のフェッチエージェントFCH1に渡すべき受信パケットについてはFHC1キューに格納し、データ転送用のフェッチエージェントFCH2に渡すべき受信パケットについてはFHC2キューに格納する。そして、図11(A)に示すように、FCH1キューに格納されているコマンド制御用の受信パケットを優先して処理し、FCH1キューの全ての受信パケットについてのパケット処理が完了した後に、図11(B)に示すように、FCH2キューに格納されている受信パケットのパケット処理を開始する。
【0092】
このようにすれば、フェッチエージェントFCH1による処理が優先されるようになり、フェッチエージェントFCH2によるデータ転送処理の間に、フェッチエージェントFCH1によるコマンド制御処理を容易に割り込ませることができる。従って、印刷が完了するのを待つことなく、インク残量を調べることなどが可能になる。
【0093】
3.2 バスリセット時の不要パケットの処理
IEEE1394においては、バスに電子機器が新たに接続されたり、バスから電子機器が取り外されたりすると、バスリセットが発生する。そして、バスリセットが発生すると、ノードのトポロジ情報がクリアされ、バスリセット発生時点で未完了であったトランザクションは全てキャンセルされる。このため、バスリセット発生前に受信したパケットは全て無効になる。
【0094】
ところが、前述のように、データ転送制御装置が組み込まれる周辺機器で動作するCPUは処理能力が低い。このため、このCPU上で動作するファームウェアも高速に受信パケットを処理できず、多数の未処理の受信パケットがデータバッファ上に存在するようになる。従って、バスリセットが発生した場合には、これらの多数の未処理の受信パケットの中から、バスリセット発生前のパケットを区別して破棄する処理が必要になる。従って、ファームウェアの処理負荷も過大になる。
【0095】
そこで本実施形態では、図12(A)に示すように、ターゲットのデータバッファに書き込まれた受信パケットを解析した後、解析した受信パケットを直ぐには処理せずにキューに格納する。そして、データバッファ上の受信パケットが無くなったところでキューに格納された受信パケットを処理する。そして、バスリセットが発生した場合には、バスリセット発生前に受信したパケットを破棄するようにする。
【0096】
より具体的には、図12(B)に示すように、受信パケットのキューへの格納中にIEEE1394のバス上でバスリセットが発生した場合には、受信パケットのキューをクリアして、バスリセット発生前の受信パケットを破棄する(この場合には、データバッファ上の受信パケットも破棄することが望ましい)。また、図12(C)に示すように、全ての受信パケットをキューに格納した後、受信パケットの処理中に、バスリセットが発生した場合にも、受信パケットのキューをクリアして、受信パケットを破棄する。
【0097】
以上のようにすれば、バスリセットにより、パケット処理を行うまでもなく不要になる受信パケットについては、パケット処理を行わないで済むようになる。従って、全ての受信パケットに対してパケット処理が行われる図7の比較例に比べて、バスリセット処理に要する時間を大幅に短縮化できる。この結果、システム全体の処理がバスリセット処理によりストールしてしまう事態を防止できると共に、ファームウェアの処理負担も軽減化できる。
【0098】
また、キューのクリアにより受信パケットを破棄すれば、バスリセット発生前の多数の受信パケットをひとまとめに破棄できるため、受信パケットを破棄する処理を更に効率化できる。特に、CPUの処理能力の低さに起因して多数の未処理の受信パケットがデータバッファ上に存在するような場合には、キューのクリアにより受信パケットを破棄する本実施形態の手法は、処理の効率化に非常に効果的なものとなる。
【0099】
4.本実施形態の処理
次に、本実施形態の詳細な処理例について図13、図14のフロチャートを用いて説明する。
【0100】
CPU(或いはリンクデバイス)からの割り込みが発生すると、その割り込み要因を解析し、解析が済んだ割り込み要因をクリアする(ステップS1)。ここで割り込み要因としては、パケット受信の割り込み、バスリセット発生の割り込み、プリンタへのDMA転送終了の割り込み、CPUのタイマ割り込みなどがある。
【0101】
次に、解析した割り込み要因が、パケット受信の割り込みか否かを判断し(ステップS2)、パケット受信の割り込みではなかった場合には、バスリセット発生の割り込みか否かを判断する(ステップS3)。そして、バスリセット発生の割り込みであった場合には、エージェントキューの全てと送信キューをクリアし(ステップS4。図12(B)、(C)参照)、バスリセット発生前の受信パケットを破棄する。
【0102】
次に、CPUからの割り込み要因が存在するか否かを判断し(ステップS5)、存在する場合には、その割り込み要因を解析し、解析が済んだ割り込み要因をクリアする(ステップS6)。次に、解析が済んでいない未処理の割り込み要因が、まだ存在するか否かを判断し(ステップS7)、存在する場合にはステップS2に戻り、存在しない場合には割り込み処理を終了する。
【0103】
ステップS2でパケット受信の割り込みが発生したと判断した場合には、受信パケットが、自身が転送した要求パケットに対するイニシエータの応答パケットか否かを判断する(図14のステップS8)。そして、応答パケットであった場合には、応答パケットに関する処理(データバッファにおける応答パケットの格納場所のポインタ制御等)を行う(ステップS9)。
【0104】
次に、パケットの解析結果に基づいて、受信パケットがエージェントに渡すパケットか否かを判断する(ステップS10)。そして、エージェントに渡すパケットであった場合には、図9(A)、(B)で説明したように、受信パケットを、対応するエージェントのキューに格納する(ステップS11)。例えば、マネージメントエージェントに渡す受信パケットはMNGキューに格納し、フェッチエージェントに渡す受信パケットはFCHキューに格納する。
【0105】
次に、バスリセットが発生しているか否かを判断する(ステップS12)。そして、バスリセットが発生している場合には、図12(B)で説明したように、エージェントキューの全てと送信キューをクリアする(ステップS22)。一方、発生していない場合には、キューに格納すべき受信パケットがデータバッファ上にまだ存在しているか否かを判断し(ステップS13)、存在している場合にはステップS11に戻る。そして、データバッファ上の受信パケットが無くなるまで、ステップS11、S12、S13の処理を繰り返す。
【0106】
次に、キューへの受信パケットの格納後、バスリセットが発生しているか否かを判断する(ステップS14)。そして、発生している場合には、図12(C)で説明したように、エージェントキューの全てと送信キューをクリアする(ステップS22)。一方、発生してない場合には、図8のC3に示すように、キューに格納されている受信パケットに対する処理(エージェントに渡す処理等)があるか否かを判断する(ステップS15)。そして、処理がある場合には、図10(A)で説明したように、優先順位の高いエージェントキュー(例えばMNGキュー)から処理を行う(ステップS16)。
【0107】
次に、受信パケットがリセットパケット(リセットを指示するパケット)か否かを判断する(ステップS17)。例えば、ターゲットリセットの場合には、エージェントがORBの内容を解析することで、リセットパケットか否かを判断できる。また、エージェントリセットやリセットスタートの場合には、エージェントがパケットのライトアドレスを解析することで、リセットパケットか否かを判断できる。
【0108】
受信パケットがリセットパケットであった場合には、図9(C)や図10(C)で説明したように、リセットにより影響を受けるエージェントキューをクリアする(ステップS18)。例えば、マネージメントエージェントのリセットの場合には、MNGキューとFCHキューの両方をクリアする。一方、フェッチエージェントのリセットの場合には、FCHキューのみをクリアする。
【0109】
次に、データバッファ上の送信バッファに空きがあり、且つ、送信要求が存在するか否かを判断し(ステップS19)、存在する場合にはパケット送信を行う(ステップS20)。次に、バスリセットが発生しているか否かを判断し(ステップS21)、発生している場合には、エージェントキューの全てと送信キューをクリアする(ステップS22)。一方、発生してない場合には、図13のステップS3に戻る。
【0110】
そして、ステップS3〜S7、S2、S8〜S21の処理を繰り返して、キューに格納されている受信パケットを1つずつ順次処理して行く。即ち、まず、優先順位が最も高いキュー(例えばMNGキュー)に格納されている受信パケットを1つずつ順次処理して行き、全ての受信パケットに対する処理が完了した場合には、2番目に優先順位が高いキュー(例えばFCH1キュー)に格納されている受信パケットを処理する。そして、そのキューの全ての受信パケットの処理が完了すると、3番目に優先順位が高いキュー(例えばFCH2キュー)に格納されている受信パケットを処理する。以上のようにして、キューに格納されている全ての受信パケットに対して処理を行う。
【0111】
5.電子機器
次に、本実施形態のデータ転送制御装置を含む電子機器の例について説明する。
【0112】
例えば図15(A)に電子機器の1つであるプリンタの内部ブロック図を示し、図16(A)にその外観図を示す。CPU(マイクロコンピュータ)510はシステム全体の制御などを行う。操作部511はプリンタをユーザが操作するためのものである。ROM516には、制御プログラム、フォントなどが格納され、RAM518はCPU510のワーク領域として機能する。表示パネル519はプリンタの動作状態をユーザに知らせるためのものである。
【0113】
PHYデバイス502、データ転送制御装置500を介して、パーソナルコンピュータなどの相手ノードから送られてきた印字データは、バス504を介して印字処理部(プリンタエンジン)512に直接送られる。そして、印字データは、印字処理部512にて所与の処理が施され、プリントヘッダなどからなる印字部(データを出力するための装置)514により紙に印字されて出力される。
【0114】
図15(B)に電子機器の1つであるスキャナの内部ブロック図を示し、図16(B)にその外観図を示す。CPU520はシステム全体の制御などを行う。操作部521はスキャナをユーザが操作するためのものである。ROM526には制御プログラムなどが格納され、RAM528はCPU520のワーク領域として機能する。
【0115】
光源、光電変換器などからなる画像読み取り部(データを取り込むための装置)522により原稿の画像が読み取られ、読み取られた画像のデータは画像処理部(スキャナエンジン)524により処理される。そして、処理後の画像データがバス505を介してデータ転送制御装置500に直接送られる。データ転送制御装置500は、この画像データにヘッダなどを付加することでパケットを生成し、PHYデバイス502を介してパーソナルコンピュータなどの相手ノードに送信する。
【0116】
図15(C)に電子機器の1つであるCD−RWドライブの内部ブロック図を示し、図16(C)にその外観図を示す。CPU530はシステム全体の制御などを行う。操作部531はCD−RWをユーザが操作するためのものである。ROM536には制御プログラムなどが格納され、RAM538はCPU530のワーク領域として機能する。
【0117】
レーザ、モータ、光学系などからなる読み取り&書き込み部(データを取り込むための装置又はデータを記憶するための装置)533によりCD−RW532から読み取られたデータは、信号処理部534に入力され、エラー訂正処理などの所与の信号処理が施される。そして、信号処理が施されたデータが、バス506を介してデータ転送制御装置500に直接送られる。データ転送制御装置500は、このデータにヘッダなどを付加することでパケットを生成し、PHYデバイス502を介してパーソナルコンピュータなどの相手ノードに送信する。
【0118】
一方、PHYデバイス502、データ転送制御装置500を介して、相手ノードから送られてきたデータは、バス506を介して信号処理部534に直接送られる。そして、信号処理部534によりこのデータに所与の信号処理が施され、読み取り&書き込み部533によりCD−RW532に記憶される。
【0119】
なお、図15(A)、(B)、(C)において、CPU510、520、530の他に、データ転送制御装置500でのデータ転送制御のためのCPUを別に設けるようにしてもよい。
【0120】
また、図15(A)、(B)、(C)ではRAM501(データバッファに相当)がデータ転送制御装置500の外部に設けられているが、RAM501をデータ転送制御装置500に内蔵させてもよい。
【0121】
本実施形態のデータ転送制御装置を電子機器に用いれば、データ転送制御装置や電子機器に何らかのエラーが発生して、データ転送制御装置がリセットされた場合にも、短時間で正常状態に復帰できるようになる。また、バスに新たな電子機器が接続されてバスリセットが発生した場合にも、短い時間でバスリセット状態から復帰でき、システム全体がストールしてしまう事態を防止できる。
【0122】
また本実施形態のデータ転送制御装置を電子機器に用いれば、高速なデータ転送が可能になる。従って、ユーザがパーソナルコンピュータなどによりプリントアウトの指示を行った場合に、少ないタイムラグで印字が完了するようになる。また、スキャナへの画像取り込みの指示の後に、少ないタイムラグで読み取り画像をユーザは見ることができるようになる。また、CD−RWからのデータの読み取りや、CD−RWへのデータの書き込みを高速に行うことができるようになる。
【0123】
また本実施形態のデータ転送制御装置を電子機器に用いることで、CPU上で動作するファームウェアの処理負担が軽減され、安価なCPUや低速のバスを用いることが可能になる。更に、データ転送制御装置の低コスト化、小規模化を図れるため、電子機器の低コスト化、小規模化も図れるようになる。
【0124】
なお本実施形態のデータ転送制御装置を適用できる電子機器としては、上記以外にも例えば、種々の光ディスクドライブ(CD−ROM、DVD)、光磁気ディスクドライブ(MO)、ハードディスクドライブ、TV、VTR、ビデオカメラ、オーディオ機器、電話機、プロジェクタ、パーソナルコンピュータ、電子手帳、ワードプロセッサなど種々のものを考えることができる。
【0125】
なお、本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。
【0126】
例えば、本発明のデータ転送制御装置の構成は、図6に示す構成が特に望ましいが、これに限定されるものではない。
【0127】
また、受信パケットを破棄する手法も、本実施形態で説明した手法が特に望ましいが、これに限定されるものではない。
【0128】
また、本実施形態では、2つ又は3つのキューを設ける場合について説明したが、4つ以上のキューを設けるようにしてもよい。
【0129】
また、本発明は、IEEE1394規格でのデータ転送に適用されることが特に望ましいが、これに限定されるものではない。例えばIEEE1394と同様の思想に基づく規格やIEEE1394を発展させた規格におけるデータ転送にも本発明は適用できる。
【図面の簡単な説明】
【図1】IEEE1394の層構造について示す図である。
【図2】SBP−2について説明するための図である。
【図3】SBP−2のデータ転送処理の概略について説明するための図である。
【図4】データをイニシエータからターゲットに転送する場合のコマンド処理について説明するための図である。
【図5】データをターゲットからイニシエータに転送する場合のコマンド処理について説明するための図である。
【図6】本実施形態のデータ転送制御装置の構成例を示す図である。
【図7】比較例の処理について説明するためのフローチャートである。
【図8】リセット時の本実施形態の手法について説明するための図である。
【図9】図9(A)、(B)、(C)は、複数のキューを用意し、キューをクリアすることにより、不要なパケットを破棄する手法について説明するための図である。
【図10】図10(A)、(B)、(C)は、優先順位の高いキューを優先的に処理する手法について説明するための図である。
【図11】図11(A)、(B)は、コマンド制御用のフェッチエージェントのキューを優先的に処理する手法について説明するための図である。
【図12】図12(A)、(B)、(C)は、バスリセット時の本実施形態の手法について説明するための図である。
【図13】本実施形態の詳細な処理例を示すフローチャートである。
【図14】本実施形態の詳細な処理例を示すフローチャートである。
【図15】図15(A)、(B)、(C)は、種々の電子機器の内部ブロック図の例である。
【図16】図16(A)、(B)、(C)は、種々の電子機器の外観図の例である。
【符号の説明】
10 データ転送制御装置
12 PHYデバイス
14 リンクデバイス
16 CPU
18 データバッファ
20 ファームウェア(F/W)
30 コミュニケーション部(COM)
32 パケット解析部
34 パケット処理部
36 パケット破棄部
40 マネージメントエージェント(MNG。第1の要求実行手段)
50 フェッチエージェント(FCH1。第3(第2)の要求実行手段)
60 フェッチエージェント(FCH2。第4(第2)の要求実行手段)
70 プリントタスク部(PRT)
100 パーソナルコンピュータ
102 デバイスドライバ
104 データバッファ
110 情報記憶媒体
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data transfer control device and an electronic device, and more particularly to a data transfer control device and an electronic device for performing data transfer according to a standard such as IEEE 1394 between a plurality of nodes connected to a bus.
[0002]
[Background Art and Problems to be Solved by the Invention]
In recent years, an interface standard called IEEE 1394 has been in the spotlight. This IEEE 1394 standardizes a high-speed serial bus interface that can be used for next-generation multimedia. According to the IEEE 1394, it is possible to handle data such as a moving image that requires real-time performance. In addition to computer peripheral devices such as printers, scanners, CD-RW drives, and hard disk drives, home appliances such as video cameras, VTRs, and TVs can be connected to the IEEE 1394 bus. For this reason, it is expected that digitalization of electronic devices can be dramatically accelerated.
[0003]
In SBP-2 (Serial Bus Protocol-2), which is standardized as a higher-level protocol of IEEE 1394, resets such as agent reset, target reset, and reset start are defined. That is, when an error occurs in the target (printer, scanner, CD-RW, etc.) and it is determined that the data transfer process cannot be continued, the initiator (personal computer, etc.) requests the reset. When such a reset is requested, a received packet that becomes unnecessary due to the reset needs to be discarded.
[0004]
In IEEE 1394, when an electronic device is newly connected to the bus or an electronic device is removed from the bus and the number of nodes connected to the bus increases or decreases, a so-called bus reset occurs. When a bus reset occurs, the topology information of the node is cleared, and all incomplete transactions are canceled. Therefore, all packets received before the bus reset occurs are invalidated.
[0005]
However, in general, firmware for processing packets generally operates on a CPU with a low processing speed. Accordingly, the processing for the received packet is performed after a given time has elapsed after the reception of the packet. For this reason, a large number of unprocessed packets are always present on the target data buffer. Therefore, it takes a lot of time to search for unnecessary received packets by reset (agent reset, bus reset, etc.) from a large number of received packets existing on the data buffer. For this reason, the reset process takes a long time, causing problems such as stalling of the entire system process and excessive firmware processing load.
[0006]
The present invention has been made in view of the technical problems as described above, and an object of the present invention is to provide a data transfer control device and an electronic apparatus capable of reducing the time required for reset processing and reducing the processing load. Is to provide.
[0007]
[Means for Solving the Problems]
In order to solve the above problems, the present invention is a data transfer control device for data transfer between a plurality of nodes connected to a bus, and analyzes a received packet written in a data buffer of its own node, Packet analysis means for storing the analyzed received packet in the queue, repeating the analysis of the received packet and storing in the queue until there are no more received packets on the data buffer, and when the received packet on the data buffer is exhausted, it is stored in the queue Packet processing means for processing received packets, and if the processed received packets are packets for instructing resetting, packet discarding for discarding received packets that are not required by the reset among the received packets stored in the queue Means.
[0008]
According to the present invention, the analyzed received packet is not processed immediately but is stored in the queue. Then, when there are no received packets on the data buffer, processing of the received packets stored in the queue is started. If the received packet is a packet for instructing resetting, the received packet that becomes unnecessary by the reset is discarded. In this way, it is possible to prevent unnecessary packet processing from being performed on received packets that are not required by reset (received packets that are affected by reset), and the time required for reset processing can be greatly shortened.
[0009]
Although it is desirable to provide a plurality of queues, one queue may be used. As processing of the received packet performed by the packet processing means, for example, processing such as passing the received packet to a subsequent processing means (request execution means or the like) can be considered. Further, as a process of discarding unnecessary received packets, a process of clearing a queue or the like can be considered, but received packets may be discarded individually.
[0010]
In the present invention, a plurality of queues are prepared as the queue, the packet analyzing unit stores the analyzed received packet in any one of the plurality of queues, and the packet discarding unit processes the received packet. When the packet is a packet for instructing resetting, the queue storing received packets that become unnecessary by resetting is cleared.
[0011]
In this way, received packets that become unnecessary due to reset can be discarded together, so that the process of discarding received packets can be made more efficient.
[0012]
It should be noted that it is desirable that each of the plurality of queues is provided with a queue corresponding to a subsequent processing means (request execution means or the like) that passes the received packet.
[0013]
The present invention also provides a first request execution means for receiving a received packet from the packet processing means and executing a request from another node; and receiving a received packet from the packet processing means and executing a request from another node And a second request execution unit that is also reset when the first request execution unit is reset, and the packet analysis unit is to receive the first request execution unit. The packet is stored in the first queue, the received packet to be passed to the second request execution unit is stored in the second queue, and the packet processing unit receives the reception stored in the first queue. The packet is processed with priority over the received packet stored in the second queue.
[0014]
In this way, the received packet to be passed to the first request execution means is processed preferentially. Accordingly, it is possible to prevent the received packet of the second request execution unit that is reset when the first request execution unit is reset, and to reduce the time required for the reset process. .
[0015]
As the first and second request execution means, for example, a management agent or a fetch agent in SBP-2 can be considered, but the present invention is not limited to this.
[0016]
According to the present invention, the packet discarding means clears both the first and second queues when the processed received packet is a packet for instructing resetting of the first request execution means. It is characterized by.
[0017]
In this way, the received packets of the second request execution means that do not need to be processed are discarded together, so that the processing efficiency can be improved.
[0018]
In the present invention, the second request execution unit includes a third request execution unit that executes a command control request for an upper layer device, and a fourth request execution unit that executes a data transfer request. The analysis means stores the received packet to be passed to the third request execution means in a third queue, stores the received packet to be passed to the fourth request execution means in a fourth queue, and The processing means processes the received packet stored in the third queue with priority over the received packet stored in the fourth queue.
[0019]
In this way, it is possible to preferentially process the received packet to be passed to the third request execution means, and it is possible to interrupt the device command control request during the data transfer process.
[0020]
The present invention also relates to a data transfer control device for data transfer between a plurality of nodes connected to a bus, which analyzes received packets written in the data buffer of the own node and queues the analyzed received packets. And packet analysis means for repeatedly analyzing received packets and storing them in the queue until there are no more received packets on the data buffer, and a packet for processing the received packets stored in the queue when there are no more received packets on the data buffer And a processing unit and a packet discarding unit for discarding a received packet before the occurrence of the reset when a reset for clearing the topology information of the node occurs.
[0021]
According to the present invention, the analyzed received packet is not processed immediately but is stored in the queue. Then, when there are no received packets on the data buffer, processing of the received packets stored in the queue is started. When a reset that clears the topology information of the node occurs, the received packet before the reset occurs is discarded. Therefore, useless packet processing can be prevented from being performed on packets received before the occurrence of reset, and the time required for reset processing can be greatly shortened.
[0022]
Further, the present invention is characterized in that the packet discarding means clears a queue storing received packets when a reset for clearing the topology information of the node occurs.
[0023]
In this way, the received packets before the occurrence of reset can be discarded together, so that the processing efficiency can be improved.
[0024]
Whether or not to clear the queue may be determined every time the received packet is stored in the queue, or may be determined after all the received packets are stored in the queue.
[0025]
The reset for clearing the topology information of the node is preferably a bus reset defined in the IEEE 1394 standard.
[0026]
In the present invention, it is desirable to perform data transfer conforming to the IEEE 1394 standard.
[0027]
An electronic device according to the present invention includes any one of the data transfer control devices described above, a device that performs a given process on the data transfer control device and data received from a partner node via a bus, and a process. And a device for outputting or storing the received data. An electronic apparatus according to the present invention includes any one of the data transfer control devices described above, a device that performs a given process on the data transfer control device and data transmitted to a partner node via a bus, and a process. And a device for capturing data.
[0028]
According to the present invention, it is possible to reduce the processing load of firmware or the like that controls data transfer, and thus it is possible to reduce the cost of electronic devices and increase the processing speed. In addition, since it is possible to prevent a situation in which processing of the entire system is stalled due to occurrence of a reset, the reliability of the electronic device can be improved.
[0029]
DETAILED DESCRIPTION OF THE INVENTION
DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
[0030]
1. IEEE 1394
First, IEEE 1394 will be briefly described.
[0031]
1.1 Overview
IEEE 1394 (IEEE 1394-1995, P1394.a) enables high-speed data transfer of 100 to 400 Mbps (800 to 3200 Mbps in P1394.b). It is also permitted to connect nodes with different transfer rates to the bus.
[0032]
Each node is connected in a tree shape, and a maximum of 63 nodes can be connected to one bus. If a bus bridge is used, it is possible to connect approximately 64,000 nodes.
[0033]
In IEEE 1394, asynchronous transfer and isochronous transfer are prepared as packet transfer methods. Asynchronous transfer is a transfer method suitable for data transfer that requires reliability, and isochronous transfer is a transfer method suitable for data transfer such as moving images and audio that requires real-time property.
[0034]
1.2 Layer structure
The layer structure (protocol structure) of IEEE1394 is shown in FIG.
[0035]
The IEEE 1394 protocol includes a transaction layer, a link layer, and a physical layer. Serial bus management monitors and controls the transaction layer, link layer, and physical layer, and provides various functions for node control and bus resource management.
[0036]
The transaction layer provides a transaction unit interface (service) to the upper layer, and performs transactions such as a read transaction, a write transaction, and a lock transaction through the interface provided by the lower link layer.
[0037]
Here, in the read transaction, data is transferred from the response node to the request node. On the other hand, in a write transaction, data is transferred from the request node to the response node. In the lock transaction, data is transferred from the request node to the response node, and the response node processes the data and returns it to the request node.
[0038]
The link layer provides addressing, data check, data framing for packet transmission / reception, cycle control for isochronous transfer, and the like.
[0039]
The physical layer provides conversion of logical symbols used by the link layer into electrical signals, bus arbitration, and a physical interface of the bus.
[0040]
1.3 SBP-2
As shown in FIG. 2, a protocol called SBP-2 (Serial Bus Protocol-2) has been proposed as an upper protocol including a part of the functions of the transaction layer of IEEE1394.
[0041]
Here, SBP-2 is proposed in order to make a SCSI command set available on the IEEE 1394 protocol. By using this SBP-2, the SCSI command set used in the existing SCSI standard electronic device can be minimally changed and used in the IEEE 1394 standard electronic device. Therefore, the design and development of electronic equipment can be facilitated. In addition, not only SCSI commands but also device-specific commands can be encapsulated and used, so the versatility is very high.
[0042]
As shown in FIG. 3, in SBP-2, a login process is first performed using a login ORB (Operation Request Block) created by an initiator (for example, a personal computer) (step T1). Next, initialization of the fetch agent is performed using the dummy ORB (step T2). Then, command processing is performed using the command block ORB (normal command ORB) (step T3), and finally logout processing is performed using the logout ORB (step T4).
[0043]
Here, in the command processing in step T3, as shown at A1 in FIG. 4, the initiator transfers the write request packet (issues a write request transaction) and rings the target doorbell register. Then, as shown in A2, the target transfers a read request packet, and the initiator returns a corresponding read response packet. As a result, the ORB (command block ORB) created by the initiator is fetched into the target data buffer. Then, the target analyzes the command included in the fetched ORB.
[0044]
If the command included in the ORB is a SCSI write command, the target transfers a read request packet to the initiator and the initiator returns a corresponding read response packet, as shown at A3. As a result, data stored in the data buffer of the initiator is transferred to the target. For example, when the target is a printer, the transferred data is printed by the printer engine.
[0045]
On the other hand, if the command included in the ORB is a SCSI read command, the target transfers a series of write request packets to the initiator, as indicated by B1 in FIG. Thereby, for example, when the target is a scanner, the scan data acquired by the scanner engine is transferred to the data buffer of the initiator.
[0046]
According to SBP-2, the target can transmit and receive data by transferring a request packet (issuing a transaction) when it is convenient for itself. Therefore, it is not necessary for the initiator and the target to move in synchronization, so that the data transfer efficiency can be improved.
[0047]
In addition to SBP-2, a protocol called FCP (Function Control Protocol) has been proposed as a higher-level protocol of IEEE 1394.
[0048]
1.4 Bus reset
In IEEE1394, a bus reset occurs when power is turned on or when a device is inserted or removed in the middle. That is, each node monitors port voltage changes. When a change occurs in the port voltage, for example, when a new node is connected to the bus, the node that has detected this change informs other nodes on the bus that a bus reset has occurred. The physical layer of each node notifies the link layer that a bus reset has occurred.
[0049]
When a bus reset occurs in this way, the topology information such as the node ID is cleared. Thereafter, the topology information is automatically reset. That is, tree identification and self-identification are performed after the bus reset. Thereafter, management nodes such as an isochronous resource manager, a cycle master, and a bus manager are determined. Then, normal packet transfer is resumed.
[0050]
As described above, in IEEE 1394, topology information is automatically reset after a bus reset, so that a cable of an electronic device can be freely inserted and removed, and a so-called hot plug can be realized.
[0051]
If a bus reset occurs in the middle of a transaction, the transaction is cancelled. Then, the request node that has issued the canceled transaction transfers the request packet again after the topology information is reset. In addition, the response node must not return a response packet of the transaction canceled by the bus reset to the request node.
[0052]
2. overall structure
Next, an example of the overall configuration of the data transfer control device of this embodiment will be described with reference to FIG. In the following, a case where the target (own node) that performs data transfer with the initiator (partner node) is a printer will be described as an example, but the present invention is not limited to this.
[0053]
The data transfer control device 10 of the present embodiment includes a PHY device 12 (physical layer device), a link device 14 (link layer device), a CPU 16 (processor), a data buffer 18 (storage means), and firmware 20 (processing means). including. Note that the PHY device 12, the link device 14, the CPU 16, and the data buffer 18 are arbitrary components, and the data transfer control device 10 of the present embodiment does not need to include all these components.
[0054]
The PHY device 12 is a circuit for realizing the physical layer protocol of FIG. 1 by hardware, and has a function of converting a logical symbol used by the link device 14 into an electrical signal.
[0055]
The link device 14 is a circuit for realizing a part of the link layer protocol and the transaction layer protocol in FIG. 1 by hardware, and provides various services for packet transfer between nodes.
[0056]
The CPU 16 controls the entire apparatus and data transfer.
[0057]
The data buffer 18 is a buffer that temporarily stores transfer data (packets), and is configured by hardware such as SRAM, SDRAM, or DRAM. In the present embodiment, the data buffer 18 functions as a random-accessible packet storage unit, although not particularly limited thereto.
[0058]
The firmware 20 is a program including various processing routines (processing modules) that operate on the CPU 16, and a transaction layer protocol is realized by the firmware 20, the CPU 16 that is hardware, and the like.
[0059]
The device driver 102 included in the personal computer 100 as an initiator is a program including various processing routines for managing and controlling peripheral devices. This program is installed in the personal computer 100 using the information storage medium 110 (FD, CD-ROM, DVD, ROM).
[0060]
Here, the program of the device driver 102 may be downloaded from an information storage medium (hard disk, magnetic tape, etc.) of the host system via a network such as the Internet and installed in the personal computer 100.
[0061]
The firmware 20 (F / W) includes a communication unit 30 (COM), a management agent 40 (MNG), a fetch agent 50 (FCH1), a fetch agent 60 (FCH2), and a print task unit 70 (PRT).
[0062]
Here, the communication unit 30 is a processing module that functions as an interface with hardware such as the link device 14.
[0063]
The management agent 40 (first request execution means) is a processing module that manages login, reconnect, logout, reset, and the like. For example, when the initiator requests the target to log in, the management agent 40 first accepts the login request.
[0064]
The fetch agents 50 and 60 (command block agents, second request execution means) are processing modules for executing a request from the initiator, and more specifically, execute commands included in the command block ORB. Unlike the management agent 40 that can handle only a single request, the fetch agents 50 and 60 can also handle a linked list of ORBs fetched by a request from an initiator.
[0065]
The printer disk unit 70 is a processing module for performing DMA transfer with a printer engine or a scanner engine (upper layer device).
[0066]
The fetch agent 50 (third (second) request execution means) is a processing module for command control of the printer engine and scanner engine (upper layer device) in the subsequent stage, and the fetch agent 60 (fourth (second) The request execution means 2) is a processing module for data transfer with a subsequent printer engine or scanner engine.
[0067]
For example, when it is desired to check the remaining ink amount during data transfer with the printer engine, if there is only one fetch agent, the remaining ink amount cannot be checked until all the data transfer by the ORB linked list is completed.
[0068]
In this embodiment, two fetch agents independent of each other are provided (three or more may be used). Then, the priority of processing of the fetch agent 50 for command control is set higher than the priority of processing of the fetch agent 60 for data transfer. More specifically, as will be described later, the received packet passed to the command control fetch agent 50 is processed with priority over the received packet passed to the data transfer fetch agent 60.
[0069]
By doing so, it is possible to interrupt a printer command control process such as an ink remaining amount check during the data transfer process based on the ORB link list. Therefore, it is possible to check the remaining ink amount without waiting for a long time until the data transfer process is completed, and it is possible to control the command of the device without affecting the data transfer.
[0070]
The communication unit 30 includes a packet analysis unit 32, a packet processing unit 34, and a packet discard unit 36.
[0071]
Here, the packet analysis unit 32 analyzes the received packet written in the data buffer 18 from the personal computer 100 via the IEEE 1394 bus, the PHY device 12, and the link device 14. The analyzed received packet is stored in the queue.
[0072]
This queue can be secured on the local memory of the CPU 16, for example. As will be described later, when there are a plurality of queues, the packet analysis unit 32 stores the received packet in a queue corresponding to the analysis result.
[0073]
Then, when the received packet is stored in the queue, the packet analyzing unit 32 analyzes the next received packet. The received packets are repeatedly analyzed and stored in the queue until there are no more received packets on the data buffer 18.
[0074]
The packet processing unit 34 processes the received packet stored in the queue when there is no received packet on the data buffer 18. More specifically, the received packet stored in the queue is transferred to the management agent 40 (MNG), the fetch agent 50 (FCH1), or the fetch agent 60 (FCH2). For example, when there are a plurality of queues such as a queue for MNG, a queue for FCH1, and a queue for FCH2, the received packets stored in the queue for MNG are passed to the management agent 40. The received packets stored in the FCH1 and FCH2 queues are transferred to the fetch agents 50 and 60, respectively.
[0075]
When the received packet processed by the packet processing unit 34 is a packet instructing reset such as agent reset, target reset, reset start, etc., the packet discard unit 36 resets the received packets stored in the queue. The process of discarding the received packet (received packet affected by the reset) that becomes unnecessary due to the above is performed. For example, when there are a plurality of queues, the received packets are discarded together by clearing the queue of the agent to be reset.
[0076]
Further, when a bus reset (a reset that clears node topology information in a broad sense) occurs, the packet discard unit 36 performs a process of discarding a packet received before the bus reset occurs.
[0077]
3. Features of this embodiment
3.1 Discarding unnecessary packets at reset
In SBP-2, when an error occurs in the target, the initiator can transfer a packet for instructing the target to reset (hereinafter referred to as a reset packet). In this case, various resets with different levels are prepared in SBP-2. For example, reset start is the strongest level of reset and all node states are reset. Further, in the abort task or abort task set, the task or task set is reset, and in the target reset, the target is reset. In the agent reset, only the fetch agent is reset.
[0078]
The reset start and agent reset are transmitted to the target by the initiator writing predetermined information to the predetermined register, and the abort task, abort task set, and target reset are performed using the management ORB transferred from the initiator. To be told.
[0079]
As described above, when the reset packet is transferred from the initiator, it is necessary to discard the packet which becomes unnecessary by the reset. In this case, in the comparative example of FIG. 7, the packet processing (processing for passing the received packet to the agent, etc.) is performed immediately after analyzing the received packet (steps T1, T2). Next, it is determined whether or not the received packet is a reset packet. If the received packet is a reset packet, processing for discarding the received packet is performed (steps T3 and T4). The above processing is repeated until there are no received packets (step T5).
[0080]
However, in this comparative example, packet processing is performed even for a received packet that is destined to be discarded by resetting. Therefore, the reset process becomes very inefficient.
[0081]
In particular, when the data transfer control device of this embodiment is incorporated in a peripheral device such as a printer, a scanner, or a CD-RW, an inexpensive CPU with low processing capability is often used due to product cost constraints. The firmware operating on the CPU is also affected by the restrictions, and the processing speed is slowed down. For this reason, the processing of the received packet is not in time, and a large number of unprocessed received packets exist on the data buffer of the own node (target). Therefore, the problem of increasing the reset processing time becomes more serious.
[0082]
Therefore, in this embodiment, as shown by C1 and C2 in FIG. 8, after analyzing the received packet written in the target data buffer, the analyzed received packet is not immediately processed but stored in the queue. Then, as shown in C3, when there are no received packets on the data buffer, the received packets stored in the queue are processed. Then, as shown in C4, when the processed received packet is a reset packet such as an agent reset, the received packet that is unnecessary by the reset (received packet affected by the reset) is discarded.
[0083]
In this way, it is not necessary to perform packet processing on a received packet that becomes unnecessary without performing packet processing by resetting. Therefore, compared with the comparative example of FIG. 7 in which packet processing is performed on all received packets, the time required for reset processing can be greatly shortened. As a result, it is possible to prevent a situation where the processing of the entire system is stalled due to the reset processing, and to reduce the processing load of the firmware.
[0084]
Furthermore, in this embodiment, a plurality of queues for storing received packets are prepared, and the analyzed received packets are sorted and stored in any of the plurality of queues. When a reset occurs, the queue storing received packets that become unnecessary due to the reset is cleared.
[0085]
More specifically, as shown in FIG. 9A, an MNG queue for storing received packets to be passed to the management agent and an FCH queue for storing received packets to be passed to the fetch agent are prepared. Then, as shown in FIGS. 9A and 9B, the received packet is stored in a queue according to the analysis result of the received packet. That is, a packet to be passed to the management agent is stored in the MNG queue, and a packet to be passed to the fetch agent is stored in the FCH queue.
[0086]
Then, as shown in FIG. 9C, for example, when the received packet is found to be an agent reset (when it is found to be a write packet to the agent reset register), the FCH queue is cleared. That is, the received packet stored in the FCH queue is a packet that is passed to the fetch agent, and is a packet that becomes unnecessary when the agent is reset. Therefore, by clearing the agent queue itself, these unnecessary packets can be discarded together.
[0087]
In this way, if received packets are discarded by clearing the queue, unnecessary received packets can be discarded all at once, and the process of discarding received packets can be made more efficient. Thereby, the reset process can be further speeded up.
[0088]
Further, in the present embodiment, when there is a relationship that the second agent is reset when the first agent is reset, the received packet stored in the queue for the first agent is Processing is prioritized over received packets stored in the agent queue.
[0089]
More specifically, as shown in FIG. 10A, when there is an MNG queue for the management agent (first request execution means) and an FCH queue for the fetch agent (second request execution means). Preferentially processes received packets stored in the MNG queue (the fetch agent is in a reset relationship when the management agent is reset). That is, after the packet processing (processing such as passing a packet to the management agent) for all received packets stored in the MNG queue is completed, the packets are stored in the FCH queue as shown in FIG. Start packet processing for received packets.
[0090]
In this way, as shown in FIG. 10C, for example, when there is a packet instructing a reset start in the received packets stored in the MNG queue, both the MNG queue and the FCH queue can be cleared. . As a result, the received packets stored in the FCH queue are discarded, and unnecessary packet processing is not required for these received packets. As a result, the efficiency of the reset process can be further improved, and the reset process can be completed at high speed.
[0091]
In this embodiment, as shown in FIG. 11A, as a fetch agent (second request execution means), a command control fetch agent FCH1 (third request execution means) and a data transfer fetch agent are used. FCH2 (fourth request execution means) is prepared. The received packet to be passed to the command control fetch agent FCH1 is stored in the FHC1 queue, and the received packet to be passed to the data transfer fetch agent FCH2 is stored in the FHC2 queue. Then, as shown in FIG. 11A, the command control received packets stored in the FCH1 queue are preferentially processed, and after the packet processing for all received packets in the FCH1 queue is completed, FIG. As shown in (B), packet processing of the received packet stored in the FCH2 queue is started.
[0092]
In this way, processing by the fetch agent FCH1 is prioritized, and command control processing by the fetch agent FCH1 can be easily interrupted during data transfer processing by the fetch agent FCH2. Accordingly, it is possible to check the remaining ink amount without waiting for the printing to be completed.
[0093]
3.2 Unnecessary packet processing at bus reset
In IEEE 1394, a bus reset occurs when an electronic device is newly connected to the bus or an electronic device is removed from the bus. When a bus reset occurs, the node topology information is cleared, and all transactions that have not been completed when the bus reset occurs are cancelled. For this reason, all the packets received before the bus reset occurs are invalidated.
[0094]
However, as described above, the CPU that operates in the peripheral device in which the data transfer control device is incorporated has low processing capability. For this reason, the firmware operating on the CPU cannot process received packets at high speed, and a large number of unprocessed received packets exist on the data buffer. Therefore, when a bus reset occurs, it is necessary to distinguish and discard a packet before the bus reset from among these many unprocessed received packets. Therefore, the processing load on the firmware becomes excessive.
[0095]
Therefore, in this embodiment, as shown in FIG. 12A, after analyzing the received packet written in the target data buffer, the analyzed received packet is stored in the queue without being immediately processed. Then, when there are no received packets on the data buffer, the received packets stored in the queue are processed. When a bus reset occurs, the packet received before the bus reset occurs is discarded.
[0096]
More specifically, as shown in FIG. 12B, when a bus reset occurs on the IEEE 1394 bus while the received packet is stored in the queue, the received packet queue is cleared and the bus reset is performed. The received packet before the occurrence is discarded (in this case, it is desirable to discard the received packet on the data buffer). Also, as shown in FIG. 12C, after all received packets are stored in the queue, even when a bus reset occurs during the processing of the received packets, the received packet queue is cleared and the received packets are cleared. Is discarded.
[0097]
By doing so, it is not necessary to perform packet processing on received packets that become unnecessary without performing packet processing due to the bus reset. Therefore, the time required for the bus reset process can be greatly shortened compared to the comparative example of FIG. 7 in which packet processing is performed on all received packets. As a result, it is possible to prevent a situation where the processing of the entire system is stalled due to the bus reset processing, and to reduce the processing load of the firmware.
[0098]
Also, if the received packets are discarded by clearing the queue, a large number of received packets before the occurrence of the bus reset can be discarded together, so that the process of discarding the received packets can be made more efficient. In particular, when a large number of unprocessed received packets exist in the data buffer due to the low processing capability of the CPU, the method of this embodiment for discarding the received packets by clearing the queue is It is very effective for improving the efficiency of the system.
[0099]
4). Processing of this embodiment
Next, a detailed processing example of this embodiment will be described using the flowcharts of FIGS.
[0100]
When an interrupt from the CPU (or link device) occurs, the interrupt factor is analyzed, and the analyzed interrupt factor is cleared (step S1). The interrupt factors include a packet reception interrupt, a bus reset generation interrupt, a DMA transfer end interrupt to the printer, and a CPU timer interrupt.
[0101]
Next, it is determined whether or not the analyzed interrupt factor is a packet reception interrupt (step S2). If it is not a packet reception interrupt, it is determined whether or not a bus reset interrupt occurs (step S3). . If it is a bus reset interrupt, all of the agent queue and the transmission queue are cleared (step S4, see FIGS. 12B and 12C), and the received packet before the bus reset occurs is discarded. .
[0102]
Next, it is determined whether or not there is an interrupt factor from the CPU (step S5). If there is an interrupt factor, the interrupt factor is analyzed, and the analyzed interrupt factor is cleared (step S6). Next, it is determined whether or not there is an unprocessed interrupt factor that has not been analyzed (step S7). If it exists, the process returns to step S2, and if not, the interrupt process is terminated.
[0103]
If it is determined in step S2 that a packet reception interrupt has occurred, it is determined whether or not the received packet is an initiator response packet to the request packet transferred by itself (step S8 in FIG. 14). If the packet is a response packet, processing related to the response packet (pointer control of the storage location of the response packet in the data buffer, etc.) is performed (step S9).
[0104]
Next, based on the packet analysis result, it is determined whether the received packet is a packet to be passed to the agent (step S10). If the packet is to be passed to the agent, the received packet is stored in the queue of the corresponding agent as described in FIGS. 9A and 9B (step S11). For example, a received packet to be passed to the management agent is stored in the MNG queue, and a received packet to be passed to the fetch agent is stored in the FCH queue.
[0105]
Next, it is determined whether a bus reset has occurred (step S12). If a bus reset has occurred, all the agent queues and the transmission queue are cleared as described with reference to FIG. 12B (step S22). On the other hand, if it does not occur, it is determined whether or not the received packet to be stored in the queue still exists on the data buffer (step S13), and if it exists, the process returns to step S11. Then, the processes in steps S11, S12, and S13 are repeated until there are no received packets on the data buffer.
[0106]
Next, after storing the received packet in the queue, it is determined whether or not a bus reset has occurred (step S14). If it has occurred, as described in FIG. 12C, all of the agent queue and the transmission queue are cleared (step S22). On the other hand, if it does not occur, as shown in C3 of FIG. 8, it is determined whether or not there is a process for the received packet stored in the queue (such as a process to be passed to the agent) (step S15). If there is a process, as described with reference to FIG. 10A, the process is performed from an agent queue (for example, MNG queue) having a high priority (step S16).
[0107]
Next, it is determined whether the received packet is a reset packet (a packet for instructing reset) (step S17). For example, in the case of target reset, the agent can determine whether it is a reset packet by analyzing the contents of the ORB. In the case of agent reset or reset start, the agent can determine whether or not the packet is a reset packet by analyzing the write address of the packet.
[0108]
If the received packet is a reset packet, the agent queue affected by the reset is cleared as described with reference to FIGS. 9C and 10C (step S18). For example, when the management agent is reset, both the MNG queue and the FCH queue are cleared. On the other hand, when the fetch agent is reset, only the FCH queue is cleared.
[0109]
Next, it is determined whether there is a vacancy in the transmission buffer on the data buffer and there is a transmission request (step S19). If it exists, packet transmission is performed (step S20). Next, it is determined whether or not a bus reset has occurred (step S21). If so, all of the agent queue and the transmission queue are cleared (step S22). On the other hand, if not, the process returns to step S3 in FIG.
[0110]
Then, the processes of steps S3 to S7, S2, and S8 to S21 are repeated to sequentially process the received packets stored in the queue one by one. That is, first, received packets stored in the highest priority queue (for example, MNG queue) are sequentially processed one by one, and when processing for all received packets is completed, the second priority Process the received packets stored in the queue with higher (for example, FCH1 queue). When processing of all received packets in the queue is completed, the received packets stored in the third highest priority queue (for example, FCH2 queue) are processed. As described above, processing is performed on all received packets stored in the queue.
[0111]
5. Electronics
Next, an example of an electronic device including the data transfer control device of this embodiment will be described.
[0112]
For example, FIG. 15A shows an internal block diagram of a printer which is one of electronic devices, and FIG. 16A shows an external view thereof. A CPU (microcomputer) 510 controls the entire system. An operation unit 511 is used by a user to operate the printer. The ROM 516 stores control programs, fonts, and the like, and the RAM 518 functions as a work area for the CPU 510. A display panel 519 is for informing the user of the operation state of the printer.
[0113]
Print data sent from a partner node such as a personal computer via the PHY device 502 and the data transfer control device 500 is sent directly to the print processing unit (printer engine) 512 via the bus 504. The print data is subjected to given processing by the print processing unit 512, and is printed on paper by a print unit (device for outputting data) 514 including a print header and the like.
[0114]
FIG. 15B shows an internal block diagram of a scanner which is one of electronic devices, and FIG. 16B shows an external view thereof. The CPU 520 controls the entire system. The operation unit 521 is for the user to operate the scanner. The ROM 526 stores control programs and the like, and the RAM 528 functions as a work area for the CPU 520.
[0115]
An image of a document is read by an image reading unit (device for capturing data) 522 including a light source, a photoelectric converter, and the like, and the read image data is processed by an image processing unit (scanner engine) 524. Then, the processed image data is sent directly to the data transfer control device 500 via the bus 505. The data transfer control device 500 generates a packet by adding a header or the like to the image data, and transmits the packet to a counterpart node such as a personal computer via the PHY device 502.
[0116]
FIG. 15C shows an internal block diagram of a CD-RW drive which is one of electronic devices, and FIG. 16C shows an external view thereof. The CPU 530 controls the entire system. The operation unit 531 is for the user to operate the CD-RW. The ROM 536 stores control programs and the like, and the RAM 538 functions as a work area for the CPU 530.
[0117]
Data read from the CD-RW 532 by the reading & writing unit (device for capturing data or device for storing data) 533 including a laser, a motor, an optical system, etc. is input to the signal processing unit 534 and an error occurs. A given signal process such as a correction process is performed. Then, the data subjected to signal processing is directly sent to the data transfer control device 500 via the bus 506. The data transfer control device 500 generates a packet by adding a header or the like to this data, and transmits the packet to a counterpart node such as a personal computer via the PHY device 502.
[0118]
On the other hand, the data sent from the counterpart node via the PHY device 502 and the data transfer control device 500 is sent directly to the signal processing unit 534 via the bus 506. Then, given signal processing is performed on this data by the signal processing unit 534, and the data is stored in the CD-RW 532 by the reading & writing unit 533.
[0119]
15A, 15B, and 15C, in addition to the CPUs 510, 520, and 530, a CPU for data transfer control in the data transfer control device 500 may be provided separately.
[0120]
15A, 15B, and 15C, the RAM 501 (corresponding to the data buffer) is provided outside the data transfer control device 500, but the RAM 501 may be built in the data transfer control device 500. Good.
[0121]
If the data transfer control device of this embodiment is used in an electronic device, even if an error occurs in the data transfer control device or the electronic device and the data transfer control device is reset, the normal state can be restored in a short time. It becomes like this. In addition, even when a new electronic device is connected to the bus and a bus reset occurs, it is possible to recover from the bus reset state in a short time and to prevent a situation where the entire system is stalled.
[0122]
Further, if the data transfer control device of this embodiment is used in an electronic device, high-speed data transfer can be performed. Therefore, when the user gives a printout instruction using a personal computer or the like, printing can be completed with a small time lag. In addition, the user can view the read image with a small time lag after the image capture instruction to the scanner. In addition, data can be read from the CD-RW and data can be written to the CD-RW at high speed.
[0123]
Further, by using the data transfer control device of this embodiment in an electronic device, the processing load of firmware operating on the CPU can be reduced, and an inexpensive CPU or a low-speed bus can be used. Furthermore, since the cost and scale of the data transfer control device can be reduced, the cost and scale of the electronic device can be reduced.
[0124]
In addition to the above, the electronic apparatus to which the data transfer control device of this embodiment can be applied includes, for example, various optical disk drives (CD-ROM, DVD), magneto-optical disk drives (MO), hard disk drives, TVs, VTRs, Various things, such as a video camera, an audio equipment, a telephone, a projector, a personal computer, an electronic notebook, a word processor, can be considered.
[0125]
In addition, this invention is not limited to this embodiment, A various deformation | transformation implementation is possible within the range of the summary of this invention.
[0126]
For example, the configuration of the data transfer control device of the present invention is particularly preferably the configuration shown in FIG. 6, but is not limited thereto.
[0127]
Further, the method described in the present embodiment is also preferable as a method for discarding received packets, but is not limited to this.
[0128]
In the present embodiment, the case where two or three queues are provided has been described. However, four or more queues may be provided.
[0129]
The present invention is particularly preferably applied to data transfer according to the IEEE 1394 standard, but is not limited to this. For example, the present invention can also be applied to data transfer in a standard based on the same idea as IEEE 1394 or a standard developed from IEEE 1394.
[Brief description of the drawings]
FIG. 1 is a diagram showing a layer structure of IEEE1394.
FIG. 2 is a diagram for explaining SBP-2.
FIG. 3 is a diagram for explaining an outline of SBP-2 data transfer processing;
FIG. 4 is a diagram for explaining command processing when data is transferred from an initiator to a target.
FIG. 5 is a diagram for explaining command processing when data is transferred from a target to an initiator;
FIG. 6 is a diagram illustrating a configuration example of a data transfer control device according to the present embodiment.
FIG. 7 is a flowchart for explaining processing of a comparative example.
FIG. 8 is a diagram for explaining a technique of the present embodiment at the time of resetting.
FIGS. 9A, 9B, and 9C are diagrams for explaining a method of discarding unnecessary packets by preparing a plurality of queues and clearing the queues.
FIGS. 10A, 10B, and 10C are diagrams for explaining a method for preferentially processing a queue having a high priority. FIG.
FIGS. 11A and 11B are diagrams for explaining a technique for preferentially processing a queue of a fetch agent for command control.
FIGS. 12A, 12B, and 12C are diagrams for explaining the method of the present embodiment at the time of bus reset.
FIG. 13 is a flowchart illustrating a detailed processing example of the present embodiment.
FIG. 14 is a flowchart illustrating a detailed processing example of the present embodiment.
FIGS. 15A, 15B, and 15C are examples of internal block diagrams of various electronic devices.
16A, 16B, and 16C are examples of external views of various electronic devices.
[Explanation of symbols]
10 Data transfer control device
12 PHY devices
14 Link device
16 CPU
18 Data buffer
20 Firmware (F / W)
30 Communication Department (COM)
32 Packet analyzer
34 Packet processor
36 Packet discard unit
40 Management Agent (MNG, first request execution means)
50 fetch agent (FCH1, third (second) request execution means)
60 Fetch agent (FCH2. Fourth (second) request execution means)
70 Print Task (PRT)
100 Personal computer
102 Device driver
104 Data buffer
110 Information storage medium

Claims (11)

バスに接続される複数のノード間でのデータ転送のためのデータ転送制御装置であって、
自ノードのデータバッファに書き込まれた受信パケットを解析し、解析した受信パケットをキューに格納し、データバッファ上の受信パケットが無くなるまで受信パケットの解析及びキューへの格納を繰り返すパケット解析手段と、
データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットを処理するパケット処理手段と、
処理した受信パケットがリセットを指示するパケットであった場合には、キューに格納された受信パケットのうち前記リセットにより不要になる受信パケットを破棄するパケット破棄手段とを含み、
前記キューとして複数のキューが用意され、
前記パケット解析手段が、
解析した受信パケットを前記複数のキューの中のいずれかのキューに格納し、
前記パケット破棄手段が、
処理した受信パケットがリセットを指示するパケットであった場合には、リセットにより不要になる受信パケットが格納されているキューをクリアすることを特徴とするデータ転送制御装置。
A data transfer control device for transferring data between a plurality of nodes connected to a bus,
A packet analysis means for analyzing the received packet written in the data buffer of its own node, storing the analyzed received packet in a queue, repeating the analysis of the received packet and storing in the queue until there is no received packet on the data buffer;
A packet processing means for processing the received packet stored in the queue when there is no received packet on the data buffer;
When the processed received packet is a packet instructing resetting, packet discarding means for discarding a received packet that is unnecessary due to the reset among the received packets stored in the queue ,
A plurality of queues are prepared as the queue,
The packet analysis means
The analyzed received packet is stored in one of the plurality of queues,
The packet discarding means,
A data transfer control device , wherein when a processed received packet is a packet instructing resetting, a queue storing received packets that become unnecessary by resetting is cleared .
請求項1において、
前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行する第1の要求実行手段と、
前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行すると共に、前記第1の要求実行手段がリセットされると自身もリセットされる関係にある第2の要求実行手段とを含み、
前記パケット解析手段が、
前記第1の要求実行手段に渡すべき受信パケットについては第1のキューに格納し、前記第2の要求実行手段に渡すべき受信パケットについては第2のキューに格納し、
前記パケット処理手段が、
前記第1のキューに格納されている受信パケットを、前記第2のキューに格納されている受信パケットよりも優先して処理することを特徴とするデータ転送制御装置。
In claim 1,
First request execution means for receiving a received packet from the packet processing means and executing a request from another node;
Receiving a received packet from the packet processing means, executing a request from another node, and a second request executing means having a relationship of resetting itself when the first request executing means is reset ,
The packet analysis means is
The received packet to be passed to the first request execution means is stored in the first queue, the received packet to be passed to the second request execution means is stored in the second queue,
The packet processing means is
A data transfer control device that processes a received packet stored in the first queue in preference to a received packet stored in the second queue.
バスに接続される複数のノード間でのデータ転送のためのデータ転送制御装置であって、
自ノードのデータバッファに書き込まれた受信パケットを解析し、解析した受信パケットをキューに格納し、データバッファ上の受信パケットが無くなるまで受信パケットの解析及びキューへの格納を繰り返すパケット解析手段と、
データバッファ上の受信パケットが無くなったところで、キューに格納された受信パケットを処理するパケット処理手段と、
処理した受信パケットがリセットを指示するパケットであった場合には、キューに格納された受信パケットのうち前記リセットにより不要になる受信パケットを破棄するパケット破棄手段と
前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行する第1の要求実行手段と、
前記パケット処理手段から受信パケットを受け、他のノードからの要求を実行すると共に、前記第1の要求実行手段がリセットされると自身もリセットされる関係にある第2の要求実行手段とを含み、
前記パケット解析手段が、
前記第1の要求実行手段に渡すべき受信パケットについては第1のキューに格納し、前記第2の要求実行手段に渡すべき受信パケットについては第2のキューに格納し、
前記パケット処理手段が、
前記第1のキューに格納されている受信パケットを、前記第2のキューに格納されてい る受信パケットよりも優先して処理することを特徴とするデータ転送制御装置。
A data transfer control device for transferring data between a plurality of nodes connected to a bus,
A packet analysis means for analyzing the received packet written in the data buffer of its own node, storing the analyzed received packet in a queue, repeating the analysis of the received packet and storing in the queue until there is no received packet on the data buffer;
A packet processing means for processing the received packet stored in the queue when the received packet on the data buffer is exhausted;
When the processed received packet is a packet for instructing resetting, a packet discarding unit for discarding a received packet that is unnecessary due to the reset among the received packets stored in the queue ;
First request execution means for receiving a received packet from the packet processing means and executing a request from another node;
Receiving a received packet from the packet processing means, executing a request from another node, and a second request executing means having a relationship of resetting itself when the first request executing means is reset ,
The packet analysis means comprises:
The received packet to be passed to the first request execution means is stored in the first queue, the received packet to be passed to the second request execution means is stored in the second queue,
The packet processing means is
Wherein the received packet stored in the first queue, the data transfer control device which comprises treating in preference to the received packet that is stored in the second queue.
請求項2又は3において、
前記パケット破棄手段が、
処理した受信パケットが前記第1の要求実行手段のリセットを指示するパケットであった場合には、前記第1、第2のキューの両方をクリアすることを特徴とするデータ転送制御装置。
In claim 2 or 3,
The packet discarding means,
A data transfer control device characterized by clearing both the first and second queues when the processed received packet is a packet for instructing reset of the first request execution means.
請求項2乃至4のいずれかにおいて、
前記第2の要求実行手段が、
上層のデバイスのコマンド制御要求を実行する第3の要求実行手段と、データ転送要求を実行する第4の要求実行手段とを含み、
前記パケット解析手段が、
前記第3の要求実行手段に渡すべき受信パケットについては第3のキューに格納し、前記第4の要求実行手段に渡すべき受信パケットについては第4のキューに格納し、
前記パケット処理手段が、
前記第3のキューに格納されている受信パケットを、前記第4のキューに格納されている受信パケットよりも優先して処理することを特徴とするデータ転送制御装置。
In any of claims 2 to 4 ,
The second request execution means is
A third request execution means for executing a command control request for an upper layer device; and a fourth request execution means for executing a data transfer request;
The packet analysis means comprises:
The received packet to be passed to the third request execution means is stored in a third queue, the received packet to be passed to the fourth request execution means is stored in a fourth queue,
The packet processing means is
The data transfer control device, wherein the received packet stored in the third queue is processed in preference to the received packet stored in the fourth queue.
バスに接続される複数のノード間でのデータ転送のためのデータ転送制御装置であって、
自ノードのデータバッファに書き込まれた受信パケットを解析し、解析した受信パケットをキューに格納し、データバッファ上の受信パケットが無くなるまで受信パケットの解析及びキューへの格納を繰り返すパケット解析手段と、
データバッファ上の受信パケットが無くなったところでキューに格納された受信パケットを処理するパケット処理手段と、
ノードのトポロジ情報をクリアするリセットが発生した場合には、前記リセットの発生前の受信パケットを破棄するパケット破棄手段とを含み、
前記パケット破棄手段が、
受信パケットがキューに格納される毎に前記リセットが発生したか否かを判断し、前記リセットが発生したと判断した場合には、前記リセット発生前の受信パケットが格納されているキューをクリアすることで、前記リセット発生前の受信パケットを破棄することを特徴とするデータ転送制御装置。
A data transfer control device for transferring data between a plurality of nodes connected to a bus,
A packet analysis means for analyzing the received packet written in the data buffer of its own node, storing the analyzed received packet in a queue, repeating the analysis of the received packet and storing in the queue until there is no received packet on the data buffer;
A packet processing means for processing the received packet stored in the queue when the received packet on the data buffer runs out;
When the reset that clears node topology information has occurred, see contains a discarding packet discarding means for receiving packets before the occurrence of the reset,
The packet discarding means,
Each time a received packet is stored in the queue, it is determined whether the reset has occurred. If it is determined that the reset has occurred, the queue storing the received packet before the reset is cleared. Thus , the data transfer control device , wherein the received packet before the occurrence of the reset is discarded .
請求項6において、
前記パケット破棄手段が、
ノードのトポロジ情報をクリアするリセットが発生した場合には、受信パケットが格納されているキューをクリアすることを特徴とするデータ転送制御装置。
In claim 6,
The packet discarding means,
A data transfer control device characterized by clearing a queue storing received packets when a reset for clearing topology information of a node occurs.
請求項6又は7において、
ノードのトポロジ情報をクリアする前記リセットが、IEEE1394の規格において定義されるバスリセットであることを特徴とするデータ転送制御装置。
In claim 6 or 7,
A data transfer control device, wherein the reset for clearing the topology information of a node is a bus reset defined in the IEEE 1394 standard.
請求項1乃至8のいずれかにおいて、
IEEE1394の規格に準拠したデータ転送を行うことを特徴とするデータ転送制御装置。
In any one of Claims 1 thru | or 8.
A data transfer control device that performs data transfer conforming to the IEEE 1394 standard.
請求項1乃至9のいずれかのデータ転送制御装置と、
前記データ転送制御装置及びバスを介して相手ノードから受信したデータに所与の処理を施す装置と、
処理が施されたデータを出力又は記憶するための装置とを含むことを特徴とする電子機器。
A data transfer control device according to any one of claims 1 to 9,
A device that performs a given process on data received from a partner node via the data transfer control device and the bus; and
And an apparatus for outputting or storing processed data.
請求項1乃至9のいずれかのデータ転送制御装置と、
前記データ転送制御装置及びバスを介して相手ノードに転送するデータに所与の処理を施す装置と、
処理が施されるデータを取り込むための装置とを含むことを特徴とする電子機器。
A data transfer control device according to any one of claims 1 to 9,
A device that performs a given process on the data transfer control device and data transferred to the counterpart node via the bus;
And an apparatus for capturing data to be processed.
JP37050199A 1999-12-27 1999-12-27 Data transfer control device and electronic device Expired - Fee Related JP3606145B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP37050199A JP3606145B2 (en) 1999-12-27 1999-12-27 Data transfer control device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP37050199A JP3606145B2 (en) 1999-12-27 1999-12-27 Data transfer control device and electronic device

Publications (2)

Publication Number Publication Date
JP2001186146A JP2001186146A (en) 2001-07-06
JP3606145B2 true JP3606145B2 (en) 2005-01-05

Family

ID=18497077

Family Applications (1)

Application Number Title Priority Date Filing Date
JP37050199A Expired - Fee Related JP3606145B2 (en) 1999-12-27 1999-12-27 Data transfer control device and electronic device

Country Status (1)

Country Link
JP (1) JP3606145B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3671925B2 (en) 2002-03-20 2005-07-13 セイコーエプソン株式会社 Data transfer control device, electronic device, and data transfer control method
WO2013062602A1 (en) 2011-10-26 2013-05-02 Intel Coproration Multi-touch interface schemes

Also Published As

Publication number Publication date
JP2001186146A (en) 2001-07-06

Similar Documents

Publication Publication Date Title
JP3843667B2 (en) Data transfer control device and electronic device
JP3608441B2 (en) Data transfer control device and electronic device
JP3584789B2 (en) Data transfer control device and electronic equipment
JP3598923B2 (en) Data transfer control device, information storage medium, and electronic device
US6937355B1 (en) Data communications apparatus for resuming data transfer after interruption
JP4627456B2 (en) Communication system, cycle master node and communication method
EP1033658B1 (en) Communication apparatus with means for allocating alternate designation information to each function unit, and communication system with two such communication apparatus
JP3539287B2 (en) Data transfer control device and electronic equipment
JP3494041B2 (en) Data transfer control device and electronic equipment
JP3606145B2 (en) Data transfer control device and electronic device
US6457072B1 (en) System and method for effectively performing physical direct memory access operations
EP1351459B1 (en) Data transfer control device and electronic equipment
JP3494042B2 (en) Data transfer control device and electronic equipment
JP3624767B2 (en) Data transfer control device, information storage medium, and electronic device
JP3598924B2 (en) Data transfer control device, information storage medium, and electronic device
JP3598922B2 (en) Data transfer control device, information storage medium, and electronic device
JP2003244277A (en) Data transfer method and system by protocol conversion, and program
JP3610982B2 (en) Data transfer control device and electronic device

Legal Events

Date Code Title Description
A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20040312

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20040409

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040622

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040820

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040914

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040927

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081015

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091015

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101015

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101015

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111015

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121015

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121015

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131015

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees