1. Field of the Invention
This invention relates to a host controller for the Universal Serial Bus (USB) and more particularly to monitoring of USB activity.
2. Description of the Related Art
The Universal Serial Bus (USB) provides a way to attach and access peripheral devices through a common interface over a serial bus in a personal computer (PC) system. The USB was intended to reduce overall cost and simplify the attachment and configuration of peripheral devices from the end-user perspective. In older (also referred to as legacy) personal computer systems, peripheral devices were typically mapped into the central processing unit's (CPU's) input/output space and assigned a specific interrupt request (IRQ) line. In some cases, the peripheral device also received a direct memory access (DMA) channel. These system resources were assigned to particular peripheral devices by various personal computer manufacturers and became the standard input/output locations, IRQs and DMA channels used by software developers to access a given device.
The USB breaks away from the resource problems associated with legacy PC input/output implementations. Instead, the USB provides an input/output port where several types of devices can be connected simultaneously and occupy the same hardware resources. The devices range from keyboards to printers to cameras. The USB relies heavily on system software to transfer data between the peripheral device and applications programs requiring use of the peripheral device. Each device on the USB is assigned an address known only to the USB software and thus does not consume additional hardware system resources in the manner typical of legacy PC architectures.
In many computer systems, power savings features are utilized to reduce power consumption to extend battery life in e.g., laptop systems or to reduce power consumption to reduce operating costs of the system. Systems incorporating such power saving features typically operate in several reduced power modes where one or more parts of the system are turned off. In typical existing low power designs, hardware which is not controlled by the operating system, monitors system activity and determines the appropriate power state for the computer system. Systems typically measure system activity by monitoring peripheral activity including interrupts and accesses to specific input/output locations. System hardware uses such system activity to appropriately enter and exit from various power states.
For example, when the PC is in a low power state, keyboard activity typically causes the PC to wake up from its low power state. On the other hand, many notebook computers are designed to automatically suspend when no activity is detected. Thus, inactivity of the mouse and keyboard, along with other inactive resources, cause the system to go into a low power state. In a legacy system, the specific input/output location, IRQs and DMA channels can be readily monitored by hardware to determine activity.
However, in a USB system, only software and the actual peripherals connected to the USB know where USB transactions are directed. So there is no way for the hardware to readily identify which particular USB device, if any, is active. From a power management perspective, one solution is to ignore USB activity. However, that can result in the computer system suspending in the middle of a mouse or keyboard operation.
Another solution is to have activity on the USB cause the system to wake up. However, because the hardware cannot distinguish activity on the bus that is relevant to power management from activity that is not, such a solution may prevent the system from entering a low power state. For example, if the system wakes up from a low power state because of any USB activity, even such activity as unacknowledged interrupts will cause the system to wake up. That is because on the USB, the USB host controller periodically polls devices to see if an interrupt is pending on the device. If so, the polled device will acknowledge the interrupt. If the device has no interrupt pending, then the device will not acknowledge the interrupt. If any activity on the USB causes a wake up operation, then even unacknowledged interrupts from the keyboard indicating no keyboard activity, would be considered USB activity and an unwanted wake up operation would occur. It can be seen, therefore, that it is desirable to integrate the USB into power management in a more useful manner.