JP2011198314A - Data receiver and program - Google Patents

Data receiver and program Download PDF

Info

Publication number
JP2011198314A
JP2011198314A JP2010067227A JP2010067227A JP2011198314A JP 2011198314 A JP2011198314 A JP 2011198314A JP 2010067227 A JP2010067227 A JP 2010067227A JP 2010067227 A JP2010067227 A JP 2010067227A JP 2011198314 A JP2011198314 A JP 2011198314A
Authority
JP
Japan
Prior art keywords
memory
packet data
data
size
buffer
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.)
Pending
Application number
JP2010067227A
Other languages
Japanese (ja)
Inventor
Hiroshi Okubo
宏 大久保
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP2010067227A priority Critical patent/JP2011198314A/en
Publication of JP2011198314A publication Critical patent/JP2011198314A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a data receiving apparatus including a control device that recognizes reception of packet data without polling.SOLUTION: A target device 30 includes a plurality of buffers 321, 322, 323 for storing packet data transmitted from a host device 10 through a data communication channel. The data receiving apparatus includes: a USB target controller 33 for receiving packet data transmitted from the host device 10; the buffer 321 which stores packet data first among the plurality of buffers when transmission of packet data from the host device 10 is started, in which the maximum size of packet data transferred from the host device 10 is an effective memory size to store the packet data; and a control part 36 for informing a CPU 31 for controlling the target device 30 about reception of the packet data when the packet data is stored in the buffer 321 and the effective memory size of the buffer 321 is satisfied.

Description

本発明は、データ受信装置及びプログラムに関する。   The present invention relates to a data receiving apparatus and a program.

装置間における通信は、一般に、何らかの規格に基づいて行われる。例えば、シリアル通信においては、IEEE(Institute of Electrical and Electronic Engineers)1394やUSB( Universal Serial Bus)が広く用いられている。IEEE1394は、100Mbps、200Mbps、400Mbpsの転送速度が定められた規格である。また、USBは、USB1.1で採用された最大12Mbpsの転送速度を持つFS(フルスピードモード)や、USB2.0で追加された最大480Mbpsの転送速度を持つHS(ハイスピード)モードなどが定められた規格である。   Communication between apparatuses is generally performed based on some standard. For example, in serial communication, IEEE (Institute of Electrical and Electronic Engineers) 1394 and USB (Universal Serial Bus) are widely used. IEEE 1394 is a standard in which transfer rates of 100 Mbps, 200 Mbps, and 400 Mbps are defined. In addition, USB is defined by FS (full speed mode) having a transfer speed of up to 12 Mbps adopted in USB 1.1, HS (high speed) mode having a transfer speed of up to 480 Mbps added by USB 2.0, and the like. Standard.

特許文献1は、画像形成装置のデータ転送方法であって、メモリにパケットが格納されているかを第1の監視時間ごとに監視する第1の監視段階と、監視の結果、メモリにパケットが格納されていれば第1の監視時間よりも短い第2の監視時間ごとにメモリへのパケットの格納を監視する第2監視段階とを備えている。   Patent Document 1 is a data transfer method of an image forming apparatus, in which a first monitoring stage for monitoring whether a packet is stored in a memory every first monitoring time, and as a result of monitoring, a packet is stored in a memory. If this is the case, a second monitoring stage for monitoring the storage of the packet in the memory every second monitoring time shorter than the first monitoring time is provided.

特許公報第3857598号Japanese Patent Publication No. 3857598

本発明は、ポーリングを使用せずにパケットデータの受信を制御装置に認識させることができるデータ受信装置及びプログラムを提供することを目的とする。   An object of the present invention is to provide a data receiving apparatus and a program that allow a control apparatus to recognize reception of packet data without using polling.

かかる目的を達成するために請求項1記載の発明は、データ通信路を介して外部装置から送信されたパケットデータを格納する複数のメモリを備えるデータ受信装置であって、前記データ通信路を介して前記外部装置から送信されるパケットデータを受信する受信手段と、前記外部装置から転送されるパケットデータの最大転送サイズを、パケットデータを格納可能な有効メモリサイズとし、前記外部装置からのパケットデータの送信が開始されると、前記複数のメモリにおいて最初にパケットデータを格納する第1メモリと、前記第1メモリにパケットデータが格納され、前記第1メモリの有効メモリサイズを満たした場合に、前記データ受信装置を制御する制御装置に、パケットデータの受信を通知する通知手段とを備える。   In order to achieve such an object, the invention described in claim 1 is a data receiving device comprising a plurality of memories for storing packet data transmitted from an external device via a data communication path, wherein the data communication path is provided via the data communication path. Receiving means for receiving packet data transmitted from the external device, and the maximum transfer size of the packet data transferred from the external device is an effective memory size capable of storing packet data, and the packet data from the external device When the transmission of the first memory, the first memory for storing the packet data first in the plurality of memories, and when the packet data is stored in the first memory and the effective memory size of the first memory is satisfied, Notification means for notifying reception of packet data to a control device that controls the data receiving device.

請求項2記載の発明は、請求項1記載の発明において、前記複数のメモリは、前記第1メモリと、前記外部装置から順次送信される、前記第1メモリに格納されたパケットデータに後続するパケットデータを順次格納する、前記最大転送サイズの整数倍をパケットデータを格納可能な有効メモリサイズとする複数の後続メモリとを備え、前記複数の後続メモリのいずれかにパケットデータの格納が開始されてから、該メモリの有効メモリサイズを満たすパケットデータが格納されるまでの待ち時間を設定する待ち時間設定手段を有し、前記通知手段は、前記複数の後続メモリのうちのいずれかのメモリにパケットデータの格納が開始されてから、前記待ち時間を経過しても前記メモリの有効メモリサイズを満たすパケットデータが前記メモリに格納されない場合に、前記制御装置に、前記外部装置からのパケットデータの受信完了を通知するとよい。   According to a second aspect of the invention, in the first aspect of the invention, the plurality of memories follow the first memory and packet data stored in the first memory, which is sequentially transmitted from the external device. A plurality of subsequent memories that sequentially store packet data and have an effective memory size capable of storing packet data that is an integer multiple of the maximum transfer size, and storage of packet data is started in any of the plurality of subsequent memories Wait time setting means for setting a wait time until packet data satisfying the effective memory size of the memory is stored, and the notification means is stored in any one of the plurality of subsequent memories. Packet data that satisfies the effective memory size of the memory even after the waiting time has elapsed since the start of packet data storage is stored in the memory. If not stored, the control device may notify the reception completion of the packet data from the external device.

請求項3記載の発明は、請求項1記載の発明において、前記後続メモリは、第2メモリと第3メモリとを備え、前記第2メモリのパケットデータを格納可能な有効メモリサイズは、前記第3メモリの有効メモリサイズから前記第1メモリの有効メモリサイズを差し引いたメモリサイズを備えるとよい。   The invention according to claim 3 is the invention according to claim 1, wherein the subsequent memory includes a second memory and a third memory, and an effective memory size capable of storing packet data of the second memory is the first memory. A memory size obtained by subtracting the effective memory size of the first memory from the effective memory size of 3 memories may be provided.

請求項4記載の発明は、請求項3記載の発明において、前記第1メモリと前記第2メモリとの有効メモリサイズを変更する有効メモリサイズ変更手段を備え、前記有効メモリサイズ変更手段は、前記第1メモリと前記第2メモリとのそれぞれに、各メモリの有効メモリサイズを満たすパケットデータが格納され、前記制御装置によって、格納されたパケットデータが後段側の処理部へ転送された後に、前記第1メモリと前記第2メモリとの有効メモリサイズを、前記第3メモリの有効メモリサイズに変更して、前記第3メモリに、該第3メモリの有効メモリサイズを満たすパケットデータが格納された後に、後続するパケットデータを前記第1メモリと前記第2メモリとに順次格納させるとよい。   The invention according to claim 4 is the invention according to claim 3, further comprising effective memory size changing means for changing an effective memory size of the first memory and the second memory, wherein the effective memory size changing means is Packet data satisfying the effective memory size of each memory is stored in each of the first memory and the second memory, and after the stored packet data is transferred to the processing unit on the subsequent stage by the control device, The effective memory size of the first memory and the second memory is changed to the effective memory size of the third memory, and packet data satisfying the effective memory size of the third memory is stored in the third memory. Later, subsequent packet data may be sequentially stored in the first memory and the second memory.

請求項5記載の発明は、データ通信路を介して外部装置から送信されたパケットデータを格納する複数のメモリを備えるデータ受信装置のデータ受信プログラムであって、コンピュータに、前記データ通信路を介して前記外部装置から送信されるパケットデータを受信手段で受信するステップと、前記外部装置からのパケットデータの送信が開始されると、前記外部装置から転送されるパケットデータの最大転送サイズを、パケットデータを格納可能な有効メモリサイズとする第1メモリに、前記複数のメモリにおいて最初にパケットデータを格納させるステップと、前記第1メモリにパケットデータが格納され、前記第1メモリの有効メモリサイズを満たした場合に、前記データ受信装置を制御する制御装置に、パケットデータの受信を通知するステップとを実行させることを特徴としている。   The invention according to claim 5 is a data reception program of a data reception device including a plurality of memories for storing packet data transmitted from an external device via a data communication path, and the computer receives the data communication path via the data communication path. Receiving the packet data transmitted from the external device by the receiving means, and when transmission of the packet data from the external device is started, the maximum transfer size of the packet data transferred from the external device is set to the packet A step of first storing packet data in the plurality of memories in a first memory having an effective memory size capable of storing data; the packet data being stored in the first memory; and an effective memory size of the first memory being When the condition is satisfied, the packet data reception is transmitted to the control device that controls the data reception device. It is characterized by and a step of.

請求項1記載の発明によれば、ポーリングを使用せずにパケットデータの受信を制御装置に認識させることができる。   According to the first aspect of the present invention, it is possible to make the control device recognize the reception of packet data without using polling.

請求項2記載の発明によれば、パケットデータの受信完了を判定し、制御装置にパケットデータの受信完了を通知することができる。   According to the second aspect of the present invention, it is possible to determine completion of reception of packet data and notify the control device of completion of reception of packet data.

請求項3記載の発明によれば、後段側の処理部に送るパケットデータのデータサイズを第3メモリの有効メモリサイズに合わせることができる。   According to the third aspect of the present invention, the data size of the packet data sent to the processing unit on the subsequent stage can be matched with the effective memory size of the third memory.

請求項4記載の発明によれば、第1メモリと第2メモリとに一度パケットデータが格納された後は、第1メモリと第2メモリの有効メモリサイズを第3メモリの有効メモリサイズに合わせることができる。   According to the fourth aspect of the present invention, after the packet data is once stored in the first memory and the second memory, the effective memory sizes of the first memory and the second memory are matched with the effective memory size of the third memory. be able to.

請求項5記載の発明によれば、ポーリングを使用せずにパケットデータの受信を制御装置に認識させることができる。   According to the fifth aspect of the present invention, it is possible to make the control device recognize the reception of the packet data without using polling.

USB通信システムのハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of a USB communication system. USB通信システムのソフトウェアとハードウェアの階層を示す図である。It is a figure which shows the hierarchy of the software and hardware of a USB communication system. バルクアウト転送において送受信されるパケットを説明するための図である。It is a figure for demonstrating the packet transmitted / received in bulk-out transfer. バルクアウト転送において送受信されるパケットを説明するための図である。It is a figure for demonstrating the packet transmitted / received in bulk-out transfer. ターゲットデバイス内部におけるデータ転送について説明するための図である。It is a figure for demonstrating the data transfer inside a target device. カーネル領域のバッファに関する処理の流れを示す図である。It is a figure which shows the flow of the process regarding the buffer of a kernel area | region. IOリクエスト構造体の構造を示す図である。It is a figure which shows the structure of IO request structure. IOリクエストとIOリクエスト待ちキューについて説明するための図である。It is a figure for demonstrating an IO request and IO request waiting queue. IOリクエストとIOリクエスト完了キューについて説明するための図である。It is a figure for demonstrating an IO request and an IO request completion queue. カーネル領域のバッファ設定処理を示すフローチャートである。It is a flowchart which shows the buffer setting process of a kernel area | region.

以下、添付図面を参照しながら本発明の好適な実施例を説明する。   Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings.

まず、図1を参照しながら本発明をUSB通信システムに適用した実施例の構成を説明する。USB通信システムは、USBのホスト装置(例えば、パーソナルコンピュータ)10と、ターゲットデバイス(例えば、画像形成装置)30とがUSBケーブル20で接続された構成を備える。   First, the configuration of an embodiment in which the present invention is applied to a USB communication system will be described with reference to FIG. The USB communication system has a configuration in which a USB host device (for example, a personal computer) 10 and a target device (for example, an image forming apparatus) 30 are connected by a USB cable 20.

ホスト装置10は、汎用的なコンピュータであり、例えば、所有者によって携帯されるノート型PCを一例として挙げることができる。ホスト装置10には、内部通信路としてのバスを介して、CPU(中央処理装置)11、メモリ12、USBホストコントローラ13が接続されている。   The host device 10 is a general-purpose computer. For example, a notebook PC carried by the owner can be cited as an example. A CPU (central processing unit) 11, a memory 12, and a USB host controller 13 are connected to the host device 10 via a bus as an internal communication path.

CPU11は、メモリ12に格納されたプログラム(ソフトウエア)に従って演算や制御を実行する装置であり、バスを通じて、各装置の動作を制御したり、各装置間あるいは外部との通信を制御したりする。メモリ12は、記憶装置であり、OS(オペレーションシステム)、デバイスドライバ、アプリケーションプログラム、各種のデータなどが格納される。なお、、メモリ12には、OSやデバイスドライバが使用するカーネル領域12Aや、アプリケーションプログラムが使用するユーザ領域12Bが構築される。   The CPU 11 is a device that executes computation and control according to a program (software) stored in the memory 12, and controls the operation of each device and controls communication between devices or externally through a bus. . The memory 12 is a storage device and stores an OS (operation system), a device driver, an application program, various data, and the like. In the memory 12, a kernel area 12A used by the OS and device driver and a user area 12B used by the application program are constructed.

USBホストコントローラ13は、USB通信を制御し、USBケーブル20を通じてターゲットデバイス30とのデータの送信及び受信を可能にする通信制御装置である。USBホストコントローラ13は、バッファメモリ14、USBインタフェース(以下、USBI/Fと略記する)15及び制御部16を備えている。   The USB host controller 13 is a communication control device that controls USB communication and enables transmission and reception of data with the target device 30 through the USB cable 20. The USB host controller 13 includes a buffer memory 14, a USB interface (hereinafter abbreviated as USB I / F) 15, and a control unit 16.

バッファメモリ14は、半導体メモリを用いて構成された先入れ先出し方式の記憶装置であり、入力または出力するデータを一時的に格納する。また、USBI/F15は、USBケーブル20を接続するインタフェースである。制御部16は、演算処理機能を備え、USBホストコントローラ13を制御する装置である。制御部16は、CPU14の指示の下、バッファメモリ14やUSBI/F15を制御する。この制御部16には、DMA(DirectMemoryAccess)17が設けられている。DMA17は、バッファメモリ14とメモリ12との間のデータ通信を制御する装置であり、CPU11を介在せずに直接的にバッファメモリ14とメモリ12との通信制御を行うことができる。   The buffer memory 14 is a first-in first-out storage device configured using a semiconductor memory, and temporarily stores data to be input or output. The USB I / F 15 is an interface for connecting the USB cable 20. The control unit 16 is a device that has an arithmetic processing function and controls the USB host controller 13. The control unit 16 controls the buffer memory 14 and the USB I / F 15 under the instruction of the CPU 14. This control unit 16 is provided with a DMA (Direct Memory Access) 17. The DMA 17 is a device that controls data communication between the buffer memory 14 and the memory 12, and can directly control communication between the buffer memory 14 and the memory 12 without the CPU 11.

ターゲットデバイス30は、内部バスに、CPU31、メモリ32、USBターゲットコントローラ33等が接続された構成を備える。CPU31、メモリ32は、PC20とほぼ同様に構成されており、メモリ32にカーネル領域32Aとユーザ領域32Bとを設けている点も同様である。   The target device 30 has a configuration in which a CPU 31, a memory 32, a USB target controller 33, and the like are connected to an internal bus. The CPU 31 and the memory 32 are configured in substantially the same manner as the PC 20, and the same is true in that the memory 32 is provided with a kernel area 32A and a user area 32B.

また、USBターゲットコントローラ33は、USBホストコントローラ13とほぼ同様にして構成されているが、USB通信におけるターゲットデバイスとして用いられる点で異なる。つまり、USBターゲットコントローラ33では、USBI/F35や制御部36などが、受信手段として構築されている。   The USB target controller 33 is configured in substantially the same manner as the USB host controller 13, but differs in that it is used as a target device in USB communication. That is, in the USB target controller 33, the USB I / F 35, the control unit 36, and the like are constructed as receiving means.

次に、図2を参照しながら、USBによる通信について説明する。図2は、USB通信において通信に携わるホスト装置10とターゲットデバイス30との機能部を、ソフトウェアとハードウェアとに階層分けして示した図である。図2では、ホスト装置10及びターゲットデバイス30の構成を、アプリケーションレベル、デバイスドライバレベル及びハードウエアレベルの三つの階層に分けている。   Next, USB communication will be described with reference to FIG. FIG. 2 is a diagram illustrating functional units of the host device 10 and the target device 30 that are involved in communication in USB communication, divided into software and hardware. In FIG. 2, the configurations of the host device 10 and the target device 30 are divided into three layers of an application level, a device driver level, and a hardware level.

ホスト装置10においては、アプリケーションレベルは、アプリケーション101のプログラムによって構成される。また、デバイスドライバレベルは、汎用的な上位ドライバとしてのクラスドライバ102と、API(Application Program Interface)103と、ホストコントロール/バスドライバ104によって構成される。API103は、クラスドライバ102と、ホストコントロール/バスドライバ104とをつなぐソフトウェアである。また、ホストコントロールドライバは、USBホストコントローラ13を抽象化したドライバであり、バスドライバは、USB固有のプロトコルを実装するドライバである。また、ハードウェアレベルは、図1で説明したUSBホストコントローラ13によって構成される。   In the host device 10, the application level is configured by the application 101 program. The device driver level includes a class driver 102 as a general-purpose host driver, an API (Application Program Interface) 103, and a host control / bus driver 104. The API 103 is software that connects the class driver 102 and the host control / bus driver 104. The host control driver is a driver that abstracts the USB host controller 13, and the bus driver is a driver that implements a USB-specific protocol. The hardware level is configured by the USB host controller 13 described in FIG.

ターゲットデバイス30は、アプリケーションレベルは、アプリケーション108のプログラムによって構成される。また、デバイスドライバレベルは、H/W(ハードウエア)非依存部107と、API106と、H/W依存部105とによって構成される。また、ハードウェアレベルは、図1で説明したUSBターゲットコントローラ33によって構成される。
なお、デバイスドライバレベルにおいて、H/W非依存部107とH/W依存部105に分離しているのは、USBターゲットコントローラ33を別のものに取り替えた場合の影響を少なくすることを考慮したためであるが、もちろん、両者を一体化することも可能である。また、API106は、H/W非依存部107と、H/W依存部105とをつなぐソフトウェアである。
The target device 30 is configured by a program of the application 108 at the application level. The device driver level includes an H / W (hardware) independent unit 107, an API 106, and an H / W dependent unit 105. The hardware level is configured by the USB target controller 33 described with reference to FIG.
Note that the reason why the H / W-independent part 107 and the H / W-dependent part 105 are separated at the device driver level is because the influence when the USB target controller 33 is replaced with another is reduced. Of course, it is also possible to integrate the two. The API 106 is software that connects the H / W-independent unit 107 and the H / W-dependent unit 105.

USBでは、デフォルトタイプのコントロール転送の他に、大容量データを転送するためのバルク転送、小容量データを周期的に転送するためのインタラプト転送、一定時間内の転送データ量が補償されたアイソクロナス転送が定められている。以下では、バルク転送をホストからターゲットに行うバルクアウト転送をHSモードで行う例について説明する。   In USB, in addition to default type control transfer, bulk transfer for transferring large-capacity data, interrupt transfer for transferring small-capacity data periodically, isochronous transfer with compensated transfer data amount within a certain time Is stipulated. Hereinafter, an example in which bulk-out transfer in which bulk transfer is performed from the host to the target is performed in the HS mode will be described.

ホスト装置10のアプリケーション101が、通信対象となるデータをターゲットデバイス30のアプリケーション108にバルクアウト送信する場合には、まず、アプリケーション101からクラスドライバ(プリンタクラスなど)102にデータが転送される。続いて、クラスドライバ102が、API103を介してホストコントロール/バスドライバ104にデータを転送する。そして、ホストコントロール/バスドライバ104は、USB2.0の規格にもとづいて512byteのパケット(これは、データ転送の単位となるデータ要素である)にデータを分割し、USBホストコントローラ13を用いてOUTトランザクションとして送信を行う。   When the application 101 of the host apparatus 10 performs bulk-out transmission of data to be communicated to the application 108 of the target device 30, first, the data is transferred from the application 101 to the class driver (printer class or the like) 102. Subsequently, the class driver 102 transfers data to the host control / bus driver 104 via the API 103. Then, the host control / bus driver 104 divides the data into 512-byte packets (this is a data element as a data transfer unit) based on the USB 2.0 standard, and uses the USB host controller 13 to output OUT. Send as a transaction.

送信される各パケットデータは、USBケーブル20を経由して、ターゲットデバイス30のUSBターゲットコントローラ33に到達する。USBターゲットコントローラ33は、パケットデータを受信して、バッファメモリ34に一時的に格納する。具体的には、バッファメモリ34は、パケットデータ1個(USB2.0では最大512byte)を格納できるFIFO(先入れ先出し方式の格納部)によって構成されており、ここにパケットデータが格納される。1つのターゲットデバイス30とホスト装置10の間には、複数の論理的な通信路(パイプ)を設定することが可能である。各パイプのターゲットデバイス側の端は、エンドポイントと呼ばれ、通常は、物理的にはパケットデータ1個を格納できるFIFOが設けられる。FIFOの個数は固定であってもよいし、変更可能であってもよい。一般的には、FIFOの個数が多い方がデータ転送を高速化できる余地が高まる。   Each packet data to be transmitted reaches the USB target controller 33 of the target device 30 via the USB cable 20. The USB target controller 33 receives the packet data and temporarily stores it in the buffer memory 34. Specifically, the buffer memory 34 is configured by a FIFO (a first-in first-out storage unit) capable of storing one packet data (maximum 512 bytes in USB 2.0), and the packet data is stored therein. A plurality of logical communication paths (pipes) can be set between one target device 30 and the host apparatus 10. The end of each pipe on the target device side is called an end point, and usually a FIFO capable of physically storing one packet data is provided. The number of FIFOs may be fixed or changeable. In general, the larger the number of FIFOs, the higher the room for speeding up data transfer.

ここで、図3を用いて、バルクアウト転送トランザクションにおいて、USBホストコントローラ13とUSBターゲットコントローラ33との間でやりとりされているパケットのフォーマットを示す。USBホストコントローラ13は、バルクアウト転送の開始を通知するために、まず、OUTトークンパケット120を送信する。これにより、USBターゲットコントローラ33は、これから行われる転送がバルクアウト転送であることを認識し、バルクアウト用のエンドポイントにパケットデータを格納するFIFOを用意する。続いて、USBホストコントローラ13は、DATA0というパケットデータ121を送信する。そして、USBターゲットコントローラ33は、DATA0のパケットデータを受信して、このパイプのエンドポイントに設けられたFIFOに格納する。この時点では、2つのFIFOのうち、他方のFIFOは使用可能である。そこで、USBターゲットコントローラ33は、次のパケットデータ121を受信できる旨を示すACKハンドシェーク124をUSBホストコントローラ13に送信する。 USBホストコントローラ13は、ACKハンドシェーク124を受信すると、引き続きOUTトークンパケット120と、DATA1というパケットデータ121を送信する。そして、USBターゲットコントローラ33は、このパケットデータ121を受信して、他方のFIFOに格納する。   Here, FIG. 3 shows a format of a packet exchanged between the USB host controller 13 and the USB target controller 33 in the bulk-out transfer transaction. The USB host controller 13 first transmits an OUT token packet 120 to notify the start of bulk-out transfer. As a result, the USB target controller 33 recognizes that the transfer to be performed from now on is bulk-out transfer, and prepares a FIFO for storing packet data at the bulk-out endpoint. Subsequently, the USB host controller 13 transmits packet data 121 called DATA0. The USB target controller 33 receives the DATA0 packet data and stores it in the FIFO provided at the end point of this pipe. At this point, the other of the two FIFOs is usable. Therefore, the USB target controller 33 transmits an ACK handshake 124 indicating that the next packet data 121 can be received to the USB host controller 13. When the USB host controller 13 receives the ACK handshake 124, it continuously transmits the OUT token packet 120 and the packet data 121 of DATA1. Then, the USB target controller 33 receives this packet data 121 and stores it in the other FIFO.

この段階で、先にDATA0のパケットデータ121を格納したFIFOが空である場合、つまり後段の装置に既にデータ転送が行われており、新たなるケットデータパが格納可能な状況にある場合には、USBターゲットコントローラ33は、次のパケットデータ121を受信可能である旨を示すACKハンドシェーク124を送信する。他方、先にDATA0のパケットデータ121を格納したFIFOが使用中である場合、つまり後段の装置にデータ転送が行われていない場合には、USBターゲットコントローラ33は、次のパケットデータを受信できない旨を表すNYETハンドシェーク123をUSBホストコントローラ13に送信する。   At this stage, if the FIFO that previously stored the DATA0 packet data 121 is empty, that is, if data transfer has already been performed in the subsequent apparatus and a new packet data path can be stored. The USB target controller 33 transmits an ACK handshake 124 indicating that the next packet data 121 can be received. On the other hand, if the FIFO storing the packet data 121 of DATA0 is in use, that is, if no data transfer is performed to the subsequent apparatus, the USB target controller 33 cannot receive the next packet data. Is transmitted to the USB host controller 13.

図4は、USBホストコントローラ13が、NYETハンドシェーク123を受信した場合のパケットのやりとりを示す図である。この場合、USBホストコントローラ13は、OUTトークンパケット120の代わりにPINGトークンパケット127を発行する。そして、USBターゲットコントローラ33は、DATA0のパケットデータ121を保持するFIFOが使用不可能な場合にはNAKハンドシェーク125を、使用可能な場合にはACKハンドシェーク124をUSBホストコントローラ13に送信する。USBホストコントローラ13は、ACKハンドシェーク124を受信した場合には、OUTトランザクションを再開するために、図3に示したOUTトークンパケット120を発行する。他方、USBホストコントローラ13は、NAKハンドシェーク125を受信した場合には、再びPINGトークンパケット127を発行する。このPINGトークンパケット127の発行は、USBターゲットコントローラ33からACKハンドシェーク124を受信するまで継続される。なお、USBターゲットコントローラ33は、動作不能な状態のときにはSTALLハンドシェーク126を返信する。ここで説明した各ハンドシェークは、ターゲットデバイスとホストとの間で、コネション型の通信を行う(対話的に通信を行う)ためのパケットである。   FIG. 4 is a diagram showing packet exchange when the USB host controller 13 receives the NYET handshake 123. In this case, the USB host controller 13 issues a PING token packet 127 instead of the OUT token packet 120. Then, the USB target controller 33 transmits the NAK handshake 125 to the USB host controller 13 when the FIFO holding the DATA0 packet data 121 is not usable, and the ACK handshake 124 when it is usable. When receiving the ACK handshake 124, the USB host controller 13 issues the OUT token packet 120 shown in FIG. 3 in order to resume the OUT transaction. On the other hand, when the USB host controller 13 receives the NAK handshake 125, it issues the PING token packet 127 again. The issuing of the PING token packet 127 is continued until the ACK handshake 124 is received from the USB target controller 33. The USB target controller 33 returns a STALL handshake 126 when it is in an inoperable state. Each handshake described here is a packet for performing connection-type communication (communication interactively) between the target device and the host.

次に、図5を参照しながら、パケットデータを受信した後のターゲットデバイス30内でのパケットデータの流れについて説明する。図5は、ホスト装置10からターゲットデバイス30に、HSモードのバルクアウト転送(パケットデータは512byte)でデータ転送が行われる場合に、ターゲットデバイス30内でのパケットデータの処理の流れを示した図である。   Next, the flow of packet data in the target device 30 after receiving the packet data will be described with reference to FIG. FIG. 5 is a diagram showing a flow of processing of packet data in the target device 30 when data transfer is performed from the host apparatus 10 to the target device 30 by bulk-out transfer in HS mode (packet data is 512 bytes). It is.

USBターゲットコントローラ33のUSBI/F35で受信されたパケットデータは、パケットデータ毎に、エンドポイントに設定されたFIFO341、342のいずれかに一時的に格納される。FIFO341、342は、USBターゲットコントローラ33内のバッファメモリ34に確保された領域である。   The packet data received by the USB I / F 35 of the USB target controller 33 is temporarily stored in one of the FIFOs 341 and 342 set as the end point for each packet data. The FIFOs 341 and 342 are areas secured in the buffer memory 34 in the USB target controller 33.

FIFO341、342に格納されたパケットデータは、USBターゲットコントローラ33内のDMA37によって、メモリ32内のカーネル領域32Aに転送される。カーネル領域32Aには、FIFO341、342から転送されるパケットデータを一時的に格納するため、3つのバッファ321、322、323が確保されている。   The packet data stored in the FIFOs 341 and 342 is transferred to the kernel area 32A in the memory 32 by the DMA 37 in the USB target controller 33. In the kernel area 32A, three buffers 321, 322, and 323 are secured for temporarily storing packet data transferred from the FIFOs 341 and 342.

バッファ321、322、323は、アプリケーション108からのリクエストによって、カーネル領域32A内に用意される。このうち、バッファ321、322は、パケットを格納できる使用可能な有効領域のサイズ(以下、有効メモリサイズと呼ぶ)を変更することができる。例えば、カーネル領域32A内に用意されたバッファ321のサイズ(以下、オリジナルサイズと呼ぶ)をそれぞれ4Kbyteとすると、バッファ321は、そのうちの512byteを有効メモリサイズとしている。このバッファ321の有効メモリサイズである512byteは、本実施例では、USB2.0を想定しているため、データ転送されるパケットデータ1個の最大サイズと等しい値である。バッファ321の有効メモリサイズは、データ転送されるパケットデータ1個の最大サイズに応じて変更される。   Buffers 321, 322, and 323 are prepared in the kernel area 32 </ b> A in response to a request from the application 108. Among these, the buffers 321 and 322 can change the size of an available effective area that can store a packet (hereinafter referred to as an effective memory size). For example, if the size of the buffer 321 prepared in the kernel area 32A (hereinafter referred to as the original size) is 4 Kbytes, the buffer 321 uses 512 bytes of the effective memory size. The effective memory size of 512 bytes of the buffer 321 is assumed to be USB 2.0 in the present embodiment, and is therefore equal to the maximum size of one packet data to be transferred. The effective memory size of the buffer 321 is changed according to the maximum size of one packet data to be transferred.

また、バッファ322の有効メモリサイズは、パケットデータ1個の最大サイズの整数倍(すなわち、512byte×整数)としている。本実施例では、バッファ322の有効領域のサイズは、オリジナルサイズの4Kbyteから、バッファ321の有効メモリサイズ(又は、パケットデータ1個の最大サイズ)である512byteを差し引いた約3.5Kbyteとしている。
また、バッファ323の有効メモリサイズは、カーネル領域32A内に用意されたオリジナルサイズの4Kbyteとしている。
The effective memory size of the buffer 322 is an integral multiple of the maximum size of one packet data (that is, 512 bytes × integer). In this embodiment, the size of the effective area of the buffer 322 is about 3.5 Kbytes obtained by subtracting 512 bytes, which is the effective memory size of the buffer 321 (or the maximum size of one packet data), from the original size of 4 Kbytes.
The effective memory size of the buffer 323 is 4 Kbytes of the original size prepared in the kernel area 32A.

カーネル領域32Aに格納されたパケットデータは、ユーザ領域32Bに確保されたバッファ325に転送される。バッファ325は、ホスト装置10から送信されるデータ全体を格納できるサイズを持っており、ここで各パケットデータの統合が行われる。こうして復元されたデータは、アプリケーション108によって管理・利用されることになる。カーネル領域32Aからユーザ領域32Bへのパケットデータの転送は、CPU31によって行われる。   The packet data stored in the kernel area 32A is transferred to the buffer 325 secured in the user area 32B. The buffer 325 has a size capable of storing the entire data transmitted from the host device 10, and the packet data is integrated here. The restored data is managed and used by the application 108. The packet data is transferred from the kernel area 32A to the user area 32B by the CPU 31.

図5においては、カーネル領域32A内に3つのバッファ321、322、323を設ける例を示した。しかし、カーネル領域32A内に設けるバッファの数及びサイズ(オリジナルサイズ及び有効メモリサイズ)は、動的に変更可能である。   FIG. 5 shows an example in which three buffers 321, 322, and 323 are provided in the kernel area 32A. However, the number and size (original size and effective memory size) of buffers provided in the kernel area 32A can be dynamically changed.

図6は、ターゲットデバイス30内における内部処理の流れを、図2に示したソフトウエア及びハードウエアの構造と関連づけて説明する図である。
H/W非依存部107は、ioctl()及びread()などの一般的なシステムコールのルーチンを管理しており、これらのルーチンがアプリケーション108から呼び出された場合には、API106を通じて、H/W依存部105に、対応する処理を命じる。ここで、ioctl()は、カーネル領域32Aに設けるバッファの個数及びサイズを設定するためのファンクションをサポートするルーチンであり、read()は、データの読み込みを行うためのルーチンである。
FIG. 6 is a diagram for explaining the flow of internal processing in the target device 30 in association with the software and hardware structures shown in FIG.
The H / W-independent unit 107 manages routines for general system calls such as ioctl () and read (). When these routines are called from the application 108, the H / W-independent unit 107 transmits the H / W through the API 106. Commands the W-dependent unit 105 for the corresponding processing. Here, ioctl () is a routine that supports a function for setting the number and size of buffers provided in the kernel area 32 </ b> A, and read () is a routine for reading data.

アプリケーション108は、まず、ioctl()の引数にファンクション値とファンクション値の属性値を設定し、タイムアウト時間と、バッファの個数及びサイズ(オリジナルサイズ及び有効メモリサイズ)を設定する。そして、ioctl()は、設定されたバッファの個数と同数のIOリクエスト構造体(以下、簡単に、IOリクエストと呼ぶ場合もある)を生成する(図6に示すIOリクエストa、b、c)。なお、図6に示すIOリクエストaによって、図5に示すカーネル領域32Aに、有効メモリサイズが512byteのバッファ321が設定されるものとする。同様にして、IOリクエストbによって、図5に示すカーネル領域32Aに、有効メモリサイズが約3.5Kbyteのバッファ322が設定されるものとし、IOリクエストcによって、図5に示すカーネル領域32Aに、有効メモリサイズが4Kbyteのバッファ323が設定されるものとする。なお、タイムアウト時間については、後述する。   First, the application 108 sets a function value and an attribute value of the function value in an argument of ioctl (), and sets a timeout time, the number of buffers and the size (original size and effective memory size). Then, ioctl () generates the same number of IO request structures (hereinafter sometimes simply referred to as IO requests) as the number of set buffers (IO requests a, b, and c shown in FIG. 6). . It is assumed that a buffer 321 having an effective memory size of 512 bytes is set in the kernel area 32A shown in FIG. 5 by the IO request a shown in FIG. Similarly, it is assumed that a buffer 322 having an effective memory size of about 3.5 Kbytes is set in the kernel area 32A shown in FIG. 5 by the IO request b, and the kernel area 32A shown in FIG. Assume that a buffer 323 having an effective memory size of 4 Kbytes is set. The timeout time will be described later.

図7は、IOリクエスト構造体210について説明する図である。IOリクエスト構造体210は、カーネル領域32Aに確保されるバッファ毎に設定される構造体であり、バッファへのポインタ212、バッファのオリジナルサイズ214、バッファの有効サイズ216、コールバックルーチンへのポインタ218、データサイズ220、及びリストポインタ222の各フィールドをもつ。バッファへのポインタ212は、このIOリクエスト構造体210によってカーネル領域32Aに確保されるバッファ321(322、323)のアドレスを表す。バッファのオリジナルサイズ214は、このIOリクエスト構造体210によってカーネル領域32Aに確保されるバッファ321(322、323)のオリジナルのサイズを表す。バッファ321、322、323のオリジナルサイズは、すべて4Kbyteに設定されている。また、バッファの有効サイズ216は、カーネル領域32Aに用意されたバッファ321(322、323)のオリジナルサイズのうち、実際に使用(パケットデータを格納)する有効メモリサイズを表す。また、コールバックルーチンへのポインタ218は、H/W依存部105からIOリクエストが完了した旨の通知をもらうために設定されるアドレスである。そして、データサイズ220は、実際にバッファに格納されるデータのサイズを表し、リストポインタ222は、複数のIOリクエスト構造体210の並びを制御するために設定される。   FIG. 7 is a diagram for explaining the IO request structure 210. The IO request structure 210 is a structure set for each buffer secured in the kernel area 32A, and includes a pointer 212 to the buffer, an original size 214 of the buffer, an effective size 216 of the buffer, and a pointer 218 to the callback routine. , Data size 220 and list pointer 222 fields. The pointer 212 to the buffer represents the address of the buffer 321 (322, 323) secured in the kernel area 32A by the IO request structure 210. The buffer original size 214 represents the original size of the buffer 321 (322, 323) secured in the kernel area 32A by the IO request structure 210. The original sizes of the buffers 321, 322, and 323 are all set to 4 Kbytes. The buffer effective size 216 represents the effective memory size that is actually used (packet data is stored) among the original sizes of the buffers 321 (322, 323) prepared in the kernel area 32A. Further, the pointer 218 to the callback routine is an address set for receiving a notification from the H / W dependency unit 105 that the IO request has been completed. The data size 220 represents the size of data actually stored in the buffer, and the list pointer 222 is set to control the arrangement of the plurality of IO request structures 210.

H/W非依存部107において、ioctl()は、IOリクエスト構造体210の各フィールドに値を設定する。このとき、リストポインタ222はNULLで初期化され、データサイズ220は0で初期化される。また、ioctl()からの指示に基づいて、H/W依存部105が管理するリクエスト待ちキューがNULLで初期化される。   In the H / W-independent unit 107, ioctl () sets a value in each field of the IO request structure 210. At this time, the list pointer 222 is initialized with NULL, and the data size 220 is initialized with 0. Further, based on an instruction from ioctl (), the request waiting queue managed by the H / W dependent unit 105 is initialized with NULL.

ホスト装置10からのデータを受信する場合、図6で示すようにアプリケーション108は、H/W非依存部107が提供するread()をコールする。すると、H/W非依存部107は、バッファの個数分のIOリクエストをAPI106を通じて、H/W依存部105に対し順次発行する。H/W依存部105は、発行されたIOリクエストを順次処理するためにIOリクエスト待ちキューを管理しており、発行されたIOリクエストに対応するIOリクエスト構造体210を順次IOリクエスト待ちキューにつなぐ処理を行う。図8は、この様子を説明する図であり、発行された3個のIOリクエスト240,242,244(IOリクエスト240が図6に示すIOリクエストaに該当し、IOリクエスト242が図6に示すIOリクエストbに該当し、IOリクエスト244が図6に示すIOリクエストcに該当する)がIOリクエスト待ちキュー246につながれている。   When receiving data from the host device 10, the application 108 calls read () provided by the H / W independent unit 107 as shown in FIG. 6. Then, the H / W independent unit 107 sequentially issues IO requests for the number of buffers to the H / W dependent unit 105 through the API 106. The H / W dependency unit 105 manages the IO request waiting queue in order to sequentially process the issued IO requests, and sequentially connects the IO request structures 210 corresponding to the issued IO requests to the IO request waiting queue. Process. FIG. 8 is a diagram for explaining this state. Three issued IO requests 240, 242, and 244 (the IO request 240 corresponds to the IO request a shown in FIG. 6 and the IO request 242 is shown in FIG. The IO request b corresponds to the IO request b, and the IO request 244 corresponds to the IO request c shown in FIG. 6).

DMA37は、バッファメモリ34に設けられたFIFO341あるいはFIFO342に格納されたパケットデータを、IOリクエスト待ちキュー246の先頭のIOリクエストによってカーネル領域32Aに用意されたバッファ321に転送する。そして、バッファ321への転送が完了すると、USBターゲットコントローラ33の制御部36からCPU31へインタラプトが通知され、CPU31はそのインタラプトの内容からH/W依存部105のインターラプトハンドラ(H/W依存部105に含まれるルーチン)に、パケットデータが格納されたことを通知する。H/W依存部105は、インターラプトハンドラで、制御部36からの通知を受け付けると、IOリクエスト待ちキュー246の先頭のIOリクエストを、IOリクエスト完了キュー250の最後尾につなげる。H/W依存部105は、IOリクエスト完了キュー250につながれたIOリクエストを、IOリクエスト完了キュー250につながれた順番に処理する。H/W依存部105は、IOリクエスト完了キュー250につながれたIOリクエスト構造体に設定されたコールバックルーチンへのポインタ218に従って、H/W非依存部107のコールバックルーチンをコールする。   The DMA 37 transfers the packet data stored in the FIFO 341 or the FIFO 342 provided in the buffer memory 34 to the buffer 321 prepared in the kernel area 32A by the first IO request in the IO request waiting queue 246. When the transfer to the buffer 321 is completed, an interrupt is notified from the control unit 36 of the USB target controller 33 to the CPU 31, and the CPU 31 determines the interrupt handler (H / W dependent unit) of the H / W dependent unit 105 from the contents of the interrupt. (Routine included in 105) notifies that the packet data has been stored. When the H / W dependency unit 105 is an interrupt handler and receives a notification from the control unit 36, the H / W dependency unit 105 connects the top IO request of the IO request waiting queue 246 to the end of the IO request completion queue 250. The H / W dependency unit 105 processes the IO requests connected to the IO request completion queue 250 in the order of connection to the IO request completion queue 250. The H / W dependent unit 105 calls the callback routine of the H / W non-dependent unit 107 in accordance with the pointer 218 to the callback routine set in the IO request structure connected to the IO request completion queue 250.

続いて、コールされたH/W非依存部107のコールバックルーチンは、図9に示すIOリクエスト完了キュー250をチェックする。そして、IOリクエスト完了キュー250の先頭のIOリクエストをキューから外し、先頭のIOリクエストのバッファへのポインタ212に設定されたバッファ(例えば、IOリクエストaであればバッファ321、IOリクエストbであればバッファ322、IOリクエストcであればバッファ323)から、ユーザ領域32Bのバッファ325へ、IOリクエストのデータサイズ220に設定されたサイズのパケットデータをコピーする。また、H/W非依存部107のコールバックルーチンは、コピーしたパケットデータのサイズがバッファ321(322、323)の有効メモリサイズと等しいかどうかをチェックする。まず、コピー元であるバッファ321(322、323)の有効メモリサイズと、ユーザ領域32Bのバッファ325へコピーしたパケットデータのサイズとが一致しなかった場合(すなわち、コピーしたパケットデータのサイズである512byteの整数倍ではなかった場合(以下、この場合をショートパケットと呼ぶ)、H/W非依存部107のコールバックルーチンは、ホスト装置10から送信されたパケットデータはもう存在しないと判定し、IOリクエストの取消処理を行い、IOリクエスト待ちキュー246に繋がれている不要なIOリクエストを外す。また、ホスト装置10から受信したパケットデータがヌルパケットであった場合にも、コールバックルーチンは、ホスト装置10から送信されたパケットデータはもう存在しないと判定し、IOリクエストの取消処理を行い、IOリクエスト待ちキュー246につながれている不要なIOリクエストを外す。   Subsequently, the callback routine of the called H / W non-dependent unit 107 checks the IO request completion queue 250 shown in FIG. Then, the head IO request of the IO request completion queue 250 is removed from the queue, and the buffer set in the pointer 212 to the buffer of the head IO request (for example, the buffer 321 if the IO request a, if the IO request b) If the buffer 322 is an IO request c, the packet data of the size set in the data size 220 of the IO request is copied from the buffer 323) to the buffer 325 of the user area 32B. The callback routine of the H / W independent unit 107 checks whether the size of the copied packet data is equal to the effective memory size of the buffer 321 (322, 323). First, when the effective memory size of the copy source buffer 321 (322, 323) does not match the size of the packet data copied to the buffer 325 of the user area 32B (that is, the size of the copied packet data). If it is not an integer multiple of 512 bytes (hereinafter, this case is referred to as a short packet), the callback routine of the H / W independent unit 107 determines that there is no longer packet data transmitted from the host device 10, and The IO request is canceled and the unnecessary IO request connected to the IO request waiting queue 246 is removed, and even when the packet data received from the host device 10 is a null packet, the callback routine Packet data sent from the host device 10 already exists It is determined that there is no, do the cancellation processing of the IO request, remove the unnecessary IO requests that are connected to the IO request queue 246.

他方、コピーしたパケットデータのサイズが、バッファ321(322、323)の有効メモリサイズに等しい場合、コールバックルーチンは、ホスト装置10からのパケットデータがまだ存在すると判定し、使用済みとなったIOリクエストを使用してIOリクエストを再度発行し、再度待ち状態に入る前にIOリクエスト完了キュー250をチェックする。以降、同様な処理を繰り返す。   On the other hand, if the size of the copied packet data is equal to the effective memory size of the buffer 321 (322, 323), the callback routine determines that the packet data from the host device 10 still exists and the used IO The request is used to reissue the IO request and check the IO request completion queue 250 before entering the wait state again. Thereafter, similar processing is repeated.

ここで、タイムアウト時間について図6を参照しながら説明する。
タイムアウト時間は、H/W非依存部107がIOリクエストを発行してから、H/W非依存部107のコールバックルーチンがコールされるまでの時間である。但し、タイムアウト時間の計時開始タイミングに、IOリクエストa,b,cの発行タイミングは含まれていない。すなわち、IOリクエストa,b,cに後続するIOリクエストd,e,f・・の発行タイミングが、タイムアウト時間の計時開始タイミングとなる。IOリクエストaが対象となっていないのは、最初に発行されるIOリクエストaのタイムアウト時間を無限時間に設定しているからである。IOリクエストaのタイムアウト時間を無限時間に設定しているのは、ホスト装置10側が、いつパケットデータの送信を開始するのかはターゲットデバイス30側では分からないためである。また、IOリクエストb,cは、IOリクエストaと一緒に発行され、IOリクエスト待ちキュー246にIOリクエストaと共に接続されているからである。なお、タイムアウト時間の計時終了に、IOリクエストaが含まれないのも、IOリクエストaは、タイムアウト時間を無限時間に設定しているからである。
図6に示すIOリクエストを参照して、タイムアウト時間についてより詳細に説明する。バッファ321に、バッファ321の有効メモリサイズ分のパケットデータが格納されると、IOリクエストaがIOリクエスト完了キュー250につながれ、次のIOリクエスト構造体であるIOリクエストbがIOリクエスト待ちキュー246の先頭に接続される。そして、H/W依存部105によって、H/W非依存部107のコールバックルーチンがコールされると、H/W非依存部107は、使用済みとなったIOリクエスト構造体を使用してIOリクエストを再度発行する。このIOリクエストをIOリクエストaと区別するため、便宜上、IOリクエストdと呼ぶ。H/W非依存部107は、IOリクエストdを発行した段階で、タイムアウト時間の計時を開始する。そして、バッファ322に、バッファ322の有効メモリサイズ分のパケットデータが格納され、IOリクエストbがIOリクエスト完了キュー250につながれ、H/W依存部105によって、H/W非依存部107のコールバックルーチンがコールされるまでの時間(図6参照)がタイムアウト時間である。このタイムアウト時間をオーバーした場合、タイムアウト時間を経過しても、H/W依存部105がコールバックルーチンをコールすることがないので、H/W非依存部107は、ホスト装置10から送信されたパケットデータはもう存在しないと判定し、IOリクエストの取消処理を行い、IOリクエスト待ちキュー246に繋がれている不要なIOリクエストを外す。
なお、タイムアウト時間は、バッファ322、323、321に、各バッファの有効メモリサイズのパケットデータが格納されるまでにかかる時間ということができる。例えば、バッファ323へのパケットデータの格納が完了して、コールバックルーチンがコールされているのに、次のバッファであるバッファ321へのパケットデータの格納が完了せず、コールバックルーチンがコールされない場合に、H/W非依存部107は、ホスト装置10から送信されたパケットデータはもう存在しないと判定する。
Here, the timeout time will be described with reference to FIG.
The timeout time is the time from when the H / W independent unit 107 issues an IO request until the callback routine of the H / W independent unit 107 is called. However, the timing for starting the timing of the timeout time does not include the timing for issuing the IO requests a, b, and c. That is, the issuing timing of the IO requests d, e, f,... Following the IO requests a, b, c is the timing start timing of the timeout time. The reason why the IO request a is not targeted is that the timeout period of the IO request a issued first is set to infinite time. The time-out time of the IO request a is set to infinite time because the target device 30 does not know when the host device 10 starts transmitting packet data. This is because the IO requests b and c are issued together with the IO request a and are connected to the IO request waiting queue 246 together with the IO request a. Note that the IO request a is not included in the end of the time-out time measurement because the IO request a sets the timeout time to an infinite time.
The timeout time will be described in more detail with reference to the IO request shown in FIG. When packet data corresponding to the effective memory size of the buffer 321 is stored in the buffer 321, the IO request a is connected to the IO request completion queue 250, and the next IO request b, which is the IO request structure, is stored in the IO request waiting queue 246. Connected to the top. When the callback routine of the H / W non-dependent unit 107 is called by the H / W dependent unit 105, the H / W non-dependent unit 107 uses the IO request structure that has been used. Reissue the request. In order to distinguish this IO request from the IO request a, it is called an IO request d for convenience. The H / W non-dependent unit 107 starts measuring the timeout time when the IO request d is issued. The buffer 322 stores packet data corresponding to the effective memory size of the buffer 322, the IO request b is connected to the IO request completion queue 250, and the H / W dependent unit 105 calls back the H / W independent unit 107 callback. The time until the routine is called (see FIG. 6) is the timeout time. When the timeout time is exceeded, the H / W dependent unit 105 does not call the callback routine even if the timeout time elapses, so the H / W independent unit 107 is transmitted from the host device 10. It is determined that the packet data no longer exists, the IO request is canceled, and unnecessary IO requests connected to the IO request waiting queue 246 are removed.
Note that the timeout time can be said to be the time it takes for the buffers 322, 323, and 321 to store packet data of the effective memory size of each buffer. For example, storage of packet data in the buffer 323 is completed and the callback routine is called, but storage of packet data in the buffer 321 that is the next buffer is not completed and the callback routine is not called. In this case, the H / W independent unit 107 determines that there is no more packet data transmitted from the host device 10.

次に、バッファ321、322の有効メモリサイズについて説明する。
ホスト装置10から送信されるパケットデータを最初に格納するカーネル領域32Aのバッファ321の有効メモリサイズは、初期状態では、512byteに設定している。例えば、最初にパケットデータを格納するバッファの有効メモリサイズを4Kbyteとした場合、この4Kbyteよりも小さく、かつ最大転送サイズである512byteの整数倍のパケットを受信してバッファ321に格納すると、後続してパケットデータを受信したり、ヌルパケットを受信しない限り、ターゲットデバイス30側は、無限にパケットデータの受信を待つことになってしまう。しかし、バッファ321の有効メモリサイズをUSB2.0の最大転送サイズである512byteに設定しておくことで、ターゲットデバイス30側では、パケットデータを受信して、受信したパケットデータがバッファ321に格納されると、CPU31経由でH/W依存部105に通知が行き、パケットデータの受信が認識可能となる。また、CPU31が所定時間ごとにポーリングでパケットデータの受信状態を監視しなくても、512byteのパケットデータがバッファ321に格納されるとUSBターゲットコントローラ33の制御部36から通知があるので、CPU31はホスト装置10からのパケットデータの受信を認識可能となる。
Next, the effective memory size of the buffers 321 and 322 will be described.
In the initial state, the effective memory size of the buffer 321 of the kernel area 32A that initially stores packet data transmitted from the host apparatus 10 is set to 512 bytes. For example, if the effective memory size of the buffer that initially stores packet data is 4 Kbytes, a packet that is smaller than 4 Kbytes and that is an integer multiple of 512 bytes, which is the maximum transfer size, is received and stored in the buffer 321. Unless the packet data is received or the null packet is received, the target device 30 waits for reception of the packet data indefinitely. However, by setting the effective memory size of the buffer 321 to 512 bytes which is the maximum transfer size of USB 2.0, the target device 30 receives the packet data, and the received packet data is stored in the buffer 321. Then, the notification is sent to the H / W dependent unit 105 via the CPU 31, and the reception of the packet data can be recognized. Even if the CPU 31 does not monitor the reception state of the packet data by polling every predetermined time, when the 512-byte packet data is stored in the buffer 321, there is a notification from the control unit 36 of the USB target controller 33. Reception of packet data from the host device 10 can be recognized.

また、バッファ321の次にパケットデータを格納するバッファ322の有効メモリサイズは、バッファ321(322、323)のオリジナルサイズである4Kbyteから512byteを差し引いた約3.5Kbyteとしている。このため、バッファ321とバッファ322に格納されるパケットデータのデータサイズは、合わせて4Kbyteになる。また、バッファ322の次にパケットデータを格納するバッファ323の有効メモリサイズも、オリジナルサイズの4Kbyteとし、さらに、バッファ321とバッファ322は、一度、有効メモリサイズのパケットデータを格納し、パケットデータがユーザ領域32Bに読み出された後は、バッファ321とバッファ322の有効メモリサイズは、それぞれオリジナルサイズの4Kbyteに設定される。
ユーザ領域32Bのバッファ325のサイズは、バッファ321、322、323のオリジナルサイズの整数倍に設定されている。そして、パケットデータの受信開始時にだけ、バッファ321とバッファ322とに格納されるパケットデータの和が4Kbyteとし、それ以降は、バッファ321、322、323からバッファ325に送られるパケットデータのサイズを4Kbyteで揃えておく。このように処理することで、パケットデータを、バッファ321、322、323のいずれかからバッファ325に転送しているときに、この転送しているバッファ321(322、323)にパケットデータを残した状態で、バッファ325が満杯になってしまうことがない。
The effective memory size of the buffer 322 that stores packet data next to the buffer 321 is about 3.5 Kbytes obtained by subtracting 512 bytes from 4 Kbytes that is the original size of the buffer 321 (322, 323). For this reason, the data size of the packet data stored in the buffer 321 and the buffer 322 is 4 Kbytes in total. The effective memory size of the buffer 323 that stores the packet data next to the buffer 322 is also 4 Kbytes of the original size. Furthermore, the buffer 321 and the buffer 322 once store the packet data of the effective memory size, and the packet data After being read out to the user area 32B, the effective memory sizes of the buffer 321 and the buffer 322 are set to 4 Kbytes of the original size, respectively.
The size of the buffer 325 in the user area 32B is set to an integer multiple of the original size of the buffers 321, 322, and 323. The sum of the packet data stored in the buffer 321 and the buffer 322 is 4 Kbytes only at the start of reception of the packet data, and thereafter, the size of the packet data sent from the buffers 321, 322, and 323 to the buffer 325 is set to 4 Kbytes. Keep it in place. By processing in this way, when packet data is transferred from any of the buffers 321, 322, and 323 to the buffer 325, the packet data is left in the transferring buffer 321 (322 and 323). In this state, the buffer 325 does not become full.

図10に示すフローチャートに沿って、カーネル領域32Aのバッファ設定処理の手順を、図6を参照しながら説明する。
まず、アプリケーション108は、デバイスドライバのH/W非依存部107が提供するioctl()をコールし、このioctl()にタイムアウト時間を設定する(ステップS1)。なお、タイムアウト時間は、パケットデータを格納する順番が2番目以降のバッファ(すなわち、バッファ322、バッファ323、バッファ321、バッファ322、・・・)に、有効メモリサイズ分のパケットデータが格納されるまでにかかる時間である。より詳細には、タイムアウト時間は、H/W非依存部107で、各IOリクエストd,e,f・・・が発行されてから、IOリクエストb,c,d・・・がIOリクエスト完了キュー250に接続され、H/W非依存部107のコールバックルーチンがコールされるまでの時間(図6参照)である。なお、一番最初にパケットデータを格納するバッファ321は、タイムアウト時間なしに無限にホスト装置10からのパケットデータの受信を待つ。
The procedure of the buffer setting process for the kernel area 32A will be described with reference to FIG. 6 along the flowchart shown in FIG.
First, the application 108 calls ioctl () provided by the H / W-independent unit 107 of the device driver, and sets a timeout time in ioctl () (step S1). In the timeout period, packet data corresponding to the effective memory size is stored in the second and subsequent buffers in which packet data is stored (that is, buffer 322, buffer 323, buffer 321, buffer 322,...). It takes time to complete. More specifically, the time-out time is determined by the H / W-independent unit 107 after the IO requests d, e, f,... Are issued, and the IO requests b, c, d,. 250 is a time until the callback routine of the H / W independent unit 107 is called (see FIG. 6). Note that the buffer 321 that stores packet data first waits indefinitely for reception of packet data from the host device 10 without a timeout time.

次に、アプリケーション108は、デバイスドライバのH/W非依存部107が提供するRead()をコールする。アプリケーション108によってRead()がコールされると、H/W非依存部107は、図6に示すIOリクエストa,b,cをデバイスドライバのH/W依存部105に対して発行する(ステップS2)。IOリクエストa,b,cがH/W依存部105に発行されることで、H/W依存部105は、カーネル領域32Aにバッファ321、322、323を用意する。すなわち、IOリクエストaによって、カーネル領域32Aにバッファ321が用意され、IOリクエストbによって、カーネル領域32Aにバッファ322が用意され、IOリクエストcによって、カーネル領域32Aにバッファ323が用意される。IOリクエストa,b,cは、それぞれIOリクエスト待ちキュー246に登録される。ホスト装置10から送られるパケットデータを格納する順番は、バッファ321、バッファ322、バッファ323の順番であるので、IOリクエスト待ちキュー246にも、IOリクエストa,IOリクエストb,IOリクエストcの順番で登録される。最初にパケットデータを格納するバッファ321は、タイムアウト時間なしに無限にホスト装置10からのパケットデータの受信を待つ(ステップS3)。   Next, the application 108 calls Read () provided by the H / W independent unit 107 of the device driver. When Read () is called by the application 108, the H / W non-dependent unit 107 issues the IO requests a, b, and c shown in FIG. 6 to the H / W dependent unit 105 of the device driver (step S2). ). When the I / O requests a, b, and c are issued to the H / W dependency unit 105, the H / W dependency unit 105 prepares buffers 321, 322, and 323 in the kernel area 32A. That is, the buffer 321 is prepared in the kernel area 32A by the IO request a, the buffer 322 is prepared in the kernel area 32A by the IO request b, and the buffer 323 is prepared in the kernel area 32A by the IO request c. IO requests a, b, and c are registered in the IO request waiting queue 246, respectively. Since the packet data sent from the host device 10 is stored in the order of the buffer 321, the buffer 322, and the buffer 323, the IO request waiting queue 246 is also in the order of the IO request a, the IO request b, and the IO request c. be registered. The buffer 321 that first stores the packet data waits indefinitely for reception of packet data from the host device 10 without a timeout time (step S3).

ホスト装置10がバルクアウト転送を開始し、バッファ321に最初のパケットデータが格納されると、USBターゲットコントローラ33の制御部36からCPU31経由でH/W依存部105のインターラプトハンドラにパケットデータが格納されたことが通知される。H/W依存部105は、インターラプトハンドラで制御部36からの通知を受け付けると、IOリクエストaをIOリクエスト待ちキュー246からIOリクエスト完了キュー250に移動させる。また、H/W依存部105は、図7に示すIOリクエスト構造体の“コールバックルーチンへのポインタ”218で設定されている、H/W非依存部107のコールバックルーチンをコールする。H/W依存部105がコールバックルーチンをコールすることで、CPU31は、バッファ321に格納されたパケットデータを読み出して、ユーザ領域32Bのバッファ325に格納する(ステップS4)。   When the host device 10 starts the bulk-out transfer and the first packet data is stored in the buffer 321, the packet data is transferred from the control unit 36 of the USB target controller 33 to the interrupt handler of the H / W dependent unit 105 via the CPU 31. The storage is notified. When receiving the notification from the control unit 36 by the interrupt handler, the H / W dependency unit 105 moves the IO request a from the IO request waiting queue 246 to the IO request completion queue 250. Further, the H / W dependent unit 105 calls the callback routine of the H / W independent unit 107 set by the “pointer to the callback routine” 218 of the IO request structure shown in FIG. When the H / W dependent unit 105 calls the callback routine, the CPU 31 reads out the packet data stored in the buffer 321 and stores it in the buffer 325 of the user area 32B (step S4).

次に、H/W非依存部107は、ユーザ領域32Bのバッファ325に格納したパケットデータがショートパケットであるか否かを判定する(ステップS5)。H/W非依存部107は、パケットデータのデータサイズが、最大パケット転送サイズである512byteの整数倍ではないショートパケットであった場合には(ステップS5/YES)、未使用のIOリクエストb,cの取り消しや、Read()の完了処理を行い(ステップS6)、バルクアウト転送を終了させる。また、H/W非依存部107は、パケットデータがヌルパケットであった場合にも、未使用のIOリクエストb,cの取り消しや、Read()の完了処理を行い(ステップS6)、バルクアウト転送を終了させる。   Next, the H / W independent unit 107 determines whether or not the packet data stored in the buffer 325 of the user area 32B is a short packet (step S5). When the data size of the packet data is a short packet that is not an integral multiple of 512 bytes that is the maximum packet transfer size (step S5 / YES), the H / W independent unit 107 determines that the unused IO request b, Canceling c and completing Read () are performed (step S6), and the bulk-out transfer is terminated. Further, even when the packet data is a null packet, the H / W independent unit 107 cancels unused IO requests b and c and completes Read () (step S6), and performs bulk-out. End the transfer.

また、ユーザ領域32Bのバッファ325に新たに格納されたパケットデータのデータサイズが、最大パケット転送サイズである512byteの整数倍のデータサイズであった場合(ステップS5/NO)、H/W非依存部107は、バッファ321の有効メモリサイズがオリジナルサイズ(4Kbyte)であるか否かを判定する(ステップS7)。最初、バッファ321の有効メモリサイズは、512byteに設定されているので(ステップS7/NO)、H/W非依存部107は、バッファ321の有効メモリサイズを512byteからオリジナルサイズの4Kbyteに変更(ステップS8)したIOリクエストd(図6参照)をデバイスドライバのH/W依存部105に発行する(ステップS9)。IOリクエストdがH/W依存部105に発行されることで、H/W依存部105は、カーネル領域32Aに、バッファ321を4Kbyteで用意させる。すなわち、パケットデータの格納が終わったバッファ321は、格納したパケットデータのユーザ領域32Bへの転送が終了すると、有効メモリサイズ等を新たに設定されて、メモリ32のカーネル領域32Aに再度、用意される。   If the data size of the packet data newly stored in the buffer 325 of the user area 32B is a data size that is an integral multiple of 512 bytes, which is the maximum packet transfer size (step S5 / NO), it is H / W independent. The unit 107 determines whether or not the effective memory size of the buffer 321 is the original size (4 Kbytes) (step S7). First, since the effective memory size of the buffer 321 is set to 512 bytes (step S7 / NO), the H / W independent unit 107 changes the effective memory size of the buffer 321 from 512 bytes to the original size of 4 Kbytes (step S7 / NO). S8) The issued IO request d (see FIG. 6) is issued to the H / W dependency unit 105 of the device driver (step S9). When the IO request d is issued to the H / W dependency unit 105, the H / W dependency unit 105 causes the kernel area 32A to prepare the buffer 321 with 4 Kbytes. That is, the buffer 321 in which the packet data has been stored is newly prepared in the kernel area 32A of the memory 32 with a new effective memory size and the like when the transfer of the stored packet data to the user area 32B is completed. The

その後、後続するパケットデータがバッファ322に格納され、バッファ322の有効メモリサイズを満たすと、バッファ321の場合と同様に、USBターゲットコントローラ33の制御部36からCPU31経由でH/W依存部105のインターラプトハンドラにパケットデータが格納されたことが通知される。H/W依存部105は、インターラプトハンドラで制御部36からの通知をCPU31経由で受け、IOリクエストbをIOリクエスト待ちキューらIOリクエスト完了キューに移動させる。また、H/W依存部105は、図7に示すIOリクエスト構造体の“コールバックルーチンへのポインタフィールド”で設定されている、H/W非依存部107のコールバックルーチンをコールする(ステップS10)。H/W依存部105がコールバックルーチンをコールすることで、CPU31は、バッファ321に格納されたパケットデータを読み出して、ユーザ領域32Bのバッファ325に格納する(ステップS4)。この後、同様にして、H/W非依存部107は、ユーザ領域32Bのバッファ325に新たに格納されたパケットデータがショートパケットであるか否かを判定する(ステップS5)。ユーザ領域32Bのバッファ325に新たに格納されたパケットデータのデータサイズが、最大パケット転送サイズである512byteの整数倍のデータサイズであった場合(ステップS5/NO)、H/W非依存部107は、バッファ322のサイズが最大サイズであるか否かを判定する(ステップS7)。最初、バッファ322のサイズは、最大サイズである4Kbyteではなく、最大サイズである4Kbyteから512byteを差し引いた、約3.5Kbyteに設定されている(ステップS7/NO)。そこで、H/W非依存部107は、バッファ321の有効メモリサイズをオリジナルサイズの4Kbyteに変更(ステップS8)したIOリクエストe(図6参照)をデバイスドライバのH/W依存部105に発行する(ステップS9)。IOリクエストeがH/W依存部105に発行されることで、H/W依存部105は、カーネル領域32Aにバッファ322を4Kbyteで用意させる。
これ以後、バッファ321、322、323の有効メモリサイズは、4Kbyteとなり、バッファ321、322、323に、4Kbyteのパケットデータが格納されるごとに、H/W依存部105、H/W非依存部107を介してアプリケーション108のユーザ領域32Bに4Kbyteのパケットデータが転送される。
After that, the subsequent packet data is stored in the buffer 322, and when the effective memory size of the buffer 322 is satisfied, as in the case of the buffer 321, the control unit 36 of the USB target controller 33 passes through the CPU 31 and the H / W dependent unit 105 The interrupt handler is notified that the packet data has been stored. The H / W dependency unit 105 receives the notification from the control unit 36 via the CPU 31 as an interrupt handler, and moves the IO request b from the IO request waiting queue to the IO request completion queue. Further, the H / W dependent unit 105 calls the callback routine of the H / W independent unit 107 set in the “pointer field to the callback routine” of the IO request structure shown in FIG. S10). When the H / W dependent unit 105 calls the callback routine, the CPU 31 reads out the packet data stored in the buffer 321 and stores it in the buffer 325 of the user area 32B (step S4). Thereafter, similarly, the H / W independent unit 107 determines whether or not the packet data newly stored in the buffer 325 of the user area 32B is a short packet (step S5). When the data size of the packet data newly stored in the buffer 325 of the user area 32B is a data size that is an integral multiple of 512 bytes, which is the maximum packet transfer size (step S5 / NO), the H / W independent unit 107 Determines whether the size of the buffer 322 is the maximum size (step S7). Initially, the size of the buffer 322 is set to about 3.5 Kbytes obtained by subtracting 512 bytes from the maximum size of 4 Kbytes, not the maximum size of 4 Kbytes (step S7 / NO). Therefore, the H / W independent unit 107 issues an IO request e (see FIG. 6) in which the effective memory size of the buffer 321 is changed to the original size of 4 Kbytes (step S8) to the H / W dependent unit 105 of the device driver. (Step S9). By issuing the IO request e to the H / W dependency unit 105, the H / W dependency unit 105 causes the kernel area 32A to prepare the buffer 322 in 4 Kbytes.
Thereafter, the effective memory size of the buffers 321, 322, and 323 becomes 4 Kbytes. Every time 4 Kbytes of packet data is stored in the buffers 321, 322, and 323, the H / W dependent unit 105 and the H / W independent unit 4 Kbytes of packet data is transferred to the user area 32 </ b> B of the application 108 via 107.

また、ステップS10において、IOリクエスト(例えば、図6に示すIOリクエストg)が発行されてから、タイムアウト時間を経過してもH/W非依存部107のコールバックルーチンがコールされない場合(ステップS11/YES)、未使用のIOリクエストの取り消しや、Read()の完了処理を行い(ステップS6)、バルクアウト転送を終了させる。   In step S10, if the callback routine of the H / W independent unit 107 is not called even after the time-out period has elapsed since the IO request (for example, the IO request g shown in FIG. 6) is issued (step S11). / YES), cancellation of unused IO requests, and completion of Read () are performed (step S6), and the bulk-out transfer is terminated.

上述した実施例は、本発明の好適な実施の例である。但し、これに限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変形実施が可能である。   The embodiment described above is a preferred embodiment of the present invention. However, the present invention is not limited to this, and various modifications can be made without departing from the scope of the present invention.

10 ホスト装置
11 CPU
12 メモリ
13 USBホストコントローラ
30 ターゲットデバイス
31 CPU(制御装置)
32 メモリ
33 USBターゲットコントローラ
36 制御部(通知手段)
101、108 アプリケーション
102 クラスドライバ
103、106 API
104 ホストコントロール/バスドライバ
105 H/W依存部
107 H/W非依存部
321 バッファ(第1メモリ)
322 バッファ(第2メモリ)
323 バッファ(第3メモリ)
325 バッファ
10 Host device 11 CPU
12 Memory 13 USB Host Controller 30 Target Device 31 CPU (Control Device)
32 Memory 33 USB target controller 36 Control unit (notification means)
101, 108 Application 102 Class driver 103, 106 API
104 Host control / bus driver 105 H / W dependent unit 107 H / W independent unit 321 Buffer (first memory)
322 buffer (second memory)
323 buffer (third memory)
325 buffer

Claims (5)

データ通信路を介して外部装置から送信されたパケットデータを格納する複数のメモリを備えるデータ受信装置であって、
前記データ通信路を介して前記外部装置から送信されるパケットデータを受信する受信手段と、
前記外部装置から転送されるパケットデータの最大転送サイズを、パケットデータを格納可能な有効メモリサイズとし、前記外部装置からのパケットデータの送信が開始されると、前記複数のメモリにおいて最初にパケットデータを格納する第1メモリと、
前記第1メモリにパケットデータが格納され、前記第1メモリの有効メモリサイズを満たした場合に、前記データ受信装置を制御する制御装置に、パケットデータの受信を通知する通知手段と、
を有することを特徴とするデータ受信装置。
A data receiving device comprising a plurality of memories for storing packet data transmitted from an external device via a data communication path,
Receiving means for receiving packet data transmitted from the external device via the data communication path;
When the maximum transfer size of the packet data transferred from the external device is set to an effective memory size capable of storing the packet data, and transmission of the packet data from the external device is started, the packet data is first transmitted in the plurality of memories. A first memory for storing
A notification means for notifying the control device that controls the data reception device of reception of packet data when packet data is stored in the first memory and the effective memory size of the first memory is satisfied;
A data receiving apparatus comprising:
前記複数のメモリは、前記第1メモリと、前記外部装置から順次送信される、前記第1メモリに格納されたパケットデータに後続するパケットデータを順次格納する、前記最大転送サイズの整数倍をパケットデータを格納可能な有効メモリサイズとする複数の後続メモリとを備え、
前記複数の後続メモリのいずれかにパケットデータの格納が開始されてから、該メモリの有効メモリサイズを満たすパケットデータが格納されるまでの待ち時間を設定する待ち時間設定手段を有し、
前記通知手段は、前記複数の後続メモリのうちのいずれかのメモリにパケットデータの格納が開始されてから、前記待ち時間を経過しても前記メモリの有効メモリサイズを満たすパケットデータが前記メモリに格納されない場合に、前記制御装置に、前記外部装置からのパケットデータの受信完了を通知することを特徴とする請求項1記載のデータ受信装置。
The plurality of memories sequentially store packet data subsequent to packet data stored in the first memory and sequentially transmitted from the first device and the external device. A plurality of subsequent memories having an effective memory size capable of storing data,
Wait time setting means for setting a wait time from the start of storing packet data to any of the plurality of subsequent memories until the packet data satisfying the effective memory size of the memory is stored;
The notifying means stores packet data that satisfies the effective memory size of the memory in the memory even after the waiting time has elapsed since the start of storing packet data in any one of the plurality of subsequent memories. 2. The data receiving apparatus according to claim 1, wherein when the data is not stored, the control apparatus is notified of completion of reception of packet data from the external apparatus.
前記後続メモリは、第2メモリと第3メモリとを備え、
前記第2メモリのパケットデータを格納可能な有効メモリサイズは、前記第3メモリの有効メモリサイズから前記第1メモリの有効メモリサイズを差し引いたメモリサイズを備えることを特徴とする請求項2記載のデータ受信装置。
The subsequent memory includes a second memory and a third memory,
The effective memory size capable of storing the packet data of the second memory includes a memory size obtained by subtracting an effective memory size of the first memory from an effective memory size of the third memory. Data receiving device.
前記第1メモリと前記第2メモリとの有効メモリサイズを変更する有効メモリサイズ変更手段を備え、
前記有効メモリサイズ変更手段は、前記第1メモリと前記第2メモリとのそれぞれに、各メモリの有効メモリサイズを満たすパケットデータが格納され、前記制御装置によって、格納されたパケットデータが後段側の処理部へ転送された後に、前記第1メモリと前記第2メモリとの有効メモリサイズを、前記第3メモリの有効メモリサイズに変更して、前記第3メモリに、該第3メモリの有効メモリサイズを満たすパケットデータが格納された後に、後続するパケットデータを前記第1メモリと前記第2メモリとに順次格納させることを特徴とする請求項3記載のデータ受信装置。
Effective memory size changing means for changing the effective memory size of the first memory and the second memory;
The effective memory size changing means stores packet data satisfying the effective memory size of each memory in each of the first memory and the second memory, and the control device stores the packet data stored on the rear stage side. After being transferred to the processing unit, the effective memory size of the first memory and the second memory is changed to the effective memory size of the third memory, and the effective memory of the third memory is changed to the third memory. 4. The data receiving apparatus according to claim 3, wherein after the packet data satisfying the size is stored, the subsequent packet data is sequentially stored in the first memory and the second memory.
データ通信路を介して外部装置から送信されたパケットデータを格納する複数のメモリを備えるデータ受信装置のデータ受信プログラムであって、
コンピュータに、
前記データ通信路を介して前記外部装置から送信されるパケットデータを受信手段で受信するステップと、
前記外部装置からのパケットデータの送信が開始されると、前記外部装置から転送されるパケットデータの最大転送サイズを、パケットデータを格納可能な有効メモリサイズとする第1メモリに、前記複数のメモリにおいて最初にパケットデータを格納させるステップと、
前記第1メモリにパケットデータが格納され、前記第1メモリの有効メモリサイズを満たした場合に、前記データ受信装置を制御する制御装置に、パケットデータの受信を通知するステップとを実行させることを特徴とするプログラム。
A data receiving program of a data receiving device comprising a plurality of memories for storing packet data transmitted from an external device via a data communication path,
On the computer,
Receiving packet data transmitted from the external device via the data communication path by a receiving unit;
When transmission of packet data from the external device is started, the plurality of memories are used as a first memory in which the maximum transfer size of the packet data transferred from the external device is an effective memory size capable of storing packet data. First storing packet data in
When packet data is stored in the first memory and the effective memory size of the first memory is satisfied, a step of notifying reception of packet data to a control device that controls the data receiving device is executed. A featured program.
JP2010067227A 2010-03-24 2010-03-24 Data receiver and program Pending JP2011198314A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010067227A JP2011198314A (en) 2010-03-24 2010-03-24 Data receiver and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010067227A JP2011198314A (en) 2010-03-24 2010-03-24 Data receiver and program

Publications (1)

Publication Number Publication Date
JP2011198314A true JP2011198314A (en) 2011-10-06

Family

ID=44876361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010067227A Pending JP2011198314A (en) 2010-03-24 2010-03-24 Data receiver and program

Country Status (1)

Country Link
JP (1) JP2011198314A (en)

Similar Documents

Publication Publication Date Title
JP3636157B2 (en) Data transfer control device, electronic device, and data transfer control method
US8713239B2 (en) Bus controller for handling split transactions
US8521934B1 (en) Multi-port context-based host controller
JP3632695B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2004021613A (en) Data transfer controller, electronic apparatus, and data transfer control method
JP5641754B2 (en) Interface card system
US9390036B2 (en) Processing data packets from a receive queue in a remote direct memory access device
US10540301B2 (en) Virtual host controller for a data processing system
US8402180B2 (en) Autonomous multi-packet transfer for universal serial bus
JP4696199B2 (en) USB host controller with transfer descriptor memory
US20080201498A1 (en) Data communication system, data communication program recording medium, data communication method, data receiving device, and data receiving program recording medium
JP3636158B2 (en) Data transfer control device and electronic device
US6990550B2 (en) Transaction duration management in a USB host controller
JP3636160B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2011065630A (en) Data transfer control device and data transfer control method
US20070208896A1 (en) Interrupt Scheme for Bus Controller
US8842547B2 (en) Communication control apparatus and control method
JP2011198314A (en) Data receiver and program
KR20070024600A (en) Bus controller for transferring data
JP4127071B2 (en) Data transfer control device, electronic device, and data transfer control method
JP2008250496A (en) Engine-processor coordination system and method
JP2003316734A (en) Data transfer control device, electronic equipment, and data transfer control method
JP2003323391A (en) Data transfer control device, electronic equipment and data transfer control method
JP2004021976A (en) Data transfer controller, electronic apparatus, and data transfer control method
JP2004021742A (en) Usb (universal serial bus) device controller