Method and apparatus for communication between universal serial bus (USB) host and USB device

A method of interfacing between a universal serial bus (USB) host and a USB device. The USB host and the USB device include modules to process packets according to network protocols, instead of USB bus interfaces. Therefore, the USB device can be connected to the USB host even without a USB cable, and thus is not affected by the distance between the USB host and USB device.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of Korean Application No. 2006-134985, filed in the Korean Intellectual Property Office on Dec. 27, 2006, the disclosure of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Aspects of the present invention relate to a universal serial bus (USB) communicating method and, more particularly, to an interface between a USB host and USB device.

2. Description of the Related Art

The universal serial bus (USB) is a serial port developed to standardize an interface for connecting computer peripherals to a computer. Examples of computer peripherals include mice, keyboards, printers, modems, or speakers. USB makes installation and removal of a device easy and fast, and is therefore widely used as current PC standard equipment.

FIG. 1is a block diagram illustrating a general USB communication method. A general USB system includes a USB host and a USB device. The USB host (hereinafter referred to as a host) is generally a PC, and the USB device (hereinafter, referred to as a device) is generally a peripheral device having a USB interface. The host includes client software (SW), USB System SW, and a USB bus interface. The device includes a Function, a USB logical device, and a USB bus interface. The Function is a collection of interfaces that each provide functionality for the USB device. The host and the device are connected to each other via a USB cable.

The client SW is a part of the USB host that actually uses the Function of the USB device. The flow of all data generated by the client SW to use the Function of the USB device will now be described. The data that the client SW generates to use the Function of the USB device is transmitted to the USB bus interface of the device via the system SW, a host controller, and a USB cable. The data is transmitted from the USB Bus Interface to the Function via the USB logical device. The Function of the USB device processes the data transmitted by the client SW of the USB host. Data that the Function of the USB device transmits to the client SW of the USB host flows in the order opposite to that of the data transmitted by the client SW.

The USB device may belong to a specific USB class according to the type of function that the USB device provides. For example, the USB device may belong to a printer class, a mass storage device class, or a Human Interface Device (HID) class. The substance and form of data transmitted between the client SW of the USB host and the Function of the USB device depend on the type of USB class to which the USB device belongs, and are defined in the USB class specification. The client SW and the USB System SW, which exists in a level lower than the client SW, exchange the data defined in the USB class specification. Similarly, the Function and the USB logical device, which are included in the USB device, exchange the data defined in the USB class specification. The data is physically transmitted via the USB cable. However, in a logical sense, the data is transmitted and received between the client SW of the USB host and the Function of the USB device. A path taken by this transmission is referred to as a pipe, and an end of the pipe in the USB device is referred to as an endpoint.

When the USB device is connected to the USB host via the USB cable, enumeration occurs. Enumeration is a process in which the USB host determines the type and number of endpoints of the USB device, the type of a product (for example, a peripheral device), and the like. In this process, the host allocates addresses to the device and receives a device descriptor and a configuration descriptor from the device in order to prepare for transmission and reception of data. This process is performed during transmission and reception of data between the USB system SW of the USB host and the USB logical device (i.e., an endpoint 0) of the USB device. The data transmitted and received in this process is referred to as setup data. A logical transmission path for transmitting and receiving the setup data is referred to as a default pipe.

Consequently, the data transmitted and received between the client S/W of the USB host and the function of the USB device and the setup data transmitted and received between the USB system SW of the USB host and the USB logical device is logically transmitted via the pipe, but physically transmitted via the USB cable. Due to a physical limitation of the USB cable, the USB host and the USB device can communicate with each other when both are within about 5 meters of each other. Hence, a user should only use a device that is adjacent to a host.

SUMMARY OF THE INVENTION

Aspects of the present invention provide a method and apparatus for performing transmission and reception of data between a universal serial bus (USB) host and a USB device without a limit to a distance between the USB host and the USB device.

According to an aspect of the present invention, a method in which a USB (universal serial bus) host communicates with a USB device is provided. The method comprises generating a packet having a format that is used in a network other than a USB network, using data output by USB system software; and transmitting the generated packet to the USB device via the network.

According to another aspect of the present invention, the data may be at least one of setup data or data transmitted by client software of the USB host to a Function of the USB device.

According to another aspect of the present invention, the packet may be at least one of information about a transmission type, an address of an endpoint, information about a transmission direction, or a device address.

According to another aspect of the present invention, the data comprises at least one of information indicating that the USB host is in a suspended state or information used to reset the USB device.

According to another aspect of the present invention, the network may be at least one of a wireless LAN, an Ethernet, and a token ring.

According to another aspect of the present invention, a computer readable recording medium is provided. The computer readable recording medium has recorded thereon a program to execute the above-described communication method.

According to another aspect of the present invention, a method in which a USB host communicates with a USB device is provided. The method comprises receiving a packet that is used in a network other than a USB network, from a USB device via the network; extracting data recognizable to USB system software from the received packet; and transmitting the extracted data to the USB system software.

According to another aspect of the present invention, a USB host to communicate with a USB device is provided. The USB host comprises a network protocol unit to transmit and receive a packet to and from a USB device via a network other than a USB network; and a host interface unit to generate a payload of a packet to be transmitted by the network protocol unit, using data output by USB system software, to extract data recognizable to the USB system software from the payload of the packet received by the network protocol unit, and to transmit the extract data to the USB system software.

According to another aspect of the invention, the data is at least one of setup data or data transmitted and received between client software of the USB host and a function of the USB device.

According to another aspect of the present invention, a method in which a USB device communicates with a USB host is provided. The method comprises generating a packet having a format that is used in a network other than a USB network, using data output by a USB logical device; and transmitting the generated packet to the USB host via the network.

According to another aspect of the present invention, a method in which a USB device communicates with a USB host is provided. The method comprises receiving a packet that is used in a network other than a USB network, from the USB host via the network; extracting data recognizable to a USB logical device from the received packet; and transmitting the extracted data to the USB logical device.

According to another aspect of the present invention a USB device to communicate with a USB host is provided. The USB device comprises a network protocol unit to transmit and receive a packet to and from the USB host via a network; and a host interface unit to generate a payload of a packet to be transmitted by the network protocol unit, using data output by a USB logical device, to extract data recognizable to the USB logical device from the payload of the packet received by the network protocol unit, and to transmit the extracted data to the USB logical device.

DETAILED DESCRIPTION OF THE EMBODIMENTS

FIG. 2is a block diagram of structures of a universal serial bus (USB) host250and a USB device280according to an embodiment of the present invention. The USB host250and the USB device280need not include any USB bus interfaces. The USB host250and the USB device280instead communicate with each other via a network206instead of a USB cable.

The USB host250includes a host interface unit203and a network protocol unit205. The host interface unit203receives data transmitted by a client SW201of the USB host250to a function211of the USB device280, receives data (i.e., setup data) transmitted by USB system SW202to a USB logical device210of the USB device280from the USB system SW202, and generates a payload of a network packet.

Generally, USB traffic, in which data transmission and reception are conducted between a host and a device in a USB system, includes specific information. This information is referred to by the client SW201, the USB system SW202, the function211, and a logical device210. Examples of the information include information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc. Examples of transmission type include a bulk type, an isochronous type, an interrupt type, and a control type. Examples of transmission direction include an inward direction and an outward direction. The details thereof are described in the USB specification, so a detailed description will be omitted.

According to conventional art, a host controller included in a host inserts the above-described information when generating a packet having a format of transmission that uses a USB cable (hereinafter, a link layer format) using the data received from USB system software. However, the USB host250according to an embodiment of the present invention need not include any host controllers, and thus the host interface unit203plays the role of the host controller. The payload of the network packet generated by the host interface unit203includes information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc.

The host interface unit203may also play the role of a root hub. A root hub is originally included in a host controller and transmits a signal, such as a suspend signal or a port reset signal, to a device using an electrical signal. A suspend signal indicates that a host is suspended. A port reset signal is used to reset a device. The USB host250need not include any host controllers and is thus unable to transmit the suspend signal or the port reset signal to the USB device280using an electrical signal. Accordingly, the host interface unit203generates a payload of a network packet corresponding to the suspend signal or port reset signal. A packet including this payload will be interpreted by a device interface unit209of the USB device280. Additionally, the host interface unit203extracts data recognizable to the USB system software202from the payload of the packet received from the USB device280and transmits the extracted data to the USB system software202. The extracted data is at least one of setup data or data that is transmitted and received between the client software201and the function211. “At least one of” is used herein in an inclusive sense; thus, the extracted data may be setup data, data transmitted/received between the client software201and the function211, or both setup data and data transmitted/received.

The client software201, the USB system software202, the function211, and the USB logical device210are the same as those in a conventional USB system and accordingly may not interpret the payload format of the network. For this reason, the host interface unit203extracts necessary data from the packet and transmits the extracted data to the USB system software202. The USB system software202communicates with the host interface unit203in the same manner as conventional USB system software communicates with a host controller. The payload of the network packet received by the host interface203from the network protocol unit205may further include information indicating a success or failure of reception of a previous packet by the USB host250, in addition to information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc.

The network protocol unit205generates a packet that is to be used in the network206using the payload generated by the host interface unit203, and transmits the packet to the USB device280via the network206. The network206may be at least one of a wireless LAN, an Ethernet, a token ring, or the like. The network protocol unit205transmits the packet using an appropriate protocol according to the type of the network206, such as the Internet Protocol (IP), the Internetwork Packet Exchange (IPX) protocol, or the X.25 protocol.

The USB device280includes the device interface unit209and a network protocol unit207. The device interface unit209generates a payload of a packet to be transmitted by the network protocol unit207using data that the USB logical device210transmits to the USB bus interface, extracts data recognizable to the USB logical device210from the payload of the packet received by the network protocol unit207, and transmits the extracted data to the logical device209. Similar to the host interface unit203, data transmitted and received between the device interface unit209and the USB logical device210is at least one of setup data, data that is transmitted and received between the client software201and the function211, or data corresponding to a suspend signal or a port reset signal.

The payload of the network packet that is processed by the device interface unit209includes information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc. The payload of a packet to be transmitted to the USB host250may further include information indicating a success or failure of reception of a previous packet by the USB host250, in addition to the aforementioned information.

The network protocol unit207performs the same function as that of the network protocol unit205of the USB host250. The network protocol207generates a network packet using the payload generated by the device interface unit209and transmits the network package to the USB host250via the network206. Additionally, the network protocol207generates a network packet from the USB host250and transmits the payload of the network packet to the device interface unit209.

The host interface unit203and the device interface unit209may be implemented as either hardware or software.FIG. 3is a flowchart of a process in which the USB host250transmits data to the USB device280, according to an embodiment of the present invention. Although the process shown inFIG. 3is described with respect to the USB host250and the USB host280shown inFIG. 2, other aspects of the invention may employ the process shown inFIG. 3using any arrangement of hosts and devices.

In operation310, the host interface unit203receives data output by the USB system software202. In the conventional USB system, this data is received by a host controller. The USB host250need not have any host controllers, and therefore the host interface unit203receives data from the USB system software202, in contrast with the conventional USB system in which a host controller receives the data.

The data transmitted by the USB system software202to the host interface unit203may be data transmitted and received between the USB system software202of the USB host250and the USB logical device210of the USB device250, that is, setup data, or data defined in a USB class specification, that is, data transmitted and received between the client software of the USB host250and the function211of the USB device280. The data transmitted by the USB system software202to the host interface unit203may also be information indicating that the USB host250is in a suspended state or data including information used to reset the USB device280.

In operation320, the host interface unit203generates a payload of a packet to be transmitted via a network, using data received from the USB system software202. The payload may include information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc.

In operation330, the network protocol unit205of the USB host250generates a packet having a format used in the network. In operation340, the network protocol unit205of the USB host250transmits the generated packet to the USB device according to a network protocol.

FIG. 4is a flowchart of a process in which the USB host250receives data from the USB device280, according to an embodiment of the present invention. In operation410, the network protocol unit205of the USB host250receives a packet from the USB device280via the network and transmits a payload of the received packet to the host interface unit202.

In operation420, the host interface unit203analyzes the payload of the received packet and extracts data from the payload recognizable to the USB system software202. The extracted data may be the data transmitted and received between the USB system software202of the USB host250and the USB logical device210of the USB device280, that is, setup data, or data defined in a USB class specification, that is, data transmitted and received between the client software201of the USB host250and the function211of the USB device280.

The payload of the received packet may further include information indicating a success or failure of reception of a packet transmitted to the USB device280, in addition to information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, etc. In operation430, the host interface unit203transmits the extracted data to the USB system software202.

FIG. 5is a flowchart of a process in which the USB device280receives data from the USB host250, according to an embodiment of the present invention. In operation510, the network protocol unit207included in the USB device280receives a packet from the USB host250via the network and transmits a payload of the packet to the device interface unit209included in the USB device280.

In operation520, the device interface unit209analyzes the payload of the packet and extracts data from the payload recognizable to the USB logical device210. In operation530, the device interface unit209transmits the extracted data to the USB logical device210.

FIG. 6is a flowchart of a process in which the USB device280transmits data to the USB host250, according to an embodiment of the present invention. In operation610, the device interface unit209receives data that the USB logical device210transmits to a USB bus interface in a conventional USB system. The USB device280need not have any USB bus interfaces, and therefore the device interface unit209receives data from the USB logical device210, in contrast with the conventional USB system in which the USB bus interface receives the data.

In operation620, the device interface unit209generates a payload of a network packet to be transmitted to the USB host250using received data. The payload may include, for example, information about a transmission type, the address of an endpoint, information about a transmission direction, an address of a device, or information indicating a success or failure of reception of a previous packet by the USB device280.

In operation630, the network protocol unit207of the USB device280generates a packet having a format that is used in the network. In operation640, the network protocol unit207of the USB device280transmits the generated packet to the USB host250via the network.

FIG. 7illustrates a structure of a packet transmitted between the USB device280and the USB host250according to an embodiment of the present invention. The packet is assumed to be transmitted using the Transmission Control Protocol/Internet Protocol (TCP/IP) standard via the Ethernet; however, the packet may also be transmitted using any protocol, such as the User Datagram Protocol (UDP). A payload720of a packet710is USB traffic data. The payload720includes a header725and a payload728. The payload720of the packet710has a format that can be processed by the host interface unit of the USB host and the device interface unit of the USB device. In the present embodiment, the header725includes a field representing a sequence number, a field representing pipe information, and a field representing the length of the payload728. A control request field of the payload728stores setup data. A buffer field of the payload728stores data other than the setup data. Other arrangements of information in the packet710are also possible.

A field730, namely, the field representing pipe information, includes information731about a transmission type, an address732of an endpoint, information733about a transmission direction, a device address734, and status information735indicating a success or failure of reception of a packet.

According to aspects of the present invention, a USB device can be connected to a USB host via a network even without a USB cable, and thus is not affected by a restriction of the distance between the USB host and USB device. Moreover, the USB host may use the client software and USB system software of a conventional USB system without any changes thereto, and the USB device may use the function or USB Logical Device of the conventional USB system without any changes thereto.