CN105589771A - Test method and apparatus - Google Patents

Test method and apparatus Download PDF

Info

Publication number
CN105589771A
CN105589771A CN201510443470.XA CN201510443470A CN105589771A CN 105589771 A CN105589771 A CN 105589771A CN 201510443470 A CN201510443470 A CN 201510443470A CN 105589771 A CN105589771 A CN 105589771A
Authority
CN
China
Prior art keywords
usb
test
usb interface
interface
pattern
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510443470.XA
Other languages
Chinese (zh)
Inventor
兰中
邱浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201510443470.XA priority Critical patent/CN105589771A/en
Publication of CN105589771A publication Critical patent/CN105589771A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention provides a detection method and apparatus. A server single board is provided with an expandable host controller interface XHCI controller. The method comprises the steps of performing first testing on a USB interface through a USB device accessing the USB interface of the server single board; after the first testing is finished, uninstalling a bus driver of the XHCI controller, wherein the USB interface is mounted on the XHCI controller; modifying a register corresponding to the USB interface, so that the USB interface is switched to a second mode; reloading the bus driver of the XHCI controller; and performing second testing on the USB interface through the USB device. According to the detection method and apparatus, when the USB interface is tested, only one USB device needs to access the USB interface and the USB interface is controlled to be automatically switched to different modes, so that the test cost is reduced while the automated test is realized.

Description

A kind of method of testing and device
Technical field
The present invention relates to network communications technology field, particularly a kind of method of testing and device.
Background technology
The shipment amount of USB (UniversalSerialBus, USB) 3.0 equipment increases severely year by year,But USB2.0 equipment is still in occupation of critical role. In order to take into account the use of USB2.0, to serviceIn the process that device veneer is tested, USB3.0 interface should be tested the pin of compatible USB2.0.
In the time of test, can adopt USB2.0 equipment and USB3.0 equipment to access respectively described USB and connectMouthful, thereby carry out respectively USB2.0 and USB3.0 test. But, plug manually USB deviceCannot realize automatic test, and relatively lose time, in test process, increase man-machine interaction, easilyIntroduce artificial factors for failure, cause less stable.
In order to address this problem, in prior art, introduce USB switch. To server veneerWhen USB interface is tested, USB2.0 equipment and USB3.0 equipment connect by USB switch simultaneouslyEnter the USB interface of server veneer. By serial port command, control described USB switch and be communicated with USBPassage between interface and different USB device, thus test.
But, while adopting aforesaid way to test, need to join for each USB3.0 interface to be testedPut a USB switch, testing cost is higher; Also need serial ports of each switch configurations simultaneouslyBe used for controlling described USB switch, environment relative complex, once go wrong change with contrast locating numberTired.
Summary of the invention
In view of this, the invention provides a kind of method of testing and device, in the time that USB interface is tested,Only need to, at a USB device of described USB interface access, control described USB interface and automatically switch toDifferent patterns, thus testing cost in realizing automatic test, reduced.
According to the first aspect of the embodiment of the present invention, a kind of method of testing is provided, for server veneer,Described server veneer is provided with extendible host controller interface XHCI controller, described method bagDraw together:
USB device by accessing described server veneer general-purpose serial bus USB interface is to describedUSB interface carries out the first test;
Complete after described the first test, unload the bus driver of described XHCI controller, wherein said USBInterface carry is on described XHCI controller;
Revise the register corresponding with described USB interface, so that described USB interface switches to the second mouldFormula;
Reload the described bus driver of described XHCI controller;
By described USB device, described USB interface is carried out to the second test.
According to the second aspect of the embodiment of the present invention, a kind of testing arrangement is provided, for server veneer,Described server veneer is provided with extendible host controller interface XHCI controller, described device bagDraw together:
The first test cell, for by the described server veneer general-purpose serial bus USB interface of accessUSB device carries out the first test to described USB interface;
The first unloading unit, for completing after described the first test, unloads the total of described XHCI controllerLine drives, and wherein said USB interface carry is on described XHCI controller;
Amendment unit, for revising the register corresponding with described USB interface, so that described USB connectsMouth switches to the second pattern;
Loading unit, for reloading the described bus driver of described XHCI controller;
The second test cell, for carrying out the second test by described USB device to described USB interface.
In the embodiment of the present invention, in the time that the USB interface of server veneer is tested, can first pass throughThe USB device that is linked into described USB interface carries out the first test to described USB interface. Due to describedUSB interface carry, on XHCI controller, for hardware security, completes after described the first test,Need to unload the bus driver of described XHCI controller, then by USB described in the control of amendment registerInterface switches to the second pattern, and then reloading after described bus driver, by described USB deviceDescribed USB interface is carried out to the second test. Only need to be at USB to be tested in above-mentioned test processOn interface, access a USB device, thereby reduced testing cost; In addition, can be by server veneerAutomatically the described USB interface of controlling access switches to different patterns, when having realized automatic testReduce tester's workload.
Brief description of the drawings
Accompanying drawing is herein merged in description and forms the part of this description, shows and meets thisBright embodiment, and be used from and explain principle of the present invention with description one.
Fig. 1 is the application scenarios schematic diagram that the application embodiment of the present invention realizes test process;
Fig. 2 is an embodiment flow chart of method of testing of the present invention;
Fig. 3 is another embodiment flow chart of method of testing of the present invention;
Fig. 4 is a kind of hardware structure diagram of testing arrangement of the present invention place equipment;
Fig. 5 is an embodiment block diagram of testing arrangement of the present invention;
Fig. 6 is another embodiment block diagram of testing arrangement of the present invention;
Fig. 7 is another embodiment block diagram of testing arrangement of the present invention;
Fig. 8 is another embodiment block diagram of testing arrangement of the present invention;
Fig. 9 is another embodiment block diagram of testing arrangement of the present invention.
Detailed description of the invention
Here will at length describe exemplary embodiment, its sample table shows in the accompanying drawings. BelowWhen description relates to accompanying drawing, unless separately there is expression, the same numbers in different accompanying drawings represents same or analogousKey element. Embodiment described in following exemplary embodiment does not represent the institute consistent with the present inventionThere is embodiment. On the contrary, they be only with as that described in detail in appended claims, of the present invention oneThe example of the consistent apparatus and method in a little aspects.
The term using in the present invention is only for describing the object of specific embodiment, but not is intended to restrictionThe present invention. " one ", " institute of the singulative using in the present invention and appended claimsState " and " being somebody's turn to do " be also intended to comprise most forms, unless context clearly represents other implications. Also shouldWork as understanding, term "and/or" used herein refer to and comprise one or more be associated list itemAny or all may combine object.
Although should be appreciated that may to adopt term first, second, third, etc. to describe in the present invention variousInformation, but these information should not be limited to these terms. These terms be only used for by the information of same type thatThis distinguishes. For example, without departing from the present invention, the first information also can be called asTwo information, similarly, the second information also can be called as the first information. Depend on linguistic context, as in this instituteUse word " if " can be construed as into " ... time " or " when ... time " or " responseIn determining ".
Referring to Fig. 1, realize the application scenarios schematic diagram of test process for applying the embodiment of the present invention:
In Fig. 1, the USB interface carry of server veneer is at extendible host controller interfaceOn (eXtensibleHostControllerInterface, XHCI) controller, XHCI controller carryIn Peripheral Component Interconnect standard (PeripheralComponentInterconnect, the PCI) bus of south bridge.Wherein, south bridge (not shown in figure 1) is responsible for controlling the communication of described PCI, particularly, can pass throughIn amendment south bridge register (not shown in figure 1), thereby corresponding value is entered the communication process of pci busRow is controlled. In embodiments of the present invention, alternatively, first mode is USB3.0 pattern, the second patternFor USB2.0 pattern, USB interface to be tested is USB3.0 interface, ultrahigh speed main frame (Host)Be connected with described USB3.0 interface with USB2.0Host, wherein ultrahigh speed Host can articulate simultaneouslyUSB3.0 equipment, USB2.0Host can articulate USB2.0 equipment.
In embodiments of the present invention, can be by be tested the USB3.0 equipment access of compatible USB2.0 pinUSB interface. First by described USB3.0 equipment, described USB interface is carried out to the first test,USB3.0 test. First tested after, for hardware security, unloading XHCI bus driver. ThenThe USB3.0 port high speed enable register corresponding with USB interface in amendment south bridge register, thus closeClose ultrahigh speed Host, make USB3.0 interface switch to USB2.0 pattern. Further, reloadXHCI bus driver, re-starts identification to the USB device of access, when identifying USB3.0 equipmentWhen current support USB2.0 pattern, can carry out to described USB interface by described USB deviceTwo tests, i.e. USB2.0 test.
In above-mentioned test process, only need on USB interface to be tested, access a USB3.0 equipment,Thereby reduce testing cost; In addition, can complete USB3.0 equipment after USB3.0 test, byThe described USB3.0 interface that server veneer is controlled access automatically switches to USB2.0 pattern, and then passes throughUSB3.0 equipment completes USB2.0 test to described USB interface, is realizing the same of automatic testTime reduced tester's workload.
Fig. 2 is an embodiment flow chart of the inventive method, with reference to Fig. 2, and the test in the present embodimentMethod is for server veneer, and described server veneer is provided with extendible host controller interfaceXHCI controller, comprises the steps:
Step 201: establish by the USB that accesses described server veneer general-purpose serial bus USB interfaceFor described USB interface is carried out to the first test.
In this step, alternatively, described USB interface is USB3.0 interface; Described USB device isUSB3.0 equipment, it supports USB3.0 pattern and USB2.0 pattern simultaneously. The first test is USB3.0Test.
Accordingly, described step 201 can be specially by accessing described server veneer USB3.0 and connectThe USB3.0 equipment of mouth carries out USB3.0 test to described USB3.0 interface, wherein said USB3.0Equipment is supported different patterns, both can support the ultrahigh speed pattern of USB3.0, also compatible USB2.0 of whileFast mode.
In disclosure embodiment, alternatively, described step 201 comprises:
Step 201-1: in the time detecting that USB device accesses the USB interface of described server veneer,Obtain the USB pattern of current support in the basic input-output system BIOS of described server veneer.
In the time of server single board starting, enter linux operating system, obtain server veneer and substantially inputThe USB pattern of current support in output system (BasicInputOutputSystem, BIOS). OneAs in situation, BIOS default setting is for supporting first mode or automatic mode, wherein, described the first mouldFormula is USB3.0 pattern. Now can carry out described USB3.0 interface by described USB3.0 equipmentUSB3.0 test, otherwise can directly carry out subsequent step 205, by described USB device to describedUSB interface carries out the second test, carries out USB2.0 test.
Step 201-2: when the described USB pattern of the current support of described BIOS be described first mode orWhen automatic mode, identify whether described USB device is current supports described first mode.
If the described USB pattern of the current support of described BIOS is first mode or automatic mode, alsoNeed the current institute that whether supports of described USB device of the USB interface of the described server veneer of identification accessState first mode. Can pass through RM of the prior art, by described USB3.0 interface to accessUSB device carry out rate consulation, when access USB device support first mode, i.e. USB3.0When pattern, theoretical transmission rate can reach 4.8Gbps.
If when recognizing described USB device and supporting described first mode, execution step 201-3, otherwiseDirectly carry out subsequent step 205.
Step 201-3: described USB interface is carried out to the first test by described USB device.
In this step, described the first test is USB3.0 test. Test process and survey of the prior artExamination process is identical, does not repeat them here.
Step 202: complete after described the first test, unload the bus driver of described XHCI controller,Wherein said USB interface carry is on described XHCI controller.
Before carrying out the bus driver of the described XHCI controller of unloading in described step 202, optionalGround, described method also comprises (not shown in Fig. 2):
Step 201-1: the port driver that unloads the USB port on described server veneer.
The hardware damage that may cause for fear of the pattern of the described USB device of direct switching, therefore,In the embodiment of the present invention, need to, completing after described the first test, send unloading by described server veneerInstruction, to unload the port driver of the USB port on described server veneer.
Accordingly, described step 202 is specially:
After the described port driver of the described USB port of unloading, unload the total of described XHCI controllerLine drives.
In the embodiment of the present invention, described server veneer is provided with extendible host controller interfaceXHCI controller, described USB3.0 interface carry is on described XHCI controller. Further, instituteState XHCI controller carry in the pci bus of south bridge. Therefore,, for hardware security, unloadingAfter described port driver, also need to unload again the bus driver of described XHCI controller.
Step 203: revise the register corresponding with described USB interface, so that described USB interface is cutChange to the second pattern.
In the embodiment of the present invention, ultrahigh speed main frame (Host) and USB2.0Host are simultaneously with to be testedDescribed USB3.0 interface connects, and wherein ultrahigh speed Host can articulate USB3.0 equipment, USB2.0HostCan articulate USB2.0 equipment.
When USB3.0 interface is switched to the second pattern by needs, when USB2.0 pattern, can to instituteState the register that USB interface is corresponding and modify, thereby close corresponding with described first mode firstHost, closes ultrahigh speed Host, and described USB3.0 interface is only connected with the second main frame, onlyBe connected with USB2.0Host, so just can be by USB3.0 equipment be carried out to weight in subsequent processNew identification, supports, after USB2.0 pattern, to establish by described USB when identifying described USB3.0 equipmentFor USB interface is carried out to USB2.0 test.
Particularly, described step 203 can comprise (not shown in Fig. 2):
Step 203-1: the register address that obtains the register corresponding with described USB interface.
In this step, need to obtain the register address of the register corresponding with USB interface, obtain and makeCan the register address of ultrahigh speed register of USB3.0 port. In embodiments of the present invention, due toDescribed USB3.0 interface carry is on described XHCI controller, and described XHCI controller carry existsIn the pci bus of south bridge, wherein, south bridge is responsible for controlling the communication of described PCI, particularly, and Ke YitongThereby cross and revise in south bridge register corresponding value the communication process of pci bus is controlled. Therefore,Can be by the side of corresponding value on register corresponding with described USB interface in amendment south bridge registerFormula, thus the described USB interface different pattern that automatically switches controlled.
In disclosure embodiment, can pass through bus number (busnumber), device numbering (deviceNumber) and function number (functionnumber) obtain the physical address of south bridge register, obtainProcess is identical with process of the prior art, does not repeat them here. With respect to this physical address skew D8It is exactly the described register address of described ultrahigh speed register.
Step 203-2: according to described register address, deposit described in searching on described server veneerDevice.
According to described register address, find described ultrahigh speed register, it is right to search according to register addressThe process of the register of answering is identical with process of the prior art, repeats no more equally at this.
Step 203-3: the bit corresponding with described USB interface in the described register that amendment findsValue, wherein in the time that the value of described bit is 1, enable first mode, when the value of described bit is 0Time enable described the second pattern.
Finding after described ultrahigh speed register the value of the bit that has enabled first mode by correspondenceBe set to 0, thereby close corresponding ultrahigh speed Host, enable USB2.0 test.
Now, owing to having closed ultrahigh speed Host, described USB3.0 interface only with the second main frameConnect, be only connected with USB2.0Host. Described USB3.0 interface switches to the second pattern, i.e. USB2.0Pattern. Wherein, under the pattern of USB2.0, theoretical transmission rate can reach 480Mbps.
Step 204: the described bus driver of reloading described XHCI controller.
Owing to having unloaded before the described port driver of described USB port, therefore, carrying out described stepBefore 204, alternatively, described method also comprises (not shown in Fig. 2):
Step 203-4: restart described USB port.
In this step, can restart described USB port by the mode of amendment south bridge register, particularly,The value of bit corresponding with restarting described USB port in south bridge register can be set to 1, thus heavyOpen described USB port.
After restarting described USB port, reload the described bus of described XHCI controller and driveMoving. Loading procedure is identical with loading procedure of the prior art, does not repeat them here.
Step 205: described USB interface is carried out to the second test by described USB device.
Alternatively, before carrying out described the second test, need the described USB interface of identification access described inCurrent second pattern of whether supporting of USB device, can be by the described XHCI controller that reloadsThe pattern of the current support of the described bus driver identification described USB device of access.
Before carrying out described step 205, described method can also comprise (not shown in Fig. 2):
Step 204-1: whether the described USB device that detects the described USB interface of access powers on.
After having reloaded described bus driver, XHCI controller is normally worked, and detects described USB3.0Whether equipment powers on.
Step 204-2: after detecting that described USB device has powered on, described USB device is carried outLink training, when the result of described link training is indicated described the second pattern of the current support of described USB deviceTime, carry out described step 205.
The state machine of USB3.0 has 4 Link States, Rx.Detect STA representation after link powers on,Host and equipment (device) can recognize both sides' existence mutually, once identification, both sides will startEnter initialization training program; Polling STA representation Host and device initialize transmitting terminal in trainingWith receiving terminal and carry out synchronously, prepare to carry out the transmission of packet; Recovery state is mainly to work as chainRoad finds that current system will switch out or currently not be operated in U0 state and need from low power consumpting stateWhen re-starting training and configuration, carry out link-recovery; HotReset represents that link allows downstream endMouth resets uplink port.
Wherein, Link State when Rx.Detect representative initially powers on, USB3.0 port determines whether existenceUltrahigh speed link partner. Once detect and have ultrahigh speed link partner, link training process will start.
In disclosure embodiment, due to ultrahigh speed, Host closes, and the ultrahigh speed of USB3.0 enablesBanned fall, ultrahigh speed link also banned fall, link training starts the meeting of rear described USB3.0 equipmentDirectly proceed to USB2.0 pattern.
When USB3.0 equipment proceeds to after USB2.0 pattern, before it is carried out to USB2.0 test, alsoNeed to guarantee that it can carry out transfer of data. Particularly, can work as and determine USB3.0 equipment support USB2.0When pattern, Host sends to default passage (address0) order that usb protocol specifies, scarce to obtainEconomize and control the maximum data packet length that pipeline is supported. Host is now specially USB2.0Host,USB3.0 equipment is supported USB2.0 pattern, and therefore current transfer rate is to support under USB2.0 standardMaximum empty datagram length. Host waits for the response of USB3.0 equipment within the limited time.
Host distributes a unique address to USB3.0 equipment by sending a request. USB3.0Equipment reads this request, returns to a confirmation, and preserves new address. After this all communication is all usedThis new address. And then, Host sends order to the circulation of USB3.0 equipment, requires USB3.0 to establishStandby answer, such as, to read whole configuration informations (the needed supply current of USB device etc.) and to obtainCharacter set is described. It is that this USB3.0 equipment is in the described configuration information reading that Host sends command requestSelect a configuration matching with the current state of USB3.0 equipment. If configuration successful, USB establishesFor entering configuration status, now support the described USB3.0 equipment of USB2.0 pattern can carry out data biographyDefeated.
If use in the prior art USB switch, need in the instruction of USB switch downlink portRow port carries out HotReset. While adopting the embodiment of the present invention to carry out the switching of USB pattern, be XHCIAfter drive load, directly send Reset order, downlink port is carried out to Reset, control procedure is more direct,Its pattern machine, with of the prior art consistent, meets USB3.0 specification.
In the time that the result of link training is indicated described the second pattern of the current support of described USB device, just canBy described USB device, described USB interface is carried out to described the second test. Particularly, when identifyingThe current support of described USB3.0 equipment USB2.0 pattern, and described USB device can carry out data biographyAfter defeated, described USB3.0 interface is carried out to the second test, i.e. described USB2.0 test, test process withExisting USB2.0 test process is identical, does not repeat them here.
In above-described embodiment, only need on USB interface to be tested, access a USB device, because ofAnd reduce testing cost; In addition, can complete described USB interface by described USB deviceAfter the first test, automatically control described USB interface by server veneer and switch to the second pattern, Jin ErtongCross described USB device described USB interface is completed to the second test, realizing the same of automatic testTime reduced tester's workload.
Referring to Fig. 3, be another embodiment flow chart of method of testing of the present invention, the side in the present embodimentMethod is for server veneer, and described server veneer is provided with extendible host controller interface XHCIController, comprises the steps:
Step 301: when server veneer described in general-purpose serial bus USB equipment access being detectedWhen USB interface, obtain the USB pattern in current Bios, if default setting is for supporting first modeOr automatic mode, perform step 302, otherwise directly perform step 311.
In the time of server single board starting, enter linux operating system, obtain in server board B IOS and work asThe USB pattern of front support. Described first mode is USB3.0 pattern. Generally, BIOS is silentRecognize and be set to enable USB3.0 or automatic mode. Now can continue to perform step 302, otherwise can be straightConnect and carry out subsequent step 311, by described USB device, described USB interface is carried out to the second test,Carry out USB2.0 test.
Step 302: identify the current first mode of whether supporting of described USB device. If described USBEquipment supports described first mode to perform step 303, otherwise execution step 311.
If the described USB pattern of the current support of described BIOS is first mode or automatic mode,BIOS enables USB3.0 or automatic mode, also needs the USB of the described server veneer of identification accessCurrent described first mode, i.e. the USB3.0 pattern whether supported of described USB device of interface.
Can pass through RM of the prior art, by described USB3.0 interface, the USB of access be establishedThe standby rate consulation that carries out, when the USB device of access is supported first mode, when USB3.0 pattern, reasonOpinion transfer rate can reach 4.8Gbps, now can perform step 303, otherwise directly carry out follow-up stepRapid 311, by described USB device, described USB interface is carried out to USB2.0 test.
Step 303: described USB interface is carried out to the first test by described USB device.
In this step, described the first test is USB3.0 test, test process and survey of the prior artExamination process is identical, does not repeat them here.
Step 304: the port driver that unloads the USB port on described server veneer.
For fear of causing hardware damage, need to complete after described the first test, by described server listPlate sends unloading command, to unload the port driver of the USB port on described server veneer.
Step 305: the bus driver that unloads described XHCI controller.
In the embodiment of the present invention, described server veneer is provided with extendible host controller interfaceXHCI controller, described USB3.0 interface carry is on described XHCI controller. Further, instituteState XHCI controller carry in the pci bus of south bridge.
After having unloaded described port driver, for hardware security, unloaded described port driver itAfter, also need to unload again the bus driver of described XHCI controller.
Step 306: revise the register corresponding with USB interface, so that USB device switches to secondPattern.
In the embodiment of the present invention, ultrahigh speed Host and USB2.0Host simultaneously with to be tested described inUSB3.0 interface connects, and wherein ultrahigh speed Host can articulate USB3.0 equipment, and USB2.0Host canTo articulate USB2.0 equipment.
In the time that USB3.0 interface is switched to USB2.0 pattern by needs, can close corresponding with first modeThe first main frame, close ultrahigh speed Host, described USB3.0 interface is only connected with the second main frame,Be only connected with USB2.0Host, so just can be by USB3.0 equipment be entered in subsequent processRow is identification again, supports after the second pattern when identifying described USB3.0 equipment, i.e. and USB2.0 pattern,By described USB3.0 equipment, described USB interface is carried out to USB2.0 test.
Particularly, described step 306 can comprise (not shown in Fig. 3):
Step 306-1: the register address that obtains corresponding with described USB interface register.
In this step, need to obtain the register address of the ultrahigh speed register that has enabled USB3.0 port.In embodiments of the present invention, because described USB3.0 interface carry is on described XHCI controller, andDescribed XHCI controller carry is in the pci bus of south bridge. Can pass through bus number (busnumber),Device numbering (devicenumber) and function number (functionnumber) are obtained south bridge registerPhysical address, acquisition process is identical with process of the prior art, does not repeat them here. With respect to thisPhysical address skew D8 is exactly the described register address of described ultrahigh speed register.
Step 306-2: according to described register address, deposit described in searching on described server veneerDevice.
According to described register address, find described ultrahigh speed register, it is right to search according to register addressThe process of the register of answering is identical with process of the prior art, repeats no more equally at this.
Step 306-3: the bit corresponding with described USB interface in the described register that amendment findsValue, wherein in the time that the value of described bit is 1, enable described first mode, when the value of described bitBe to enable described the second pattern at 0 o'clock.
The bit 5~0 of described ultrahigh speed register represents whether the ultrahigh speed of USB3.0 port one~6 makesCan, in the time that being 1, the value of bit represents to enable first mode, and ultrahigh speed enables, and is within 0 o'clock, to represent to prohibitUse described first mode, ultrahigh speed forbidding, enables described the second pattern. Can in the embodiment of the present inventionBy the value of the bit corresponding port of needs amendment is set to 0, close corresponding ultrahigh speed Host.
When register ultrahigh speed enables, the state value of corresponding bit is as shown in table 1.
Table 1
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The value of bit 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
In the embodiment of the present invention, need to the value of bit of the transfer rate under described first mode will be enabledBe set to 0, need the value of the ultrahigh speed bit 5~0 of described register to be all set to 0. Described depositingAfter device ultrahigh speed enables to forbid, the state value of corresponding bit is as shown in table 2.
Table 2
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The value of bit 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Finding after described ultrahigh speed register, the value that has enabled superfast bit by correspondence is putBe 0, thereby close corresponding ultrahigh speed Host.
Now, owing to having closed ultrahigh speed Host, described USB3.0 interface only with the second main frameConnect, be only connected with USB2.0Host. Described USB3.0 interface switches to the second pattern, i.e. USB2.0Pattern. Wherein, under USB2.0 pattern, theoretical transmission rate can reach 480Mbps.
Step 307: restart described USB port.
In this step, can be by USB port described in the mode of amendment south bridge register, particularly, canSo that the value of bit corresponding with restarting described USB port in south bridge register is set to 1, thereby restartDescribed USB port.
Step 308: the described bus driver of reloading described XHCI controller.
Step 309: whether the described USB device that detects the described USB interface of access powers on.
After having reloaded described bus driver, XHCI controller is normally worked, and detects described USB3.0Whether equipment powers on.
Step 310: after detecting that described USB device has powered on, described USB device is carried outLink training. In the time that the result of link training is indicated described the second pattern of the current support of described USB device,Execution step 311.
The state machine of USB3.0 has 4 Link States, Rx.Detect STA representation after link powers on,Host and equipment (device) can recognize both sides' existence mutually, once identification, both sides will startEnter initialization training program; Polling STA representation Host and device initialize transmitting terminal in trainingWith receiving terminal and carry out synchronously, prepare to carry out the transmission of packet; Recovery state is mainly to work as chainRoad finds that current system will switch out or currently not be operated in U0 state and need from low power consumpting stateWhen re-starting training and configuration, carry out link-recovery; HotReset represents that link allows downstream endMouth resets uplink port.
Wherein, Link State when Rx.Detect representative initially powers on, USB3.0 port determines whether existenceUltrahigh speed link partner. Once detect and have ultrahigh speed link partner, link training process will start.
In disclosure embodiment, due to the ultrahigh speed of USB3.0 enable banned fall, ultrahigh speed chainRoad also banned fall, link training starts rear described USB3.0 equipment and can directly proceed to USB2.0 pattern.
When USB3.0 equipment proceeds to after USB2.0 pattern, passing through described USB device to described USBBefore interface carries out USB2.0 test, also need to guarantee that USB3.0 equipment can carry out transfer of data. ToolBody ground, in the time that definite USB3.0 equipment is supported USB2.0 pattern, Host can be to default passage (address0) send the order that specifies of usb protocol, long to obtain the maximum data packet that default control pipeline supportedDegree, now Host is specially USB2.0Host, and USB3.0 equipment is supported USB2.0 pattern, therefore works asFront transfer rate is the maximum empty datagram length of supporting under USB2.0 standard. Host is limitedIn time, wait for the response of USB3.0 equipment.
Host distributes a unique address to USB3.0 equipment by sending a request. USB3.0Equipment reads this request, returns to a confirmation, and preserves new address. After this all communication is all usedThis new address. And then, Host sends order to the circulation of USB3.0 equipment, requires USB3.0 to establishStandby answer, such as, to read whole configuration informations (the needed supply current of USB device etc.) and to obtainCharacter set is described. It is that this USB3.0 equipment is in the described configuration information reading that Host sends command requestSelect a configuration matching with the current state of USB3.0 equipment. If configuration successful, USB establishesFor entering configuration status, now can carry out transfer of data.
In the time recognizing described the second pattern of the current support of described USB device, identify described USB3.0The current support of equipment USB2.0 pattern, and described USB device can carry out after transfer of data, carries out stepRapid 311.
Step 311: described USB interface is carried out to described the second test by described USB device.
Described USB3.0 interface is carried out to the second test, i.e. described USB2.0 test, test process is with existingSome USB2.0 test process are identical, do not repeat them here.
In above-described embodiment, in the time that the USB interface of server veneer is tested, described in first passing throughUSB device carries out the first test to described USB interface. Complete after described the first test, by repairingThe described USB interface of the automatic control of mode of redirecting storage switches to the second pattern, and then by described USBEquipment carries out the second test to described USB interface. Only need to be to be tested in above-mentioned test processOn USB interface, access a USB device, thereby reduced testing cost; In addition, can be by servingThe described USB interface that device veneer is controlled access automatically switches to different patterns, has realized automatic testTime reduced tester's workload.
Corresponding with aforementioned method of testing embodiment, the present invention also provides the embodiment of testing arrangement.
The embodiment of testing arrangement of the present invention can be applied on server veneer. Device embodiment can lead toCross software and realize, also can realize by the mode of hardware or software and hardware combining. Be embodied as example with software,As the device on a logical meaning, be that processor by its place equipment is by nonvolatile memoryThe computer program instructions of middle correspondence reads in internal memory that operation forms. Say from hardware view, as figureShown in 4, for a kind of hardware structure diagram of testing arrangement of the present invention place equipment, except locating shown in Fig. 4Outside reason device, network interface, internal memory and nonvolatile memory, in embodiment, install the equipment at placeConventionally can also comprise other hardware, as being responsible for forwarding chip of processing message etc.; From hardware configurationThis equipment may be also distributed equipment, may comprise multiple interface cards, so that at hardware viewThe expansion of testing.
Referring to Fig. 5, be an embodiment block diagram of testing arrangement of the present invention, described application of installation forOn server veneer, described server veneer is provided with extendible host controller interface XHCI and controlsDevice, described device comprises: the first test cell 510, the first unloading unit 520, amendment unit 530,Loading unit 540 and the second test cell 550.
Wherein, described the first test cell 510, for passing through the described server veneer general serial of accessThe USB device of bus USB interface carries out the first test to described USB interface;
Described the first unloading unit 520, for completing after described the first test, unloads described XHCI controlThe bus driver of device processed, wherein said USB interface carry is on described XHCI controller;
Described amendment unit 530, for revising the register corresponding with described USB interface, so that described inUSB interface switches to the second pattern;
Described loading unit 540, for reloading the described bus driver of described XHCI controller;
Described the second test cell 550, for carrying out described USB interface by described USB deviceThe second test.
In an optional implementation:
Referring to Fig. 6, Fig. 6 is that the present invention is according to the another kind of testing arrangement frame shown in an exemplary embodimentFigure, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described device also comprises: the second unloadingUnit 560 and restart unit 570.
Wherein, described the second unloading unit 560, for unloading the USB port on described server veneerPort driver;
Describedly restart unit 570, in post corresponding with described USB interface of described amendment unit amendmentAfter storage, restart described USB port.
In another optional implementation:
Referring to Fig. 7, Fig. 7 is that the present invention is according to the another kind of testing arrangement frame shown in an exemplary embodimentFigure, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described the first test cell 510 comprises:Obtain subelement 511, recognin unit 512 and test subelement 513.
Wherein, described in obtain subelement 511, for when having detected that USB device accesses described serverWhen the described USB interface of veneer, obtain in the basic input-output system BIOS of described server veneerThe USB pattern of current support;
Described recognin unit 512 is institute for the described USB pattern when the current support of described BIOSWhile stating first mode or automatic mode, identify whether described USB device is current supports described first mode;
Described test subelement 513, in the time that described USB device is supported first mode, by describedUSB device carries out described the first test to described USB interface;
In the time that described USB device is not supported first mode, trigger described the second test module and carry out described logicalCross described USB device described USB interface is carried out to the second test.
In another optional implementation:
Referring to Fig. 8, Fig. 8 is that the present invention is according to the another kind of testing arrangement frame shown in an exemplary embodimentFigure, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described amendment unit 530 comprises:
Wherein, described in obtain subelement 531, deposit for obtaining described in corresponding with described USB interfaceThe register address of device;
The described subelement 532 of searching, for according to described register address, on described server veneerSearch described register;
Described amendment subelement 533, for revising the described register and described USB interface that findThe value of corresponding bit wherein enables first mode, when described ratio in the time that the value of described bit is 1The value of special position is to enable described the second pattern at 0 o'clock.
In another optional implementation:
Referring to Fig. 9, Fig. 9 is that the present invention is according to the another kind of testing arrangement frame shown in an exemplary embodimentFigure, this embodiment is on aforementioned basis embodiment illustrated in fig. 5, and described device also comprises: detecting unit580 and link training unit 590.
Wherein, whether described detecting unit 580, power on for detection of described USB device;
Described link training unit 590, for after detecting that described USB device has powered on, to instituteState USB device and carry out link training, when the result of described link training indicates described USB device currentWhile supporting described the second pattern, trigger described the second test module and carry out described by described USB device pairDescribed USB interface carries out the second test.
In another optional implementation:
Described first mode is USB3.0 pattern, and described the second pattern is USB2.0 pattern.
In said apparatus, the implementation procedure of the function and efficacy of unit specifically refers in said method correspondingThe implementation procedure of step, does not repeat them here.
For device embodiment, because it corresponds essentially to embodiment of the method, so relevant part ginsengSee the part explanation of embodiment of the method. Device embodiment described above is only schematically,The wherein said unit as separating component explanation can or can not be also physically to separate, and doesThe parts that show for unit can be or can not be also physical locations, can be positioned at a place,Or also can be distributed on multiple NEs. Can select according to the actual needs part wherein orThe whole modules of person realize the present invention program's object. Those of ordinary skill in the art are not paying creativenessIn the situation of work, be appreciated that and implement.
As seen from the above-described embodiment, in test process, only need on USB interface to be tested, access oneUSB3.0 equipment, thereby reduced testing cost; In addition, can connect USB by USB deviceMouth completes after USB3.0 test, by server veneer by register is modified, thereby control automaticallyMake described USB interface and switch to USB2.0 pattern, and then pass through described USB device to described USBInterface carries out USB2.0 test, has reduced tester's work in having realized automatic testAmount.
Those skilled in the art are considering description and are putting into practice after invention disclosed herein, will easily expect thisOther embodiment of invention. The application is intended to contain any modification of the present invention, purposes or adaptabilityChange, these modification, purposes or adaptations are followed general principle of the present invention and are comprised thisBright undocumented common practise or conventional techniques means in the art. Description and embodiment only byBe considered as exemplary, true scope of the present invention and spirit pointed out by claim below.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all at thisWithin the spirit and principle of invention, any amendment of making, be equal to replacement, improvement etc., all should be included inWithin the scope of protection of the invention.

Claims (12)

1. a method of testing, for server veneer, described server veneer is provided with extendible masterMachine controller interface XHCI controller, is characterized in that, described method comprises:
USB device by accessing described server veneer general-purpose serial bus USB interface is to describedUSB interface carries out the first test;
Complete after described the first test, unload the bus driver of described XHCI controller, wherein said USBInterface carry is on described XHCI controller;
Revise the register corresponding with described USB interface, so that described USB interface switches to the second mouldFormula;
Reload the described bus driver of described XHCI controller;
By described USB device, described USB interface is carried out to the second test.
2. the method for claim 1, is characterized in that, unloads the total of described XHCI controllerBefore line drives, described method also comprises:
Unload the port driver of the USB port on described server veneer;
After the register corresponding with described USB interface in amendment, described method also comprises:
Restart described USB port.
3. the method for claim 1, is characterized in that, described by the described server list of accessThe USB device of plate USB interface carries out the first test to described USB interface and comprises:
In the time detecting that USB device accesses the described USB interface of described server veneer, obtain instituteState the USB pattern of current support in the basic input-output system BIOS of server veneer;
In the time that the described USB pattern of the current support of described BIOS is described first mode or automatic mode,Identify whether described USB device is current supports described first mode;
In the time that described USB device is supported first mode, by described USB device to described USB interfaceCarry out described the first test;
In the time that described USB device is not supported first mode, described in carrying out, pass through described USB device to instituteState the step that USB interface carries out the second test.
4. the method for claim 1, is characterized in that, described amendment and described USB interface pairThe register of answering comprises:
Obtain the register address of the described register corresponding with described USB interface;
According to described register address, on described server veneer, search described register;
The value of the bit corresponding with described USB interface in the described register that amendment finds, wherein works asThe value of described bit is to enable first mode at 1 o'clock, enables described in the time that the value of described bit is 0Two modes.
5. the method for claim 1, is characterized in that, described in reload described XHCI controlAfter the described bus driver of device processed, described method also comprises:
Whether detect described USB device powers on;
After detecting that described USB device has powered on, described USB device is carried out to link training,In the time that the result of described link training is indicated described the second pattern of the current support of described USB device, carry out instituteState the step of by described USB device, described USB interface being carried out the second test.
6. the method as described in claim 1-5 any one, is characterized in that, described first mode isUSB3.0 pattern, described the second pattern is USB2.0 pattern.
7. a testing arrangement, for server veneer, described server veneer is provided with extendible masterMachine controller interface XHCI controller, is characterized in that, described device comprises:
The first test cell, for by the described server veneer general-purpose serial bus USB interface of accessUSB device carries out the first test to described USB interface;
The first unloading unit, for completing after described the first test, unloads the total of described XHCI controllerLine drives, and wherein said USB interface carry is on described XHCI controller;
Amendment unit, for revising the register corresponding with described USB interface, so that described USB connectsMouth switches to the second pattern;
Loading unit, for reloading the described bus driver of described XHCI controller;
The second test cell, for carrying out the second test by described USB device to described USB interface.
8. device as claimed in claim 7, is characterized in that, described device also comprises:
The second unloading unit, for unloading the port driver of the USB port on described server veneer;
Restart unit, after the register corresponding with described USB interface in the amendment of described amendment unit,Restart described USB port.
9. device as claimed in claim 7, is characterized in that, described the first test cell comprises:
Obtain subelement, detect that for working as USB device accesses the described USB of described server veneerWhen interface, obtain the USB of current support in the basic input-output system BIOS of described server veneerPattern;
Recognin unit is described the first mould for the described USB pattern when the current support of described BIOSWhen formula or automatic mode, identify whether described USB device is current supports described first mode;
Test subelement, in the time that described USB device is supported first mode, establishes by described USBFor described USB interface being carried out to described the first test;
In the time that described USB device is not supported first mode, trigger described the second test module and carry out described logicalCross described USB device described USB interface is carried out to the second test.
10. device as claimed in claim 7, is characterized in that, described amendment unit comprises:
Obtain subelement, for obtaining the register address of the described register corresponding with described USB interface;
Search subelement, for according to described register address, described in searching on described server veneerRegister;
Amendment subelement, for revising the described register ratio corresponding with described USB interface findingThe value of special position wherein enables first mode, when the value of described bit in the time that the value of described bit is 1Be to enable described the second pattern at 0 o'clock.
11. devices as claimed in claim 7, is characterized in that, described device also comprises:
Whether detecting unit, power on for detection of described USB device;
Link training unit, for after detecting that described USB device has powered on, to described USBEquipment carries out link training, when the result of described link training is indicated described in the current support of described USB deviceWhen the second pattern, trigger described the second test module carry out described by described USB device to described USBInterface carries out the second test.
12. devices as described in claim 7-11 any one, is characterized in that, described first mode isUSB3.0 pattern, described the second pattern is USB2.0 pattern.
CN201510443470.XA 2015-07-24 2015-07-24 Test method and apparatus Pending CN105589771A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510443470.XA CN105589771A (en) 2015-07-24 2015-07-24 Test method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510443470.XA CN105589771A (en) 2015-07-24 2015-07-24 Test method and apparatus

Publications (1)

Publication Number Publication Date
CN105589771A true CN105589771A (en) 2016-05-18

Family

ID=55929370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510443470.XA Pending CN105589771A (en) 2015-07-24 2015-07-24 Test method and apparatus

Country Status (1)

Country Link
CN (1) CN105589771A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107302477A (en) * 2017-08-09 2017-10-27 武汉微创光电股份有限公司 A kind of Ethernet switch interface test method
CN108196993A (en) * 2017-12-28 2018-06-22 努比亚技术有限公司 USB interface test method, terminal and computer readable storage medium
CN111752771A (en) * 2019-03-29 2020-10-09 杭州海康威视数字技术股份有限公司 USB port test equipment and system
CN112559317A (en) * 2019-09-26 2021-03-26 通用电气公司 Interface accessory of test device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102176702A (en) * 2011-02-18 2011-09-07 威盛电子股份有限公司 Test system and test method
US20110219272A1 (en) * 2010-03-08 2011-09-08 Via Technologies, Inc. Data Transmission System and Method Thereof
CN102467430A (en) * 2010-11-04 2012-05-23 英业达股份有限公司 Universal serial bus (USB) test device and method
US20120290761A1 (en) * 2011-05-10 2012-11-15 Jui-Yen Chen USB Converter and Related Method
CN103795586A (en) * 2012-11-02 2014-05-14 银灿科技股份有限公司 Switching type communication interface detection method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110219272A1 (en) * 2010-03-08 2011-09-08 Via Technologies, Inc. Data Transmission System and Method Thereof
CN102467430A (en) * 2010-11-04 2012-05-23 英业达股份有限公司 Universal serial bus (USB) test device and method
CN102176702A (en) * 2011-02-18 2011-09-07 威盛电子股份有限公司 Test system and test method
US20120290761A1 (en) * 2011-05-10 2012-11-15 Jui-Yen Chen USB Converter and Related Method
CN103795586A (en) * 2012-11-02 2014-05-14 银灿科技股份有限公司 Switching type communication interface detection method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李朝纯: "《微机计算机原理及接口技术》", 31 August 2003, 武汉:武汉理工大学出版社 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107302477A (en) * 2017-08-09 2017-10-27 武汉微创光电股份有限公司 A kind of Ethernet switch interface test method
CN108196993A (en) * 2017-12-28 2018-06-22 努比亚技术有限公司 USB interface test method, terminal and computer readable storage medium
CN111752771A (en) * 2019-03-29 2020-10-09 杭州海康威视数字技术股份有限公司 USB port test equipment and system
CN112559317A (en) * 2019-09-26 2021-03-26 通用电气公司 Interface accessory of test device

Similar Documents

Publication Publication Date Title
CN105589771A (en) Test method and apparatus
US8904082B1 (en) Operation based polling in a memory system
CN106598632B (en) Firmware upgrading method and device for optical module
CN102945173B (en) User program online upgrade system and upgrade method
CN107926075B (en) System and method for supporting data communication in heterogeneous environment
CN104750510A (en) Chip start method and multi-core processor chip
CN103645945A (en) Automatic probing and drive loading method of virtual network interface card
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
EP3208723A1 (en) Usb wireless network card configuration method, host, usb wireless network card and communication system
CN108647131B (en) Output system of running log
CN110704365A (en) Reconstruction device based on FPGA
CN107070747A (en) A kind of method of the automatic test network interface card network connection stability under network card binding pattern
CN104010077A (en) Information processing method and electronic equipment
US6751569B2 (en) System and method for receiving information from a test apparatus
CN109815070A (en) A kind of HOST-BOX server stability test method, apparatus, terminal and storage medium
US6973564B2 (en) Automatically initiating a manufacturing mode of a system firmware
CN113391931B (en) Remote control method and device based on Bluetooth, computer equipment and storage medium
CN111147400B (en) Method and device for command line configuration synchronization and electronic equipment
CN112667060B (en) External equipment resetting method based on Loongson processor
CN115129378A (en) Intelligent network card starting method and device capable of being actively adjusted, storage medium and equipment
CN106648697A (en) Method for illuminating terminal and method for automatically controlling terminal
JPWO2005066745A1 (en) Bus share adapter
KR20210051794A (en) Automated apparatus and method for fuzz testing for embedded devices
CN111752829B (en) Dynamic debugging method for firmware program of embedded system
US6842855B2 (en) System and method for providing information to a computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160518