CN101021825A - Method and equipment for acquiring universal serial port bus port information - Google Patents

Method and equipment for acquiring universal serial port bus port information Download PDF

Info

Publication number
CN101021825A
CN101021825A CN 200710086653 CN200710086653A CN101021825A CN 101021825 A CN101021825 A CN 101021825A CN 200710086653 CN200710086653 CN 200710086653 CN 200710086653 A CN200710086653 A CN 200710086653A CN 101021825 A CN101021825 A CN 101021825A
Authority
CN
China
Prior art keywords
usb
port information
usbd
module
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200710086653
Other languages
Chinese (zh)
Other versions
CN100504835C (en
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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou Huawei 3Com Technology 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 Huawei 3Com Technology Co Ltd filed Critical Hangzhou Huawei 3Com Technology Co Ltd
Priority to CNB2007100866536A priority Critical patent/CN100504835C/en
Publication of CN101021825A publication Critical patent/CN101021825A/en
Application granted granted Critical
Publication of CN100504835C publication Critical patent/CN100504835C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method for accessing information via USB universal serial Bus port, in which, it adds an information interface port into the interface for the USB client driver in the USB host driver USBD layer, and it includes: USB Hub driver saves the port connectivity information and transfers it to USBD layer when the USB device is accessing. The USB client-driver accesses information from the USBD layer through interactive interface port. The invention also discloses a USB host device, which is used for accessing the port information of USB device.

Description

The acquisition methods of universal serial port bus port information and equipment
Technical field
The present invention relates to field of computer technology, especially refer to the acquisition methods and the equipment of a kind of USB (Universal Serial Bus, universal serial port bus) port information.
Background technology
USB is a kind of computer external serial communication interface standard, and characteristics such as plug and play, data transmission are reliable, expansion convenience, low cost that it has have become one of indispensable interface of computing machine.
Usb communication model hierarchy structure of the prior art as shown in Figure 1, the operate as normal of system must have usb host and the common software and hardware support of USB device both sides.The USB drive software is exactly a communication software of keeping the USB system, comprises usb host end and USB device end two parts.The former comprises HCD (Host Controller Driver, host controller driver), USBD (Universal Serial BusDriver, usb host driver) again and comprises the client driver of various devices class driver.The drive software of USB device end then comprises the driving of USB logical device and functional interface parts.
Client driver in the above-mentioned USB standard is different from I/O (Input/Output such as traditional serial ports or parallel port, I/O) device driver, it is mutual by interface and USB device that USBD provides, rather than visits equipment by I/O device address or port.In the usb protocol, usb host distributes a USB address for the USB device that each is connected on the bus, and it doesn't matter for the port numbers at this address and USB device place; Usb host controller is to come differentiation equipment by the USB address of distributing rather than by the port numbers that connects USB device; And the USB address is to be safeguarded by the USBD layer, is sightless for the USB client driver.
Perfect day by day along with USB standard and correlation technique nearly 2 years, also begins to occur datacom devices such as router and switch and uses USB interface circumscribed USB equipment.Be different from PC (Personal Computer, personal computer) USB uses, datacom device is as usb host, generally be to go out one or two USB interface by the integrated RootHub of USB controller (Root Hub), and do not support the external hub of USB interface, and only support a few class USB device of appointment.The maximum characteristics that datacom device is different from PC are its interface type and One's name is legion, the interface panel of datacom device clearly indicates the slot number and the port numbers of interface, its operating system all is to manage according to the port numbers docking port, therefore with only need manage equipment during the USB of PC uses different by the USB address, the USB application need of datacom device considers to connect the port numbers of USB device.
Do not support that at usb protocol in the prior art interface management of datacom device need be according to the contradiction of port access USB device according to the port access USB device, present datacom device all is that the interface area of USB interface with other types separated, adopt two kinds of different interface managerial methods, the management of USB interface is then adopted and the identical method of PC operating system, according to the visit according to USB address realization connection USB device of USB standard defined.Therefore, the operating system of datacom device need be distinguished USB interface and non-USB interface, and two kinds of interfaces are adopted different way to manages, thereby has increased the complicacy of datacom device interface management; In addition, the configuration of datacom device generally all is to realize by the order line operation, with being configured according to slot number and port numbers docking port per family, so USB uses and the irrelevant characteristic of port on the above-mentioned datacom device, brings operation inconvenience can for the user of datacom device; Also be unfavorable for simultaneously the expansion of follow-up USB interface business in the datacom device application.
Summary of the invention
The acquisition methods and the equipment that the purpose of this invention is to provide a kind of USB port information are not supported problem according to the port access USB device to solve usb protocol in the prior art.
For achieving the above object, the present invention proposes a kind of acquisition methods of USB port information, comprising:
Drive USBD course USB client at usb host and drive in the interface that provides, add the port information interactive interface;
Usb hub drives when handling the USB device access, preserves the port information of described USB device, and described port information is passed to described USBD layer;
Described USB client drives and obtains described port information by described port information interactive interface from described USBD layer.
Described USB client also comprises after driving and obtaining port information:
Application layer drives the port information that obtains the USB device of described access is conducted interviews according to described USB client.
Before conducting interviews, the USB device that the described application layer port information that driving is obtained according to the USB client inserts port also comprises:
Described port information is obtained and preserved to described USB application layer.
Described usb hub drives and port information is passed to the USBD layer obtains between the port information with the driving of described USB client and also comprise:
Described USBD layer drives the USB client according to described USB device and positions, and described port information is preserved.
Described port information comprises: hub address and/or port numbers that described USB device connects.
The present invention also proposes a kind of usb host equipment, comprises usb hub driver module, USBD module, USB client driver module, and described USBD module also comprises port information interactive interface submodule,
Described usb hub driver module when handling the USB device connection, obtains the port information of described USB device and is passed to described USBD module;
Described USB client driver module is connected with described USBD module, and obtains described port information by described port information interactive interface submodule.
Also comprise USB application message acquisition module,
Described USB application message acquisition module is connected with described USB client driver module, and according to described port information described USB device is conducted interviews.
Described USB client driver module further comprises the port information sub module stored,
Described port information sub module stored is used to preserve the port information of described USB device, for described USB application message acquisition module described USB device is conducted interviews.
Described usb hub driver module comprises that further equipment connects notice submodule and port information notice submodule,
Described equipment connects the notice submodule, is used for notifying to described USBD module the connection of described USB device;
Described port information is notified submodule, is used for transmitting to described USBD module the port information of described USB device.
Described port information comprises: hub address and/or port numbers that described USB device connects.
The acquisition methods of USB port information of the present invention and equipment, by newly-increased port information interactive interface in the standard interface that provides is provided in USBD course USB client, realization is obtained the port information that USB device connects as datacom device or other embedded devices of usb host, simplified the interface management of embedded device, and solved the contradiction of conflicting with the embedded device operating custom to a certain extent based on the USB technology of PC application.
Description of drawings
Fig. 1 is a usb communication model hierarchy structural drawing of the prior art;
Fig. 2 is the acquisition methods first embodiment process flow diagram of USB port information of the present invention;
Fig. 3 is the acquisition methods second embodiment process flow diagram of USB port information of the present invention;
Fig. 4 is a kind of usb host apparatus embodiments of the present invention figure.
Embodiment
In conjunction with the accompanying drawings the present invention is further set forth with specific embodiment below.
The present invention discloses a kind of acquisition methods of USB port information, and its first embodiment may further comprise the steps as shown in Figure 2:
S201, usb hub drive when handling the USB device access, and the port information of preserving USB device also is passed to the USBD layer.
For realizing that the USB client drives connecting obtaining of USB device port information, in the present embodiment, usb hub drives when handling the USB device access, obtain and preserve information such as the port numbers that connects the port that this USB device inserted and hub address, and those information are passed to the USBD layer, but not similar USB of the prior art 2.0 standards only connect entirely/carry out under the low speed USB device preservation of port information at hub.
S202, USB client drive by the port information interactive interface and obtain the port information that connects USB device from the USBD layer.
In the usb protocol of prior art, the interface that the USB client driver provides by USBD also carries out alternately according to the USB address and the USB device of distributing, it doesn't matter for the port numbers of this address and USB device place hub, and be to safeguard by the USBD layer, it is sightless driving for the USB client.In the present embodiment, for the port information and final realization of obtaining USB device conducts interviews to USB device according to port information, must be in the standard interface that USBD course USB client driver provides, increase a port information interactive interface, be used for the port information that the USB client driver obtains the USB device of its management.
S203, the USB application layer USB device that visit connects according to port information.
The USB client driver obtains information such as the hub address that connects USB device and port numbers and preserves by the port information interactive interface after, the USB application software layer on upper strata promptly can conduct interviews to the USB device that connects according to port information.
Acquisition methods second embodiment of a kind of USB port information of the present invention may further comprise the steps as shown in Figure 3:
S301, usb hub drive handles the USB device access, and obtains the port information of connection.
When USB device inserts, at first drive and handle by usb hub, drive by usb hub and obtain the port numbers that is connected with USB device.In addition, usb hub drives and can also obtain hub address information, but the present invention still can realize under the situation of this hub address not obtaining.
S302, usb hub drive the connection of notice USBD layer USB device and the port information of connection.
Usb hub drives after the processing of finishing the USB device access, has USB device to connect to USBD layer notice, by USBD the USB device that inserts is configured.In the present embodiment, when notice USBD layer had USB device to insert, usb hub drove the port information that also has the USB device access and is passed to the USBD layer.
In the present embodiment, usb hub drives when handling the USB device access, no matter whether hub connects entirely/the low speed USB device, all preserve hub address and the port numbers that connects this USB device, and be passed to the USBD layer, thereby the port information that guarantees the preservation of USBD layer is under any circumstance all meaningful.
S303, the client that USBD layer location is relevant drive, and preserve the port information that connects USB device.
After the USBD layer is received the notice of usb hub driving about the USB device connection, corresponding client driving is positioned, and call standard interface and notify the driving of USB client that the USB device access is arranged according to the USB device difference that connects.In the present embodiment, the USBD layer also needs the port information of usb hub drive transmitting is preserved, and drives for the USB client and obtains.
S304, USB client drive by the port information interactive interface obtains the port information that connects USB device.
For realizing that the USB client drives connecting obtaining of USB device port information, need drive in the standard interface that provides to the USB client at USBD, add the port information interactive interface.Newly-increased port information interactive interface, do not influence the original function of usb protocol stack, general client in the former protocol stack drives also need not make amendment at this newly-increased interface, can satisfy simultaneously in the USB that does not have the circumscribed USB hub uses, the USB client drives the demand that connects the USB device port information of obtaining.
S305, USB client drive knows the port information that connects USB device, and application layer is according to this port information visit USB device.
The obtaining and transmitting of step S301~S304 middle port information, purpose all are the USB client to be driven know information such as hub address that USB device connects and port numbers, USB device are conducted interviews according to port information with further realization.After the port information that connects USB device was known in the driving of USB client, the port information that the application software on upper strata is preserved in promptly can driving according to the USB client conduct interviews to the USB device that connects.
Acquisition methods second embodiment of the invention described above USB port information, by increasing an interface that obtains the USB device port numbers newly at the USBD layer, realization is obtained the port information that USB device connects as the datacom device of usb host, thereby simplifies the interface management on the datacom device greatly; Pass through the foregoing description, the embedded device of the USB interface of going out can be distinguished USB interface and non-USB interface, and all interfaces are carried out unified management according to slot number and port numbers, solve embedded device operatings such as the USB technology used based on PC and datacom device to a certain extent and be accustomed to the contradiction of conflicting; Simultaneously, the port information interactive interface that USBD is newly-increased belongs to optional interface, can in USBD, directly be provided with, increase or reduce this class interface and there is no with the USB standard and conflict, need not break USB gauge hierarchy structure Design, to other functions of usb protocol stack without any influence.
The present invention also discloses a kind of usb host equipment, be used to obtain the port information that connects USB device, one embodiment as shown in Figure 4, usb hub driver module 410, USBD module 420, USB client driver module 430, USBD module 420 also comprises port information interactive interface submodule 421.Wherein, usb hub driver module 410 is used to obtain port information such as the hub address that connects USB device and port numbers and is passed to USBD module 420 when handling USB device and connect; USB client driver module 430 is connected with USBD module 420, and obtains port information by port information interactive interface submodule 421.
The usb host equipment that present embodiment provides also comprises USB application message acquisition module 440, and USB client driver module 430 then further comprises port information sub module stored 431.Wherein, port information sub module stored 431 is used to preserve the port information of the connection USB device of obtaining from USBD module 420; 440 of USB application message acquisition modules further drive the visit of the 430 port informations realizations of preserving to USB device according to the USB client.
In addition, usb hub driver module 410 comprises that further equipment connects notice submodule 411 and port information notice submodule 412.Wherein, equipment connects the connection that notice submodule 411 is used for notifying to USBD module 420 USB device; And port information notice submodule 412 then is used for the port information to USBD module transmission connection USB device.
The embodiment of the invention described above usb host equipment, by newly-increased port information interactive interface in the interface that provides is provided in USBD course USB client, be used to obtain information such as the hub address that connects USB device and port numbers, thereby realize obtaining the port information that USB device connects, simplify the interface management of embedded device as datacom device or other embedded devices of usb host; And the embedded device of the USB interface of going out can be distinguished USB interface and non-USB interface, according to slot number and port numbers all interfaces is carried out unified management, has solved the contradiction of conflicting with the embedded device operating custom based on the USB technology of PC application.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (10)

1, a kind of acquisition methods of universal serial port bus USB port information is characterized in that, comprising:
Drive USBD course USB client at usb host and drive in the interface that provides, add the port information interactive interface;
Usb hub drives when handling the USB device access, preserves the port information of described USB device, and described port information is passed to described USBD layer;
Described USB client drives and obtains described port information by described port information interactive interface from described USBD layer.
2, the acquisition methods of USB port information according to claim 1 is characterized in that, described USB client also comprises after driving and obtaining port information:
Application layer drives the port information that obtains the USB device of described access is conducted interviews according to described USB client.
As the acquisition methods of USB port information as described in the claim 2, it is characterized in that 3, described application layer drives according to the USB client and also comprises before USB device that the port information that obtains inserts port conducts interviews:
Described port information is obtained and preserved to described USB application layer.
4, the acquisition methods of USB port information according to claim 1 is characterized in that, described usb hub drives and port information is passed to the USBD layer obtains between the port information with the driving of described USB client and also comprise:
Described USBD layer drives the USB client according to described USB device and positions, and described port information is preserved.
5, as the acquisition methods of claim 1 to 4 USB port information as described in each, it is characterized in that described port information comprises: hub address and/or port numbers that described USB device connects.
6, a kind of usb host equipment comprises usb hub driver module, USBD module, USB client driver module, it is characterized in that described USBD module also comprises port information interactive interface submodule,
Described usb hub driver module when handling the USB device connection, obtains the port information of described USB device and is passed to described USBD module;
Described USB client driver module is connected with described USBD module, and obtains described port information by described port information interactive interface submodule.
7, as usb host equipment as described in the claim 6, it is characterized in that, also comprise USB application message acquisition module,
Described USB application message acquisition module is connected with described USB client driver module, and according to described port information described USB device is conducted interviews.
8, as usb host equipment as described in the claim 7, it is characterized in that described USB client driver module further comprises the port information sub module stored,
Described port information sub module stored is used to preserve the port information of described USB device, for described USB application message acquisition module described USB device is conducted interviews.
As usb host equipment as described in the claim 6, it is characterized in that 9, described usb hub driver module comprises that further equipment connects notice submodule and port information notice submodule,
Described equipment connects the notice submodule, is used for notifying to described USBD module the connection of described USB device;
Described port information is notified submodule, is used for transmitting to described USBD module the port information of described USB device.
10, as claim 6 to 9 usb host equipment as described in each, it is characterized in that described port information comprises: hub address and/or port numbers that described USB device connects.
CNB2007100866536A 2007-03-28 2007-03-28 Method and equipment for acquiring universal serial port bus port information Active CN100504835C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100866536A CN100504835C (en) 2007-03-28 2007-03-28 Method and equipment for acquiring universal serial port bus port information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100866536A CN100504835C (en) 2007-03-28 2007-03-28 Method and equipment for acquiring universal serial port bus port information

Publications (2)

Publication Number Publication Date
CN101021825A true CN101021825A (en) 2007-08-22
CN100504835C CN100504835C (en) 2009-06-24

Family

ID=38709597

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100866536A Active CN100504835C (en) 2007-03-28 2007-03-28 Method and equipment for acquiring universal serial port bus port information

Country Status (1)

Country Link
CN (1) CN100504835C (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281474B (en) * 2008-05-06 2010-06-02 北京握奇数据系统有限公司 Method and apparatus for opening appoint terminal port USB equipment
CN101989250A (en) * 2010-11-03 2011-03-23 中兴通讯股份有限公司 Serial communication method and system
CN102147710A (en) * 2010-01-15 2011-08-10 金士顿科技股份有限公司 Management hub and method for managing a plurality of driver connected with host
CN106991067A (en) * 2017-04-14 2017-07-28 湖南威胜信息技术有限公司 Data interactive method and its embedded device for one master and multiple slaves formula network
CN108829623A (en) * 2018-06-20 2018-11-16 郑州云海信息技术有限公司 A kind of USB port adaptation method and device
CN112015686A (en) * 2019-05-28 2020-12-01 海能达通信股份有限公司 Equipment access port positioning method and equipment access device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281474B (en) * 2008-05-06 2010-06-02 北京握奇数据系统有限公司 Method and apparatus for opening appoint terminal port USB equipment
CN102147710A (en) * 2010-01-15 2011-08-10 金士顿科技股份有限公司 Management hub and method for managing a plurality of driver connected with host
US8667191B2 (en) 2010-01-15 2014-03-04 Kingston Technology Corporation Managing and indentifying multiple memory storage devices
CN101989250A (en) * 2010-11-03 2011-03-23 中兴通讯股份有限公司 Serial communication method and system
CN101989250B (en) * 2010-11-03 2014-12-17 中兴通讯股份有限公司 Serial communication method and system
CN106991067A (en) * 2017-04-14 2017-07-28 湖南威胜信息技术有限公司 Data interactive method and its embedded device for one master and multiple slaves formula network
CN108829623A (en) * 2018-06-20 2018-11-16 郑州云海信息技术有限公司 A kind of USB port adaptation method and device
CN112015686A (en) * 2019-05-28 2020-12-01 海能达通信股份有限公司 Equipment access port positioning method and equipment access device

Also Published As

Publication number Publication date
CN100504835C (en) 2009-06-24

Similar Documents

Publication Publication Date Title
CN1955893B (en) Media sharing apparatus
US7953917B2 (en) Communications protocol expander
CN100504835C (en) Method and equipment for acquiring universal serial port bus port information
US7458075B2 (en) Virtual USB port system and method
US7155546B2 (en) Multiple physical interfaces in a slot of a storage enclosure to support different storage interconnect architectures
US20060059293A1 (en) Universal serial bus switching hub
US7213096B2 (en) Operating a remote USB host controller
US20090119413A1 (en) Addresses assignment for adaptor interfaces
CN102981990B (en) Data transmission method and device of terminal equipment with Androild platform
EP2051172A2 (en) Interfacing an external attachment device to a computing device
US7836241B2 (en) Electronic apparatus having switching unit
CN105159632A (en) Graphics multi-media IC and method of its operation
CN102388357B (en) Method and system for accessing memory device
CN110012095A (en) A kind of system and method for mobile intelligent terminal connection cloud desktop server
CN111459632B (en) Serial port agent for calling terminal application program and implementation method
WO2024036887A1 (en) Sim card communication circuit, related device, and control method
US20090106472A1 (en) Virtual SATA port multiplier, virtual SATA device, SATA system and data transfer method in a SATA system
US7886105B2 (en) Combined fibre channel and SAS host bus adapter
US8954623B2 (en) Universal Serial Bus devices supporting super speed and non-super speed connections for communication with a host device and methods using the same
CN201622818U (en) Display device
CN101251831B (en) Mobile memory supporting master-salve equipment interchange and method of master-salve equipment interchange
CN111274184B (en) Serial interface device driver, embedded processor and video controller
CN101000595B (en) Cable and information getting method
CN101674219B (en) Communication method and device in tunnel mode of Internet security protocol intelligent card
CN210954981U (en) Keyboard device with KVM

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

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

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address