USB device connection control circuit, host device, USB device connection control method, and program
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- NEC PLATFROMS LTD
- Filing Date
- 2024-12-20
- Publication Date
- 2026-07-02
Smart Images

Figure 2026109678000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a USB device connection control circuit, a host device, a USB device connection control method, and a program.
Background Art
[0002] There is a USB device that connects to a host device using USB (Universal Serial Bus) as a high-speed serial interface. Sometimes, this USB device may not be correctly recognized when connected to the host device. This is because, although the host device detects an interruption due to the connection of the USB device, during the initial setting of the USB device, it cannot receive the descriptor in the USB device and cannot identify the driver for operating the USB device. The descriptor contains various attribute information necessary for identifying the driver, such as the vendor ID and product ID.
[0003] One reason for not being able to correctly receive the descriptor is that the power states may not match due to link power management. For example, in the USB3.0 standard, in addition to the state U0 during normal operation, there are standby states U1 / U2 and suspend state U3. In order to communicate data between the host device and the USB device, the states of both must be U0. However, since the host device and the USB device each independently transition the state, a mismatch may occur.
[0004] For example, there is a technique to avoid connection state inconsistencies when transitioning the connection state between a host device and a USB device from an active state to a low-power state (see, for example, Patent Document 1). According to the technique disclosed in Patent Document 1, when a device controller in a USB device receives a state transition request from the host device to transition from an active state to a low-power state a predetermined number of times, it observes the state of the USB device for a predetermined period and determines the state of the host device. If the device controller determines that the host device has transitioned to a low-power state, it transitions to a low-power state, and if it determines that the host device is maintaining an active state, it maintains an active state. [Prior art documents] [Patent Documents]
[0005] [Patent Document 1] Japanese Patent Publication No. 2011-215855 [Overview of the Initiative] [Problems that the invention aims to solve]
[0006] The following analysis was performed by the inventors of this disclosure.
[0007] The technology disclosed in Patent Document 1 controls the system to prevent state mismatches from occurring, but it does not recover from a mismatched state. Therefore, there is no means of recovery if a state mismatch occurs despite the mechanism of the technology disclosed in Patent Document 1. Consequently, there remains a possibility that connected USB devices may not be recognized correctly and may become unusable. For this reason, user experience has not necessarily improved.
[0008] This disclosure is made in view of the above circumstances and aims to provide a user-friendly USB device connection control technology. [Means for solving the problem]
[0009] According to the first perspective of this disclosure, A USB device connection control circuit installed in a host device equipped with a USB (Universal Serial Bus) interface, When a new USB device is connected to the USB interface and the device is attached, a descriptor processing unit obtains a descriptor from the USB device and determines whether the obtained descriptor is valid or invalid. A power management unit that manages the power state between the host device and the USB device, If the acquired descriptor is determined to be negative, the system includes a reconnection unit that puts the USB device back into the device-attached state. The power management unit is provided with a USB device connection control circuit that, if it is determined that the acquired descriptor is not available, performs a state matching process to return the power states of the host device and the USB device to their normal operating states before the reconnection unit enters the device attachment state.
[0010] According to the second perspective of this disclosure, A host device is provided that includes the above-mentioned USB device connection control circuit.
[0011] According to the third perspective of this disclosure, A USB device connection control method performed by a host device equipped with a USB (Universal Serial Bus) interface, When a new USB device is connected to the USB interface and the device is attached, a descriptor is obtained from the USB device, and the validity of the obtained descriptor is determined. If the acquired descriptor is determined to be negative, a state matching process is performed to set the power state of the host device and the USB device to the normal operating state. A USB device connection control method is provided, which, after performing the state matching process, puts the USB device back into the device attached state.
[0012] According to the fourth perspective of this disclosure, A program is provided that causes a host device equipped with a USB (Universal Serial Bus) interface to execute the above-described USB device connection control method.
[0013] These programs can be recorded on a computer-readable storage medium. The storage medium can be non-transitory, such as semiconductor memory, hard disks, magnetic recording media, or optical recording media. This disclosure can also be implemented as a computer program product. [Effects of the Invention]
[0014] This disclosure can contribute to providing user-friendly USB device connection control technology. [Brief explanation of the drawing]
[0015] [Figure 1] (a) is a diagram showing an example of the overall configuration of a USB connection system according to an embodiment of the present disclosure, and (b) is a diagram showing an example of a functional block of a host controller according to an embodiment of the present disclosure. [Figure 2] This figure shows an example of a flowchart of the connection control process according to the embodiment of the present disclosure. [Figure 3] This figure shows an example of the functional blocks of a host device and a USB device according to an embodiment of the present disclosure. [Figure 4] (a) and (b) are diagrams showing an example of an item in the discrimination criteria database and an example of a descriptor, respectively, according to an embodiment of the present disclosure. [Figure 5] This figure shows an example of a flowchart of the connection control process according to the embodiment of the present disclosure. [Figure 6] This figure shows an example of the functional blocks of a host device and a USB device according to an embodiment of the present disclosure. [Figure 7]It is a diagram showing an example of a flowchart of the validity determination process of an embodiment of the present disclosure. [Figure 8] It is a diagram showing an example of the overall configuration of a USB connection system according to a modified example of the present disclosure. [Figure 9] It is a diagram showing an example of a flowchart of connection control processing according to a modified example of the present disclosure. [Figure 10] It is a diagram showing an example of the hardware configuration of a host device according to an embodiment of the present disclosure.
Mode for Carrying Out the Invention
[0016] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. Note that the reference signs in the drawings are attached to each element for convenience as an example to assist understanding, and are not intended to limit the present disclosure to the illustrated embodiments. Also, the connection lines between blocks in the drawings and the like referred to in the following description include both bidirectional and unidirectional ones. The one-way arrow schematically shows the flow of the main signal (data) and does not exclude bidirectionality. Further, in the following description, "A and / or B" is used to mean A or B, or A and B.
[0017] <<First Embodiment>> The outline of this embodiment will be described. FIG. 1(a) is a diagram for explaining the overall outline of the USB connection system 100 of this embodiment. The USB connection system 100 includes a host device 200 and a USB device 300.
[0018] The host device 200 is a device having a USB (Universal Serial Bus) interface 290 and capable of connecting a USB device 300. For example, it is a PC (Personal Computer) or the like. As shown in this figure, the host device 200 includes a CPU 210, a main storage device 220, a host controller 230, a power switch 240, and an internal bus 250 for connecting these.
[0019] Furthermore, the USB device 300 is a device that can be connected to the host device 200 via the USB interface 390. Examples include peripheral devices such as USB memory, USB keyboard, USB mouse, and USB camera. As shown in this figure, the USB device 300 comprises a device controller 310 and a storage device 320.
[0020] The CPU 210 controls the operation of each part of the host device 200.
[0021] The main memory 220 stores data necessary for the CPU 210 to perform various processes according to the CPU 210's control, as well as various data generated during or as a result of processing.
[0022] The host controller 230 is a controller on the host device 200 side that controls the connection via the USB interface 290. The host controller 230 controls the transmission and reception of data (signals) to and from the USB device 300 connected via the USB interface 290, according to the control of the CPU 210. The host controller 230 also functions as a USB device connection control circuit. The host controller 230 performs functions such as transmit / receive packet control compliant with the USB protocol, serial-to-parallel conversion of transmit / receive data, USB endpoint management, transmit / receive data buffer control, and response control.
[0023] The power switch 240 controls the power on / off of the USB device 300 according to the control of the CPU 210.
[0024] The device controller 310 writes and reads data from the storage device 320 according to instructions from the host controller 230. When connected, it reads the descriptor and transmits it to the host controller 230. It also manages the power status of its own device and transmits it to the host controller 230 according to instructions from the host controller 230.
[0025] The storage device 320 is the storage unit of the USB device 300. In its initial state, the descriptor of the USB device 300 is stored in it.
[0026] The host controller 230 and the device controller 310 are connected via USB interfaces 290 and 390. USB interfaces 290 and 390 are used to connect the host device 200 and the USB device 300, respectively, and are interfaces for USB-compliant data communication between the two devices. Both devices are equipped with USB connectors, also called the host-side plug and the device-side plug.
[0027] Next, the functions of the host controller 230 will be described. As shown in Figure 1(b), the host controller 230 includes a descriptor processing unit 231, a power management unit 232, and a reconnection unit 233.
[0028] When a new USB device 300 is connected to the USB interface 290 and the device is attached, the descriptor processing unit 231 obtains a descriptor from the USB device 300 and determines whether the obtained descriptor is valid or invalid.
[0029] A descriptor is attribute information held by a USB device 300, including its vendor ID, product ID, etc. This attribute information is also called a device descriptor.
[0030] The descriptor processing unit 231 detects an interrupt caused by the connection of the USB device 300 and performs the initial setup of the USB device 300. At this time, the descriptor processing unit 231 obtains the device descriptor held by the USB device 300. Alternatively, only the attribute information necessary for the initial setup may be read from the device descriptor. This initial setup includes, for example, determining the driver for the USB device 300 and setting it to an operational state. This driver is pre-registered in association with the attribute information.
[0031] The descriptor processing unit 231 determines whether the acquired descriptor is correct if a device driver is registered in association with it, and incorrect if it is not registered. Even if the device driver is not registered, if it can be acquired via a network, for example, the unit may acquire the driver via the network and then determine whether it is correct.
[0032] If the descriptor processing unit 231 determines that the input is correct, it considers that the initial setup of the USB device 300 has been successfully completed and terminates the connection control process. Subsequently, the host controller 230 operates the USB device 300 using its device driver. For example, the host controller 230 supplies power to the USB device 300, starts it up, and begins sending and receiving data to and from the USB device 300.
[0033] The power management unit 232 manages the power state of the host device 200 and the USB device 300 connected to it. If the acquired descriptor is determined to be negative, the power management unit 232 performs a state matching process to return the power states of the host device 200 and the USB device 300 to the normal operating state before the reconnection unit 233 (described later) puts the USB device 300 into the device attachment state.
[0034] If the reconnection unit 233 determines that the acquired descriptor is invalid, it puts the USB device 300 back into the device-attached state. This process is called the reconnection process or retry.
[0035] The reconnection unit 233 puts the USB device 300 into a device-attached state using an existing method. For example, it sends a reset signal to the USB device 300. Alternatively, it may temporarily turn off the power to the USB device 300. In this case, the reconnection unit 233 instructs the power switch 240 via the CPU 210 to stop supplying power to the USB device 300.
[0036] Each function of the host controller 230 is realized by the CPU 210 executing a program stored in the main memory 220.
[0037] [Connection control processing] Here, we will explain the process flow for controlling the connection of the USB device 300 by the host controller 230 of the host device 200.
[0038] Figure 2 shows the processing flow of the connection control process in this embodiment. This process is initiated when a new USB device 300 is connected to the USB interface 290 (i.e., the device is attached).
[0039] When a new USB device 300 is connected to the USB interface 290 and the device is attached, the descriptor processing unit 231 obtains a descriptor from the USB device 300 (step S1101).
[0040] The descriptor processing unit 231 performs a validity determination process to determine whether the acquired descriptor is valid or not (step S1102).
[0041] If the correctness determination process determines that the connection is correct (step S1103; Yes), the descriptor processing unit 231 terminates the connection matching process.
[0042] On the other hand, if the pass / fail determination process determines that the result is false (step S1103; No), the descriptor processing unit 231 notifies the power management unit 232 of this fact. The power management unit 232 then performs a state matching process (step S1104). In the state matching process, the power management unit 232 obtains the current power status of the host device 200 and the USB device 300. If the status is anything other than the normal operating state, it sets them to the normal operating state.
[0043] Subsequently, the reconnection unit 233 performs a reconnection process and returns the USB device 300 to a newly connected state (device attached state) (step S1105). Here, the reconnection unit 233 returns the USB device 300 to the device attached state by performing the predetermined process described above on the USB device 300.
[0044] As described above, according to the USB connection system 100 of this embodiment, if the host device 200 cannot recognize the USB device 300 connected via the USB interface 290, the power status of both devices is checked and both devices are returned to their normal operating state. Therefore, the possibility that the descriptor cannot be read due to an abnormal power status of both devices can be reduced.
[0045] According to this embodiment, such a simple configuration reduces the possibility of the USB device 300 connection not being recognized, thus providing a user-friendly USB device connection control technology.
[0046] <<Second Embodiment>> Next, a second embodiment will be described. This embodiment is a more detailed and specific version of the first embodiment. In this embodiment, components with the same names as in the first embodiment basically have the same functions as in the first embodiment. The following description of this embodiment will focus on the differences from the first embodiment.
[0047] The USB connection system 100 of this embodiment has basically the same configuration as the USB connection system 100 of the first embodiment shown in Figure 1(a). The USB device 300 of this embodiment is also the same. On the other hand, the host device 200 of this embodiment has a function to manage link power in addition to the configuration of the first embodiment.
[0048] Figure 3 is a functional block diagram of the host controller 230 and USB device 300 of the host device 200 in this embodiment.
[0049] As shown in this figure, the host controller 230 of this embodiment includes a descriptor processing unit 231, a power management unit 232a, and a reconnection unit 233. The power management unit 232a includes a link power management function 234.
[0050] Furthermore, the host device 200 of this embodiment includes a discrimination criteria database 221. The discrimination criteria database 221 is stored, for example, in the main memory 220.
[0051] Similar to the first embodiment, when a USB device 300 is newly connected to the USB interface 290 and the device attachment state is reached, the descriptor processing unit 231 acquires a descriptor from the USB device 300 and determines whether the acquired descriptor is valid or invalid.
[0052] When the descriptor processing unit 231 detects that a USB device 300 has been newly inserted into the USB connector provided as the USB interface 290, it determines that the device has entered an attached state. The descriptor processing unit 231 then executes a predetermined connection sequence. Specifically, it performs a negotiation that involves a handshake between the host controller 230 and the device controller 310 using existing methods.
[0053] During this negotiation, the descriptor processing unit 231 requests the USB device 300 to send a descriptor. Upon receiving this request, the device controller 310 of the USB device 300 notifies the host controller 230 of the attribute information (descriptor) defined in the USB 3.0 specification, etc. As a result, the descriptor processing unit 231 obtains the descriptor from the USB device 300.
[0054] Subsequently, the descriptor processing unit 231 determines whether the acquired descriptor is valid or invalid. In this embodiment, the validity of the acquired descriptor is determined by whether or not it is stored in the discrimination criteria database 221.
[0055] Here, we will explain the discrimination criteria database 221. An example of items registered in the discrimination criteria database 221 is shown in Figure 4(a). As shown in this figure, the discrimination criteria database 221 is a database in which driver information 420 of the USB device 300 is registered in association with descriptor information 410.
[0056] Descriptor information 410 is descriptor information for USB devices 300 that may be connected to the host device 200. Descriptor information 410 is pre-stored in the host device 200.
[0057] The device descriptor possessed by the USB device 300 includes various attribute information such as size, type, and class, as will be described later. However, it is not necessary to register all of this attribute information as descriptor information 410.
[0058] In this example, descriptor information 410 illustrates a case where two attribute pieces of information from the device descriptor are registered: the vendor ID and the product ID. The vendor ID is an ID issued to each vendor by the USB Implementers Forum. The product ID is an ID that each vendor can freely assign to each product.
[0059] Driver information 420 is information that identifies the driver for each USB device 300 whose attribute information is stored in descriptor information 410. The driver for a USB device 300 is the software that operates the USB device 300. Driver information 420 mainly registers information that identifies the driver held by the host device 200, for example, in the main memory 220.
[0060] The descriptor processing unit 231 acquires descriptors from the USB device 300 and extracts attribute information used for identification from them. Alternatively, the descriptor processing unit 231 may be configured to acquire only the attribute information used for identification from the descriptors of the USB device 300.
[0061] The descriptor processing unit 231 then determines whether the acquired set of attribute information is registered as descriptor information 410 in the discrimination criteria database 221. If it is registered, it determines it to be true; if it is not registered, it determines it to be false.
[0062] If it determines that the descriptor information is correct, the descriptor processing unit 231 extracts the driver information 420 registered in the determination criteria database 221 in association with the corresponding descriptor information 410. The host controller 230 then operates the USB device 300 using the driver identified by the driver information 420.
[0063] Similar to the first embodiment, the power management unit 232a manages the power status of the host device 200, which is itself, and the USB device 300 connected to it. If the power management unit 232a determines that the acquired descriptor is not valid, it performs a state matching process to return the power status of the host device 200 and the USB device 300 to the normal operating state before the reconnection unit 233, described later, enters the device attachment state.
[0064] The power management unit 232a of this embodiment includes a link power management function 234. The link power management function 234 is a function that sets the connected USB device 300 to power saving mode. The link power management function 234 also controls the USB device 300 when it spontaneously enters power saving mode, and provides support when the USB device 300 returns from power saving mode. These functions make it possible to reduce the power consumption of the USB device 300, which operates on USB bus power.
[0065] In this embodiment, the power management unit 232a acquires the power status of the USB device 300 from the device controller 310 via the USB interfaces 290 and 390. It also acquires the power status of the host device 200, which is itself.
[0066] The power state acquired here is one of the four power states (link power states; hereinafter simply referred to as states) U0, U1, U2, or U3, as defined by USB 3.0.
[0067] For example, State U0 is the full-power state, i.e., the normal operating state. State U0 is a dynamic state in which data transfer is possible. State U1 is the fast-recovery standby power state. In State U1, power consumption is lower than in State U0, but data communication is not possible. State U2 is the slow-recovery standby power state. In State U2, power consumption is even lower than in State U1. State U3 is the suspend state power state. State U3 is the most power-efficient state.
[0068] Each of these states is transitioned to by a request from the link power management function 234. The link power management function 234 monitors, for example, the transmission and reception of data between the host controller 230 and the device controller 310, and if an idle state without data transmission or reception continues for a predetermined period, it transitions the state of the USB device 300 from state U1 to state U2, state U3, and so on. Alternatively, the state transitions may be configured using a timer function or the like that built into the USB device 300.
[0069] The power management unit 232a can transition the link power state of the USB device 300 to state U0 by, for example, sending an LFPS (Low Frequency Periodic Signaling) command to the device controller 310.
[0070] If the USB device 300 is in state U1, U2, or U3, the power management unit 232a first disables the link power management function 234. Here, it is also possible to disable only the function of the link power management function 234 that automatically transitions the state of the USB device 300 to state U1, U2, or U3.
[0071] Then, the power management unit 232a sends an LFPS command to the device controller 310 of the USB device 300, causing the power state of the USB device 300 to transition to state U0.
[0072] Furthermore, the power management unit 232a also acquires the power state of the host device 200. If the power state of the host device 200 is anything other than state U0, it transitions to state U0. This synchronizes the power states of the host device 200 and the USB device 300.
[0073] If the reconnection unit 233 determines that the connection is not successful in the success / failure determination process, it performs a reconnection process (retry) to put the USB device 300 back into the device attached state.
[0074] In this embodiment, similar to the first embodiment, the reconnection unit 233 transmits a reset signal to the USB device 300, for example. This reset signal sets the reset register in the USB device 300 via a data signal (soft reset). After the register is set, the USB device 300 autonomously performs a reset.
[0075] Furthermore, similar to the first embodiment, the reconnection unit 233 may also control the power of the USB device 300 by turning it on and off. In this case, the reconnection unit 233 requests the CPU 210 to control the power on and off. The CPU 210 then issues an instruction to the power switch 240. Specifically, first, the power switch 240 turns off the power to the USB device 300. That is, it stops supplying power from the power pins of the USB connector. Then, after a predetermined period, it turns on the power to the USB device 300. That is, it resumes supplying power from the power pins.
[0076] The reconnection process performed by the reconnection unit 233 may be configured to be executed a predetermined number of times. In this case, the threshold number of executions is stored in the main memory 220 in advance.
[0077] As shown in Figure 3, the USB device 300 includes a device controller 310 and a storage device 320, similar to the first embodiment. The device controller 310 has the same functions as in the first embodiment. The storage device 320 stores the descriptor 321.
[0078] An example of a descriptor 321 stored in the storage device 320 of this embodiment is shown in Figure 4(b). As shown in this figure, the descriptor 321 holds the specifications of the USB device 300 as a data table. For example, as shown in this figure, the vendor ID, product ID, release number, number of configurations, etc., are described.
[0079] [Connection control processing] Here, we will explain the connection control process for the USB device 300 by the host controller 230 of this embodiment. Figure 5 shows the processing flow of the connection control process of this embodiment. Here, we will explain the processing flow assuming that the reconnection process (retries) is performed up to a predetermined number of times. The predetermined number of times is N (where N is a natural number of 1 or more). This process is started when the USB device 300 is newly connected to the USB interface 290 (the device is attached). Also, the same reference numerals are used for the same processes as in the first embodiment.
[0080] First, the reconnection unit 233 initializes a counter n that counts the number of retries (n=1) (step S2101).
[0081] When the USB interface 290 enters a device-attached state with a newly connected USB device 300, the descriptor processing unit 231 acquires a descriptor from the USB device 300 (step S1101).
[0082] The descriptor processing unit 231 performs a validity determination process to determine whether the acquired descriptor is valid or not (step S1102).
[0083] In the success / failure determination process, if it is determined to be successful (step S1103; Yes), the descriptor processing unit 231 terminates the connection control process, indicating that the connection was successful.
[0084] On the other hand, if the success / failure determination process determines that the connection is unsuccessful (step S1103; No), the reconnection unit 233 first determines whether the number of retries n exceeds the threshold N (step S2102). If it does (S2102; Yes), the connection is considered unsuccessful and the connection control process is terminated.
[0085] On the other hand, if the number of retries n is less than or equal to the threshold N (S2102; No), the power management unit 232a performs state matching processing (step S1104). In the state control processing, the power management unit 232a obtains the current power state of the host device 200 and the USB device 300. If the state is anything other than the normal operating state, it sets it to the normal operating state (state U0).
[0086] Subsequently, the reconnection unit 233 performs a reconnection process to return the USB device 300 to a newly connected state (device attached state) (step S1105). Here, the reconnection unit 233 reconnects the USB device 300 by performing the predetermined process described above.
[0087] Then, the reconnection unit 233 increments the counter n by 1, returns to step S1101, and repeats the process.
[0088] As described above, the USB connection system 100 of this embodiment has the same configuration as the first embodiment. Therefore, the same effects as the first embodiment can be obtained.
[0089] According to this embodiment, such a simple configuration reduces the possibility of the USB device 300 connection not being recognized, thus providing a user-friendly USB device connection control technology.
[0090] <<Third Embodiment>> Next, a third embodiment will be described. In this embodiment, predetermined information is assigned to the descriptor in advance on the USB device 300 side. Note that the information to be assigned may be configured to be assigned when it is transmitted to the host device 200.
[0091] The USB connection system 100 of this embodiment basically has the same configuration as the first embodiment shown in Figure 1(a). The following description will focus on the differences from the first embodiment.
[0092] As shown in Figure 6, the device controller 310a of the USB device 300 in this embodiment includes a descriptor editing unit 311.
[0093] The descriptor editor 311 assigns predetermined information to the descriptor. The information assigned is such that the receiving host controller 230 can check the validity of the descriptor. Specifically, it is error detection bits.
[0094] The error detection bits to be added include, for example, parity bits, checksums, cyclic redundancy checks (CRC), and Hamming distance.
[0095] Furthermore, the descriptor editor 311 may add error detection bits only to the attribute information that it transmits to the host controller 230 during negotiation (handshake) in the device attachment state, among the various attribute information it holds as descriptor 321.
[0096] When the device controller 310a receives a request from the host controller 230 during negotiation to send a descriptor, it sends a descriptor (attribute information) with error detection bits attached to it to the host controller 230.
[0097] Furthermore, when the descriptor processing unit 231 of the host controller 230 in this embodiment receives a descriptor to which an error detection bit has been added, it uses the added error detection bit to determine the validity of the transmitted descriptor.
[0098] If it is determined to be legitimate, then, as in the second embodiment, a determination is made using the determination criterion database 221 stored in the main memory 220. On the other hand, if it is determined to be illegitimate, the power management unit 232a is notified of this at this point.
[0099] The functions of the power management unit 232a and the reconnection unit 233 are the same as those of any of the embodiments described above, so their description is omitted here.
[0100] Furthermore, the connection control process is the same as in any of the embodiments described above. However, the pass / fail determination process is different. The pass / fail determination process of this embodiment will be described below.
[0101] [True / False Determination Process] Figure 7 shows the processing flow of the pass / fail determination process in this embodiment. This process is initiated when a descriptor is obtained.
[0102] The descriptor processing unit 231 first extracts error detection bits from the descriptor and performs a check using the error detection bits (step S3101).
[0103] If the result is determined to be valid (step S3102; Yes), the descriptor processing unit 231 performs discrimination using the discrimination criteria database 221 (step S3103). Here, the descriptor processing unit 231 determines whether or not the acquired set of attribute information is registered as descriptor information 410 in the discrimination criteria database 221.
[0104] If registered (step S3104; Yes), the descriptor processing unit 231 determines the determination result to be true (step S3105) and terminates the true / false determination process.
[0105] If it is determined in step S3102 that the result is invalid, the descriptor processing unit 231 sets the determination result to "no" (step S3106) and terminates the validity determination process.
[0106] Furthermore, if there is no registration in step S3104, the descriptor processing unit 231 determines the determination result to be negative (step S3106) and terminates the correct / false determination process.
[0107] As described above, according to this embodiment, before accessing the discrimination criterion database 221, the validity of the descriptor obtained from the USB device 300 is determined using an error detection bit. Therefore, if it is not valid, the reconnection process can be performed more quickly.
[0108] According to this embodiment, such a simple configuration reduces the possibility of the USB device 300 connection not being recognized, thus providing a user-friendly USB device connection control technology.
[0109] <Example 1> In the above embodiments, the case in which the host device 200 and the USB device 300 are directly connected via USB interfaces 290 and 390 was described as an example. However, the connection configuration of the two devices is not limited to this.
[0110] For example, as shown in Figure 8, a USB hub 500 may be interposed between the host device 200 and the USB device 300.
[0111] The USB hub 500 splits one USB port (USB interface 290) on the host device 200 into multiple ports. This allows multiple USB devices 300 to be connected to the host device 200 via USB simultaneously.
[0112] Figure 8 shows an example of a USB hub 500 that operates on bus power. As shown in this figure, this modified USB hub 500 includes a hub controller 510 and a power switch 520. The USB hub 500 is connected to the host controller 230 and the device controller 310 via USB interfaces 590, respectively.
[0113] The hub controller 510 controls the operation of the entire USB hub 500 and relays data transmission and reception between the host controller 230 and the device controllers 310 of each USB device 300.
[0114] In this modified example, the hub controller 510 notifies the host controller 230 of the power status of its own device (USB hub 500) upon instruction from the host controller 230. Furthermore, upon instruction from the host controller 230, it sets the power status of its own device to state U0.
[0115] Furthermore, the hub controller 510, upon instruction from the host controller 230, obtains the power status of the connected USB device 300 and notifies the host controller 230. Also, upon instruction from the host controller 230, it sets the power status of the USB device 300 to state U0.
[0116] Furthermore, the power switch 520 controls the power on / off for each of the USB devices 300 connected to it, under the control of the hub controller 510.
[0117] In this modified example, the power management unit 232 manages the power status of the USB hub 500 and the power status of the USB device 300. The power status of the USB device 300 is obtained via the hub controller 510 of the USB hub 500.
[0118] According to the USB standard, once the host device 200 is fixed in state U0, the USB hub 500 cannot autonomously transition to any state other than U0. Therefore, the host device 200 is first fixed in state U0, and then the USB hub 500 and USB device 300 are set to state U0.
[0119] This ensures that the host device 200 and the USB hub 500 always maintain state U0, thus avoiding the issue of the USB device 300 not being correctly recognized due to a state mismatch.
[0120] <Modification 2> In each of the embodiments and modifications described above, the descriptor information 410 of the discrimination criteria database 221 contains the attribute information itself of the USB device 300 that may be connected. However, the information to be registered is not limited to this.
[0121] For example, invalid values and digit counts, or values and digit counts that cannot occur, may be registered. In this case, the descriptor processing unit 231 determines that the attribute information in the acquired descriptor is not included in the registered value.
[0122] <Variation 3> In the above embodiments and modifications, if the pass / fail determination process determines that the result is false, a state matching process is performed before the reconnection process. However, the state matching process is not necessarily required.
[0123] For example, only correct / incorrect processing may be performed, and no state matching processing may be performed at all. In this case, the power management unit 232 may not be provided.
[0124] Furthermore, the system may be configured to perform state matching processing only under predetermined conditions. For example, in each of the above embodiments and modifications, if the pass / fail determination process determines that the connection is false, the state matching processing is not performed, and the reconnection process is performed a predetermined number of times. If the USB device 300 is still not recognized, the system may be configured to perform state matching processing.
[0125] Figure 9 shows an example of the connection control process flow in this case. Here, we illustrate the case where a state matching process is performed if the USB device 300 cannot be recognized even after M (where M is an integer greater than or equal to 1) reconnection attempts. m is a counter. Note that the same reference numerals are used for processes that are the same as those in the connection control process of each embodiment described above, and their explanations are omitted.
[0126] In this modified version, the descriptor is obtained, and if it is determined to be negative, the state control process is skipped M times, and the reconnection process is performed.
[0127] Then, if the result is determined to be "No" M times (step S4102; Yes), the descriptor processing unit 231 notifies the power management unit 232 of this fact.
[0128] The power management unit 232 receives this information, obtains the power status of the host device 200 and the USB device 300, and determines whether they are in state U0 or not (step S4104).
[0129] If there is a mismatch, the power management unit 232 performs the state matching process described above (step S1104). Then, the reconnection unit 233 performs the reconnection process (step S1105) and returns to the descriptor acquisition process in step S1101.
[0130] If the success / failure determination process is again deemed unsuccessful, then in step S4102, m is greater than M, and in step S4104, the power states are matched, so the host controller 230 terminates the process as a connection failure.
[0131] <Modification 4> In each of the embodiments or modifications described above, the reconnection process is configured to either send a reset signal or turn the power on or off, but is not limited to this.
[0132] For example, both methods may be used in combination. For instance, the reconnection unit 233 first sends a reset signal to the USB device 300. Then, it repeats the process starting from descriptor acquisition a predetermined number of times. If the USB device 300 is not recognized after repeating the process a predetermined number of times, it turns the power off and on and repeats the process starting from descriptor acquisition.
[0133] Reconnecting via a reset signal has the advantage of requiring a shorter recovery time. On the other hand, reconnecting via the power switch 240 has a higher probability of recovery.
[0134] <Modification 5> The host device 200 may also include hardware other than that shown in the above embodiments and / or variations. For example, as shown in Figure 10, it may include an auxiliary storage device 261, an expansion interface (I / F) 262, a communication I / F 263, a speaker 264, a lamp 265, etc.
[0135] The CPU 210 implements the above functions, for example, by loading a program stored in the auxiliary storage device 261 into the main memory device 220 and executing it, and also comprehensively controls the entire host device 200. Alternatively, one or more processors, such as an MPU (Micro Processing Unit), may be used instead of the CPU 210.
[0136] The main memory 220 is a type of memory such as RAM (Random Access Memory). The main memory 220 also functions as a work area when the CPU 210 processes programs executed by the host device 200.
[0137] The auxiliary storage device 261 is, for example, a ROM (Read Only Memory), an HDD (Hard Disk Drive), or an SSD (Solid State Drive). The auxiliary storage device 261 stores various programs executed by the main memory 220. In each of the above embodiments and / or modifications, the discrimination criterion database 221 may also be stored in the auxiliary storage device 261. The auxiliary storage device 261 may include storage media such as a flexible disk, hard disk, optical disk, CD-ROM, CD-R, magnetic tape, non-volatile memory card, or DVD.
[0138] Furthermore, programs stored in the auxiliary storage device 261 can be provided as program products recorded on a non-temporary computer-readable recording medium. The auxiliary storage device 261 can be used to store various programs recorded on a non-temporary computer-readable recording medium for medium to long term.
[0139] The extension I / F262 is an interface for connecting input devices, output devices, etc. For example, displays, keyboards, mice, touch panels, etc., can be connected. For example, the host device 200 may be equipped as a receiving device that receives instructions from the user for these devices. In this case, for example, the user may be able to set whether to send a reset signal or turn the power on or off during the reconnection process. Also, if the connection control process ends in failure, the system may be configured to notify the user by displaying a message to that effect on the display, for example.
[0140] Communication I / F263 is an interface for wired or wireless input and output of signals and data. It functions as an interface for connecting to an external network. For example, the driver for USB device 300 may be configured to be obtained via this communication I / F263.
[0141] In this case, the driver information 420 in the discrimination criteria database 221 is not limited to information about drivers already possessed by the host device 200. It may also include information about drivers that the host device 200 has not yet acquired but which are available for acquisition.
[0142] For example, information indicating the location of the driver on the network (address) may be registered as driver information 420. When descriptor information 410, which is registered in association with the driver information 420, is obtained from the discrimination criteria database 221, the system accesses the address via the communication interface 263 and retrieves the driver.
[0143] Speaker 264 outputs signals such as audio data. The output audio data is, for example, an alarm sound, an alarm message, etc., and the source data is stored in advance in an auxiliary storage device 261 or the like.
[0144] Lamp 265 emits light. For example, it is composed of an LED.
[0145] The speaker 264 and / or lamp 265 may be configured, for example, to notify the user if the connection control process ends in failure.
[0146] The hardware configuration of the host device 200 is not limited to this. Furthermore, each function may be implemented, for example, by a dedicated integrated circuit (IC), an application-specific integrated circuit (ASIC), a system-on-a-chip (SOC), a field-programmable gate array (FPGA), etc.
[0147] In the process flow described above, multiple steps (processes) are listed in order, but the execution order of each step is not restricted by that order. For example, the order of the illustrated steps can be changed to the extent that it does not affect the content, such as by executing each process in parallel.
[0148] While embodiments and modifications of this disclosure have been described above, this disclosure is not limited to the embodiments described above, and various modifications can be made that will be understood by those skilled in the art. Furthermore, each embodiment and modification can be combined with other embodiments as appropriate. In addition, for example, the network configurations and element configurations shown in each drawing are examples to aid in understanding this disclosure and are not limited to the configurations shown in these drawings.
[0149] Finally, we summarize the preferred forms of this disclosure. Some or all of the embodiments described above may also be described as follows, but are not limited to the following: (Note 1) The USB device connection control circuit installed in a host device equipped with a USB interface is When a new USB device is connected to the USB interface and the device is attached, a descriptor processing unit obtains a descriptor from the USB device and determines whether the obtained descriptor is valid or invalid. A power management unit that manages the power state between the host device and the USB device, If the acquired descriptor is determined to be negative, the system includes a reconnection unit that puts the USB device back into the device-attached state. If the power management unit determines that the acquired descriptor is not valid, it performs a state matching process to return the power states of the host device and the USB device to their normal operating states before the reconnection unit enters the device attachment state. (Note 2) In the USB device connection control circuit described in Appendix 1, In the state matching process, the power management unit preferably acquires the power state of the host device and the USB device, and if the acquired power state is other than the normal operating state, it transitions to the normal operating state. (Note 3) In the USB device connection control circuit described in Appendix 1 or 2, When a link power management function is provided, it is desirable for the power management unit to disable the link power management function when executing the state matching process. (Note 4) In the USB device connection control circuit described in any of the appendices 1 to 3, It is desirable that the descriptor processing unit refers to a database of discrimination criteria that pre-stores descriptors for each USB device connectable to the host device, and determines whether the acquired descriptor is correct or incorrect. (Note 5) In the USB device connection control circuit described in any of the appendices 1 to 4, An error detection code is added to the descriptor held by the USB device. It is desirable that the descriptor processing unit also acquires the error detection code along with the descriptor, and uses the acquired error detection code to determine whether the descriptor is correct or incorrect. (Note 6) In the USB device connection control circuit described in any of Appendix 1 to 5, It is desirable that the reconnection unit puts the USB device into the device-attached state by transmitting a reset signal to the USB device. (Note 7) In the USB device connection control circuit described in any of the appendices 1 to 6, The reconnection unit preferably puts the USB device into the device-attached state by turning off the power to the USB device and then turning on the power after a predetermined period of time. (Note 8) The host device is preferably equipped with a USB device connection control circuit as described in any of the appendices 1 to 7, 11, and 12. (Note 9) A USB device connection control method performed by a host device equipped with a USB interface is: When a new USB device is connected to the USB interface and the device is attached, a descriptor is obtained from the USB device, and the validity of the obtained descriptor is determined. If the acquired descriptor is determined to be negative, a state matching process is performed to set the power state of the host device and the USB device to the normal operating state. After performing the state matching process, the USB device is returned to the device attached state. (Note 10) The program causes a host device equipped with a USB (Universal Serial Bus) interface to execute the USB device connection control method described in Appendix 9. (Note 11) In the USB device connection control circuit described in any of Appendix 1 to 7, It is desirable that the reconnection unit be kept in the device attachment state for a predetermined number of times. (Note 12) In the USB device connection control circuit described in any of Appendix 1 to 7, It is desirable that the power management unit, if it determines that the acquired descriptor is not valid a predetermined number of times, execute the state matching process before the reconnection unit enters the device attachment state. Furthermore, the forms described in appendices 9 and 10 can be expanded into the forms described in appendices 2-7 and 11 and 12, similar to appendice 1.
[0150] Furthermore, the disclosures in the above-mentioned patent documents, etc., are incorporated into this document by reference. Within the framework of this disclosure (including the claims), further modifications and adjustments to the embodiments or variations are possible based on the fundamental technical concept. Also, within the framework of this disclosure, various combinations or selections of various disclosed elements (including each element of each claim, each element of each embodiment or variation, each element of each drawing, etc.) are possible. In other words, this disclosure includes the entire disclosure, including the claims, and of course, various modifications and changes that a person skilled in the art could make in accordance with the technical concept. In particular, with respect to the numerical ranges described in this document, any numerical value or sub-range included within that range should be interpreted as being specifically described unless otherwise stated. [Explanation of symbols]
[0151] 100: USB connection system, 200: Host device, 210: CPU, 220: Main memory, 221: Discrimination criterion database, 230: Host controller, 231: Descriptor processing unit, 232: Power management unit, 232a: Power management unit, 233: Reconnection unit, 234: Link power management function, 240: Power switch, 250: Internal bus, 261: Auxiliary storage device, 262: Expansion I / F, 263: Communication I / F, 264: Speaker, 265: Lamp, 290: USB interface 300: USB device, 310: device controller, 310a: device controller, 311: descriptor editor, 320: storage device, 321: descriptor, 390: USB interface, 410: Descriptor information, 420: Driver information, 500: USB hub, 510: hub controller, 520: power switch, 590: USB interface
Claims
1. A USB device connection control circuit installed in a host device equipped with a USB (Universal Serial Bus) interface, When a new USB device is connected to the USB interface and the device is attached, a descriptor processing unit obtains a descriptor from the USB device and determines whether the obtained descriptor is correct or incorrect. A power management unit manages the power state between the host device and the USB device, If the acquired descriptor is determined to be invalid, the system includes a reconnection unit that puts the USB device back into the device-attached state. The USB device connection control circuit, when the power management unit determines that the acquired descriptor is not available, performs a state matching process to return the power state of the host device and the USB device to the normal operating state before the reconnection unit enters the device attachment state.
2. A USB device connection control circuit according to claim 1, The power management unit, in the state matching process, acquires the power state of the host device and the USB device, respectively, and if the acquired power state is other than the normal operating state, transitions to the normal operating state, a USB device connection control circuit.
3. A USB device connection control circuit according to claim 1, A USB device connection control circuit that, when equipped with a link power management function, disables the link power management function when the power management unit performs the state matching process.
4. A USB device connection control circuit according to claim 1, The descriptor processing unit is a USB device connection control circuit that refers to a discrimination criterion database which has a prior storage of descriptors for each USB device that can be connected to the host device, and determines whether the acquired descriptor is correct or incorrect.
5. A USB device connection control circuit according to claim 1, An error detection code is added to the descriptor held by the USB device. The descriptor processing unit also acquires the error detection code along with the descriptor, and uses the acquired error detection code to determine whether the connection is correct or incorrect, in a USB device connection control circuit.
6. A USB device connection control circuit according to claim 1, The reconnection unit is a USB device connection control circuit that puts the USB device into the device attached state by transmitting a reset signal to the USB device.
7. A USB device connection control circuit according to claim 1, The reconnection unit is a USB device connection control circuit that turns off the power to the USB device and turns on the power after a predetermined period of time, thereby putting the USB device into the device attached state.
8. A host device comprising a USB device connection control circuit according to any one of claims 1 to 7.
9. A USB device connection control method performed by a host device equipped with a USB (Universal Serial Bus) interface, When a new USB device is connected to the USB interface and the device is attached, a descriptor is obtained from the USB device, and the validity of the obtained descriptor is determined. If the acquired descriptor is determined to be negative, a state matching process is performed to set the power state of the host device and the USB device to the normal operating state. A USB device connection control method that, after performing the state matching process, returns the USB device to the device attached state.
10. A program that causes a host device equipped with a USB (Universal Serial Bus) interface to execute the USB device connection control method described in claim 9.