JP2007096737A - Communication controller and its control method - Google Patents
Communication controller and its control method Download PDFInfo
- Publication number
- JP2007096737A JP2007096737A JP2005283254A JP2005283254A JP2007096737A JP 2007096737 A JP2007096737 A JP 2007096737A JP 2005283254 A JP2005283254 A JP 2005283254A JP 2005283254 A JP2005283254 A JP 2005283254A JP 2007096737 A JP2007096737 A JP 2007096737A
- Authority
- JP
- Japan
- Prior art keywords
- packet
- size
- communication control
- received packet
- transmission side
- 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.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
Description
本発明は、通信制御装置およびその制御方法に関するものである。本発明の通信制御装置は、とくに、USB(Universal Serial Bus)の通信において生じるエラーの耐性を向上させる技術に関するものである。また、本発明の通信制御方法は、たとえばUSB通信のショートパケット等で生じるパケット誤認識を的確に判断し、この判断に応じてパケット通信を制御する手順に関するものである。 The present invention relates to a communication control device and a control method therefor. The communication control apparatus according to the present invention particularly relates to a technique for improving resistance to errors that occur in USB (Universal Serial Bus) communication. The communication control method of the present invention relates to a procedure for accurately determining packet misrecognition caused by, for example, a short packet of USB communication and controlling packet communication in accordance with this determination.
USB(Universal Serial Bus)通信では、通信品質の確保のためクロック精度、信号波形、ジッタおよびスキュー等の影響にともなう信号品質、ならびにノイズ対策等の様々な条件が規定されている。また、USB通信は、通信エラーに関してもパケットの各フィールドにCRC(Cyclic Redundancy Check)等の冗長部を持たせることでエラー検出する仕組みが採用されている。また、ハンドシェークを使い分けることにより、USB通信は、フロー制御ができるだけでなく、検出したエラーに対する再送の仕組みも用意されている。
前述したようにUSB通信には、通信品質、パケットのエラー検出および再送に関する各種の規定が設けられている。しかしながら、パケット長に関しては、EOP(End Of Packet)を検出することでパケットの終端と認識する。したがって、パケットはパケット長を示すフィールドを持たない。このため、EOPの検出を誤ると、正常なパケットであっても、そのパケット長を知ることができない。さらに、USB通信におけるパケット長は可変長である。 As described above, the USB communication is provided with various regulations relating to communication quality, packet error detection, and retransmission. However, the packet length is recognized as the end of the packet by detecting EOP (End Of Packet). Therefore, the packet does not have a field indicating the packet length. For this reason, if the EOP is detected incorrectly, the packet length cannot be known even for a normal packet. Furthermore, the packet length in USB communication is variable.
ここで、パケット破損が発生し、これによりEOPを誤認識すると、パケットはショートパケットとして扱われてしてしまう。この場合、パケット破損は、冗長部によるフィールドのエラー検出機能に基づく検出を頼ることとなる。たとえばパケットがショートパケットとして扱われた場合、テータフィールドにおけるデータの並びには制約がとくにないことから、データフィールドの正常に転送できた部分とCRCフィールドとして扱われた部分によるCRC検査において偶然、CRC値が一致してしまうことが有り得る。これが生じると、結果的に破損パケットが正常パケットと認識されてしまう。 Here, when packet corruption occurs and thus EOP is misrecognized, the packet is treated as a short packet. In this case, the packet corruption depends on detection based on the error detection function of the field by the redundant part. For example, if a packet is treated as a short packet, there is no restriction on the data sequence in the data field, so the CRC value by chance in the CRC check by the part that was successfully transferred and the part that was treated as a CRC field. May match. When this occurs, the corrupted packet is recognized as a normal packet as a result.
ところで、USB通信規格のバージョンl.1にて規定され、USB通信規格のバージョン2.0でも継承されているUSB通信のフルスピードにおいて、EOPは信号の種類を表わすバスコンディションとして、他では再現され難い2ビットタイムのSE0(Send End 0)ステートとして定義されていた。通常の信号は差動信号であるため、2つのデータ線で位相が逆になるが、SEOは2つのデータ線がともにローレベルの信号になる。すなわち、それが2ビットタイムを継続することになる。これにより、このような破損したパケットの検出に支障をきたす可能性を完全になくすことはできないが、その可能性は低く抑えられていた。 By the way, at the full speed of USB communication specified in version l.1 of the USB communication standard and inherited in version 2.0 of the USB communication standard, EOP is difficult to be reproduced elsewhere as a bus condition representing the type of signal. It was defined as the SE0 (Send End 0) state of bit time. Since the normal signal is a differential signal, the phase is reversed between the two data lines, but in SEO, the two data lines are both low level signals. That is, it will continue for 2 bit times. As a result, the possibility of hindering the detection of such a damaged packet cannot be completely eliminated, but the possibility has been kept low.
一方、USB通信規格のバージョン2.0で追加されたハイスピード通信でEOPは、フルスピード通信と定義が異なる。ハイスピード通信においてEOPは、通常のデータビットと同一な差動信号であるJステートまたはKステートの8ビットタイム継続として定義された。JおよびKステートは通常のデータビットと同一なステートではあるが、USB通信ではビットスタッフという仕組みにより7ビット以上同じステートが続く場合、JおよびKステートがトグルする規則があり、8ビットタイム継続するJおよびKステートはデータ並びとしては発生せず、EOPを識別できることになる。 On the other hand, EOP is a high-speed communication added in version 2.0 of the USB communication standard, and the definition differs from full-speed communication. In high-speed communication, EOP was defined as 8-bit time continuation in J state or K state, which is the same differential signal as normal data bits. The J and K states are the same states as normal data bits, but in USB communication, if the same state continues for 7 or more bits due to the mechanism of bit stuff, there is a rule that the J and K states toggle, and the 8-bit time continues The J and K states do not occur as data sequences, and EOP can be identified.
ここで、このビットスタッフに対するエラー、すなわちビットスタッフエラーが発生すると、フルスピード通信ではエラーとして検出し、検出したエラーのパケットを破棄する。しかしながら、ハイスピード通信では、直ちにEOPと同じバスコンディションとなり、USB通信規格のバージョン2.0でもEOPとして扱われることが明記されている。この結果、ビットスタッフエラーが検出できなくなっている。したがって、フルスピード通信では2ビット分のエラーが発生しない限り、EOPを誤認識することはなかったが、ハイスピード通信では、データ並びによっては1ビット分のエラーでもEOPを誤認識することとなる。これにより、フルスピード通信よりもハイスピード通信では、EOP検出に対するエラー耐性が低くなっている。この結果として、EOPの誤認識による破損した短いパケットを正常パケットとして扱う危険性が増してしまう。 Here, when an error with respect to this bit stuff, that is, a bit stuff error occurs, it is detected as an error in full-speed communication, and the packet of the detected error is discarded. However, it is specified that in high-speed communication, the bus condition immediately becomes the same as that of EOP, and it is treated as EOP even in version 2.0 of the USB communication standard. As a result, a bit stuff error cannot be detected. Therefore, EOP was not misrecognized unless an error of 2 bits occurred in full-speed communication. However, in high-speed communication, EOP was misrecognized even with an error of 1 bit depending on the data arrangement. . As a result, error tolerance for EOP detection is lower in high-speed communication than in full-speed communication. As a result, there is an increased risk of handling a short packet that is damaged due to erroneous recognition of EOP as a normal packet.
この危険性について簡単に説明する。偶然CRCが一致し、EOPが誤認識にあるエラーパケットの残りに対するデータ送信完了前にACK(ACKnowledge)応答が返された場合、送信側はACK応答が受け取れない。このため、送信側はパケット送信が失敗したと認識、すなわち異常なトランザクションの完了と判断する。しかしながら、エラーパケットの残りに対するデータが送信完了後にACK応答が返されると、送信側はACK応答を受け取るから、正常受信と誤認識する。この結果、送信データの再送が起こらない。 This danger will be briefly explained. If the CRC coincides and the ACK (ACKnowledge) response is returned before the data transmission for the rest of the error packets in which EOP is misrecognized, the transmitting side cannot receive the ACK response. For this reason, the transmission side recognizes that the packet transmission has failed, that is, determines that the abnormal transaction has been completed. However, if the ACK response is returned after the data for the remainder of the error packet is transmitted, the transmitting side receives the ACK response, so that it is erroneously recognized as normal reception. As a result, transmission data is not retransmitted.
本発明はこのような従来技術の欠点を解消し、破損したパケットに対する認識を正しくし、より一層エラー耐性を向上させることができる通信制御装置およびその制御方法を提供することを目的とする。 It is an object of the present invention to provide a communication control device and a control method therefor that can eliminate such drawbacks of the prior art, correct recognition of damaged packets, and further improve error resistance.
本発明は上述の課題を解決するために、送信側から供給されるパケットを受信し、受信したパケットを解析し、解析により得られる情報を基にこの受信したパケットの受信状態に応じて送信側に対してこの受信したパケットの通信を制御する通信制御装置において、この装置は、受信したパケットの解析により得られた第1のパケットサイズを格納する情報格納手段と、送信側から供給されるパケットの再送される回数をカウントするカウント手段と、第1のパケットサイズおよび回数が入力され、受信したパケットに対してあらかじめ設定された第2のパケットサイズと第1のパケットサイズとを比較し、少なくとも、比較結果および回数のいずれか一方をサイズ条件とし、このサイズ条件に対する受信したパケットを検査し、検査結果に応じて送信側へのハンドシェークを無応答にするか否かを判定し、制御するサイズ検査手段とを含むことを特徴とする。 In order to solve the above-mentioned problem, the present invention receives a packet supplied from the transmission side, analyzes the received packet, and based on the information obtained by the analysis, the transmission side according to the reception state of the received packet In the communication control device for controlling the communication of the received packet, the device includes an information storage means for storing the first packet size obtained by analyzing the received packet, and a packet supplied from the transmission side. Counting means for counting the number of times of retransmission, a first packet size and the number of times are input, a second packet size set in advance for the received packet is compared with the first packet size, and at least , One of the comparison result and the number of times is set as a size condition, and the received packet for this size condition is inspected, and Flip handshaking to the sender determines whether the no-response, characterized in that it comprises a size checking means for controlling.
本発明の通信制御装置は、情報格納手段に第1のパケットサイズを格納し、カウント手段に再送した回数をカウントし、サイズ検査手段で第1のパケットサイズおよび回数が入力され、受信したパケットに対してあらかじめ設定された第2のパケットサイズと第1のパケットサイズとを比較し、少なくとも、比較結果および回数のいずれか一方をサイズ条件とし、このサイズ条件に対する受信したパケットを検査し、検査結果に応じて送信側へのハンドシェークを無応答にするか否かを判定し、この判定に応じて制御することにより通常どのサイズであっても、パケットのペイロードが所定のサイズ以内であれば、ACK(ACKnowledge)応答を返すところを、サイズ条件の一致や回数によりハンドシェークを無応答とすることによりパケットサイズの誤認識に対して的確に再送を送信側にさせる。 The communication control apparatus of the present invention stores the first packet size in the information storage means, counts the number of retransmissions in the counting means, receives the first packet size and the number of times in the size inspection means, The second packet size set in advance and the first packet size are compared, and at least one of the comparison result and the number of times is set as the size condition, and the received packet for the size condition is inspected. If the packet payload is within the specified size, the ACK is normally determined regardless of the size. (ACKnowledge) The packet size by returning no response when the handshake is not responded depending on the size condition match or the number of times. Is the correct retransmitted against erroneous recognition to the sender.
また、本発明は上述の課題を解決するために、送信側から供給されるパケットを受信し、受信したパケットを解析し、解析により得られる情報を基に該受信したパケットの受信状態に応じて送信側に対してこの受信したパケットの通信を制御する通信制御方法において、この方法は、解析により受信したパケットのサイズを第1のパケットサイズとして求める第1の工程と、送信側から供給されるパケットの再送される回数をカウントする第2の工程と、あらかじめ第2のパケットサイズを設定しておき、第1のパケットサイズと第2のパケットサイズとの比較結果および回数をサイズ条件とし、このサイズ条件に対する受信したパケットを検査する第3の工程と、受信したパケットの検査結果に応じて送信側へのハンドシェークを無応答にするか否かを判定し、制御する第4の工程とを含み、第4の工程は、回数の判定がパケットの再送を認める限界より小さい回数の場合、送信側へのハンドシェークを無応答に制御し、回数が限界に一致した場合、送信側に対し正常として制御し、この通信制御方法にて規定される上位階層の構成要素に対して受信したパケットのエラーを割り込みでアサートし、この受信したパケットを保持することを特徴とする。 In order to solve the above-described problem, the present invention receives a packet supplied from the transmission side, analyzes the received packet, and based on information obtained by the analysis, according to the reception state of the received packet. In the communication control method for controlling the communication of the received packet with respect to the transmission side, this method is supplied from the transmission side and a first step for obtaining the size of the packet received by analysis as the first packet size. A second step of counting the number of times a packet is retransmitted, a second packet size is set in advance, and the comparison result and the number of times between the first packet size and the second packet size are used as size conditions. The third step of inspecting the received packet for the size condition, and the handshake to the transmission side according to the inspection result of the received packet, no response And the fourth step of controlling whether or not the handshake to the transmitting side is made to be unresponsive when the number of times is smaller than the limit for allowing retransmission of the packet. If the number of times matches the limit, the transmission side is controlled as normal, and the received packet error is asserted by an interrupt to the upper layer component specified by this communication control method. It is characterized by holding a packet.
本発明の通信制御方法は、解析により受信したパケットのサイズを第1のパケットサイズとして求め、送信側から供給されるパケットの再送される回数をカウントし、あらかじめ第2のパケットサイズを設定しておき、第1のパケットサイズと第2のパケットサイズとの比較結果およびカウントした回数をサイズ条件とし、このサイズ条件に対する受信したパケットを検査し、受信したパケットの検査結果に応じて送信側へのハンドシェークを無応答にするか否かを判定し、制御し、この制御は回数の判定がパケットの再送を認める限界より小さい回数の場合、送信側へのハンドシェークを無応答にし、回数が限界に一致した場合、送信側に対し正常として制御し、この通信制御方法にて規定される上位階層の構成要素に対して受信したパケットのエラーを割り込みでアサートし、この受信したパケットを保持することで破損したパケット、とくに、ショートパケットに対する認識を正しくし、より一層エラー耐性を向上させる。 The communication control method according to the present invention obtains the size of a packet received by analysis as the first packet size, counts the number of times the packet supplied from the transmission side is retransmitted, and sets a second packet size in advance. Then, the comparison result between the first packet size and the second packet size and the number of times counted are used as the size condition, the received packet is inspected for the size condition, and the transmission side is inspected according to the inspection result of the received packet. Determines whether or not to make the handshake unresponsive, and controls this. If the number of times is less than the limit that allows packet retransmission, the handshake to the sending side is made unresponsive and the number matches the limit. In this case, the transmission side is controlled as normal, and the received packet is received for the upper layer component specified by this communication control method. Bets errors asserted by interrupt, corrupted packets by holding this received packet, in particular, properly awareness of short packets, it improves the more error tolerant.
本発明の通信制御装置および通信制御方法によれば、上位層プロトコルで決まっているサイズ条件によりUSBプロトコルでは検出できないエラーを検出して誤り検出率を高めることができる。また、再送単位を小さく、さらにハードウェアにより応答速度も通常のエラーパケットと同様にすることでエンドポイントの転送パフォーマンスへの影響および無駄なパケットの転送をなくすことができ、USBバス全体のバンド幅も有効に使用することができる。 According to the communication control device and the communication control method of the present invention, an error that cannot be detected by the USB protocol due to the size condition determined by the upper layer protocol can be detected and the error detection rate can be increased. In addition, the resend unit is reduced and the response speed of hardware is the same as that of normal error packets, so that the impact on endpoint transfer performance and unnecessary packet transfer can be eliminated, and the bandwidth of the entire USB bus Can also be used effectively.
次に添付図面を参照して本発明による通信制御装置の一実施例を詳細に説明する。 Next, an embodiment of a communication control apparatus according to the present invention will be described in detail with reference to the accompanying drawings.
本実施例は、本発明の通信制御装置をUSB通信装置10に適用した場合である。本発明と直接関係のない部分について図示および説明を省略する。以下の説明で、信号はその現れる接続線の参照番号で指示する。
In this embodiment, the communication control device of the present invention is applied to the
USB通信装置10は、図2に示すように、プロトコルを制御するハードウェア12(HW)、ソフトウェア14(SW)がスタックした階層構造を有する。また、レイヤの観点から見ると、大きくUSBバス1/Fレイヤ16、USB論理デバイスレイヤ18、ファンクションレイヤ20の3つに分けることができる。
As shown in FIG. 2, the
USBバス1/Fレイヤ16は、USBの物理層(PHYsical HW)22とUSBのコントローラ(リンク層HW)24を含む。物理層HW(22)は、クロック同期、バスステート検出、EOP検出、NRZI(Non-Return to Zero Invert)コーデックおよびビットスタッフ/アンスタッフ等の機能を有する。NRZIとは、変調符号のビットにデータ"1"が現れるごとに極性を反転する方法である。
The
また、USBリンク層HW(24)では、パケットエラー検出、トランザクション管理、アドレス、エンドポイント管理等の機能を有する。通信路としてエンドポイント毎にアクセスするためのインタフェースを持つ。 The USB link layer HW (24) has functions such as packet error detection, transaction management, address, and endpoint management. It has an interface for accessing each endpoint as a communication path.
USB論理デバイスレイヤ18は、USBデバイスとして標準コマンドによるPnP(Plug and Play)や電源管理および状態管理等を制御し、複数のトランザクションが集まったトランスファ単位で通信を管理する機能を有する。USB論理デバイスレイヤ18には、この機能を実現させるプロトコルが実装される。これが、たとえばUSBペリフェラルドライバ26である。
The USB logical device layer 18 functions as a USB device to control PnP (Plug and Play), power management, status management, and the like using standard commands, and manage communication in units of transfer in which a plurality of transactions are collected. The USB logical device layer 18 is implemented with a protocol for realizing this function. This is the USB
ファンクションレイヤ20は、周辺機器としての機能を制御する機能を有する。ファンクションレイヤ20には、いくつかのトランスファを組み合わせたファンクション毎のプロトコルが実装される。本実施例では、ファンクションを限定していないが、たとえば大容量のストレージクラスのファンクションとしてUSBクラスドライバ28やアプリケーション30を含む。
The function layer 20 has a function of controlling functions as a peripheral device. In the function layer 20, a protocol for each function in which several transfers are combined is implemented. In the present embodiment, the functions are not limited. For example, the
上述した構成要素を含むUSB通信装置10の一例にUSB HDD(Hard Disk Drive)がある。USB HDD 32を図3に示す。USB HDD 32は、図3に示すように、USBホスト34とデバイス36との間に配され、両装置の間の通信を担う。USB HDD 32は、この場合、クラスドライバとしては、USBデバイスクラスを用いて定義される大容量ストレージクラス38が実装される。また、アプリケーションとしては、ソフトウェアの対応によりコマンド解析AP(APplication)40で解析し、データ処理することにより具体的にはUSB to IDE(Integrated Drive Electronics)ブリッジ機能を実装し、実現させている。
An example of the
ここで、IDEとは、パーソナルコンピュータの互換機用ハードディスクインターフェイスの1つである。 Here, IDE is one of hard disk interfaces for compatible computers of personal computers.
USBイベント制御ソフトウェア42は、USB HDD 32におけるUSB論理デバイスレイヤ18の具体例である。デバイスドライバ44は、デバイス36側のドライバである。
The USB
制御部46は、USBデバイスコントローラ48およびデバイスコントローラ50を含む。USBデバイスコントローラ48は、USBパケットの送受信を制御し、本発明を適用して誤認識により短いパケットの正常なパケットと認識してしまうことで生じるエラー耐性の低下を防ぐ機能を有する。この機能を実現させる構成例を後段にて示しながら説明する。デバイスコントローラ50は、デバイス側との通信を制御する機能を有する。
The
デバイス36には、ATA(Advanced Technology Attachment)/SCSI(Small Computer System Interface)規格のHDD/CD-ROM(Compact Disk-Read Only Memory)/FDD(Floppy Disk Driver)(登録商標)等がある。
The
次に本実施例におけるUSBデバイスコントローラ48の概略的な構成例を図1に示す。USBコントローラ48は、複数のエンドポイント処理部をたとえば、エンドポイントA(52), B(54),・・・として含み、さらに、トランザクション制御部56、MUX(MUltipleXer)58および60、データパケット送信処理部62、ハンドシェーク送信処理部64、トークン送信処理部66、PID(Packet Identifier)生成部68、データパケット送信処理部62、ハンドシェーク送信処理部64、トークン送信処理部66、PID(Packet Identifier)生成部68、データパケット受信処理部70、ハンドシェーク受信処理部72、トークン受処理部74、ならびにPID検査部76を含む。
Next, FIG. 1 shows a schematic configuration example of the
エンドポイント処理部を代表してエンドポイントA(52)を示す。エンドポイントA(52)は、一般的に含まれるFIFO(First-IN First-Out)メモリ78、送受信カウンタ80、ステータスレジスタ82とともに、特徴としてサイズレジスタ84および再送カウンタ86を含む。サイズレジスタ84は、エンドポイント毎に送受信の両方で使用され、送信時に既知および予測可能なサイズに指定された送信サイズを格納する機能を有し、受信時に受信サイズおよびサイズ検査回路の有効/無効を指定する機能も有する。後者の指定機能で無効を指定すると、USBコントローラ48は、通常のUSBコントローラと同じように動作させることができる。USBコントローラ48は、MCU(Micro-Controller Unit)インタフェース上に作られたレジスタインタフェースよりサイズレジスタ84を動的に設定することができる。サイズレジスタ84は、各指定された機能を実現するように動作する。
The endpoint A (52) is shown on behalf of the endpoint processing unit. The endpoint A (52) includes a first-in first-out (FIFO)
再送カウンタ86は、受信専用に用いてパケットの再送された回数を歩進計測する機能を有する。エンドポイントA、B、・・・はMUX 58に接続される。とくに、サイズレジスタ84および再送カウンタ86は、それぞれ、パケットサイズおよび再送回数をデータパケット受信処理部70に供給する。
The
トランザクション制御部56は、MUX 58および60にイネーブル信号86を供給して動作を制御し、送受信における各ステートを制御する機能を有する。この機能を実現させるように、トランザクション制御部56は、送信処理ブロックとしてのデータパケット送信処理部62、ハンドシェーク送信処理部64、トークン送信処理部66、PID生成部68、受信処理ブロックとしてのデータパケット受信処理部70、ハンドシェーク受信処理部72、トークン受信処理部74およびPID検査部76に制御信号88〜102が供給される。
The
データパケット送信処理部62は、図示しないがCRC生成部およびトグル値生成部を含む。データパケット送信処理部62はMUX 60に接続される。また、ハンドシェーク送信処理部64はPID生成部68と接続され、トークン送信処理部66もPID生成部68と接続される。トークン送信処理部66は、図示しないがエンドポイント番号生成部およびアドレス生成部を含む。PID生成部68は、MUX 60に接続される。送信処理ブロックではパケットの各フィールド値を生成する。データパケットの処理ブロックそれぞれはエンドポイントの各レジスタとデータパスにより接続される。
Although not shown, data packet
データパケット受信処理部70は、サイズ検査部104、CRC検査部106およびトグル値検査部106を含む。サイズ検査部104は、パケットのサイズエラーを検出する機能を有する。サイズ検査部104は、トランザクション制御部56だけでなく、エンドポイント毎のサイズレジスタ84、送受信のうちの受信カウンタおよび再送カウンタ86とのデータパスを有する。これにより、サイズ検査部104はサイズレジスタ84、受信カウンタおよび再送カウンタ86それぞれの値を取得する。サイズ検査部104は取得した値を基に再送カウンタ86に対する値を設定することができ、取得した値によりサイズを検査する。既存のUSBコントローラでもサイズ検査として、該当するエンドポイントの最大パケットサイズを超えているかどうかだけを検査するが、本実施例では、これに加えて、サイズレジスタ84で指定したパケットサイズと実際のパケットサイズとを比較し、検査する。ここで、比較検査が一致しない場合、無効パケットとしてトランザクション制御部56に通知する。これによりハンドシェークを無応答にできる。受信処理ブロックとして、データパケット受信処理部70、ハンドシェーク受信処理部72、トークン受信処理部74およびPID検査部76は各フィールドを検査する機能を有する。
The data packet
前述した再送カウンタ86は、サイズ検査部104でエラー判定された場合、カウントが加算され、正常判定をした場合にクリアする連続した再送回数を記憶する機能を有する。また、記憶した再送回数は、サイズ検査の判定後に行なうハンドシェークを選択する際にも使用される。
The above-described
データパケット受信処理部70の動作について簡単に説明する。データパケット受信処理部70では、トグル値検査とCRC検査を行ない、これらの検査の完了後に受信したパケットが正常なパケットと判定した場合、サイズ検査部104でサイズ検査を実行する。サイズ検査では、受信したパケットに該当するエンドポイントのサイズレジスタ84からサイズ検査の有効/無効の指定を取得する。取得したサイズ検査結果が有効であればサイズ検査を実行し、無効であればサイズ検査は実行しない。
The operation of the data packet
サイズ検査を実施する場合、サイズ検査部104はサイズレジスタ84と送受信カウンタ80の受信カウンタとからそれぞれ受信サイズを取得する。サイズ検査部104は取得した受信サイズを比較する。この受信サイズの値が一致すれば、サイズ検査部104は正常と判定する。この判定結果を基にデータ受信パケット処理部70はトランザクション制御部56に正常パケットの受信をアサートする。これにともない該当するエンドポイントの再送カウンタ86をゼロに戻し、処理を終了する。
When performing the size inspection, the
また、サイズ検査部104にてサイズの値が一致しなければ、サイズ検査を異常と判断する。そして、さらに再送カウンタ86を確認する。再送カウンタ86のカウント値が2以下であれば、データ受信パケット処理部70は、トランザクション制御56に異常パケットの受信をアサートする。また、再送カウンタ86のカウント値が3であれば、データ受信パケット処理部70は、反対に正常パケットの受信をアサートする。データ受信パケット処理部70はこのアサートとともに、MCUに外部割込み要求としてショートパケットの受信割込みをアサートする。そして、再送カウンタ86をゼロに戻し処理を終了する。
If the
本実施例のUSBコントローラ48におけるソフトウェアの動作を含む通信処理、とくにパケットの受信手順について図4および図5を参照しながら説明する。図4に受信エンドポイントのUSB制御ソフトウェアの手順を示す。第1にUSBコントローラ48を動作可能にするように初期化等を実施する(ステップS10)。この後、データ受信に割り当てられたエンドポイントに対して設定する(ステップS12)。この設定はエンドポイントが有するサイズレジスタ84に対してソフトウェアにより行なわれる。サイズレジスタ84は供給されるパケットを予期しているパケットサイズとショートパケットの受信を許すか否かを設定する。
A communication process including a software operation in the
次にアプリケーションからのトランスファ要求が有るか否かを判断する(ステップS14)。トランスファ要求が有る場合(YES)、トランスファの受付・解析処理に進む(ステップS16へ)。また、トランスファ要求がない場合(NO)、この手順を終了する。 Next, it is determined whether or not there is a transfer request from the application (step S14). If there is a transfer request (YES), the process proceeds to transfer acceptance / analysis processing (to step S16). If there is no transfer request (NO), this procedure is terminated.
トランスファの受付・解析処理(ステップS16)は、転送されるパケットを受け付けて、このパケットを解析する。この解析においてUSBコントローラ48は、受信したパケットのサイズを求める。この後、トランスファ受信処理に進む(サブルーチンSUB1)。トランスファ受信処理では、受信したパケットのサイズを評価し、正常の評価に応じて受信する。
The transfer acceptance / analysis process (step S16) accepts a transferred packet and analyzes the packet. In this analysis, the
次にトランスファ要求が無いか否かを判断する(ステップS18)。トランスファ要求が無い場合(YES)、受信するパケットが無いと判断してデータ受信を終了する。また、トランスファ要求が有る場合(NO)、トランスファの受付・解析処理に戻る(ステップS16へ)。 Next, it is determined whether or not there is a transfer request (step S18). If there is no transfer request (YES), it is determined that there is no packet to be received, and data reception is terminated. If there is a transfer request (NO), the process returns to the transfer acceptance / analysis process (to step S16).
次にトランスファ受信処理(サブルーチンSUB1)を簡単に説明する。受信したパケットのサイズが既知および予測可能のいずれかを判定する(サブステップSS10)。受信したパケットのサイズが既知および予測可能のいずれかの場合(YES)、パケットサイズの設定に進む(サブステップSS12へ)。また、パケットのサイズが不定および可変長のいずれかの場合(NO)、パケットの受信に進む(サブステップSS14へ)。 Next, the transfer reception process (subroutine SUB1) will be briefly described. It is determined whether the size of the received packet is known or predictable (substep SS10). If the size of the received packet is either known or predictable (YES), the process proceeds to the setting of the packet size (go to substep SS12). If the packet size is either indefinite or variable length (NO), the process proceeds to packet reception (go to sub-step SS14).
次に受信したパケットのサイズを設定する(サブステップSS12)。次に受信したパケットのサイズエラーを検出する(サブステップSS16)。サイズ検査部104にてサイズエラーは、データを受信した際にUSBコントローラ48が設定レジスタ、すなわちサイズレジスタ84の値とパケット解析の結果により得られた受信パケットサイズとを比較する。比較した値が異なる場合は、無効パケットと判断する。このときUSBコントローラ48はデータトグルを変化させずにパケットを破棄し、ハンドシェークは無応答とする。
Next, the size of the received packet is set (substep SS12). Next, a size error of the received packet is detected (substep SS16). When the
ただし、サイズ検査部104は再送カウンタ86から再送回数を受け、この再送回数に応じて通信を制御する。サイズ検査部104は、たとえば受信側が3回連続の無応答をした場合、送信側は通信不能と判断するため、無応答は2回までに制御する。サイズ検査部104は、3回連続でパケットサイズが異なる場合、ACKハンドシェークを返し、有効パケットとして受信する(サブステップSS14)。この場合、サイズエラーパケットの受信を示す割り込みを発生する。
However, the
また、サイズ検査部104は、サイズ比較の結果が同値であれば、状況に応じたハンドシェークを返し、パケット受信を示す割り込みを発生する。
If the size comparison results are the same value, the
次に割込みが有るか否かを判断する(サブステップSS18)。割込みが無い場合サブステップSS18に戻って、待機する。また、割込みが有る場合(YES)、正常受信か否かを判断する(サブステップSS20)。正常受信の場合(YES)、トランスファ完了の判断に進む(サブステップSS22へ)。異常受信の場合(NO)、サイズエラーと判断して、リターンに進む。そして、このときエラーパケット受信割り込みが発生した場合のソワトウェア制御としては、上位層にトランスファエラーを通知する。 Next, it is determined whether or not there is an interrupt (substep SS18). If there is no interrupt, return to substep SS18 and wait. If there is an interrupt (YES), it is determined whether or not the reception is normal (substep SS20). In the case of normal reception (YES), the process proceeds to transfer completion determination (go to sub-step SS22). In the case of abnormal reception (NO), it is determined as a size error and the process proceeds to return. Then, as software control when an error packet reception interrupt occurs at this time, a transfer error is notified to the upper layer.
次にトランスファ完了か否かを判断する(サブステップSS22)。トランスファ未完了の場合(NO)、受信するパケットがまだ存在すると判断して、パケットサイズの既知および予測可能か否かの判断処理に戻る(サブステップSS10へ)。また、トランスファ完了の場合(YES)、トランスファ受信完了と判断して、リターンに進む。 Next, it is determined whether or not the transfer is completed (substep SS22). If the transfer is not completed (NO), it is determined that there are still packets to be received, and the process returns to the determination process of whether the packet size is known and predictable (go to sub-step SS10). When the transfer is completed (YES), it is determined that the transfer reception is completed, and the process proceeds to return.
USBコントローラ48は、このように上位アプリケーション、クラスドライバ次第で、転送するパケットサイズを知ることができる場合、簡単なハードウェアを追加し、ソフトウェア制御することによりエラーパケットだけの再送を実現することができる。また、この場合、とくに、ソフトウェアによりUSBにおける最小の再送単位であるパケット単位の再送を行なうため、パケット単位の再送方法として、ハードウェアでエラー判定とレスポンスの選択を行なうことが好ましい。
If the
これに対して、ソフトウェアによる応答を変更することで早期に再送を実行させる方法も考えられるが、この場合、再送単位が大きくなってしまう。一般的に階層構造のプロトコルでは、階層が上位になるほど扱うデータの単位が大きくなるからである。 On the other hand, a method of executing retransmission at an early stage by changing a response by software is also conceivable, but in this case, a retransmission unit becomes large. This is because, in general, in a hierarchical protocol, the higher the hierarchy, the larger the data unit handled.
具体的に前述した構成および動作を要約すると、USBコントローラ48は、エンドポイント毎にサイズ条件の設定とサイズによるエラー判定とこれに応じたトランザクションのハンドシェーク選択ができるように改良され、ショートパケットに対するレスポンスがパケット受信前に設定できる機能を有する。USBコントローラ48は、このサイズ条件とサイズエラーの判定とともに、ハンドシェーク選択の有効/無効を、レジスタインタフェースを介してオプショナルな機能としてソフトウェアにより設定する。さらに、USBコントローラ48はこの設定を動的に変更可能とし、この機能の動的に制御することを可能にする。
To summarize the configuration and operation specifically described above, the
このソフトウェアでは、上位レイヤプロトコルにより決まるトランスファのサイズ条件に応じてサイズエラー再送機能の有効/無効の切替えとサイズ条件を設定しなおすように制御することが好ましい。サイズ条件はパケット毎に設定するとよい。 In this software, it is preferable to perform control so that the size error retransmission function is enabled / disabled and the size condition is reset according to the transfer size condition determined by the upper layer protocol. The size condition should be set for each packet.
バルク転送の場合、一つのトランスファで最終パケット以外は、ペイロードサイズで転送され、最終パケットだけトランスファの残りのバイト数となるため、トランスファの最終パケットとそれ以外でサイズ条件を設定するように制御することが望ましい。 In the case of bulk transfer, all but the last packet in one transfer is transferred with the payload size, and only the last packet is the number of remaining bytes in the transfer. Therefore, control is performed so that the size condition is set for the last packet of the transfer and others. It is desirable.
そして、連続再送の最大回数である3回目の再送に関して、USBコントローラ48は、下位プロトコルではエラーしていないと判断して、ハードウェアはACK応答して、正常受信し、MCUにショートパケットエラー割込みを発生させる。これによりトランスファサイズが期待したサイズより小さいショートパケット中止に対しても対応することができる。
Then, regarding the third retransmission, which is the maximum number of continuous retransmissions, the
以上のように構成することにより通常、USBプロトコルで検出できないエラーを上位層プロトコルで決まっているサイズ条件を基に検出することでよりエラー検出率を高めることができる。再送単位が大きければ、当然、再送時間が長くなり、転送対象となるエンドポイントの転送パフォーマンスが低下するだけでなく、無駄なパケットの転送によりUSBのバンド幅を消費してしまい、USBバス全体のバンド幅を低下させてしまう。本発明を適用した本実施例によれば、再送単位を小さくし、さらにハードウェアにより応答速度も通常のエラーパケットと同様にして、パフォーマンスヘの影響をなくすことができる。 With the above configuration, it is possible to increase the error detection rate by detecting an error that cannot be detected by the USB protocol based on the size condition determined by the upper layer protocol. Naturally, if the retransmission unit is large, the retransmission time will be longer and not only the transfer performance of the endpoint to be transferred will be degraded, but also the USB bandwidth will be consumed due to the transfer of useless packets, and the entire USB bus will be consumed. Reduces bandwidth. According to the present embodiment to which the present invention is applied, the resend unit can be reduced, and the response speed can be reduced by hardware in the same manner as a normal error packet, thereby eliminating the influence on the performance.
10 USB通信装置
48 USBコントローラ
52、54 エンドポイントA, B
84 サイズレジスタ
86 再送カウンタ
104 サイズ検査部
10 USB communication device
48 USB controller
52, 54 Endpoint A, B
84 Size register
86 Retransmission counter
104 Size inspection section
Claims (10)
前記受信したパケットの解析により得られた第1のパケットサイズを格納する情報格納手段と、
前記送信側から供給されるパケットの再送される回数をカウントするカウント手段と、
第1のパケットサイズおよび前記回数が入力され、前記受信したパケットに対してあらかじめ設定された第2のパケットサイズと第1のパケットサイズとを比較し、少なくとも、比較結果および前記回数のいずれか一方をサイズ条件とし、該サイズ条件に対する前記受信したパケットを検査し、検査結果に応じて前記送信側へのハンドシェークを無応答にするか否かを判定し、制御するサイズ検査手段とを含むことを特徴とする通信制御装置。 Receives a packet supplied from the transmission side, analyzes the received packet, and controls the communication of the received packet to the transmission side according to the reception state of the received packet based on information obtained by the analysis In the communication control device, the device
Information storage means for storing a first packet size obtained by analyzing the received packet;
Counting means for counting the number of times the packet supplied from the transmission side is retransmitted;
The first packet size and the number of times are input, the second packet size set in advance for the received packet is compared with the first packet size, and at least one of the comparison result and the number of times Size check means for inspecting the received packet for the size condition, determining whether or not to make no response to the handshake to the transmitting side according to the inspection result, A communication control device.
前記解析により前記受信したパケットのサイズを第1のパケットサイズとして求める第1の工程と、
前記送信側から供給されるパケットの再送される回数をカウントする第2の工程と、
あらかじめ第2のパケットサイズを設定しておき、第1のパケットサイズと第2のパケットサイズとの比較結果および前記回数をサイズ条件とし、該サイズ条件に対する前記受信したパケットを検査する第3の工程と、
前記受信したパケットの検査結果に応じて前記送信側へのハンドシェークを無応答にするか否かを判定し、制御する第4の工程とを含み、
第4の工程は、前記回数の判定が前記パケットの再送を認める限界より小さい回数の場合、前記送信側へのハンドシェークを無応答に制御し、前記回数が限界に一致した場合、前記送信側に対し正常として制御し、該通信制御方法にて規定される上位階層の構成要素に対して前記受信したパケットのエラーを割り込みでアサートし、該受信したパケットを保持することを特徴とする通信制御方法。 Receives a packet supplied from the transmission side, analyzes the received packet, and controls the communication of the received packet to the transmission side according to the reception state of the received packet based on information obtained by the analysis In the communication control method, the method includes:
A first step of determining the size of the received packet as a first packet size by the analysis;
A second step of counting the number of times the packet supplied from the transmission side is retransmitted;
A third step in which a second packet size is set in advance, the comparison result between the first packet size and the second packet size and the number of times are set as size conditions, and the received packet is inspected with respect to the size conditions When,
Determining whether or not to make no response to the handshake to the transmission side according to the inspection result of the received packet, and a fourth step of controlling,
In the fourth step, when the number of times is smaller than the limit for allowing retransmission of the packet, the handshake to the transmission side is controlled to be no response, and when the number of times matches the limit, the transmission side A communication control method, comprising: controlling as normal, asserting an error of the received packet with an interrupt to an upper layer component defined by the communication control method, and holding the received packet .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005283254A JP4649304B2 (en) | 2005-09-29 | 2005-09-29 | COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005283254A JP4649304B2 (en) | 2005-09-29 | 2005-09-29 | COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2007096737A true JP2007096737A (en) | 2007-04-12 |
JP4649304B2 JP4649304B2 (en) | 2011-03-09 |
Family
ID=37981904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005283254A Expired - Fee Related JP4649304B2 (en) | 2005-09-29 | 2005-09-29 | COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4649304B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021171687A1 (en) * | 2020-02-26 | 2021-09-02 | パナソニックIpマネジメント株式会社 | Video signal processing device, video signal processing method, program, and signal processing circuit |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60246140A (en) * | 1984-05-21 | 1985-12-05 | Meidensha Electric Mfg Co Ltd | Error check device in data transmission system |
JPH06177941A (en) * | 1992-12-09 | 1994-06-24 | Nec Ic Microcomput Syst Ltd | Home bus controller |
JPH10261268A (en) * | 1997-03-19 | 1998-09-29 | Hitachi Ltd | Digital signal processing method, recording method using it and device therefor |
JP2003179626A (en) * | 2001-12-10 | 2003-06-27 | Fujitsu Ltd | Relay connection management program and relay connection management method |
JP2003241870A (en) * | 2002-02-20 | 2003-08-29 | Brother Ind Ltd | Usb device |
JP2005018496A (en) * | 2003-06-27 | 2005-01-20 | Kyocera Mita Corp | Information processor, usb-connected apparatus, information processor control program, usb-connected apparatus control program, and recording medium |
-
2005
- 2005-09-29 JP JP2005283254A patent/JP4649304B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60246140A (en) * | 1984-05-21 | 1985-12-05 | Meidensha Electric Mfg Co Ltd | Error check device in data transmission system |
JPH06177941A (en) * | 1992-12-09 | 1994-06-24 | Nec Ic Microcomput Syst Ltd | Home bus controller |
JPH10261268A (en) * | 1997-03-19 | 1998-09-29 | Hitachi Ltd | Digital signal processing method, recording method using it and device therefor |
JP2003179626A (en) * | 2001-12-10 | 2003-06-27 | Fujitsu Ltd | Relay connection management program and relay connection management method |
JP2003241870A (en) * | 2002-02-20 | 2003-08-29 | Brother Ind Ltd | Usb device |
JP2005018496A (en) * | 2003-06-27 | 2005-01-20 | Kyocera Mita Corp | Information processor, usb-connected apparatus, information processor control program, usb-connected apparatus control program, and recording medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021171687A1 (en) * | 2020-02-26 | 2021-09-02 | パナソニックIpマネジメント株式会社 | Video signal processing device, video signal processing method, program, and signal processing circuit |
EP4114020A4 (en) * | 2020-02-26 | 2023-05-03 | Panasonic Intellectual Property Management Co., Ltd. | Video signal processing device, video signal processing method, program, and signal processing circuit |
US12015822B2 (en) | 2020-02-26 | 2024-06-18 | Panasonic Intellectual Property Management Co., Ltd. | Video signal processing device, video signal processing method, recording medium, and signal processing circuit |
Also Published As
Publication number | Publication date |
---|---|
JP4649304B2 (en) | 2011-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3893415B1 (en) | Characterizing error correlation based on error logging for computer buses | |
US20080163005A1 (en) | Error injection in pci-express devices | |
US20050002384A1 (en) | Method of transmitting data through an I2C router | |
US20070002827A1 (en) | Automated serial protocol target port transport layer retry mechanism | |
EP1224548B1 (en) | System and method improving fault isolation and diagnosis in computers | |
CN104699576B (en) | Serial communication testing device, system comprising same and method thereof | |
US8281189B2 (en) | SATA primitive prediction and correction | |
US7430619B2 (en) | Communication device, host apparatus, and communication method | |
JP3996928B2 (en) | How to handle corrupted data | |
CN111625388B (en) | SSD front end error processing method, SSD front end error processing device, computer equipment and storage medium | |
US7701846B2 (en) | Bad data packet capture device | |
US8874989B2 (en) | Memory system capable of increasing data transfer efficiency | |
US7436777B2 (en) | Failed link training | |
US20040095929A1 (en) | Data processor, packet recognition method, and error correction method | |
US8327212B2 (en) | Error identifying method, data processing device, and semiconductor device | |
JP4649304B2 (en) | COMMUNICATION CONTROL DEVICE AND ITS CONTROL METHOD | |
US7363402B2 (en) | Data communications architecture employing parallel SERDES channels | |
US7606253B2 (en) | Successful transactions | |
JP4455393B2 (en) | Programmable logic controller | |
KR100604842B1 (en) | Method for optimizing UDMA transfer signals using CRC errors | |
US7310762B2 (en) | Detection of errors | |
US20050154968A1 (en) | Detection of errors | |
JPH0535616A (en) | Data transfer system | |
US7454514B2 (en) | Processing data with uncertain arrival time | |
US20240214111A1 (en) | Network interface device with frame sequence value checking |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080305 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20081203 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20090218 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100609 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100629 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100827 |
|
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: 20101116 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20101213 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131217 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4649304 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |