JP5794266B2 - USB host device and program for USB host device - Google Patents
USB host device and program for USB host device Download PDFInfo
- Publication number
- JP5794266B2 JP5794266B2 JP2013179780A JP2013179780A JP5794266B2 JP 5794266 B2 JP5794266 B2 JP 5794266B2 JP 2013179780 A JP2013179780 A JP 2013179780A JP 2013179780 A JP2013179780 A JP 2013179780A JP 5794266 B2 JP5794266 B2 JP 5794266B2
- Authority
- JP
- Japan
- Prior art keywords
- usb
- controller unit
- hub
- host controller
- host
- 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.)
- Active
Links
Images
Landscapes
- Information Transfer Systems (AREA)
Description
本発明は、USB(Universal Serial Bus)規格に準拠した方式で、USBデバイスと通信を行うUSBホスト装置、及びUSBホスト装置用のプログラムに関する。 The present invention relates to a USB host device that communicates with a USB device by a method compliant with the USB (Universal Serial Bus) standard, and a program for the USB host device.
従来、USB2.0対応のホスト装置において、USB2.0対応のデバイスと通信する際、ホスト装置の負荷が増大しそうな場合に、ホスト−デバイス間の通信方式をUSB2.0からUSB1.1に切り替える技術を、既に提案している(特許文献1参照。)。 Conventionally, in a USB 2.0 compatible host device, when communication with a USB 2.0 compatible device is likely to increase the load on the host device, the host-device communication method is switched from USB 2.0 to USB 1.1. A technique has already been proposed (see Patent Document 1).
ところで、一般に、USBホスト装置には複数のUSBポートが設けられているが、これらのUSBポートの総数を上回る数のUSBデバイスをUSBホスト装置に接続したい場合に、USBハブが利用されている。このUSBハブは、USBデバイスの一種であり、他のUSBデバイス同様に、USBホスト装置からはUSB1.1対応なのかUSB2.0対応なのかが認識され、それに応じた制御が行われることになる。 By the way, in general, a plurality of USB ports are provided in the USB host device, but a USB hub is used when it is desired to connect more USB devices than the total number of these USB ports to the USB host device. This USB hub is a type of USB device. Like other USB devices, the USB host device recognizes whether it is compatible with USB 1.1 or USB 2.0, and performs control accordingly. .
具体的には、USBハブがUSB1.1対応の場合、USBホスト装置に設けられたUSBコントローラは、USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部を利用してUSBハブとの通信を行う。また、USBハブがUSB2.0対応の場合、USBホスト装置に設けられたUSBコントローラは、USB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を利用してUSBハブとの通信を行う。 Specifically, when the USB hub is compatible with USB 1.1, the USB controller provided in the USB host device uses a first host controller unit that controls communication with the USB device by a method compliant with USB 1.1. To communicate with the USB hub. Further, when the USB hub is compatible with USB 2.0, the USB controller provided in the USB host device uses a second host controller unit that controls communication with the USB device by a method compliant with USB 2.0. Communicate with.
しかし、上記のようなシステムにおいて、USBホスト装置に複数のUSBハブが接続され、かつ、それら複数のUSBハブがいずれもUSB2.0対応である場合には、上述の第二ホストコントローラ部に通信負荷が集中する。そのため、仮に第一ホストコントローラ部の処理能力には余力があったとしても、第二ホストコントローラ部だけで複数のUSBハブに接続された各USBデバイスに順に対処せざるを得ず、複数のUSBデバイスに対するアクセス速度は全体的に低下してしまう、という問題がある。 However, in the system as described above, when a plurality of USB hubs are connected to the USB host device and each of the plurality of USB hubs is compatible with USB 2.0, communication is performed with the second host controller unit described above. The load is concentrated. Therefore, even if the processing capacity of the first host controller unit is sufficient, it is necessary to deal with each USB device connected to a plurality of USB hubs only by the second host controller unit, and a plurality of USB devices. There is a problem that the overall access speed to the device is reduced.
このような問題に対し、上記特許文献1に記載の技術を利用すれば、いずれかのUSBハブとの通信方式をUSB2.0からUSB1.1に切り替えることは可能なので、これにより、第二ホストコントローラ部にかかる通信負荷を軽減することはできる。
With respect to such a problem, if the technique described in
しかし、USBハブの中には、USB1.1に切り替えてもかまわないものや、USB2.0のまま使用したいものなどが混在している場合がある。そのため、USB1.1に切り替えてもかまわないUSBハブか否かを考慮しないまま通信方式を切り替えてしまうと、USB2.0のまま使用したいUSBハブであったにもかかわらず、USB1.1に切り替えられてしまう、という問題が発生する。 However, there are cases in which USB hubs that can be switched to USB 1.1 or those that are desired to be used as USB 2.0 are mixed. Therefore, if the communication method is switched without considering whether it is a USB hub that can be switched to USB 1.1, it is switched to USB 1.1 even though the USB hub is intended to be used as USB 2.0. Problem occurs.
例えば、低速通信でも十分なUSBデバイス(例えば、マウスやキーボードなど。)が接続されたUSBハブであれば、USB1.1に切り替えても大きな問題はない。これに
対し、高速通信が必要なUSBデバイス(例えば、メモリーカードやハードディスク装置など。)が接続されたUSBハブであれば、USB2.0のまま使用する方が好ましい。しかし、通信負荷の軽減だけを目的に、高速通信が必要なUSBデバイスが接続されているUSBハブに対して通信方式の切り替えを行うと、高速通信が必要なUSBデバイスへのアクセス速度が低下してしまう、という問題が起きる。このような問題について、上記特許文献1には、何ら解決策は示されていない。
For example, if it is a USB hub to which sufficient USB devices (for example, a mouse, a keyboard, etc.) are connected even at low-speed communication, there is no big problem even when switching to USB 1.1. On the other hand, if the USB hub is connected to a USB device that requires high-speed communication (for example, a memory card or a hard disk device), it is preferable to use the USB 2.0 as it is. However, if the communication method is switched for a USB hub to which a USB device that requires high-speed communication is connected only for the purpose of reducing the communication load, the access speed to the USB device that requires high-speed communication decreases. Problem occurs. Regarding such a problem, the
以下に説明する技術は、上述のような課題を解決しようとするものであり、その目的の一つは、USB2.0対応のUSBハブを対象にして、通信方式をUSB1.1に切り替えても問題がない場合にのみ通信方式の切り替えを実行するUSBホスト装置と、USBホスト装置用のプログラムを提供することにある。 The technology described below is intended to solve the above-described problems, and one of the purposes is to change the communication method to USB 1.1 for a USB 2.0 compatible USB hub. The object is to provide a USB host device that executes switching of communication methods only when there is no problem, and a program for the USB host device.
以下に説明するUSBホスト装置は、USB規格に準拠した方式で、USBデバイスと通信を行うUSBホスト装置であって、USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段とを備え、前記制御手段は、USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定し、前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令し、当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させ、以降は、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行い、しかも、前記所定の切り替え条件を満たすか否かを判定する際、前記制御手段は、前記USBハブに接続された一つ以上のUSBデバイスのうち、少なくとも一つのUSBデバイスが、あらかじめ取り決められた所定の第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定し、さらに、前記第一USBデバイスであるか否かを判定する際、前記制御手段は、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中から前記USBハブに接続されたUSBデバイスを特定し、特定されたUSBデバイスの中に、所定のベンダーID及びプロダクトIDを有するUSBデバイスが存在していたら、当該USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方のデータを読み出し、当該読み出したデータがあらかじめ取り決められたデータと一致していたら、データの読み出し対象となったUSBデバイスについて、前記第一USBデバイスであると判定する(なお、以上のような構成を備えるUSBホスト装置のことを、以下の説明では第一の構成を備えるUSBホスト装置とも称する。)。
あるいは、以下に説明するUSBホスト装置は、USB規格に準拠した方式で、USBデバイスと通信を行うUSBホスト装置であって、USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段とを備え、前記制御手段は、USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定し、前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令し、当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させ、以降は、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行い、しかも、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する際、前記制御手段は、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中においてUSBポートのポート番号の大きさ順に列挙される前記USBハブのデバイス番号を特定し、前記USBポートのポート番号毎の接続状態を示すリストを作成して、そのリストから接続状態にあるUSBポートのポート番号を特定し、前記ポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、前記接続状態にあるUSBポートのポート番号との関係に基づいて、前記USBハブが接続されたUSBポートのポート番号を特定し、前記所定の切り替え条件を満たすと判定した場合には、前記特定されたポート番号を指定して、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する(なお、以上のような構成を備えるUSBホスト装置のことを、以下の説明では第二の構成を備えるUSBホスト装置とも称する。)。
The USB host device described below is a USB host device that communicates with a USB device in a method compliant with the USB standard, and is a first host controller that controls communication with the USB device in a method compliant with USB 1.1. And a second host controller unit that controls communication with a USB device in a manner compliant with USB 2.0, and switching to control by the first host controller unit during control by the second host controller unit Is controlled, the USB controller that stops the control by the second host controller unit and starts the control by the first host controller unit, and the control unit that communicates with the USB device using the USB controller The control means is connected to a USB hub compatible with USB 2.0. The first host controller unit determines whether or not the USB device connected to the USB hub satisfies a predetermined switching condition and determines that the predetermined switching condition is satisfied. When the USB controller is instructed to switch to control, and the USB controller that has received the instruction stops control by the second host controller unit and starts control by the first host controller unit, the first controller The USB hub and the first host controller returned to the initial state by the bus reset by instructing the USB controller to issue a bus reset to the USB hub via a host controller unit Negotiate with the USB 1.1 procedure in accordance with USB 1.1 By, wherein the first host controller, said USB hub is recognized as a USB hub corresponding to USB1.1, since, by using the first host controller, wherein the USB controller has, USB1. in the communication system conforming to 1, the have line communication via the USB hub, moreover, when determining whether the predetermined switching condition is satisfied, said control means, one or more connected to the USB hub If at least one USB device is a predetermined first USB device determined in advance, it is determined that the predetermined switching condition is satisfied, and whether or not the first USB device is the first USB device. In determining whether or not, the control means connects all the USs including the USB hub connected in a tree shape from the USB root hub. A list of B devices is created, a USB device connected to the USB hub is identified from the list, and a USB device having a predetermined vendor ID and product ID exists among the identified USB devices. If at least one of the manufacturer name and the product name stored in the storage area of the USB device is read and the read data matches the predetermined data, the data read target The determined USB device is determined to be the first USB device (note that a USB host device having the above configuration is also referred to as a USB host device having the first configuration in the following description). )
Alternatively, the USB host device described below is a USB host device that communicates with a USB device using a method that conforms to the USB standard, and that controls communication with the USB device using a method that conforms to USB 1.1. A host controller unit, and a second host controller unit that controls communication with the USB device in a manner compliant with USB 2.0, and the control by the first host controller unit during the control by the second host controller unit When the switching is instructed, the USB controller that stops the control by the second host controller unit and starts the control by the first host controller unit communicates with the USB device by using the USB controller. Control means, the control means is a USB 2.0 compatible USB 2.0 If the USB device connected to the USB hub satisfies the predetermined switching condition, and if it is determined that the predetermined switching condition is satisfied, the first host When the USB controller is instructed to switch to control by the controller unit, and the USB controller that has received the command stops control by the second host controller unit and starts control by the first host controller unit, Instructing the USB controller to issue a bus reset to the USB hub via the first host controller unit, and the USB hub returned to the initial state by the bus reset and the first Negotiate with one host controller in a procedure compliant with USB 1.1 The first host controller unit recognizes the USB hub as a USB hub compatible with USB 1.1, and thereafter uses the first host controller unit included in the USB controller. , When performing communication via the USB hub in a communication method compliant with USB 1.1 and instructing the USB controller to switch to control by the first host controller unit, Create a list of all USB devices including the USB hub connected in a tree form from the root hub, and specify the device numbers of the USB hub listed in the order of the port number of the USB port in the list. , Create a list showing the connection status for each port number of the USB port, from the list The USB hub is identified based on the relationship between the USB hub device number listed in the order of the port number and the port number of the USB port in the connected state. When the port number of the USB port to which the is connected is determined and it is determined that the predetermined switching condition is satisfied, the specified port number is designated and the switching to the control by the first host controller unit is performed. (The USB host device having the above configuration is also referred to as a USB host device having the second configuration in the following description.) ).
このように構成されたUSBホスト装置によれば、USBホスト装置が備える制御手段は、USB2.0に対応したUSBハブが接続されている場合、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定する。 According to the USB host device configured as described above, when a USB hub compatible with USB 2.0 is connected, the control unit included in the USB host device switches the USB device connected to the USB hub to a predetermined switching state. Determine whether the condition is met.
切り替え条件の具体例については後から詳述するが、例えば、上記第一の構成を備えるUSBホスト装置のように、通信方式をUSB1.1に切り替えてもよいUSBハブに対しては、その旨を示すための専用USBデバイスを事前に接続することにする。この場合は、そのような専用USBデバイスが接続されているか否かが切り替え条件となる。あるいは、そのような専用USBデバイスを利用しなくても、USBハブに接続されているUSBデバイスの中に、高速通信が必要なUSBデバイスが存在しないことを切り替え条件にしてもよい。 A specific example of the switching condition will be described in detail later. For example, for a USB hub whose communication method may be switched to USB 1.1 , such as a USB host device having the first configuration described above , this is the case. A dedicated USB device for indicating the above will be connected in advance. In this case, whether or not such a dedicated USB device is connected is a switching condition. Alternatively, the switching condition may be that there is no USB device that requires high-speed communication among USB devices connected to the USB hub without using such a dedicated USB device.
このような所定の切り替え条件を満たすと判定した場合、制御手段は、第一ホストコントローラ部による制御への切り替えをUSBコントローラに対して指令する。この指令を受けたUSBコントローラは、第二ホストコントローラ部による制御を中止するとともに第一ホストコントローラ部による制御を開始する。 When it is determined that such a predetermined switching condition is satisfied, the control unit instructs the USB controller to switch to the control by the first host controller unit. Upon receiving this command, the USB controller stops control by the second host controller unit and starts control by the first host controller unit.
ただし、USBコントローラが第一ホストコントローラ部による制御を開始したとき、USBハブは、既にUSB2.0に対応したデバイスとして機能している状態にある。そのため、USBコントローラが、単に第一ホストコントローラ部による制御を開始しても、それだけではUSBハブをUSB1.1に対応したデバイスとして認識することができず、その場合、USBコントローラは、第一ホストコントローラ部による制御を中止するとともに第二ホストコントローラ部による制御を行う状態に復帰してしまう。そこで、USBコントローラが、第一ホストコントローラ部による制御を開始した後には、さらに、制御手段からの指令に基づき、第一ホストコントローラ部を介してUSBハブに対してバスリセット信号(本明細書中では単に「バスリセット」とも称する。)を発行する。 However, when the USB controller starts control by the first host controller unit, the USB hub is already functioning as a device compatible with USB 2.0. For this reason, even if the USB controller simply starts control by the first host controller unit, it cannot recognize the USB hub as a device compatible with USB 1.1. The control by the controller unit is stopped, and the control by the second host controller unit is restored. Therefore, after the USB controller starts control by the first host controller unit, a bus reset signal (in this specification) is further transmitted to the USB hub via the first host controller unit based on a command from the control means. Then, it is also simply referred to as “bus reset”).
バスリセットが発行されると、USBハブは初期状態に戻り、第一ホストコントローラ部による制御を開始したUSBコントローラとの間で、ネゴシエーションを開始する。その結果、第一ホストコントローラ部は、USBハブをUSB1.1に対応したUSBデバイスと認識し、以降は、USBコントローラが有する第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式でUSBハブとの通信を行う状態に切り替わることになる。また、USBハブ側においても、USBホスト装置をUSB1.1に対応しているものと認識し、USB1.1に準拠した通信方式でUSBホスト装置との通信を行う状態になる。 When the bus reset is issued, the USB hub returns to the initial state, and starts negotiation with the USB controller that has started control by the first host controller unit. As a result, the first host controller unit recognizes the USB hub as a USB device compatible with USB 1.1, and thereafter, using the first host controller unit included in the USB controller, a communication method compliant with USB 1.1. Thus, the state is switched to the state of performing communication with the USB hub. Also, the USB hub side recognizes that the USB host device is compatible with USB 1.1, and enters a state of communicating with the USB host device using a communication method compliant with USB 1.1.
つまり、USBコントローラが第一ホストコントローラ部による制御を開始することで、USBホスト装置がUSB1.1対応の機器に切り替わるとともに、USBホスト装置側がUSBハブの認識に失敗する前にUSBハブに対してバスリセットを発行することで、USB2.0対応の作動状態になっているUSBハブを初期状態に戻すのである。これにより、USBホスト装置及びUSBハブは、双方がUSB1.1に準拠した手順でネゴシエーションを行うことになり、最終的にUSB1.1に準拠した通信方式での通信が可能となる。 In other words, when the USB controller starts control by the first host controller unit, the USB host device is switched to a device that supports USB 1.1, and the USB host device side does not recognize the USB hub before the USB hub fails. By issuing a bus reset, the USB hub that is in an operation state compatible with USB 2.0 is returned to the initial state. As a result, the USB host device and the USB hub both negotiate in accordance with a procedure compliant with USB 1.1, and finally communication in a communication method compliant with USB 1.1 becomes possible.
以上説明した通り、上記USBホスト装置によれば、USB2.0対応のUSBハブが一つ以上接続されている場合に、そのUSBハブに接続されているUSBデバイスが所定の切り替え条件を満たせば、USBハブとの通信方式がUSB1.1となる。一方、USBハブに接続されているUSBデバイスが所定の切り替え条件を満たさない場合は、USBハブとの通信方式がUSB2.0のまま維持される。 As described above, according to the USB host device, when one or more USB 2.0 compatible USB hubs are connected, if the USB device connected to the USB hub satisfies a predetermined switching condition, The communication method with the USB hub is USB 1.1. On the other hand, when the USB device connected to the USB hub does not satisfy the predetermined switching condition, the communication method with the USB hub is maintained at USB 2.0.
したがって、通信方式をUSB1.1に切り替えてもかまわないUSBハブについては、所定の切り替え条件を満たすように設定し、通信方式をUSB2.0のまま使用したいUSBハブについては、所定の切り替え条件を満たさないように設定しておけば、USB2.0のまま使用したいUSBハブであったにもかかわらず、USB1.1に切り替えられてしまう、という問題が発生するのを未然に防ぐことができる。 Therefore, for USB hubs whose communication method may be switched to USB 1.1, the predetermined switching condition is set, and for USB hubs that want to use the communication method with USB 2.0, the predetermined switching condition is set. If it is set so as not to satisfy, it is possible to prevent the occurrence of the problem of switching to USB 1.1 even though the USB hub is to be used as it is at USB 2.0.
また、上記のように、通信方式をUSB1.1に切り替えてもかまわないUSBハブについては、USB1.1に切り替えることにより、第二ホストコントローラ部に通信負荷が集中するのを抑制することができる。これにより、USB2.0のまま使用したいUSBハブに接続されたUSBデバイスに対するアクセスは、上述の切り替え前よりも容易になる。 As described above, for a USB hub whose communication method may be switched to USB 1.1, it is possible to suppress communication load from being concentrated on the second host controller unit by switching to USB 1.1. . As a result, access to a USB device connected to a USB hub that is desired to be used with USB 2.0 becomes easier than before the switching described above.
ところで、上記第一の構成を備えるUSBホスト装置の場合、前記制御手段は、前記USBハブに接続された一つ以上のUSBデバイスのうち、少なくとも一つのUSBデバイスが、あらかじめ取り決められた所定の第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定する。このような構成は、上記第二の構成を備えるUSBホスト装置において採用しても好ましい。 By the way, in the case of the USB host device having the first configuration , the control means includes a predetermined first device in which at least one USB device among the one or more USB devices connected to the USB hub is determined in advance. when an USB device, it determined that the predetermined switching condition is satisfied. Such a configuration is preferably adopted in a USB host device having the second configuration.
このように構成されたUSBホスト装置によれば、所定の第一USBデバイスをUSBハブに接続する、という簡単な手法で、そのUSBハブの通信方式をUSB2.0からUSB1.1に切り替えてもよいことを、USBホスト装置側へ伝達することができる。 According to the USB host device configured as described above, even if the communication method of the USB hub is switched from USB 2.0 to USB 1.1 by a simple method of connecting a predetermined first USB device to the USB hub. Good things can be transmitted to the USB host device side.
また、上記第一の構成を備えるUSBホスト装置の場合、前記制御手段は、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中から前記USBハブに接続されたUSBデバイスを特定し、特定されたUSBデバイスの中に、所定のベンダーID及びプロダクトIDを有するUSBデバイスが存在していたら、当該USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方のデータを読み出し、当該読み出したデータがあらかじめ取り決められたデータと一致していたら、データの読み出し対象となったUSBデバイスについて、前記第一USBデバイスであると判定する。 In the case of the USB host device having the first configuration, the control unit creates a list of all USB devices including the USB hub connected in a tree shape from the USB root hub, and from the list. A USB device connected to the USB hub is specified, and if a USB device having a predetermined vendor ID and product ID exists in the specified USB device, it is stored in the storage area of the USB device. If at least one of the manufacturer name and the product name is read and the read data matches the predetermined data, the USB device that is the data read target is the first USB device. you determined.
このように構成されたUSBホスト装置によれば、USBデバイスのベンダーID及びプロダクトIDに基づいて、第一USBデバイスの可能性があるUSBデバイスを検出する。その上で、そのUSBデバイスの記憶領域に記憶されている製造者名(USB規格で規定されている“iManufacturer”。)及び製品名(USB規格で規定されている“iProduct”。)のうち、少なくとも一方のデータを読み出し、読み出したデータがあらかじめ取り決められたデータと一致したら、そのUSBデバイスが第一USBデバイスであると判定する。 According to the USB host device configured as described above, a USB device that may be the first USB device is detected based on the vendor ID and product ID of the USB device. Then, among the manufacturer name (“iManufacturer” defined in the USB standard) and the product name (“iProduct” defined in the USB standard) stored in the storage area of the USB device. When at least one of the data is read and the read data matches the predetermined data, it is determined that the USB device is the first USB device.
したがって、USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方を利用して第一USBデバイスであるか否かを的確に判断することができる。また、USBデバイスの記憶領域に記憶されている製造者名及び製品名を書き換え可能なUSBデバイスを利用すれば、製造者名及び製品名を任意に書き換えておくことで、そのような書き換えがなされた特殊なUSBデバイスだけを第一USBデバイスと判断させることが可能なので、この場合は、書き換えがなされていないUSBデバイスが第一USBデバイスと誤認されてしまうのを防ぐこともできる。 Therefore, it is possible to accurately determine whether or not the device is the first USB device by using at least one of the manufacturer name and the product name stored in the storage area of the USB device. In addition, if a USB device capable of rewriting the manufacturer name and product name stored in the storage area of the USB device is used, such rewriting is performed by arbitrarily rewriting the manufacturer name and product name. Since only the special USB device can be determined as the first USB device, in this case, it is possible to prevent a USB device that has not been rewritten from being misidentified as the first USB device.
また、上記第二の構成を備えるUSBホスト装置の場合、前記制御手段は、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中においてUSBポートのポート番号の大きさ順に列挙される前記USBハブのデバイス番号を特定し、前記USBポートのポート番号毎の接続状態を示すリストを作成して、そのリストから接続状態にあるUSBポートのポート番号を特定し、前記ポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、前記接続状態にあるUSBポートのポート番号との関係に基づいて、前記USBハブが接続されたUSBポートのポート番号を特定し、前記所定の切り替え条件を満たすと判定した場合には、前記特定されたポート番号を指定して、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する。 In the case of the USB host device having the second configuration, the control unit creates a list of all USB devices including the USB hub connected in a tree shape from the USB root hub. The device numbers of the USB hubs listed in the order of the port number of the USB port are specified, a list indicating the connection state for each port number of the USB port is created, and the USB port in the connection state is created from the list Based on the relationship between the device number of the USB hub listed in the order of the port number and the port number of the USB port in the connected state, the port number is identified and the USB port to which the USB hub is connected is identified. When the port number is specified and it is determined that the predetermined switching condition is satisfied, the specified port number is designated. Te, it commands the switching to control by the first host controller to the USB controller.
このように構成されたUSBホスト装置によれば、USBポートのポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、接続状態にあるUSBポートのポート番号との関係に基づいて、USBハブが接続されたUSBポートのポート番号を特定することができる。したがって、所定の切り替え条件を満たすと判定した場合には、上述の手法で特定されたポート番号を指定して、第一ホストコントローラ部による制御への切り替えをUSBコントローラに対して指令することができる。 According to the USB host device configured in this way, the USB hub is based on the relationship between the USB hub device number listed in the order of the port number of the USB port and the port number of the connected USB port. The port number of the USB port to which is connected can be specified. Therefore, when it is determined that the predetermined switching condition is satisfied, the USB controller can be instructed to switch to the control by the first host controller unit by specifying the port number specified by the above-described method. .
また、上記第一,第二の構成を備えるUSBホスト装置において、前記制御手段は、前記USBハブに接続された一つ以上のUSBデバイスについて、全てのUSBデバイスが、USB2.0に準拠した通信速度での通信が必要なUSBデバイスではなかった場合に、前記所定の切り替え条件を満たすと判定すると好ましい。 Further , in the USB host device having the first and second configurations, the control unit is configured to communicate with one or more USB devices connected to the USB hub in accordance with USB 2.0. It is preferable to determine that the predetermined switching condition is satisfied when the USB device does not require communication at a speed.
このように構成されたUSBホスト装置によれば、USB2.0に準拠した通信速度での通信が必要なUSBデバイスが接続されていないUSBハブについて、通信方式をUSB1.1に切り替えることができる。したがって、このような手法であれば、先に説明したような専用の第一USBデバイスを利用することなく、USB1.1に切り替えてもかまわないUSBハブを選び出すことができる。ただし、このような構成を採用している場合に、更に上述の第一USBデバイスを併用することもできるので、これら二種類の切り替え条件は、所望の優先順位を付けて採用することができる。 According to the USB host device configured as described above, the communication method can be switched to USB 1.1 for a USB hub to which a USB device that requires communication at a communication speed compliant with USB 2.0 is not connected. Therefore, with such a method, a USB hub that can be switched to USB 1.1 can be selected without using the first dedicated USB device described above. However, when such a configuration is employed, the above-described first USB device can also be used together, and therefore these two types of switching conditions can be employed with a desired priority.
例えば、USB2.0に準拠した通信速度での通信が必要なUSBデバイスが存在する場合には、この切り替え条件を優先して、第一USBデバイスが接続されているか否かにかかわらず、切り替えを実行しない、という構成にすることができる。 For example, when there is a USB device that requires communication at a communication speed compliant with USB 2.0, this switching condition is prioritized, regardless of whether or not the first USB device is connected. It can be configured not to execute.
すなわち、前記制御手段は、前記USBハブに接続された二つ以上のUSBデバイスのうち、一つのUSBデバイスが、前記第一USBデバイスであったとしても、当該第一USBデバイスとは別のUSBデバイスのうち、少なくとも一つのUSBデバイスが、USB2.0に準拠した通信速度での通信が必要なUSBデバイスである場合に、前記所定の切り替え条件を満たさないと判定する、という構成を採用し得る。 That is, the control means is configured so that, even if one USB device among the two or more USB devices connected to the USB hub is the first USB device, the USB device is different from the first USB device. A configuration may be adopted in which when at least one USB device is a USB device that requires communication at a communication speed compliant with USB 2.0, it is determined that the predetermined switching condition is not satisfied. .
あるいは、第一USBデバイスが接続されている場合には、この切り替え条件を優先して、USB2.0に準拠した通信速度での通信が必要なUSBデバイスが存在するか否かにかかわらず、切り替えを実行する、という構成にすることもできる。これらの切り替え条件の優先順位をどのように設定するかは任意である。 Alternatively, when the first USB device is connected, this switching condition is given priority regardless of whether or not there is a USB device that requires communication at a communication speed compliant with USB 2.0. It can also be configured to execute. How to set the priority of these switching conditions is arbitrary.
次に、以下に説明するUSBホスト装置用のプログラムは、USB規格に準拠した方式で、USBデバイスと通信を行うUSBホスト装置であって、USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段とを備えるUSBホスト装置において、前記制御手段に、USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定する手順と、前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順と、当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させる手順とを実行させることにより、以降は、前記USBホスト装置を、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行う状態にするプログラムであり、しかも、前記所定の切り替え条件を満たすか否かを判定する手順においては、前記制御手段に、前記USBハブに接続された一つ以上のUSBデバイスのうち、少なくとも一つのUSBデバイスが、あらかじめ取り決められた所定の第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定する手順を実行させ、さらに、前記第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定する手順において、前記第一USBデバイスであるか否かを判定する際には、前記制御手段に、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中から前記USBハブに接続されたUSBデバイスを特定する手順と、特定されたUSBデバイスの中に、所定のベンダーID及びプロダクトIDを有するUSBデバイスが存在していたら、当該USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方のデータを読み出す手順と、当該読み出したデータがあらかじめ取り決められたデータと一致していたら、データの読み出し対象となったUSBデバイスについて、前記第一USBデバイスであると判定する手順とを実行させる。
あるいは、以下に説明するUSBホスト装置用のプログラムは、USB規格に準拠した方式で、USBデバイスと通信を行うUSBホスト装置であって、USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段とを備えるUSBホスト装置において、前記制御手段に、USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定する手順と、前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順と、当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させる手順とを実行させることにより、以降は、前記USBホスト装置を、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行う状態にするプログラムであり、しかも、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順においては、前記制御手段に、USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中においてUSBポートのポート番号の大きさ順に列挙される前記USBハブのデバイス番号を特定する手順と、 前記USBポートのポート番号毎の接続状態を示すリストを作成して、そのリストから接続状態にあるUSBポートのポート番号を特定する手順と、前記ポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、前記接続状態にあるUSBポートのポート番号との関係に基づいて、前記USBハブが接続されたUSBポートのポート番号を特定する手順と、前記所定の切り替え条件を満たすと判定した場合には、前記特定されたポート番号を指定して、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順とを実行させる。
Next, a program for a USB host device described below is a USB host device that communicates with a USB device in a method compliant with the USB standard, and communicates with the USB device in a method compliant with USB 1.1. A first host controller unit for controlling, and a second host controller unit for controlling communication with a USB device in a manner compliant with USB 2.0, and the first host controller during control by the second host controller unit When switching to control by the unit is instructed, a USB controller that stops control by the second host controller unit and starts control by the first host controller unit, and a USB device using the USB controller, In a USB host device comprising control means for performing communication of When a USB hub compatible with USB 2.0 is connected, the procedure for determining whether the USB device connected to the USB hub satisfies a predetermined switching condition, and the predetermined switching condition When it is determined that the condition is satisfied, a procedure for instructing the USB controller to switch to the control by the first host controller unit, and the USB controller that has received the command stops control by the second host controller unit When the control by the first host controller unit is started, the bus controller is instructed to issue a bus reset to the USB hub via the first host controller unit, and the bus reset is performed. The USB hub and the first host controller returned to the initial state by The first host controller unit to execute a procedure for recognizing the USB hub as a USB hub compatible with USB 1.1 by performing negotiation with the USB 1.1 in accordance with a procedure compliant with USB 1.1. Thus, hereinafter, a program for setting the USB host device in a state of performing communication via the USB hub in a communication method compliant with USB 1.1 using the first host controller unit of the USB controller. In addition, in the procedure for determining whether or not the predetermined switching condition is satisfied, at least one USB device among the one or more USB devices connected to the USB hub is previously connected to the control unit. When the predetermined first USB device is negotiated, the predetermined switching condition is satisfied. When determining whether or not it is the first USB device in the procedure of determining that the predetermined switching condition is satisfied in the case of the first USB device, A procedure for creating a list of all USB devices including the USB hub connected in a tree form from the USB root hub in the control means, and identifying a USB device connected to the USB hub from the list; If a USB device having a predetermined vendor ID and product ID exists in the identified USB device, at least one of the manufacturer name and product name stored in the storage area of the USB device If the read data and the read data match the predetermined data, the data read For USB devices is the object out to execute the steps determines that the first USB device.
Alternatively, the program for the USB host device described below is a USB host device that communicates with a USB device using a method conforming to the USB standard, and controls communication with the USB device using a method conforming to USB 1.1. A first host controller unit, and a second host controller unit that controls communication with a USB device in a manner compliant with USB 2.0. During the control by the second host controller unit, the first host controller unit When switching to the control by the USB controller is instructed, the USB controller that stops the control by the second host controller unit and starts the control by the first host controller unit, and the USB device using the USB controller, A USB host device comprising a control means for performing communication; When a USB hub compatible with USB 2.0 is connected to the control means, a procedure for determining whether or not a USB device connected to the USB hub satisfies a predetermined switching condition, and the predetermined switching condition If it is determined that the condition is satisfied, a procedure for instructing the USB controller to switch to control by the first host controller unit, and the USB controller that has received the command performs control by the second host controller unit. When stopping and starting control by the first host controller unit, the USB controller is instructed to issue a bus reset to the USB hub via the first host controller unit, and the bus The USB hub and the first host controller returned to the initial state by a reset The first host controller unit executes the procedure for causing the first host controller unit to recognize the USB hub as a USB hub compatible with USB 1.1 by performing negotiation with the USB unit in accordance with a procedure compliant with USB 1.1. By doing so, thereafter, the USB host device is put into a state in which communication via the USB hub is performed using the first host controller unit included in the USB controller by a communication method compliant with USB 1.1. In the procedure for instructing the USB controller to switch to the control by the first host controller unit, the control means includes the USB hub connected in a tree form from the USB root hub. Create a list of all USB devices, and select the USB port in the list. A procedure for identifying the device numbers of the USB hubs listed in order of port number size, and creating a list showing the connection status for each port number of the USB port, and the ports of the USB ports in the connection status from the list The USB port to which the USB hub is connected based on the relationship between the procedure for identifying the number, the device number of the USB hub listed in order of the port number size, and the port number of the USB port in the connected state If it is determined that the predetermined switching condition is satisfied and the specified port number is specified, the USB controller is switched to control by the first host controller unit. And execute the procedure to command .
このように構成されたUSBホスト装置用のプログラムが備える各手順を、USBホスト装置の有する制御手段が実行すれば、USBホスト装置は、先に説明した通りの制御を実行することになり、これにより、先に説明した通りの作用、効果を奏することになる。 If the control means of the USB host device executes each procedure provided in the program for the USB host device configured as described above, the USB host device executes the control as described above. Thus, the operation and effect as described above are exhibited .
次に、上述のUSBホスト装置について、より具体的な例を挙げて説明する。
[USBホスト装置を含むシステム全体の構成]
図1に示すように、PC(Personal Computer)1には、USBハブ2を介してUSBデバイス3,4が接続され、USBハブ5を介してUSBデバイス6,7が接続され、USBハブ8を介してUSBデバイス9,10が接続されている。なお、これらのうち、PC1が、本明細書でいうUSBホスト装置の一例に相当する。
Next, the above USB host device will be described with a more specific example.
[Configuration of entire system including USB host device]
As shown in FIG. 1,
PC1は、制御部11、表示部12、ハードディスク装置(HDD)13、及び入力部14などを備える。この他にも、PC1は様々な構成(例えば、光学ドライブ、ネットワークインターフェースなど。)を備えるが、これら周知の構成に関する説明については省略する。
The
制御部11は、CPU16、MCH(Memory Controller Hub)17、ICH(I/O Controller Hub)18、及びメモリ19などを備える。MCH17及びICH18は、一般にチップセットと呼ばれているCPU16の周辺回路で、MCH17はノースブリッジ、ICH18はサウスブリッジとも呼ばれている。
The
MCH17には、主に高速な入出力が必要とされる各部が接続されている。具体的には、上述のICH18の他、メモリ19や表示部12(グラフィックスコントローラなど。)との入出力インターフェースが設けられている。ICH18には、上述のMCH17に比べて低速な入出力でも問題のない各部が接続されている。具体的には、HDD13や入力部14(マウスやキーボードなど。)との入出力インターフェースが設けられている。
The
また、ICH18には、USBインターフェースが設けられている。具体的には、本事例において、ICH18は、USBコントローラ21を内蔵している。USBコントローラ21は、図2に示すように、USB1.1対応のUHCI(Universal Host Controller Interface)コントローラ22,23,24と、USB2.0対応のEHCI(Enhanced Host Controller Interface)コントローラ25を備えている。
The
USBコントローラ21は、六つのUSBポート(Port1〜Port6)をサポートしており、三つのUHCIコントローラ22,23,24は、それぞれが二つのUSBポートに対応し、EHCIコントローラ25は、六つのUSBポートに対応している。各USBポートにおいて、UHCIコントローラ22,23,24とEHCIコントローラ25は、いずれか一方が排他的に有効となる。
The
なお、本事例において、PC1には、OSとしてLinux(登録商標;以下同様。)が搭載されている。制御部11では、CPU16によって各種処理が実行されて、OSやその他のプログラムが機能する。
In this example, Linux (registered trademark; the same applies hereinafter) is installed in the
USBハブ2,5,8は、周知の通り、一つのUSBポートを複数に分岐させることにより、複数のUSBデバイスを接続可能とするUSBデバイスの一種で、本事例の場合、各USBハブ2,5,8は、いずれもUSB2.0に対応したものが採用されている。
As is well known, the
USBデバイス3,4,6,7,9,10は、例えば、マウス、キーボード、メモリーカードリーダー、HDDなど、それぞれが様々な機能を持つデバイスである。これらの機能のいずれを備えるデバイスであるのかは、本事例では任意である。ただし、これらUSBデバイス3,4,6,7,9,10は、以下のような関係にある。
The
まず、本事例において、USBハブ5は、後述する処理の中で、PC1との通信方式がUSB1.1に切り替えられるものである。また、USBハブ2,8は、後述する処理が実行されても、PC1との通信方式がUSB2.0のまま維持されるものである。このような通信方式の切り替えが行われるか否かは、USBハブ2,5,8それぞれに接続されたUSBデバイス3,4,6,7,9,10が、どのようなUSBデバイスであるかによって変わる。
First, in this example, the
具体的には、USBデバイス7,10は、これらが接続されたUSBハブ5,8とPC1との通信方式をUSB1.1に切り替えたい場合に、利用者がUSBハブ5,8に対して接続する特殊なデバイスである。このような特殊なデバイスであることは、USBデバイス7,10が備える記憶領域中に記憶された情報(本事例の場合、ベンダーID、プロダクトID、製造者名、及び製品名。)に基づいて、PC1側で判断される。なお、これら二つのUSBデバイス7,10は、本明細書でいう第一USBデバイスの一例に相当する。
Specifically, the
一方、本事例において、USBデバイス9は、USBハブ8とPC1との通信方式がUSB1.1に切り替わるのは好ましくないデバイスである。このようなUSBデバイス9の例としては、通信速度を低下させたくないデバイス(例えば、メモリーカードリーダーやHDDなど。)が想定される。このようなデバイスであることは、USBデバイス9が備える記憶領域中に記憶された情報(本事例の場合、ベンダーID、及びプロダクトID。)に基づいて、PC1側で判断される。
On the other hand, in this example, the
後述する処理においては、USBハブ5に対してUSBデバイス7が接続されていることにより、切り替え条件が成立したと判断されて、PC1とUSBハブ5との間の通信方式が、USB2.0からUSB1.1に切り替えられる。一方、USBハブ8に対してUSBデバイス10が接続されている場合、他の条件に問題がなければ、切り替え条件が成立したと判断されるが、本事例の場合、USBハブ8に対して上述のようなUSBデバイス9が接続されているため、切り替え条件が成立しない。また、USBハブ2に対しては、USBデバイス7,10のような特殊なデバイスが接続されていないため、切り替え条件が成立しない。そのため、USBハブ2,8については、PC1との間の通信方式が、USB2.0のまま維持される。
In the processing to be described later, it is determined that the switching condition is satisfied because the
このような通信方式の切り替えが行われるので、USBデバイス6は、USBハブ5とPC1との通信方式がUSB1.1に切り替わってもかまわないデバイスとなっている。このようなUSBデバイス6の例としては、通信速度が低下してもかまわないデバイス(例えば、キーボードやマウスなど。)が想定される。
Since such communication method switching is performed, the
なお、USBデバイス3,4は、利用者がPC1との通信方式をUSB1.1に切り替えたいとは考えていないUSBハブ2に対して接続されたデバイスである。したがって、このようなUSBデバイス3,4の例としては、通信速度を低下させたくないデバイス(例えば、メモリーカードリーダーやHDDなど。)が想定されるが、通信速度が低下してもかまわないデバイス(例えば、キーボードやマウスなど。)でもよい。
The
本事例において、USBデバイス7,10としては、それぞれが内蔵する記憶領域中に記憶されている製造者名(iManufacturer)及び製品名(iProduct)を、所定の書き換えツールによって書き換え可能なデバイスが採用されている。そして、本事例において、USBデバイス7,10には、製造者名としては文字列“BRO”があらかじめ書き込まれ、製品名としては文字列“USBHUB-SW-FULL”があらかじめ書き込まれている。PC1は、これらの情報に基づいて、USBデバイス7,10が特殊なデバイスである旨を認識する。
In this example, as the
ちなみに、本事例において、USBデバイス7,10は、USBポートをシリアルポートに変換する機能を備えたUSBデバイス(以下、USBシリアルデバイスと称する。)である。そのため、USBデバイス7,10を利用することで、シリアルポート接続の各種機器をUSBポートに接続することができる。ただし、本事例において、USBデバイス7,10を採用した理由は、製造者名及び製品名を書き換え可能であったからであり、USBシリアルデバイスとしての機能を備えていたからではない。
Incidentally, in this example, the
[通信方式の切り替え処理]
次に、PC1において実行される処理のうち、上述のようなUSBハブ2,5,8との間の通信方式を切り替える処理について、図3〜図5に基づいて説明する。なお、この処理は、PC1の電源をオンにしたことを契機として、CPU16において実行される処理の中の一つである。
[Communication method switching processing]
Next, of the processes executed in the
この処理を開始すると、CPU16は、Linuxカーネル、及びUSBシステムを起動する(S110)。これらの処理は、Linuxを搭載したPCにおいて一般的に実行される処理である。また、S110において、USBシステムを起動すると、USB2.0に対応しているUSBハブ2,5,8は、PC1とのネゴシエーションにより、いずれもUSB2.0対応のUSBデバイスとして認識される。その結果、PC1とUSBハブ2,5,8は、いずれもUSB2.0に準拠した通信方式で通信可能な状態となる。
When this process is started, the
続いて、CPU16は、特定のUSB2.0対応USBハブ(本事例ではUSBハブ5。)との通信方式をUSB1.1に切り替える(S120)。このS120の詳細は、図3に示すような処理となる。
Subsequently, the
すなわち、この処理を開始すると、CPU16は、まず、USBシステム全体のツリー情報を取得する(S210)。具体的には、Linuxのコマンド“lsusb”を利用して、標準エラー出力に出力される情報を所定のファイルに格納する。例えば、ファイル“usbt.txt”に情報を格納する場合であれば、CPU16は、コマンド“lsusb -t 2> usbt.txt”を実行する。これにより、ファイル“usbt.txt”には、図6に例示するような情報が格納される。
That is, when this process is started, the
続いて、CPU16は、ファイル“usbt.txt”の中から、EHCIのバス番号(b)とその下のデバイス番号(d)を抽出する(S220)。本事例の場合は、“usbt.txt”中にある“Bus#1”のみがEHCIで、“Bus#2”〜“Bus#4”がUHCIであるが、システムによってはEHCIは一つとは限らず、また、必ずしもEHCIが小さい番号とも限らない。ただし、ハードウェアが決まれば、EHCIのバス番号は一定となるので、どのバス番号がEHCIなのかを特定することはできる。
Subsequently, the
続いて、CPU16は、抽出されたバス番号(b)、デバイス番号(d)の全てを対象に、詳細情報を取得する(S230)。具体的には、Linuxのコマンド“lsusb”を利用して、標準出力に出力される情報を所定のファイルに格納する。例えば、バス番号(b)、デバイス番号(d)の詳細情報を取得して、ファイル“s-b-d.txt”(ただし、ファイル名中のb,dはバス番号、デバイス番号を示す数値。)に情報を格納する場合であれば、CPU16は、コマンド“lsusb -v -s b:d > s-b-d.txt”を実行する。
Subsequently, the
より具体的には、例えば、バス番号1、デバイス番号1の場合、コマンド“lsusb -v -s 1:1 > s-1-1.txt”が実行され、その結果、ファイル“s-1-1.txt”には、図7に例示するような情報が格納される(ただし、図7には情報の一部を省略して図示。)。また、バス番号1、デバイス番号7の場合、コマンド“lsusb -v -s 1:7 > s-1-7.txt”が実行され、その結果、ファイル“s-1-7.txt”には、図8に例示するような情報が格納される(ただし、図8には情報の一部を省略して図示。)。
More specifically, for example, in the case of
なお、例示したファイル“usbt.txt”では“Bus#1”の下のデバイス番号は、“Dev#1”〜“Dev#10”の連番になっているが、実際のシステムでは連番になっているとは限らず、欠番が存在する場合がある。ただし、“Dev#1”は、どのシステム、どのバス番号でも、ルートハブと決まっている。
In the illustrated file “usbt.txt”, the device numbers under “
続いて、CPU16は、ファイル“usbt.txt”中において、ルートハブ(Dev#1)から2段下の階層に記述された文字列“Vendor 0x0403 Product 0x6001”を探す(S240)。本事例の場合、図6に示すように、Dev#7、及びDev#10に対応する位置に、上記文字列が記述されており、これらがCPU16によって検出される。なお、文字列“Vendor 0x0403 Product 0x6001”は、上述したUSBデバイス7,10として採用したUSBシリアルデバイスのベンダーIDとプロダクトIDを示している。
Subsequently, the
続いて、CPU16は、これらの詳細情報(s-1-7.txt、s-1-10.txt)を確認し、その中にある“iManufacturer”欄に対応する文字列が“BRO”、かつ“iProduct”欄に対応する文字列が“USB-SW-FULL”の場合は、その上の階層にあるUSBハブ(本事例では“Dev#5”及び“Dev#8”)を切り替え候補に登録する(S250)。すなわち、S250では、製造者名及び製品名を示す文字列が、本システムで特殊なデバイスとして用いられることを目的として、所定の文字列に書き換えられていることを確認する。これにより、本システムで特殊なデバイスとして用いるつもりがないまま、たまたま市販のUSBシリアルデバイスが本システムに混入した場合でも、そのUSBシリアルデバイスを特殊なデバイスとして誤認識しないようにしている。なお、本事例では、製造者名及び製品名のうち、いずれか一方でも上記文字列とは違っていたら、切り替え候補への登録をしない。
Subsequently, the
続いて、CPU16は、ファイル“usbt.txt”を見て切り替え候補に登録されたUSBハブの下に、切り替え除外デバイスリスト中に登録されたベンダーID及びプロダクトIDのデバイスがあったら、その上の階層にあるUSBハブについては切り替え候補から外す(S260)。例えば、本事例の場合、切り替え除外デバイスリスト中には、“Vendor
0x090c Product 0x6000”がリスト登録されている。この場合、S260では、“Dev#9”が切り替え除外デバイスとわかる。したがって、その上の階層にあるUSBハブ8(Dev#8)は切り替え候補から外される。
Subsequently, the
“0x090c Product 0x6000” is registered in the list. In this case, in S260, “
こうして、切り替え候補の選出、及び切り替え除外デバイスの除外を終えたら、CPU16は、切り替え候補に残ったUSBハブとの通信方式をUSB1.1に切り替える(S270)。この事例では、上述の通り、S250でUSBハブ5,8(Dev#5,#8
)が選出された後、S260でUSBハブ8(Dev#8)が除外されるので、ここではUSBハブ5(Dev#5)が通信方式の切り替え対象になる。
When the selection of the switching candidate and the exclusion of the switching exclusion device are thus completed, the
) Is selected, the USB hub 8 (Dev # 8) is excluded in S260, so that the USB hub 5 (Dev # 5) is the target for switching the communication method.
S270の詳細は、図6に示すような処理となる。すなわち、この処理を開始すると、CPU16は、まず、切り替え候補のハブリストをポートリストに変換する(S310)。具体的には、ファイル“usbt.txt”(図6参照。)に列挙されたデバイスは、ポート順に表示されている。また、ファイル“usbt.txt”において、ルートハブに直結されているデバイスは、文字列“Dev#”が行中の5文字目から始まっている。したがって、この規則を利用すれば、USBポートのポート番号の大きさは“Dev#5”,“Dev#8”,“Dev#2”の順となっていることまでは、判別することができる。
The details of S270 are as shown in FIG. In other words, when this process is started, the
ただし、これだけではポート番号が連番となっているのか欠番があるのかまでは判別できないので、ルートハブの詳細情報が記録されたファイル“s-1-1.txt”(図7参照。)の中から、“Hub Port Status:”以降の情報を参照する。この情報を見ると、PC1が備える全てのUSBポート(Port1〜Port6)について、そのステータスを示す文字列が記述されている。具体的には、接続状態にある場合、文字列“0000.0503 highspeed power enable connect”が記述され、未接続状態にある場合、文字列“0000.0100 power”が記述されている。したがって、図7に示された事例であれば、Port1,Port2,Port3が接続状態にあると判別でき、先に示した“Dev#5”,“Dev#8”,“Dev#2”の順も考慮すれば、USBハブ5,8,2の順でPort1,Port2,Port3に接続されていることがわかる。よって、この事例の場合、“Dev#5”が切り替え候補なので、このUSBハブ5は、USBポートのポート番号1(Port1)と変換されて、ポートリストに登録されることになる。
However, it is not possible to determine whether the port number is a serial number or a missing number with this alone, so in the file “s-1-1.txt” (see FIG. 7) in which the detailed information of the root hub is recorded. To refer to the information after “Hub Port Status:”. Looking at this information, character strings indicating the statuses of all USB ports (
続いて、CPU16は、S310で作成されたポートリストに登録されたポートについて、全て処理を終えたか否かを判断し(S320)、未処理のポートが残っていれば(S320:いいえ)、切り替え候補のポートをEHCIからOHCI/UHCIに切り替える(S330)。本事例の場合、Port1に対応するUHCIコントローラ22は、USB1.1対応のUSBデバイスが接続されていれば、そのUSBデバイスが有するプルアップ抵抗の接続位置に基づいて、そのUSBデバイスがFS(Full Speed)モード対応機器なのかLS(Low Speed)モード対応機器なのかを認識する。
Subsequently, the
ただし、本事例において、USBハブ5は、既にPC1とのネゴシエーションを完了し、USB2.0対応機器として稼働している状態にあり、プルアップ抵抗がオフにされている。そのため、このままでは、UHCIコントローラ22側では、FSモード対応のUSBデバイス及びLSモード対応のUSBデバイスのいずれとも認識することができない。
However, in this example, the
そこで、CPU16は、S330を実行した後に、OHCI/UHCI側からバスリセットを発行する(S340)。これにより、USBハブ5は、初期状態に戻り、PC1に対してネゴシエーションを開始する。ただし、PC1では、UHCIコントローラ22がUSB1.1に準拠した手順でネゴシエーションを開始するので、USB1.1と互換性のある通信を実行可能なUSBハブ5は、PC1をUSB1.1対応機器と認識し、自らもUSB1.1対応機器として作動する状態に至る。その結果、PC1及びUSBハブ5は、双方ともUSB2.0対応機器としては機能せず、USB1.1のFSモード対応機器として機能する状態になる。
Thus, after executing S330, the
なお、S340を終えたら、S320へと戻る。その結果、ポートリストに未処理のポートが残されている間は、上述のS320〜S340が繰り返されることになる。本事例の場合は、Port1だけが登録されているので、Port1に対応する処理を終えた後
、S320へと戻るとポートリストは終了と判断され(S320:はい)、その結果、図5に示す処理を終了し、コール元にリターンする。これにより、図4へと戻って、S270を終了することになるので、更に図4に示す処理を終了し、コール元にリターンする。その結果、図3へと戻って、S120を終了することになる。以降、CPU16は、USBデバイスを使用するアプリケーションを起動する(S130)。この時点では、USBハブ5との通信方式がUSB2.0からUSB1.1に変更されているので、USBデバイス6,7との通信を行う際には、UHCIコントローラ22が利用される状態となる。
When S340 is completed, the process returns to S320. As a result, the above-described S320 to S340 are repeated while an unprocessed port remains in the port list. In this case, since only
したがって、上記処理の実行後は、EHCIコントローラ25とUHCIコントローラ22に通信負荷が分散する。また、通信速度の低いUSBデバイスをUHCIコントローラ22に担当させることで、EHCIコントローラ25を効率良く使用することができるようになる。すなわち、上記処理の実行前は、EHCIコントローラ25がPort1〜Port3の全てについて対処していたので、EHCIコントローラ25には通信負荷がかかりやすくなっていたが、そのような通信負荷が軽減される、また、EHCIコントローラ25が、通信速度の低いUSBデバイスに待たされるなどの問題もあったが、そのような問題が解消される。
Therefore, after the above process is executed, the communication load is distributed to the
また、このような負荷分散を実現するに当たっては、特殊なUSBデバイス7を、対象とするUSBハブ5に接続するという、極めて簡単な操作を行うだけでよい。したがって、利用者は、低速な通信を行えばよいUSBデバイスを特定のUSBハブに集めて接続し、そこにUSBデバイス7を接続するだけで、EHCIコントローラ25にかかる負荷を軽減し、他の高速な通信を行うUSBデバイスに対し、より多くのリソースを割り当てることができる。
Further, in order to realize such load distribution, it is only necessary to perform an extremely simple operation of connecting the
さらに、本事例において、高速な通信が必要なUSBデバイス9については、切り替え除外デバイスリストにあらかじめ登録し、特殊なUSBデバイス10がUSBハブ8に接続された場合でも、USBハブ8との通信方式を切り替えないようにしている。したがって、特殊なUSBデバイス10を接続する意義を十分に理解できていない利用者や、誤って特殊なUSBデバイス10を接続してしまったような場合に、USBデバイス9に対してUSB2.0方式での通信ができなくなるのを適切に防ぐことができる。
Further, in this example, the
[その他の事例]
以上、USBホスト装置について、具体的な実例を示して説明したが、本発明は、上述の事例に限定されるものではなく、本発明の技術的思想を逸脱しない範囲内において、種々の形態で実施することができる。
[Other cases]
The USB host device has been described above with specific examples. However, the present invention is not limited to the above-described examples, and various forms are possible without departing from the technical idea of the present invention. Can be implemented.
例えば、上記事例において、特殊なUSBデバイス7,10は、USBシリアルデバイスを利用していたが、既に説明した通り、USBシリアルデバイスとしての機能を備えること自体は重要事項ではないので、他の機能を備えるUSBデバイスを、本明細書でいう第一USBデバイスとして利用してもよい。
For example, in the above case, the
また、上記事例においては、特殊なUSBデバイス7,10として、製造者名及び製品名を特殊な文字列に書き換えたものを利用していたが、これは市販の書き換え可能なデバイスを利用した事例にすぎず、製造者名及び製品名を書き換え可能か否かは任意である。例えば、同様の特殊な文字列がデバイス製造時に書き込まれて、かつ書き換え不能となっていたとしても、上記事例と同等な挙動を示すシステムを構成することができる。
In the above example, the
また、上記事例においては、特殊なUSBデバイス7,10に記憶された製造者名及び製品名を双方とも特殊な文字列にしていたが、いずれか一方だけで判断する構成を採用してもかまわない。
In the above example, both the manufacturer name and the product name stored in the
また、上記事例では、特殊なUSBデバイス7,10と、切り替え除外デバイスリストに登録されたUSBデバイス9とを併用して、切り替え条件が成立するか否かを判断していたが、これらはいずれか一方だけを判断対象としてもよい。例えば、特殊なUSBデバイス7,10が検出された場合には、切り替え除外デバイスリスト相当のものを参照することなく、通信方式の切り替えを実施するように構成してもよい。
In the above example, the
あるいは、例えば、特殊なUSBデバイス7,10相当のものが存在するか否かを問わず、切り替え除外デバイスリスト相当のものを参照し、USBハブに接続された全てのUSBデバイスの中に除外対象が含まれていなければ通信方式を切り替え、一つでも除外対象が含まれていれば通信方式を切り替えない、という仕組みにしてもよい。この場合は、特殊なUSBデバイス7,10相当のものは不要となる。
Or, for example, regardless of whether there is a
さらに、上記事例においては、第一ホストコントローラ部として、三つのUHCIコントローラ22,23,24を備え、第二ホストコントローラ部として、一つのEHCIコントローラ25を備える例を示したが、これらの数はいずれも限定されない。また、UHCIコントローラに代えて、OHCI(Open Host Controller Interface)コントローラを採用してもよい。
Further, in the above example, the example in which three
1…PC、2,5,8…USBハブ、3,4,6,7,9,10…USBデバイス、11…制御部、12…表示部、13…HDD、14…入力部、16…CPU、17…MCH、18ICH、19…メモリ、21…USBコントローラ、22,23,24…UHCIコントローラ、25…EHCIコントローラ。
DESCRIPTION OF
Claims (6)
USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、
前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段と
を備え、
前記制御手段は、
USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定し、
前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令し、
当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させ、
以降は、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行い、
しかも、前記所定の切り替え条件を満たすか否かを判定する際、
前記制御手段は、前記USBハブに接続された一つ以上のUSBデバイスのうち、少なくとも一つのUSBデバイスが、あらかじめ取り決められた所定の第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定し、
さらに、前記第一USBデバイスであるか否かを判定する際、
前記制御手段は、
USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中から前記USBハブに接続されたUSBデバイスを特定し、
特定されたUSBデバイスの中に、所定のベンダーID及びプロダクトIDを有するUSBデバイスが存在していたら、当該USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方のデータを読み出し、
当該読み出したデータがあらかじめ取り決められたデータと一致していたら、データの読み出し対象となったUSBデバイスについて、前記第一USBデバイスであると判定する
USBホスト装置。 A USB host device that communicates with a USB device in a method compliant with the USB (Universal Serial Bus) standard,
A first host controller unit that controls communication with a USB device in a method compliant with USB 1.1, and a second host controller unit that controls communication with a USB device in a method compliant with USB 2.0, When switching to control by the first host controller unit is instructed during control by the two host controller units, the USB that stops control by the second host controller unit and starts control by the first host controller unit A controller,
Control means for communicating with a USB device using the USB controller,
The control means includes
When a USB hub compatible with USB 2.0 is connected, it is determined whether the USB device connected to the USB hub satisfies a predetermined switching condition,
If it is determined that the predetermined switching condition is satisfied, the USB controller is instructed to switch to the control by the first host controller unit,
When the USB controller that has received the instruction stops control by the second host controller unit and starts control by the first host controller unit, a bus reset is performed on the USB hub via the first host controller unit. Is issued to the USB controller, and the USB hub returned to the initial state by the bus reset and the first host controller unit in a procedure conforming to USB 1.1. By executing the negotiation, the first host controller unit recognizes the USB hub as a USB hub corresponding to USB 1.1,
Thereafter, the using the first host controller unit USB controller has, in the communication system conforming to the USB1.1, have rows communication via the USB hub,
Moreover, when determining whether or not the predetermined switching condition is satisfied,
The control means satisfies the predetermined switching condition when at least one USB device among the one or more USB devices connected to the USB hub is a predetermined first USB device negotiated in advance. And
Further, when determining whether or not the first USB device,
The control means includes
Create a list of all USB devices including the USB hub connected in a tree form from the USB root hub, identify the USB device connected to the USB hub from the list,
If a USB device having a predetermined vendor ID and product ID exists in the identified USB device, at least one of the manufacturer name and product name stored in the storage area of the USB device Read
A USB host device that determines that the USB device that is the target of data reading is the first USB device if the read data matches the predetermined data .
USB1.1に準拠した方式でUSBデバイスとの通信を制御する第一ホストコントローラ部、及びUSB2.0に準拠した方式でUSBデバイスとの通信を制御する第二ホストコントローラ部を有し、前記第二ホストコントローラ部による制御中に、前記第一ホストコントローラ部による制御への切り替えが指令されると、前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始するUSBコントローラと、
前記USBコントローラを利用して、USBデバイスとの通信を行う制御手段と
を備え、
前記制御手段は、
USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定し、
前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令し、
当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させ、
以降は、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行い、
しかも、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する際、前記制御手段は、
USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中においてUSBポートのポート番号の大きさ順に列挙される前記USBハブのデバイス番号を特定し、
前記USBポートのポート番号毎の接続状態を示すリストを作成して、そのリストから接続状態にあるUSBポートのポート番号を特定し、
前記ポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、前記接続状態にあるUSBポートのポート番号との関係に基づいて、前記USBハブが接続されたUSBポートのポート番号を特定し、
前記所定の切り替え条件を満たすと判定した場合には、前記特定されたポート番号を指定して、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する
USBホスト装置。 A USB host device that communicates with a USB device in a method compliant with the USB (Universal Serial Bus) standard,
A first host controller unit that controls communication with a USB device in a method compliant with USB 1.1, and a second host controller unit that controls communication with a USB device in a method compliant with USB 2.0, When switching to control by the first host controller unit is instructed during control by the two host controller units, the USB that stops control by the second host controller unit and starts control by the first host controller unit A controller,
Control means for communicating with a USB device using the USB controller;
With
The control means includes
When a USB hub compatible with USB 2.0 is connected, it is determined whether the USB device connected to the USB hub satisfies a predetermined switching condition,
If it is determined that the predetermined switching condition is satisfied, the USB controller is instructed to switch to the control by the first host controller unit,
When the USB controller that has received the instruction stops control by the second host controller unit and starts control by the first host controller unit, a bus reset is performed on the USB hub via the first host controller unit. Is issued to the USB controller, and the USB hub returned to the initial state by the bus reset and the first host controller unit in a procedure conforming to USB 1.1. By executing the negotiation, the first host controller unit recognizes the USB hub as a USB hub corresponding to USB 1.1,
Thereafter, using the first host controller unit of the USB controller, the communication via the USB hub is performed in a communication method compliant with USB 1.1.
Moreover, when instructing the USB controller to switch to the control by the first host controller unit, the control means includes:
Create a list of all USB devices including the USB hub connected in a tree form from the USB root hub, and specify the device number of the USB hub listed in the order of the port number of the USB port in the list And
Create a list showing the connection status for each port number of the USB port, specify the port number of the USB port in the connection status from the list,
Identify the port number of the USB port to which the USB hub is connected based on the relationship between the device number of the USB hub listed in order of the port number and the port number of the USB port in the connected state,
A USB host device that designates the specified port number and instructs the USB controller to switch to control by the first host controller unit when it is determined that the predetermined switching condition is satisfied .
請求項2に記載のUSBホスト装置。 The control means satisfies the predetermined switching condition when at least one USB device among the one or more USB devices connected to the USB hub is a predetermined first USB device negotiated in advance. The USB host device according to claim 2, which is determined as follows .
請求項1〜請求項3のいずれか一項に記載のUSBホスト装置。 The control means, for one or more USB devices connected to the USB hub, if all the USB devices are not USB devices that require communication at a communication speed compliant with USB 2.0. The USB host device according to claim 1, wherein the USB host device is determined to satisfy the following switching condition .
前記制御手段に、 In the control means,
USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定する手順と、 A procedure for determining whether a USB device connected to the USB hub satisfies a predetermined switching condition when a USB hub compatible with USB 2.0 is connected;
前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順と、 If it is determined that the predetermined switching condition is satisfied, a procedure for instructing the USB controller to switch to the control by the first host controller unit;
当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させる手順と When the USB controller that has received the instruction stops control by the second host controller unit and starts control by the first host controller unit, a bus reset is performed on the USB hub via the first host controller unit. Is issued to the USB controller, and the USB hub returned to the initial state by the bus reset and the first host controller unit in a procedure conforming to USB 1.1. By executing the negotiation, the first host controller unit recognizes the USB hub as a USB hub compatible with USB 1.1, and
を実行させることにより、 By running
以降は、前記USBホスト装置を、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行う状態にするプログラムであり、 Thereafter, the USB host device is a program that uses the first host controller unit included in the USB controller to perform communication via the USB hub in a communication method compliant with USB 1.1.
しかも、前記所定の切り替え条件を満たすか否かを判定する手順においては、 Moreover, in the procedure for determining whether or not the predetermined switching condition is satisfied,
前記制御手段に、 In the control means,
前記USBハブに接続された一つ以上のUSBデバイスのうち、少なくとも一つのUSBデバイスが、あらかじめ取り決められた所定の第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定する手順 A procedure for determining that the predetermined switching condition is satisfied when at least one USB device among the one or more USB devices connected to the USB hub is a predetermined first USB device.
を実行させ、 And execute
さらに、前記第一USBデバイスである場合に、前記所定の切り替え条件を満たすと判定する手順において、前記第一USBデバイスであるか否かを判定する際には、 Further, when determining whether the first USB device is the first USB device in the procedure for determining that the predetermined switching condition is satisfied,
前記制御手段に、 In the control means,
USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中から前記USBハブに接続されたUSBデバイスを特定する手順と、 Creating a list of all USB devices including the USB hub connected in a tree form from the USB root hub, and identifying the USB device connected to the USB hub from the list;
特定されたUSBデバイスの中に、所定のベンダーID及びプロダクトIDを有するUSBデバイスが存在していたら、当該USBデバイスの記憶領域に記憶されている製造者名及び製品名のうち、少なくとも一方のデータを読み出す手順と、 If a USB device having a predetermined vendor ID and product ID exists in the identified USB device, at least one of the manufacturer name and product name stored in the storage area of the USB device The procedure of reading
当該読み出したデータがあらかじめ取り決められたデータと一致していたら、データの読み出し対象となったUSBデバイスについて、前記第一USBデバイスであると判定する手順と A procedure for determining that the USB device from which data is to be read is the first USB device if the read data matches data determined in advance;
を実行させる Execute
USBホスト装置用のプログラム。 Program for USB host device.
前記制御手段に、
USB2.0に対応したUSBハブが接続されている場合に、当該USBハブに接続されたUSBデバイスが所定の切り替え条件を満たすか否かを判定する手順と、
前記所定の切り替え条件を満たすと判定した場合には、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順と、
当該指令を受けた前記USBコントローラが前記第二ホストコントローラ部による制御を中止するとともに前記第一ホストコントローラ部による制御を開始したら、前記第一ホストコントローラ部を介して前記USBハブに対してバスリセットを発行することを、前記USBコントローラに対して指令して、前記バスリセットによって初期状態へと戻された前記USBハブと前記第一ホストコントローラ部との間で、USB1.1に準拠した手順でネゴシエーションを実行させることにより、前記第一ホストコントローラ部には、前記USBハブをUSB1.1に対応したUSBハブと認識させる手順と
を実行させることにより、
以降は、前記USBホスト装置を、前記USBコントローラが有する前記第一ホストコントローラ部を利用して、USB1.1に準拠した通信方式で、前記USBハブ経由の通信を行う状態にするプログラムであり、
しかも、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順においては、
前記制御手段に、
USBルートハブからツリー状に接続された、前記USBハブを含む全てのUSBデバイスのリストを作成して、そのリスト中においてUSBポートのポート番号の大きさ順に列挙される前記USBハブのデバイス番号を特定する手順と、
前記USBポートのポート番号毎の接続状態を示すリストを作成して、そのリストから接続状態にあるUSBポートのポート番号を特定する手順と、
前記ポート番号の大きさ順に列挙されるUSBハブのデバイス番号と、前記接続状態にあるUSBポートのポート番号との関係に基づいて、前記USBハブが接続されたUSBポートのポート番号を特定する手順と、
前記所定の切り替え条件を満たすと判定した場合には、前記特定されたポート番号を指定して、前記第一ホストコントローラ部による制御への切り替えを前記USBコントローラに対して指令する手順と
を実行させる
USBホスト装置用のプログラム。 A USB host device that communicates with a USB device in a method compliant with the USB (Universal Serial Bus) standard, a first host controller unit that controls communication with the USB device in a method compliant with USB 1.1, and USB2 And a second host controller unit for controlling communication with the USB device in a system compliant with .0, and switching to control by the first host controller unit is instructed during control by the second host controller unit A USB controller that stops control by the second host controller unit and starts control by the first host controller unit, and a control unit that communicates with a USB device using the USB controller In the host device,
In the control means,
A procedure for determining whether a USB device connected to the USB hub satisfies a predetermined switching condition when a USB hub compatible with USB 2.0 is connected;
If it is determined that the predetermined switching condition is satisfied, a procedure for instructing the USB controller to switch to the control by the first host controller unit;
When the USB controller that has received the instruction stops control by the second host controller unit and starts control by the first host controller unit, a bus reset is performed on the USB hub via the first host controller unit. Is issued to the USB controller, and the USB hub returned to the initial state by the bus reset and the first host controller unit in a procedure conforming to USB 1.1. By causing the first host controller unit to recognize the USB hub as a USB hub compatible with USB 1.1 by executing the negotiation,
Thereafter, the USB host device is a program that uses the first host controller unit included in the USB controller to perform communication via the USB hub in a communication method compliant with USB 1.1 .
Moreover, in the procedure for instructing the USB controller to switch to the control by the first host controller unit,
In the control means,
Create a list of all USB devices including the USB hub connected in a tree form from the USB root hub, and specify the device number of the USB hub listed in the order of the port number of the USB port in the list And the steps to
Creating a list showing the connection status for each port number of the USB port and identifying the port number of the USB port in the connection status from the list;
A procedure for identifying the port number of the USB port to which the USB hub is connected based on the relationship between the device number of the USB hub listed in the order of the port number and the port number of the USB port in the connected state. When,
If it is determined that the predetermined switching condition is satisfied, a procedure for specifying the specified port number and instructing the USB controller to switch to the control by the first host controller unit;
A program for a USB host device that executes
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013179780A JP5794266B2 (en) | 2013-08-30 | 2013-08-30 | USB host device and program for USB host device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013179780A JP5794266B2 (en) | 2013-08-30 | 2013-08-30 | USB host device and program for USB host device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015049612A JP2015049612A (en) | 2015-03-16 |
JP5794266B2 true JP5794266B2 (en) | 2015-10-14 |
Family
ID=52699603
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013179780A Active JP5794266B2 (en) | 2013-08-30 | 2013-08-30 | USB host device and program for USB host device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5794266B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023128219A1 (en) * | 2021-12-31 | 2023-07-06 | 삼성전자 주식회사 | Electronic device and method for controlling connections with external electronic devices |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106991067B (en) * | 2017-04-14 | 2021-02-02 | 湖南威胜信息技术有限公司 | Data interaction method for one-master multi-slave network and embedded equipment thereof |
CN112463681B (en) * | 2019-09-06 | 2024-03-05 | 昆山尚尼司电子科技有限公司 | USB hub with resolution switching and processing method thereof |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5257343B2 (en) * | 2009-12-03 | 2013-08-07 | ブラザー工業株式会社 | USB host device |
JP5206717B2 (en) * | 2010-03-24 | 2013-06-12 | ブラザー工業株式会社 | USB host device |
JP5545853B2 (en) * | 2010-08-20 | 2014-07-09 | アルパイン株式会社 | Communication device |
US8799532B2 (en) * | 2011-07-07 | 2014-08-05 | Smsc Holdings S.A.R.L. | High speed USB hub with full speed to high speed transaction translator |
-
2013
- 2013-08-30 JP JP2013179780A patent/JP5794266B2/en active Active
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023128219A1 (en) * | 2021-12-31 | 2023-07-06 | 삼성전자 주식회사 | Electronic device and method for controlling connections with external electronic devices |
Also Published As
Publication number | Publication date |
---|---|
JP2015049612A (en) | 2015-03-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9778844B2 (en) | Installation of operating system on host computer using virtual storage of BMC | |
US9680712B2 (en) | Hardware management and control of computer components through physical layout diagrams | |
EP2926239B1 (en) | Bootability with multiple logical unit numbers | |
US9240924B2 (en) | Out-of band replicating bios setting data across computers | |
TWI610238B (en) | Fast computer startup | |
JP4948168B2 (en) | Auto-run method using semiconductor memory device | |
US9806959B2 (en) | Baseboard management controller (BMC) to host communication through device independent universal serial bus (USB) interface | |
JP6136127B2 (en) | Controller, electronic apparatus and USB device control method | |
US9529750B2 (en) | Service processor (SP) initiated data transaction with bios utilizing interrupt | |
US9779047B2 (en) | Universal intelligent platform management interface (IPMI) host to baseboard management controller (BMC) communication for non-x86 and legacy free systems | |
JP2007272430A (en) | Drive configuration setting program | |
US7793004B2 (en) | Computer peripheral device implemented as optic storage device or/and removable disk by software emulation and implementing method thereof | |
US7921230B2 (en) | USB devices pre-configuration for KVM switch | |
JP5794266B2 (en) | USB host device and program for USB host device | |
US9749189B2 (en) | Generating graphical diagram of physical layout of computer platforms | |
TWI462014B (en) | Method and system for executing applicaton programs, storage medium controller and stotage device | |
JP5314344B2 (en) | External storage device, startup program switching method, and startup program switching program | |
US10466916B2 (en) | System and method of dynamic write protect of storage devices exposed by baseboard management controller (BMC) | |
CN114185720B (en) | Method, device, equipment and storage medium for dynamic hot backup of server | |
JP2014106784A (en) | Device controller, host device, and control method of host device | |
JP7073654B2 (en) | Information processing systems, information processing equipment and programs | |
JPWO2015136965A1 (en) | Control device, control system, control device control method, and control system control method | |
TWI390399B (en) | External device having a virtual storage device | |
JP2005092392A (en) | Recovery method for personal computer and usb descriptor rewrite program | |
TWI684114B (en) | Configuration method and system of general purpose input/output |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20150428 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20150626 |
|
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: 20150714 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150727 |
|
R150 | Certificate of patent (=grant) or registration of utility model |
Ref document number: 5794266 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |