TWI436216B - Power management system, method thereof and storage medium - Google Patents
Power management system, method thereof and storage medium Download PDFInfo
- Publication number
- TWI436216B TWI436216B TW99144044A TW99144044A TWI436216B TW I436216 B TWI436216 B TW I436216B TW 99144044 A TW99144044 A TW 99144044A TW 99144044 A TW99144044 A TW 99144044A TW I436216 B TWI436216 B TW I436216B
- Authority
- TW
- Taiwan
- Prior art keywords
- usb hub
- driver
- request packet
- input
- output request
- Prior art date
Links
Landscapes
- Power Sources (AREA)
- Information Transfer Systems (AREA)
Description
本發明係有關一種管理系統,特別是關於一種電源管理系統及其方法。 The present invention relates to a management system, and more particularly to a power management system and method thereof.
手持式裝置(Handheld Device)或可攜式裝置(Portable Device),如隨身碟,除了可用來傳輸資料,通常亦可藉由插接於電腦的介面連接埠,如USB連接埠,來進行充電。然而,電腦上的介面連接埠會有數量上的限制,為了讓更多的手持式裝置能與電腦互通資訊,便發展出USB集線器來連接手持式裝置以及電腦。 Handheld devices or portable devices, such as flash drives, can be used to transfer data, usually by plugging in a computer interface such as a USB port. However, there is a limit to the number of interface ports on the computer. In order to allow more handheld devices to communicate with the computer, a USB hub has been developed to connect the handheld device to the computer.
請參考第一A圖,係為習知電源管理系統之架構示意圖。電源管理系統1包含一電腦主機11以及一USB集線器(USB Hub)13。USB集線器13具有多個子連接埠13a-13c,可供至少一可攜式裝置15插接來與電腦主機11互動。電腦主機11具有一中央處理單元111、一南北橋電路113、一記憶體115以及一介面連接埠117。中央處理單元111係用來控制電腦主機11的整 體運作,南北橋電路113用來輔助中央處理單元111與電腦主機11中各元件,如記憶體115、輸出輸入電路等,傳輸訊號或資料。記憶體115儲存作業系統(Operating System,OS)以及多個驅動程式,以供電腦主機11開機後從中載入作業系統,再依據電腦主機11所安裝的硬體元件來載入相對應的驅動程式,以控制各硬體元件的運作。 Please refer to the first A diagram, which is a schematic diagram of the architecture of the conventional power management system. The power management system 1 includes a computer host 11 and a USB hub (USB Hub) 13. The USB hub 13 has a plurality of sub-ports 13a-13c for allowing at least one portable device 15 to be plugged in to interact with the host computer 11. The host computer 11 has a central processing unit 111, a north-south bridge circuit 113, a memory 115, and an interface port 117. The central processing unit 111 is used to control the whole of the computer host 11 The north-south bridge circuit 113 is used to assist the central processing unit 111 and various components in the host computer 11, such as the memory 115, the output input circuit, etc., to transmit signals or data. The memory 115 stores an operating system (OS) and a plurality of drivers for loading the operating system from the host computer 11 and then loading the corresponding driver according to the hardware components installed in the host computer 11. To control the operation of each hardware component.
介面連接埠117係用來連接USB集線器13與電腦主機11,以USB連接埠為例,南北橋電路113中會設置有一USB控制器(USB host controller)1131,用來控制插接於子連接埠13a-13c的可攜式裝置15。請參考第一B圖,其係為USB集線器中一USB開關之架構示意圖。第一B圖中顯示出USB集線器13中之一USB開關14其對應一子連接埠,例如子連接埠13a,USB開關14用以根據電腦主機11之USB控制器1131的控制來切換子連接埠13a耦接至一資料傳輸(data transmission)電路16或是一專用充電(dedicated charge)電路17。資料傳輸電路16的作用是將子連接埠的USB資料傳輸差動端(例如D+/D-信號端)耦接至電腦主機11的介面連接埠117,而專用充電電路17的作用是將子連接埠的USB資料傳輸差動端相互短路耦接,例如以一阻抗單元12短路耦接,阻抗單元12可以是一電阻,但不限於此。在另一實施例中,上述USB開關14可位於USB集線器13的任何位置。具體來說,若USB集線器13處於一工作模式(active mode)時,可攜式裝置15(若有插接的話)便可藉由資料傳輸電路16與電腦主機11互相傳輸資料;若USB集線器23係進入休眠模式(suspend mode)時,便切斷資料傳輸功能,USB開關14便切換至專用充電電路17,USB集線器13改經由介面連接埠117接收電腦主機11提供的電力(或是USB集線器13之獨立電源,未示於圖中),來對可 攜式裝置15(不論有無插接可攜式裝置15)進行充電。 The interface port 117 is used to connect the USB hub 13 to the host computer 11. Taking the USB port as an example, a USB controller (1131) is provided in the north-south bridge circuit 113 for controlling the plug-in to the sub-port. Portable device 15 of 13a-13c. Please refer to the first B diagram, which is a schematic diagram of a USB switch in a USB hub. The first B diagram shows that one of the USB switches 14 of the USB hub 14 corresponds to a sub-port, such as a sub-port 13a. The USB switch 14 is used to switch the sub-port according to the control of the USB controller 1131 of the host computer 11 13a is coupled to a data transmission circuit 16 or a dedicated charge circuit 17. The function of the data transmission circuit 16 is to couple the USB data transmission differential end (for example, D+/D-signal end) of the sub-port 埠 to the interface port 117 of the computer host 11, and the special charging circuit 17 functions to connect the sub-connections. The USB data transmission differential terminals are short-circuited to each other, for example, short-circuited by an impedance unit 12, and the impedance unit 12 may be a resistor, but is not limited thereto. In another embodiment, the USB switch 14 described above can be located anywhere in the USB hub 13. Specifically, if the USB hub 13 is in an active mode, the portable device 15 (if plugged in) can transmit data to and from the host computer 11 through the data transmission circuit 16; if the USB hub 23 When the system enters the suspend mode, the data transmission function is cut off, the USB switch 14 is switched to the dedicated charging circuit 17, and the USB hub 13 receives the power provided by the computer host 11 via the interface port 117 (or the USB hub 13). Independent power supply, not shown in the figure) The portable device 15 (with or without the plug-in portable device 15) performs charging.
一般而言,電腦主機11的作業系統(例如微軟視窗作業系統、蘋果電腦作業系統等)中包含預設的USB集線器驅動程式,其用以偵測USB集線器13有無插接可攜式裝置15,若當一段時間內無任何可攜式裝置15插接至USB集線器13時,即控制USB集線器13進入至休眠模式,此時,USB開關14會切換至專用充電電路17進行充電。然而,電腦主機11仍處於主機工作狀態(S0)。也就是說,由於上述預設的USB集線器驅動程式的控制行為,USB集線器13並無法偵測到正確的電腦主機11的電源狀態來進入其休眠模式。在這種情形下,是無法真正地實現出USB集線器13”睡眠充電”的應用。並且,當電腦主機11是在主機工作狀態(S0)下,使用者插接可攜式裝置15至子連接埠13a-13c上時,會因為USB集線器13進入休眠模式而無法傳輸可攜式裝置15中的資料,進而誤認子連接埠13a-13c無法運作或損壞。 Generally, the operating system of the host computer 11 (such as the Microsoft Windows operating system, the Apple computer operating system, etc.) includes a preset USB hub driver for detecting whether the USB hub 13 is plugged into the portable device 15, If no portable device 15 is plugged into the USB hub 13 for a period of time, that is, the USB hub 13 is controlled to enter the sleep mode, at this time, the USB switch 14 is switched to the dedicated charging circuit 17 for charging. However, the host computer 11 is still in the host operating state (S0). That is to say, due to the control behavior of the above-mentioned preset USB hub driver, the USB hub 13 cannot detect the correct power state of the host computer 11 to enter its sleep mode. In this case, it is impossible to truly realize the application of the USB hub 13 "sleep charging". Moreover, when the host computer 11 is in the working state of the host (S0), when the user plugs in the portable device 15 to the sub-ports 13a-13c, the portable device cannot be transmitted because the USB hub 13 enters the sleep mode. The information in 15 is further misidentified that the sub-connections 13a-13c are inoperable or damaged.
因此,亟需提出一種新穎的電源管理系統及其方法,使USB集線器的模式能隨著電腦主機的電源狀態改變,進而便於識別及控制。 Therefore, it is urgent to propose a novel power management system and method thereof, so that the mode of the USB hub can be changed with the power state of the host computer, thereby facilitating identification and control.
鑑於上述,本發明實施例的目的之一在於提出一種電源管理系統及其方法,其藉由一過濾驅動程式來過濾(攔截)主機下達的指令,以控制USB集線器之模式可根據主機的電源狀態改變,進而增加控制的便利性。 In view of the above, one of the objectives of the embodiments of the present invention is to provide a power management system and method thereof, which filter (intercept) an instruction issued by a host by a filter driver to control the mode of the USB hub according to the power state of the host. Change, which in turn increases the convenience of control.
本發明係揭示一種電源管理系統,用以避免一USB集線器(USB Hub)在一電腦主機之一工作狀態時進入一休眠模式,其包含USB集線器以及電腦主機。USB集線器具有複數個子連接埠;電腦主機具有一中央處理單元,用來執行一作業系統(OS),且電腦主機係耦接於USB集線器。其中,中央處理單元更載入一過濾驅動程式(filter driver),以使電腦主機偵測到USB集線器;其中,過濾驅動程式偵測一特定ACPI事件,來發出一第一裝置休眠輸入輸出要求封包(device sleep IRP request),以控制USB集線器進入休眠模式。上述特定ACPI事件為該電腦主機進入一休眠狀態。 The present invention discloses a power management system for preventing a USB hub (USB Hub) from entering a sleep mode when a computer host is in operation, which includes a USB hub and a computer host. The USB hub has a plurality of sub-ports; the mainframe has a central processing unit for executing an operating system (OS), and the computer mainframe is coupled to the USB hub. The central processing unit further loads a filter driver to enable the host computer to detect the USB hub; wherein the filter driver detects a specific ACPI event to issue a first device sleep input and output request packet. (device sleep IRP request) to control the USB hub to enter sleep mode. The specific ACPI event described above is that the host computer enters a sleep state.
本發明又揭示一種電源管理方法,適用於一電腦主機,且電腦主機係耦接於一USB集線器(USB Hub),用以避免該USB集線器在該電腦主機之一工作狀態時進入一休眠模式。所述之電源管理方法包含以下步驟:首先,載入一過濾驅動程式(filter driver),以使電腦主機偵測到USB集線器;過濾驅動程式偵測一特定ACPI事件,來發出一第一裝置休眠輸入輸出要求封包,以控制USB集線器進入休眠模式;其中,上述特定ACPI事件為電腦主機進入一休眠狀態。 The invention further discloses a power management method, which is applicable to a computer host, and the computer host is coupled to a USB hub (USB Hub) to prevent the USB hub from entering a sleep mode when the computer host is in a working state. The power management method includes the following steps: first, loading a filter driver to enable the host to detect the USB hub; and filtering the driver to detect a specific ACPI event to issue a first device to sleep The input and output request packets are controlled to control the USB hub to enter a sleep mode; wherein the specific ACPI event described above is that the host computer enters a sleep state.
本發明更揭示一種儲存媒體,用以儲存一過濾驅動程式(filter driver),過濾驅動程式係用以載入至一電腦主機中,以使得電腦主機進行一種電源管理方法,且電腦主機係耦接於一USB集線器(USB Hub),用以避免該USB集線器在該電腦主機之一工作狀態時進入一休眠模式。所述之電源管理方法包含以下步驟:載入一過濾驅動程式,以使該電腦主機偵測到該USB集線器;該過濾驅動程式偵測一特定ACPI事件,來發出一第一裝置休眠輸入輸出要求封包,以控制該USB集線器進入休眠模式;其中,上述特 定ACPI事件為該電腦主機進入一休眠狀態。 The invention further discloses a storage medium for storing a filter driver, wherein the filter driver is loaded into a computer host, so that the computer host performs a power management method, and the computer host is coupled. In a USB hub (USB Hub), to prevent the USB hub from entering a sleep mode when one of the host computers is in operation. The power management method includes the steps of: loading a filter driver to enable the host computer to detect the USB hub; and the filter driver detecting a specific ACPI event to issue a first device sleep input and output request Packet to control the USB hub to enter sleep mode; The ACPI event enters a sleep state for the host computer.
1‧‧‧電源管理系統 1‧‧‧Power Management System
11‧‧‧電腦主機 11‧‧‧Computer host
111‧‧‧中央處理單元 111‧‧‧Central Processing Unit
113‧‧‧南北橋電路 113‧‧‧South-South Bridge Circuit
1131‧‧‧USB控制器 1131‧‧‧USB controller
115‧‧‧記憶體 115‧‧‧ memory
117‧‧‧介面連接埠 117‧‧‧Interface connection埠
12‧‧‧阻抗單元 12‧‧‧ Impedance unit
13‧‧‧USB集線器 13‧‧‧USB hub
13a-13c‧‧‧子連接埠 13a-13c‧‧‧Sub-link
14‧‧‧USB開關 14‧‧‧USB switch
15‧‧‧可攜式裝置 15‧‧‧Portable device
16‧‧‧資料傳輸電路 16‧‧‧Data transmission circuit
17‧‧‧專用充電電路 17‧‧‧Special charging circuit
2‧‧‧電源管理系統 2‧‧‧Power Management System
21‧‧‧電腦主機 21‧‧‧Computer host
211‧‧‧中央處理單元 211‧‧‧Central Processing Unit
213‧‧‧南北橋電路 213‧‧‧ North-South Bridge Circuit
2131‧‧‧USB控制器 2131‧‧‧USB controller
215‧‧‧記憶體 215‧‧‧ memory
217‧‧‧介面連接埠 217‧‧‧Interface connection埠
219‧‧‧儲存媒體 219‧‧‧ Storage media
2191‧‧‧過濾驅動程式 2191‧‧‧Filter driver
23‧‧‧USB集線器 23‧‧‧USB hub
23a-23c‧‧‧子連接埠 23a-23c‧‧‧Sub-connector
25‧‧‧可攜式裝置 25‧‧‧Portable device
31‧‧‧基本功能驅動程式 31‧‧‧Basic function driver
32‧‧‧USB集線器驅動程式 32‧‧‧USB hub driver
34‧‧‧USB主機驅動程式 34‧‧‧USB host driver
3A‧‧‧裝置休眠輸入輸出要求封包 3A‧‧‧Device sleep input and output request packet
3A’‧‧‧虛擬休眠輸入輸出要求封包回應 3A’‧‧‧Virtual sleep input and output request packet response
S401-S421‧‧‧步驟 S401-S421‧‧‧Steps
第一A圖係為習知電源管理系統之架構示意圖。 The first A diagram is a schematic diagram of the architecture of a conventional power management system.
第一B圖係為USB集線器中一USB開關之架構示意圖。 The first B diagram is a schematic diagram of the architecture of a USB switch in a USB hub.
第二圖係為本發明實施例之電源管理系統的架構示意圖。 The second figure is a schematic structural diagram of a power management system according to an embodiment of the present invention.
第三圖係為本發明實施例之傳輸IRP指令之示意圖。 The third figure is a schematic diagram of a transmission IRP instruction according to an embodiment of the present invention.
第四圖係為本發明實施例之電源管理方法之流程圖。 The fourth figure is a flowchart of a power management method according to an embodiment of the present invention.
首先,請參考第二圖,係為本發明實施例之電源管理系統的架構示意圖。如第二圖所示,電源管理系統2包含一電腦主機21以及一USB集線器(USB Hub)23。電腦主機21具有一中央處理單元211、一南北橋電路213、一記憶體215、一儲存媒體219以及一介面連接埠217。中央處理單元211係用來控制電腦主機21的整體運作,南北橋電路213用來輔助中央處理單元211與電腦主機21中各元件,如記憶體215、輸出輸入電路等,傳輸訊號或資料。記憶體215儲存作業系統(Operating System,OS)以及多個驅動程 式,以供電腦主機21開機後從中載入作業系統,再依據電腦主機21所安裝的硬體元件來載入相對應的驅動程式,以控制各硬體元件的運作。 First, please refer to the second figure, which is a schematic diagram of the architecture of the power management system according to an embodiment of the present invention. As shown in the second figure, the power management system 2 includes a computer host 21 and a USB hub (USB Hub) 23. The host computer 21 has a central processing unit 211, a north-south bridge circuit 213, a memory 215, a storage medium 219, and an interface port 217. The central processing unit 211 is used to control the overall operation of the computer host 21, and the north-south bridge circuit 213 is used to assist the central processing unit 211 and various components in the computer host 21, such as the memory 215, the output input circuit, etc., to transmit signals or data. The memory 215 stores an operating system (OS) and a plurality of driving processes For the computer host 21 to boot from the operating system, and then load the corresponding driver according to the hardware components installed in the host computer 21 to control the operation of the hardware components.
USB集線器23經由介面連接埠217來耦接於電腦主機21,其具有多個子連接埠23a-23c,並支援充電功能。當USB集線器23進入工作模式(active mode)時,插接於子連接埠23a-23c的可攜式裝置25可與電腦主機21互相傳輸資料;當進入休眠模式(suspend mode)時,便切斷資料傳輸功能,改經由介面連接埠217來接收電腦主機21所提供的電力,以對可攜式裝置25進行充電。以介面連接埠217為一USB連接埠為例,南北橋電路213中會設置有一USB控制器(USB host controller)2131,用來控制插接於介面連接埠217的USB集線器23及其連接之可攜式裝置25。介面連接埠217亦可為USB 3.0的連接埠、或其他標準規格的連接埠,不以在此揭露者為限。 The USB hub 23 is coupled to the host computer 21 via an interface port 217, which has a plurality of sub-ports 23a-23c and supports a charging function. When the USB hub 23 enters the active mode, the portable device 25 plugged into the sub-ports 23a-23c can transfer data to and from the host computer 21; when entering the suspend mode, the device is cut off. The data transmission function is adapted to receive the power provided by the host computer 21 via the interface port 217 to charge the portable device 25. Taking the interface port 217 as a USB port as an example, a USB controller (2) is provided in the north-south bridge circuit 213 for controlling the USB hub 23 plugged into the interface port 217 and its connection. Portable device 25. The interface port 217 can also be a USB 3.0 port or other standard port, not limited to those disclosed herein.
於進階架構與電源界面標準(Advanced Configuration and Power Interface,ACPI)之規格書中,中央處理單元211具有數個電源狀態,大致分成S0(工作)、S1(自動停機)、S2(休眠)、S3(深度休眠)及S4(更深度休眠)等狀態。S0狀態係被定義成一主機工作狀態(Host Active State),而S2-S4狀態被定義成一主機休眠狀態(Host Sleep State),在不同的狀態下,中央處理單元211會對電腦主機21中各元件或週邊裝置進行不同的控制。為了讓USB集線器23的模式能跟隨中央處理單元211的電源狀態,本發明特別提供一過濾驅動程式(filter driver)2191,其儲存於儲存媒體219中,用來過濾電腦主機21對USB集線器23所下達的輸入輸出要求封包IRP(I/O Request Packet)。一具體實施例中,過濾驅動程式(filter driver)2191亦可儲存於記憶體215中,而儲存媒體219除了如圖所示,係為電腦主機21中的一內 部儲存裝置,亦可為一外部儲存裝置,內部儲存裝置包含隨機存取記憶體(Random Access Memory,RAM)、動態記憶體(Dynamic RAM,DRAM)、靜態記憶體(Static RAM,SRAM)或快閃記憶體(Flash Memory),而外部儲存裝置包括光碟、隨身碟或外接式硬碟。在一實施例中,過濾驅動程式2191,其運作於一上層驅動程式與一下層驅動程式之間,用以避免USB集線器23在電腦主機21之一工作狀態時進入一休眠模式。以下將詳加說明。 In the specification of Advanced Configuration and Power Interface (ACPI), the central processing unit 211 has several power states, which are roughly divided into S0 (work), S1 (automatic stop), S2 (sleep), S3 (deep sleep) and S4 (more deep sleep) and other states. The S0 state is defined as a Host Active State, and the S2-S4 state is defined as a Host Sleep State. In different states, the central processing unit 211 will be a component of the host computer 21. Or the peripheral device performs different controls. In order to enable the mode of the USB hub 23 to follow the power state of the central processing unit 211, the present invention particularly provides a filter driver 2191, which is stored in the storage medium 219 for filtering the computer host 21 to the USB hub 23. The I/O request packet is requested by the I/O Request Packet. In a specific embodiment, the filter driver 2191 can also be stored in the memory 215, and the storage medium 219 is one of the computer hosts 21 as shown in the figure. The storage device may also be an external storage device, and the internal storage device includes a random access memory (RAM), a dynamic memory (DRAM), a static memory (SRAM), or a fast memory. Flash Memory, and external storage devices include CDs, flash drives, or external hard drives. In one embodiment, the filter driver 2191 operates between an upper driver and a lower driver to prevent the USB hub 23 from entering a sleep mode when the computer host 21 is in operation. The details will be explained below.
一般而言,電腦主機21載入作業系統後,會繼續載入和呼叫多個驅動程式來控制USB集線器23。舉例來說,微軟視窗作業系統中之驅動程式(driver)架構係層疊(layer)式,每層間均透過IRP(I/O Request Packet)傳遞其要求(Request)至各驅動程式,當驅動程式接收到IRP時,即依要求之內容確認並執行所需之處理,若此驅動程式尚非目的地驅動程式時,則繼續朝目的地呼叫(call)驅動程式。請參考第三圖,係為本發明實施例之傳輸IRP指令之示意圖,為了方便說明,該圖係將各驅動程式以物件型態來表現。電腦主機21之電源啟動後,會執行開機程序(power on self test,POST),並從記憶體215載入作業系統後,隨即執行基本功能驅動程式31,用以對電腦主機21中各元件進行初始化。在一實施例中,過濾驅動程式2191在初始化時即從儲存媒體219中被載入至作業系統,以使作業系統偵測到一特定的USB集線器。 In general, after the computer host 21 loads the operating system, it continues to load and call multiple drivers to control the USB hub 23. For example, the driver architecture in the Microsoft Windows operating system is layered, and each layer transmits its request (Request) to each driver through IRP (I/O Request Packet), when the driver receives When the IRP is reached, the required processing is confirmed and executed according to the requested content. If the driver is not the destination driver, the driver is continuously called to the destination. Please refer to the third figure, which is a schematic diagram of transmitting an IRP instruction according to an embodiment of the present invention. For convenience of description, the figure expresses each driver in an object type. After the power of the host computer 21 is started, a power on self test (POST) is executed, and after loading the operating system from the memory 215, the basic function driver 31 is executed to perform the functions of the computer host 21. initialization. In one embodiment, the filter driver 2191 is loaded into the operating system from the storage medium 219 upon initialization to cause the operating system to detect a particular USB hub.
作業系統會呼叫預設的USB集線器驅動程式32,用以偵測在一段時間內USB集線器23的子連接埠23a-23c是否為閒置狀態,若是,意即表示子連接埠23a-23c皆未插接任何可攜式裝置25,則USB集線器驅動程式32下達一裝置休眠輸入輸出要求封包(device sleep IRP request)3A,用以命令控制USB集線器23進入一休眠模式。過濾驅動程式2191運行於USB集線 器驅動程式32與USB主機驅動程式34之間。過濾驅動程式2191收到裝置休眠輸入輸出要求封包3A時,會進行過濾處理(攔截),因此裝置休眠輸入輸出要求封包3A即不會繼續被傳遞至USB主機驅動程式34,即阻止USB集線器23進入休眠模式。過濾驅動程式2191攔截裝置休眠輸入輸出要求封包3A,並回傳一虛擬休眠輸入輸出封包回應(pseudo sleep IRP response)3A’給USB集線器驅動程式32,最終傳給作業系統,以欺騙作業系統已成功將USB集線器23設定為休眠模式。由於USB集線器23並未真的進入休眠模式,故之後插接於子連接埠23a-23c的可攜式裝置25,仍然藉由喚醒事件(wake-up event)發生以與電腦主機21重新傳輸資料。 The operating system will call the preset USB hub driver 32 to detect whether the sub-connections 23a-23c of the USB hub 23 are idle for a period of time, and if so, it means that the sub-connections 23a-23c are not inserted. Connected to any portable device 25, the USB hub driver 32 issues a device sleep IRP request 3A for instructing the control USB hub 23 to enter a sleep mode. Filter driver 2191 runs on USB hub Between the driver 32 and the USB host driver 34. When the filter driver 2191 receives the device sleep input and output request packet 3A, it performs filtering processing (interception), so the device sleep input/output request packet 3A will not continue to be transmitted to the USB host driver 34, that is, the USB hub 23 is prevented from entering. Sleep mode. The filter driver 2191 intercepts the device sleep input and output request packet 3A, and returns a virtual sleep IRP response 3A' to the USB hub driver 32, and finally passes it to the operating system to trick the operating system into success. The USB hub 23 is set to the sleep mode. Since the USB hub 23 does not actually enter the sleep mode, the portable device 25 that is then plugged into the sub-ports 23a-23c still retransmits the data with the host computer 21 by the wake-up event. .
在一實施例中,當電腦主機21離開主機工作狀態,進入一主機休眠狀態,例如S2狀態,過濾驅動程式2191亦會偵測到此一ACPI事件發生,並發出(issue)裝置休眠輸入輸出要求封包3A至USB主機驅動程式34,USB主機驅動程式34再傳遞至USB集線器23,以控制USB集線器23進入一休眠模式。在一實施例中,過濾驅動程式2191會等待USB主機驅動程式34回傳一休眠輸入輸出封包回應(sleep IRP response)表示該特定USB集線器已休眠,或者,等待一特定時間(timeout),便結束此流程。 In an embodiment, when the host computer 21 leaves the host operating state and enters a host sleep state, such as the S2 state, the filter driver 2191 also detects that the ACPI event occurs and issues a device sleep input and output request. The packet 3A is sent to the USB host driver 34, and the USB host driver 34 is passed to the USB hub 23 to control the USB hub 23 to enter a sleep mode. In one embodiment, the filter driver 2191 waits for the USB host driver 34 to return a sleep input/output response (sleep IRP response) indicating that the particular USB hub has been hibernated, or waits for a specific timeout to end. This process.
在一實施例中,過濾驅動程式2191收到由USB主機驅動程式34(下層)傳遞到USB集線器驅動程式32(上層)的IRP,過濾驅動程式2191皆會傳遞,而不會進行攔截處理。 In one embodiment, the filter driver 2191 receives the IRP that is passed from the USB host driver 34 (lower layer) to the USB hub driver 32 (upper layer), and the filter driver 2191 transmits it without interception processing.
在一實施例中,過濾驅動程式2191收到由USB集線器驅動程式32(上層)欲傳遞到USB主機驅動程式34(下層)的非裝置休眠輸入輸出要求 封包,過濾驅動程式2191皆會傳遞,不會進行攔截處理。 In one embodiment, the filter driver 2191 receives a non-device sleep input and output request from the USB hub driver 32 (upper layer) to be transferred to the USB host driver 34 (lower layer). The packet, the filter driver 2191 will be passed, and no interception will be performed.
為了更進一步了解本發明的運作,請參考第四圖,係為本發明實施例之電源管理方法之流程圖。相關系統架構及訊號處理請一併參考第二、三圖。所述之電源管理方法之步驟如下:初始時,步驟S401中,過濾驅動程式2191被載入至作業系統,以使作業系統偵測到一特定的USB集線器23。在一實施例中,該過濾驅動程式2191運行於一上層驅動程式與一下層驅動程式之間。接著進行步驟S403。 In order to further understand the operation of the present invention, please refer to the fourth figure, which is a flowchart of a power management method according to an embodiment of the present invention. Please refer to the second and third figures for related system architecture and signal processing. The steps of the power management method are as follows: Initially, in step S401, the filter driver 2191 is loaded into the operating system to cause the operating system to detect a specific USB hub 23. In one embodiment, the filter driver 2191 runs between an upper driver and a lower driver. Next, step S403 is performed.
步驟S403,過濾驅動程式2191隨時等待是否有IRP之傳遞或是一ACPI事件發生。 In step S403, the filter driver 2191 waits for any IRP transfer or an ACPI event to occur at any time.
步驟S405,若判斷有IRP之傳遞,則進行步驟S407。若非IRP之傳遞,則進行步驟S417。 In step S405, if it is determined that there is an IRP transmission, step S407 is performed. If it is not the transfer of the IRP, step S417 is performed.
步驟S407中,判斷IRP是否來自下層驅動程式,如是,則進行步驟S409;否則進行步驟S411。 In step S407, it is determined whether the IRP is from the lower driver, and if so, step S409 is performed; otherwise, step S411 is performed.
步驟S409,過濾驅動程式2191便傳遞該IRP至上層驅動程式,之後即返回步驟S403。 In step S409, the filter driver 2191 transfers the IRP to the upper driver, and then returns to step S403.
步驟S411,若IRP來自上層驅動程式,且該IRP係令該特定USB集線器進入一休眠模式(亦即,該IRP為一裝置休眠IRP),則進行步驟S413。否則進行步驟S412,藉由過濾驅動程式2191傳遞IRP至下層驅動程式後,返回步驟S403。 Step S411, if the IRP is from the upper driver, and the IRP causes the specific USB hub to enter a sleep mode (that is, the IRP is a device sleep IRP), then step S413 is performed. Otherwise, in step S412, the filter driver 2191 transmits the IRP to the lower driver, and then returns to step S403.
步驟S413,過濾驅動程式2191攔截該IRP,並於步驟S415中,由過濾驅動程式2191回傳一虛擬休眠IRP回應給上層驅動程式後,再返回步驟S403。當使用者於任一子連接埠23a-23c上插接可攜式裝置25,可藉由偵測上述喚醒事件(wake-up event)發生(例如插接可攜式裝置25),使得過濾驅動程式2191發出假喚醒(pseudo wake-up)信號(圖未示)至USB集線器驅動程式32(最終傳回給作業系統),以使可攜式裝置25與電腦主機21之間傳輸資料。 In step S413, the filter driver 2191 intercepts the IRP, and in step S415, the filter driver 2191 returns a virtual sleep IRP response to the upper layer driver, and then returns to step S403. When the user plugs in the portable device 25 on any of the sub-ports 23a-23c, the filter driver can be generated by detecting the wake-up event (for example, plugging the portable device 25). The program 2191 issues a pseudo wake-up signal (not shown) to the USB hub driver 32 (which is ultimately passed back to the operating system) to transfer data between the portable device 25 and the host computer 21.
步驟S417,過濾驅動程式2191判斷是否為一指示電腦主機進入主機休眠狀態的ACPI事件發生,若是則進行步驟S419,否則返回步驟S403。 In step S417, the filter driver 2191 determines whether an ACPI event indicating that the host computer enters the host sleep state occurs, and if yes, proceeds to step S419, otherwise returns to step S403.
步驟S419,過濾驅動程式2191對下層驅動程式發出令該特定USB集線器休眠之IRP(亦即,該IRP為一裝置休眠IRP),以控制耦接於介面連接埠217的USB集線器23進入一休眠模式。接著進行步驟S421。 In step S419, the filter driver 2191 issues an IRP for the lower layer driver to sleep the specific USB hub (that is, the IRP is a device sleep IRP) to control the USB hub 23 coupled to the interface port 217 to enter a sleep mode. . Next, step S421 is performed.
步驟S421,過濾驅動程式2191等待下層驅動程式回傳一休眠IRP回應(sleep IRP response)表示該特定USB集線器已休眠;返回步驟S403。在一實施例中,步驟S421也可為等待一特定時間(timeout)後,再返回步驟S403。 In step S421, the filter driver 2191 waits for the lower driver to return a sleep IRP response (sleep IRP response) indicating that the specific USB hub is dormant; and returns to step S403. In an embodiment, step S421 may also wait for a specific timeout before returning to step S403.
當USB集線器23收到過濾驅動程式2191發出的裝置休眠IRP時,會進入一休眠模式。當USB集線器23進入休眠模式,便切斷資料傳輸功能,USB開關14便切換至專用充電電路17,當使用者於任一子連接 埠23a-23c上插接可攜式裝置25時,經由USB集線器13來對可攜式裝置15進行充電。 When the USB hub 23 receives the device sleep IRP from the filter driver 2191, it enters a sleep mode. When the USB hub 23 enters the sleep mode, the data transmission function is cut off, and the USB switch 14 is switched to the dedicated charging circuit 17, when the user connects to any of the sub-connections. When the portable device 25 is inserted into the cassette 23a-23c, the portable device 15 is charged via the USB hub 13.
藉由以上實例詳述,當可知悉本發明之電源管理系統及方法,係利用一過濾驅動程式來攔截系統下達的指令,並於處理指令的同時,會一併配合目前主機的電源狀態,以決定是否要過濾該指令。如此一來,連結於主機的USB集線器的模式,甚至其他週邊裝置,便可隨著主機的電源狀態改變。 As is apparent from the above examples, when the power management system and method of the present invention are known, a filter driver is used to intercept instructions issued by the system, and while processing the instructions, the power state of the current host is also matched. Decide if you want to filter the directive. In this way, the mode of the USB hub connected to the host, and even other peripheral devices, can change with the power state of the host.
以上所述僅為本發明之較佳實施例而已,並非用以限定本發明之申請專利範圍;凡其它未脫離發明所揭示之精神下所完成之等效改變或修飾,均應包含在下述之申請專利範圍內。 The above description is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention; all other equivalent changes or modifications which are not departing from the spirit of the invention should be included in the following Within the scope of the patent application.
2‧‧‧電源管理系統 2‧‧‧Power Management System
21‧‧‧電腦主機 21‧‧‧Computer host
211‧‧‧中央處理單元 211‧‧‧Central Processing Unit
213‧‧‧南北橋電路 213‧‧‧ North-South Bridge Circuit
2131‧‧‧USB控制器 2131‧‧‧USB controller
215‧‧‧記憶體 215‧‧‧ memory
217‧‧‧介面連接埠 217‧‧‧Interface connection埠
219‧‧‧儲存媒體 219‧‧‧ Storage media
2191‧‧‧過濾驅動程式 2191‧‧‧Filter driver
23‧‧‧USB集線器 23‧‧‧USB hub
23a-23c‧‧‧子連接埠 23a-23c‧‧‧Sub-connector
25‧‧‧可攜式裝置 25‧‧‧Portable device
Claims (18)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011100279919A CN102081581B (en) | 2010-10-01 | 2011-01-25 | Power management system and method |
US13/014,877 US8595533B2 (en) | 2010-10-01 | 2011-01-27 | Power management system, method thereof and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US38871310P | 2010-10-01 | 2010-10-01 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201216064A TW201216064A (en) | 2012-04-16 |
TWI436216B true TWI436216B (en) | 2014-05-01 |
Family
ID=46787056
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW99144044A TWI436216B (en) | 2010-10-01 | 2010-12-15 | Power management system, method thereof and storage medium |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI436216B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9281808B2 (en) * | 2013-03-08 | 2016-03-08 | Microchip Technology Incorporated | Variable voltage level translator |
CN104917016B (en) * | 2015-05-25 | 2017-12-29 | 深圳市华宝新能源股份有限公司 | Rechargeable hub |
-
2010
- 2010-12-15 TW TW99144044A patent/TWI436216B/en active
Also Published As
Publication number | Publication date |
---|---|
TW201216064A (en) | 2012-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8595533B2 (en) | Power management system, method thereof and storage medium | |
US7627696B2 (en) | Electronic device, method for controlling the same, information processing apparatus, and computer program | |
JP3264272B2 (en) | Computer and power control method for computer | |
JP5597104B2 (en) | Data transfer apparatus and control method thereof | |
EP3147793B1 (en) | Interrupt processing method and interrupt controller | |
US7895386B2 (en) | USB interface provided with host/device function and its control method | |
TWI477970B (en) | Mode switch method of electronic device and assocaited electronic device | |
US10067906B2 (en) | Computing device including an inter-integrated circuit (I2C) communication module and a communication error recovery method thereof | |
US10042800B2 (en) | Active USB device and switching method for operating mode thereof | |
JP2008287505A (en) | Information processor and legacy emulation processing stop control method | |
US8589954B2 (en) | Method and program for selective suspension of USB network device | |
US8327124B2 (en) | SD switch box in a cellular handset | |
JP2009187606A (en) | Tray ejection system of optical disk drive and computer | |
TWI436216B (en) | Power management system, method thereof and storage medium | |
US9087031B2 (en) | Method and program for selective suspension of USB device | |
US10831257B2 (en) | Storage device having a serial communication port | |
TW201520769A (en) | Peripheral equipment control device and information processing device | |
JP5627337B2 (en) | Information device, control method thereof, and program | |
US20180343302A1 (en) | Data management circuit with network functions and network-based data management method | |
US9477489B1 (en) | Software based self-encrypting drive (SED) sleep resuming method | |
JP2003216264A (en) | Computer, controlling method and program | |
US8941693B2 (en) | Method and apparatus for providing reduced power usage of a display interface | |
JP2001067157A5 (en) | Computers and their peripheral systems, computer peripherals, computers and their control methods, and computer-readable storage media | |
TWI728363B (en) | Integrated electronic apparatus for data access, data transmission and power management and method thereof | |
JP2008181230A (en) | Usb data transfer system and its computer |