1. Field of the Invention
The present invention relates to a data accessing system for a host-slave interface and related methods. In particular, it relates to such a data accessing system and related methods in which the slave automatically transmits device information to the host device without utilizing a request from the host.
2. Description of the Related Art
SDIO (Secure Digital Input Output) is an interface that uses the SD (Secure Digital) card form factor for devices other than flash memory cards. Such devices (the slave device in the SDIO interface) may include GPS receivers, Wi-Fi or Bluetooth adapters, modems, Ethernet adapters, barcode readers, IrDA adapters, FM radio tuners, TV tuners, RFID readers, digital cameras, mass storage media such as hard drives, etc. The host device (the master in the SDIO interface) that support SDIO may be PDAs (personal digital assistants), laptop computers, cell phones (“smart phones”), etc.
In a conventional host-slave system using the SDIO interface, the host device controls data transfer, and the slave device can only move data according to the host's request. The slave device cannot initiate data transfer. In data transfer, there is a time delay between the request sending of the host device and the request receiving of the slave device, and likewise there is a time delay between the response sending of the slave device and the response receiving of the host device. Such a situation is called inter-command delay. Because the slave device must wait for the host to request data, inter-command delay associated with the request command causes delay in data transfer. The inter-command delay may be as much as hundreds of microseconds.
For example, the slave device may have a plurality of buffers (a buffer pool) for buffering data to be transmitted or received, and the host device will need to know the available buffer space in the buffers before transmitting data to the slave device. Conventionally, the host device first sends a request to the slave to ask how much buffer space is available, therefore the inter-command delay problem of both the request and response sending will exist.
Therefore, one objective of the present invention is to provide a data transfer system for a host-slave interface in which the slave device automatically transmits buffer condition information such as available buffer space, interrupt status, etc., to the host (master) device, instead of requiring the host device to request such information.
Additional features and advantages of the invention will be set forth in the descriptions that follow and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
To achieve these and other advantages and in accordance with the purpose of the present invention, as embodied and broadly described, the present invention provides a slave device adapted for connecting to a host device for communicating data between the host device and an data-source/data-destination device, which includes: one or more buffers for storing data received from the data-source device and storing data received from the host device; a buffer management circuit coupled to the one or more buffers for obtaining buffer condition information indicating an amount of available space in one or more of the buffers and an amount of data received from the data-source device stored in one or more of the buffers; and a merging circuit coupled to the one or more buffers and to the buffer management circuit for generating a data stream and transferring the data stream to the host device, the data stream containing a plurality of main data segments and a plurality of auxiliary data segment associated with the main data segments, where the main data segments are obtained from the data received from the data-source device stored in the buffer, and wherein each of the auxiliary data segments contains the buffer condition information obtained by the buffer management circuit.
In another aspect, the present invention provides a method in a host-slave data transfer system, the slave being in data communication with an data-source/data-destination device, the method being implemented in the slave for transferring data to the host, which includes: (a) receiving data from the data-source device; (b) obtaining buffer condition information indicating an amount of available space in one or more buffers and an amount of data received from the data-source device stored in one or more buffers; (c) receiving a transfer command from the host; (d) in response to the transfer command, generating a data stream, the data stream containing a plurality of main data segments and a plurality of auxiliary data segment associated with the main data segments, where the main data segments are obtained from the data received from the data-source device stored in the buffer, and wherein each of the auxiliary data segments contains the buffer condition information; and (e) transferring the data stream to the host.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Certain terms are used throughout the description and following claims to refer to particular components. As one skilled in the art will appreciate, electronic equipment manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms “include” and “comprise” are used in an open-ended fashion, and thus should be interpreted to mean “include, but not limited to . . . ”. Also, the term “couple” is intended to mean either an indirect or direct electrical connection. Accordingly, if one device is coupled to another device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
In one particular embodiment, the slave device has a SD (Secure Digital) card form factor. In other words, it has a connector with a physical shape and pin configuration that can be accepted by an SD card slot. In the example described below, the slave device is a communication adapter that facilitates data communication between the host 101 and an data-source/data-destination device (not shown).
The slave device 103 includes a merging/extracting circuit 111, a processing circuit 112, a detection circuit 113, a plurality of buffers (shown in
The buffer management circuit 115 manages the buffers in the buffer pool 114. For example, it determines how much data received from the data-source device is stored in each buffer and ready to be transferred to the host, how much free buffer space is available in each to receive data from the host. The detection circuit 113 collects the interrupt status of the slave device 103. Interrupt signals are generated by the system for error-control purposes, such as over-flow, under-flow, etc. The interrupts may be firmware interrupts or hardware interrupts.
During a receive transaction (i.e. reception of data from the data-source device by the host via the slave device), the processing circuit 112 generates header and/or tailer based on outputs of the buffer management circuit 115 and the detection circuit 113 as will be described in more detail later. The header and/or tailer are inputted to the merging circuit 111. The merging circuit 111 merges received data (from the data-source device) in the buffer pool and the header and/or tailer to generate a stream of merged data according to a predetermined data format as will be described later. In one embodiment, the merging circuit 111 includes a multiplexer that selects data from one of the plurality of buffers in the buffer pool 114. The merging circuit 111 transmits the merged data to the host device 101.
During a transmit transaction (i.e. transmission of data from the host to the data-destination device via the slave device), the extracting circuit 111 receives a data stream from the host. The data stream includes multiple headers each containing a designation of the buffer (queue) in which the data is to be placed. The processing circuit 112 extracts the header information from the data stream and provides it to the buffer management circuit 115. During the transmit transaction, the detection circuit 113 is disable in the slave device 103. In other words, the detection circuit 113 does not have a function while the slave device 103 transmits the packet-based data to the data-destination device. In some of embodiment for transmit transaction; the detection circuit 113 is omitted in the system. The buffer management circuit 115 controls the buffer usage for different queues according to the header to place the data from the host in the appropriate buffers of the buffer pool 114. The interface circuit 116 transmits the data from the buffer pool 114 to the data-destination device according to the appropriate communication protocol or data format compatible with the data-destination device.
It should be noted that the block boundary is irrelevant to the size of SDU since the block size is configurable initially between the slave and host and the size of SDU is the packet size with the header and tailer information. For example, the host may initially require a transaction to receive 10 blocks while each block contains 100 bytes; however, each SDU size varies (e.g. SDU size may be, for instance, 20 bytes, 650 bytes, 1K bytes, or other . . . ). Therefore, the slave transmits 10 blocks of data stream. These blocks may contain one, several, or only part of an SDU. The numbers of SDUs are only for exemplary purpose. As result, there might be some blocks that do not contain any SDU header or tailer. Another example is that there are 990 bytes of data ready to be received at the slave. The host can receive the data by requesting 10 blocks of data (each block contains 100 bytes in this case). At result, the data stream in this transaction contains 990 bytes of data along with 10 bytes of redundant data. The host can also receive the data by requesting a transaction with 9 blocks of data together with a second request to receive the remaining 90 bytes of data. In the above particular examples, each SDU tailer 23 contains information regarding the slave device, including the amount of data received from the data-source device that is ready to be transferred to the host and the amount of free buffer space available to the host to store data to be transmitted to the data-destination device event or to be received from the data-source device event (generally referred to as buffer condition information), interrupt status, and other information. Please note that the redundant data could be useful data or non-useful data depended on the design criteria. For example, the redundant bits may be repeating data, padded-zeros, unknown data, or a portion of the auxiliary data (can be the new auxiliary data or the old auxiliary data), etc. . . .
Of course, the tailer data former illustrated in
Referring back to
In the example shown in
It should be noted that the process of obtaining the buffer condition information and interrupt status is continuous, and the tailer always contains the most recent such information. Thus, the host can in fact skip some of the tailers because subsequent tailers always contain the current information.
In a transmit transaction, as shown in
In addition (not shown in
Please note that the structure illustrated in
The data transfer method described here has many advantages over conventional SDIO systems or other similar systems. In conventional SDIO host-slave transfer methods, each data transfer only transfers one SDU (in one or more blocks). Because each data transfer requires a command from the host, such a transfer method required multiple command cycles to transfer multiple SDUs, resulting in inter-command delay. In addition, because each SDU typically does not have a size of a multiple of blocks, each SDU transfer will result in a waste of some space in the last block. Alternatively, the SDU may be transferred by first transferring a number of blocks and then transferring a number of bytes, but this again involves multiple transfer commands issued by the host and results in inter-command delay.
The advantages of the data transfer method described here are as follows. First, it reduces inter-command delay by reducing the number of commands the host needs to send to the slave in order to obtain relevant information such as the available buffer size and amount of buffered data ready to be transferred to the host, interrupt status, etc. This is accomplished by the use of SDU tailer to send the buffer condition and interrupt status information to the host automatically. Second, it reduces inter-command delay because transferring multiple SDUs in a data stream reduces the number of transmit or receive commands. Each data stream containing multiple SDUs is continuously transferred to the host without requiring additional transfer command from the host. Third, because the slave device informs the host of the amount of data buffered in the slave and ready to be transferred to the host, the host can timely transfer the data. This reduces the idle time on the slave. Fourth, because the host has information about the available buffer space and amount of buffered data ready for transfer, the host can send or request an appropriate amount of continuous data by each command, reducing the number of commands and inter-command delay.
Further, the method described here facilitates the implementation of multiple queues on the slave of host-slave data transfer system. As mentioned above, the slave according to embodiments of the present invention has multiple queues, each queue being a logical queue with its own buffer memory. Implementing multiple queues offers flexibility in data handling. For example, the queues may have different priorities assigned to them. Implementing multiple queues in a conventional SDIO system would require a high overhead because the host would have to use many commands to obtain the information about the status of each queue, such as the amount of data buffered in the queue, the amount of available space, etc. Using the method described here, updated information about the queues is automatically sent by the slave device, eliminating the need for the host to use commands to obtain such information.
It should be noted that although the SDIO system is used as an example in the above descriptions, the invention is not limited to SDIO, and can be applied in other host-slave interface systems such as USB.
It will be apparent to those skilled in the art that various modification and variations can be made in the host-slave data transfer system and related method of the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention cover modifications and variations that come within the scope of the appended claims and their equivalents.
This application claims priority from U.S. Provisional Patent Application No. 61/007,529, filed Apr. 10, 2008, which is herein incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
61007529 | Apr 2008 | US |