TWI829378B - Universal serial bus control device and control method therefore - Google Patents
Universal serial bus control device and control method therefore Download PDFInfo
- Publication number
- TWI829378B TWI829378B TW111137998A TW111137998A TWI829378B TW I829378 B TWI829378 B TW I829378B TW 111137998 A TW111137998 A TW 111137998A TW 111137998 A TW111137998 A TW 111137998A TW I829378 B TWI829378 B TW I829378B
- Authority
- TW
- Taiwan
- Prior art keywords
- usb
- bus
- host interface
- control device
- usb port
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000005540 biological transmission Effects 0.000 claims description 11
- 230000004048 modification Effects 0.000 claims description 6
- 238000012546 transfer Methods 0.000 claims description 6
- 238000012986 modification Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 claims description 2
- 230000007246 mechanism Effects 0.000 description 19
- 230000006870 function Effects 0.000 description 12
- 238000007726 management method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 241000699670 Mus sp. Species 0.000 description 2
- 230000001010 compromised effect Effects 0.000 description 1
- 238000000115 helium ionisation detection Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Information Transfer Systems (AREA)
- Bus Control (AREA)
Abstract
Description
本發明是有關於一種使用通用序列匯流排(USB)的計算機技術,且特別是有關於一種通用序列匯流排控制裝置及其控制方法。 The present invention relates to a computer technology using a universal serial bus (USB), and in particular to a universal serial bus control device and a control method thereof.
目前在電腦週邊裝置最為普遍使用的連接界面莫過於USB界面,從小型的行動裝置到大型的工作站台都仍持續使用USB界面。使用USB界面的裝置(以下稱為USB裝置)具備多種類型以及應用特性,如,顯示螢幕、高畫質攝影機、喇叭具備較高的頻寬傳輸需求;部分裝置(如,人臉辨識相機、指紋掃描裝置、隨身碟)具備資訊安全需求;作為一般用途的人機輸入裝置(如,鍵盤、滑鼠...等)、風扇、行動電源...等裝置則無特殊類型與應用特性。由於USB裝置的類型過多而難以對USB裝置進行分類,進而難以管理這些USB裝置。 Currently, the most commonly used connection interface in computer peripheral devices is the USB interface. From small mobile devices to large workstations, USB interfaces are still used. Devices using the USB interface (hereinafter referred to as USB devices) have various types and application characteristics. For example, display screens, high-definition cameras, and speakers have high bandwidth transmission requirements; some devices (such as face recognition cameras, fingerprint scanners, etc.) Scanning devices, flash drives) have information security requirements; general-purpose human-computer input devices (such as keyboards, mice, etc.), fans, mobile power supplies, etc. have no special types and application characteristics. Since there are too many types of USB devices, it is difficult to classify USB devices, and thus it is difficult to manage these USB devices.
因此,如何分類管理這些USB裝置,並且維持USB自身的彈性使用功能,便是USB裝置的管理技術在實際應用上的研究 趨勢。 Therefore, how to classify and manage these USB devices and maintain the flexible use function of USB itself is the research on the practical application of USB device management technology. trend.
本發明提供一種通用序列匯流排控制裝置及其控制方法,可使USB控制裝置透過多個主機界面分類管理多種類別的USB裝置,並使USB控制裝置中所有的USB埠仍然具備彈性使用功能。 The present invention provides a universal serial bus control device and a control method thereof, which enables the USB control device to manage multiple types of USB devices through multiple host interfaces, and allows all USB ports in the USB control device to still have flexible use functions.
本發明實施例的通用序列匯流排(USB)控制裝置包括多個主機界面、多個通用序列匯流排(USB)埠、匯流排實體層電路、微處理器,以及匯流排排程控制器。所述匯流排實體層電路耦接至所述USB埠。所述微處理器耦接所述主機界面。所述匯流排排程控制器耦接所述主機界面、所述微處理器以及所述匯流排實體層電路。所述匯流排排程控制器依據至少一USB任務控制所述匯流排實體層電路。所述微處理器透過所述主機界面獲得一USB任務指令,所述USB任務指令包括一特定主機界面的一USB埠編號,其中所述特定主機界面為所述主機界面的其中之一。所述微處理器基於一索引查找表查詢所述特定主機界面的所述USB埠編號為對應至一特定USB埠,依據所述特定USB埠產生所述至少一USB任務,並將所述至少一USB任務傳遞至所述匯流排排程控制器。所述特定USB埠是所述USB埠的其中之一,所述索引查找表用以記錄每個主機界面所負責的所述USB埠的一部分與所述USB埠編號之間的關係。 The universal serial bus (USB) control device according to the embodiment of the present invention includes multiple host interfaces, multiple universal serial bus (USB) ports, bus physical layer circuits, a microprocessor, and a bus schedule controller. The bus physical layer circuit is coupled to the USB port. The microprocessor is coupled to the host interface. The bus schedule controller is coupled to the host interface, the microprocessor and the bus physical layer circuit. The bus schedule controller controls the bus physical layer circuit according to at least one USB task. The microprocessor obtains a USB task command through the host interface, and the USB task command includes a USB port number of a specific host interface, wherein the specific host interface is one of the host interfaces. The microprocessor queries the USB port number of the specific host interface based on an index lookup table to determine whether it corresponds to a specific USB port, generates the at least one USB task based on the specific USB port, and transfers the at least one USB task to the specific USB port. USB tasks are passed to the bus schedule controller. The specific USB port is one of the USB ports, and the index lookup table is used to record the relationship between a part of the USB port that each host interface is responsible for and the USB port number.
本發明實施例所述一種用於通用序列匯流排控制裝置的控制方法包括以下步驟:透過多個主機界面獲得一USB任務指令,所述USB任務指令包括一特定主機界面的一USB埠編號,其中所述特定主機界面為所述主機界面的其中之一;基於一索引查找表查詢所述特定主機界面的所述USB埠編號為對應至一特定USB埠,依據所述特定USB埠產生所述至少一USB任務,其中所述特定USB埠是所述USB埠的其中之一,所述索引查找表用以記錄每個主機界面所負責的所述匯流排連接埠的一部分與所述USB埠編號之間的關係;以及,藉由一匯流排排程控制器以及一匯流排實體層電路以完成所述至少一USB任務。 A control method for a universal serial bus control device according to an embodiment of the present invention includes the following steps: obtaining a USB task command through multiple host interfaces, where the USB task command includes a USB port number of a specific host interface, wherein The specific host interface is one of the host interfaces; the USB port number of the specific host interface is queried based on an index lookup table to correspond to a specific USB port, and the at least one is generated based on the specific USB port. A USB task, wherein the specific USB port is one of the USB ports, and the index lookup table is used to record the portion of the bus connection port that each host interface is responsible for and the USB port number. The relationship between; and, completing the at least one USB task through a bus schedule controller and a bus physical layer circuit.
基於上述,本發明實施例所述的通用序列匯流排控制裝置及其控制方法在USB控制裝置設置多個主機界面,並利用索引查找表對部分硬體元件進行配置與共享,從而利用多種判斷機制分類管理多種類別的USB裝置,並使USB控制裝置中所有的USB埠仍然具備彈性使用功能。 Based on the above, the universal serial bus control device and its control method according to the embodiments of the present invention set multiple host interfaces in the USB control device, and use index lookup tables to configure and share some hardware components, thereby utilizing multiple judgment mechanisms Classify and manage multiple types of USB devices, and ensure that all USB ports in the USB control device still have flexible usage functions.
11:主機控制器驅動器 11: Host controller driver
100:通用序列匯流排(USB)控制裝置 100: Universal Serial Bus (USB) Control Device
110-1、110-2:主機界面 110-1, 110-2: Host interface
120:微處理器 120:Microprocessor
125:韌體 125:Firmware
130:匯流排排程控制器 130: Bus schedule controller
140:索引查找表 140: Index lookup table
145:匯流排實體層電路 145:Bus physical layer circuit
150-1:低速(LS)/全速(FS)匯流排裝置 150-1: Low speed (LS)/full speed (FS) bus device
150-2:高速(HS)匯流排裝置 150-2: High speed (HS) bus device
150-3:超高速(SS)匯流排裝置 150-3: Super high speed (SS) bus device
160:埠路由集線器 160:Port routing hub
170-1~170-N:USB埠 170-1~170-N: USB port
210:虛框 210: virtual frame
S310~S350:步驟 S310~S350: steps
PPN:第一欄位 PPN: first column
HID:第二欄位 HID: second column
HPN:第三欄位 HPN: The third column
圖1是依照本發明一實施例的一種通用序列匯流排(USB)控制裝置100的方塊圖。
FIG. 1 is a block diagram of a universal serial bus (USB)
圖2是本實施例中索引查找表140的示意圖。 FIG. 2 is a schematic diagram of the index lookup table 140 in this embodiment.
圖3是依照本發明一實施例的一種用於通用序列匯流排
(USB)控制裝置100的控制方法的流程圖。
Figure 3 is a diagram for a universal serial bus according to an embodiment of the present invention.
A flowchart of a control method of the (USB)
基於USB裝置已十分普及與廣泛地出現在各種應用,因此如何依據USB裝置的類別或應用特性而對USB裝置進行分類管理,即為實作上的趨勢。然而,若USB控制裝置希望以偵測指定類別的作法管理USB裝置的時候,便需要使用此種類別所對應的判斷機制以及硬體。此種判斷機制經常需要另外制定,目前並無統一的判斷機制來對USB裝置進行分類管理。 Since USB devices have become very popular and widely used in various applications, how to classify and manage USB devices according to their categories or application characteristics is an implementation trend. However, if the USB control device wishes to manage the USB device by detecting a specified category, it needs to use the judgment mechanism and hardware corresponding to the category. This kind of judgment mechanism often needs to be formulated separately. Currently, there is no unified judgment mechanism to classify and manage USB devices.
例如,依據頻寬需求,將高頻寛需求的USB顯示裝置或USB音效裝置與低頻寛需求的USB鍵盤或滑鼠進行分類管理;依據資訊安全管控等級,將高度資訊安全管控等級的USB人臉辨識相機、指紋掃瞄裝置或隨身碟與普通資訊安全管控等級的一般USB設備(如,USB風扇、行動電源...等)進行分類管理。USB控制裝置可使用USB裝置的主機界面識別符(ID)為基礎來作為特定類別的判斷機制,以方便管理USB裝置與分配實體資源,且每種判斷機制需要對應的硬體執行。 For example, according to the bandwidth requirements, USB display devices or USB audio devices with high frequency bandwidth requirements and USB keyboards or mice with low frequency bandwidth requirements are classified and managed; according to the information security control level, USB faces with high information security control levels are classified and managed. Identify cameras, fingerprint scanning devices or flash drives and general USB devices with general information security control levels (such as USB fans, mobile power supplies, etc.) for classified management. The USB control device can use the host interface identifier (ID) of the USB device as a specific type of judgment mechanism to facilitate management of the USB device and allocate physical resources, and each judgment mechanism requires corresponding hardware execution.
若希望USB控制裝置以多種類別或應用特性來管理這些USB裝置的時候,除了需要多套判斷機制以及硬體以外,還需要將這些USB埠劃分為不同用途使用。例如,若一個電腦裝置具備十個USB埠,而USB控制裝置100希望能夠偵測兩個特殊用途(高速傳輸用途以及高度資訊安全用途)的話,在設計電腦裝置時便
可能需要將十個USB埠中的四個USB埠劃分給高速傳輸用途的USB裝置使用,十個USB埠中的另外六個USB埠則可能劃分給高度資訊安全用途的USB裝置使用。如此一來,反而失去了USB埠原本具備的彈性使用功能。
If you want a USB control device to manage these USB devices in multiple categories or application characteristics, in addition to multiple sets of judgment mechanisms and hardware, you also need to divide these USB ports for different uses. For example, if a computer device has ten USB ports and the
因此,本發明實施例在USB控制裝置中使用多個主機控制器界面,並利用索引查找表來使這些主機界面將其餘的硬體元件進行配置與共享,便可利用多種判斷機制分類管理這些USB裝置,並使USB控制裝置中所有的USB埠仍然具備彈性使用功能。 Therefore, the embodiment of the present invention uses multiple host controller interfaces in the USB control device, and uses an index lookup table to enable these host interfaces to configure and share other hardware components, so that multiple judgment mechanisms can be used to classify and manage these USBs. device, so that all USB ports in the USB control device still have flexible use functions.
圖1是依照本發明一實施例的一種通用序列匯流排(USB)控制裝置100的方塊圖。本實施例的USB控制裝置100是符合USB的可擴展主機控制器界面(eXtensible Host Controller Interface;xHCI)作為其控制界面。USB控制裝置100也可以稱為是USB xHCI控制裝置。本實施例的USB控制裝置100受控於主機控制器驅動器(eXtensible Host Controller driver;xHCD)11。
FIG. 1 is a block diagram of a universal serial bus (USB)
USB控制裝置100可支援PCI界面的匯流排/裝置/功能(bus/device/function;BDF)作為USB裝置的主機界面識別符(ID),以將這些USB裝置進行分類。也就是說,符合本發明的實施例可採用PCI界面的匯流排/裝置/功能(bus/device/function;BDF)作為USB裝置的主機界面識別符(ID),USB控制裝置100可偵測每個USB裝置對應的主機界面識別符來判斷此USB裝置的特性位於何種特殊用途(如,是否為高速傳輸用途、高度資訊安全用途...等)或為一般用途。
The
本實施例的USB控制裝置100包括多個主機界面、微處理器120、匯流排排程控制器130、匯流排實體層電路145以及多個USB埠170-1~170-N(N為大於1的正整數)。本實施例的匯流排實體層電路145可包括基於不同傳輸速度的匯流排裝置以及埠路由集線器160。微處理器120中可儲存有韌體125。
The
本實施例以兩個主機界面110-1~110-2作為舉例,應用本實施例者可依其需求調整主機界面的數量。主機界面110-1~110-2可以為包括具備xHCI定義且依據此xHCI運行的硬體界面控制電路,以與可擴展主機控制器驅動器(xHCD)11相互通訊。xHCD 11受控於記憶體裝置中的作業系統,因此xHCD 11還可以稱為是作業系統主機驅動器。 This embodiment takes two host interfaces 110-1~110-2 as an example. Those who apply this embodiment can adjust the number of host interfaces according to their needs. The host interfaces 110-1~110-2 may include hardware interface control circuits having xHCI definitions and operating according to this xHCI to communicate with the extensible host controller driver (xHCD) 11. xHCD 11 is controlled by the operating system in the memory device, so xHCD 11 can also be called an operating system host driver.
舉例來說,當具備USB控制裝置100的計算機裝置需要存取某個USB埠所連接的USB裝置時,xHCD 11會將USB任務指令(task command)傳遞給主機界面110-1~110-2。主機界面110-1~110-2分別可從xHCD 11獲得各自的USB任務指令。這些USB任務指令主要由USB埠170-1~170-N的其中之一以及與前述單個USB埠所對應的USB任務(task)所組成。USB任務可以是與對應的USB埠所連接的USB裝置進行資料存取或相應的操作指令。
For example, when the computer device equipped with the
微處理器120可透過運行儲存於其中的韌體而實現本發明實施例。本發明實施例的微處理器120分別透過主機界面110-1~110-2獲得前述USB埠所對應的USB任務,並將USB任務
依據USB任務指令的特性按照USB規格的定義指派與傳遞給匯流排排程控制器130。
The
在本實施例中,基於不同傳輸速度的匯流排裝置可包括用於USB 1.1的低速(Low Speed;LS)/全速(Full Speed;FS)匯流排裝置150-1(可稱為是第一速率匯流排裝置)、用於USB 2.0的高速(High Speed;HS)匯流排裝置150-2(可稱為是第二速率匯流排裝置)以及用於USB 3.0的超高速(Super high Speed;SS)匯流排裝置150-3(可稱為是第三速率匯流排裝置)。換句話說,匯流排裝置150-1~150-3是用於處理USB協定中各自定義的傳輸速率的實體層硬體裝置或電路。 In this embodiment, bus devices based on different transmission speeds may include a Low Speed (LS)/Full Speed (FS) bus device 150-1 for USB 1.1 (which can be referred to as a first speed bus device), a High Speed (HS) bus device 150-2 for USB 2.0 (which can be called a second speed bus device), and a Super High Speed (SS) for USB 3.0 Bus device 150-3 (which may be referred to as a third rate bus device). In other words, the bus devices 150-1 to 150-3 are physical layer hardware devices or circuits used to handle transmission rates respectively defined in the USB protocol.
匯流排排程控制器130根據USB任務指令的要求而控制匯流排實體層電路145,以對於相對應USB匯流排的封包進行相應處理。詳細來說,匯流排排程控制器130基於微處理器120所排定的USB任務來控制埠路由集線器160以及匯流排裝置150-1~150-3,讓對應的USB埠170-1~170-N其中之一連接至匯流排裝置150-1~150-3其中之一,並控制經連結的匯流排裝置150-1~150-3其中之一來與前述USB埠170-1~170-N其中之一相連接的USB裝置存取資料,以完成USB任務。舉例來說,在與USB埠170-1相連接的USB裝置僅支援USB 1.1傳輸速率的情況下,當xHCD 11要與此USB裝置存取資料時,匯流排排程控制器130會控制埠路由集線器160以將USB埠170-1連接至支援USB 1.1傳輸速率的匯流排裝置150-1,從而完成xHCD 11與此USB裝置
存取資料的USB任務。在與USB埠170-2相連接的USB裝置能夠支援USB 3.0傳輸速率的情況下,當xHCD 11要與此USB裝置存取資料時,匯流排排程控制器130會控制埠路由集線器160以將USB埠170-3連接至支援USB 3.0傳輸速率的匯流排裝置150-3,從而完成xHCD 11與此USB裝置存取資料的USB任務。
The
匯流排排程控制器130根據USB任務指令的要求而對於相對應USB匯流排的封包進行相應處理。如果有需要使用或是存取系統記憶體(例如,記憶體裝置中的雙倍資料率(DDR)同步動態隨機存取記憶體(SDRAM))時,匯流排排程控制器130會將與此存取操作相關的USB裝置所對應的主機界面識別符帶入存取記憶體的交易(transaction)當中,並依據前述流程的基礎控制埠路由集線器160以讓對應的USB埠170-1~170-N其中之一連接至匯流排裝置150-1~150-3其中之一,並控制經連結的匯流排裝置150-1~150-3其中之一來與前述USB埠170-1~170-N其中之一連接的USB裝置存取資料以完成USB任務。
The
當主機界面110-1~110-2皆使用同一種判斷機制的時候,USB裝置所對應的用途(例如:高速傳輸或是高資訊安全要求)只能是唯一的。然而,若主機界面110-1與主機界面110-2使用不同的判斷機制的時候,由於每個判斷機制會對應不同用途於各自的主機界面識別符,而這些判斷機制針對同個主機界面識別符所控的USB裝置可能會有與主機界面識別符所定義的用途產生不一致的情況,因而造成混亂。例如,當不同用途所定義的主機 界面識別符皆為相同數值的時候,主機界面110-1、110-2會因而相同數值的主機界面識別符發生產生混淆,無法知道是何種用途所定義的主機界面識別符。 When the host interfaces 110-1~110-2 all use the same judgment mechanism, the purpose corresponding to the USB device (for example: high-speed transmission or high information security requirements) can only be unique. However, if the host interface 110-1 and the host interface 110-2 use different judgment mechanisms, each judgment mechanism will correspond to the respective host interface identifier for different purposes, and these judgment mechanisms are for the same host interface identifier. The controlled USB device may be inconsistent with the purpose defined by the host interface identifier, thus causing confusion. For example, when hosts are defined for different purposes When the interface identifiers have the same value, the host interfaces 110-1 and 110-2 will be confused by the host interface identifiers with the same value, making it impossible to know what purpose the host interface identifier is defined for.
為避免前述問題,本發明實施例透過設立索引查找表140,這個索引查找表140用以記錄每個主機界面110-1~110-2以及這些主機界面110-1~110-2所負責的USB埠的關係,讓微處理器120可根據索引查找表140中的內容得知每個主機界面110-1~110-2所負責的USB埠為何,並將USB任務經由對應的主機界面來執行。換句話說,本實施例的索引查找表可記錄每個主機界面所負責的USB埠,並且xHCD 11可透過指令修改索引查找表中的資料,從而不需實體地、非彈性地指派特定的多個USB埠給特定主機界面,而是可以彈性地透過修改索引查找表中的資料而將某個USB埠連接的USB裝置從一個主機界面改由另一個主機界面進行負責,並且在前述的修改中並不需要使用者將USB裝置從某一USB埠轉而插到另一USB埠。
In order to avoid the aforementioned problems, the embodiment of the present invention establishes an index lookup table 140. This index lookup table 140 is used to record each host interface 110-1~110-2 and the USB interfaces responsible for these host interfaces 110-1~110-2. The relationship between the ports allows the
本實施例將索引查找表140設立在匯流排排程控制器130中,應用本實施例者可依其需求調整索引查找表140的設立位置,例如,可將索引查找表140設立於微處理器120或另一記憶元件(未繪示)中,讓需要使用的元件(如,微處理器120、主機界面110-1~110-2、匯流排排程控制器130...等)能進行存取即可。
In this embodiment, the index lookup table 140 is set up in the
圖2是本實施例中索引查找表140的示意圖。索引查找表140的欄位PPN(亦稱為是第一欄位)用以表示USB埠的編號, 欄位HID(亦稱為是第二欄位)用以表示負責前述USB埠的主機界面所對應的主機界面識別符,欄位HPN(亦稱為是第三欄位)用以表示主機界面所負責的USB埠編號。 FIG. 2 is a schematic diagram of the index lookup table 140 in this embodiment. The field PPN (also called the first field) of the index lookup table 140 is used to represent the number of the USB port. The field HID (also called the second field) is used to represent the host interface identifier corresponding to the host interface responsible for the aforementioned USB port, and the field HPN (also called the third field) is used to represent the host interface identifier. Responsible USB port number.
在此假設圖1中USB埠的數量為6(即,N=6),且在索引查找表140中以USB埠170-1~170-6呈現,因此欄位PPN中列出USB埠170-1~170-6。圖1主機界面110-1的主機界面識別符為「Bus0 Dev3 Func0」且在索引查找表140的欄位HID中以「000300」呈現;圖1主機界面110-2的主機界面識別符為「Bus0 Dev4 Func0」且在索引查找表140的欄位HID中以「000400」呈現。主機界面110-1用以負責USB埠170-1、170-3、170-5的USB任務,因此欄位PPN「170-1」、「170-3」、「170-5」所對應的欄位HID皆為「000300」,且欄位PPN「170-1」、「170-3」、「170-5」所對應的欄位HPN分別為「01」、「02」、「03」,用以表示主機界面110-1中USB埠編號為「01」的是USB埠170-1、USB埠編號為「02」的是USB埠170-3、USB埠編號為「03」的是USB埠170-5。依此類推,欄位PPN「170-2」、「170-4」、「170-6」所對應的欄位HID皆為表示主機界面110-2的「000400」,且主機界面110-2中USB埠編號為「01」的是USB埠170-2、USB埠編號為「02」的是USB埠170-4、USB埠編號為「03」的是USB埠170-6。
It is assumed here that the number of USB ports in Figure 1 is 6 (ie, N=6), and they are presented as USB ports 170-1~170-6 in the index lookup table 140, so the USB port 170-170 is listed in the field PPN. 1~170-6. The host interface identifier of the host interface 110-1 in Figure 1 is "Bus0 Dev3 Func0" and is represented as "000300" in the field HID of the index lookup table 140; the host interface identifier of the host interface 110-2 in Figure 1 is "Bus0" Dev4 Func0" and appears as "000400" in the field HID of the index lookup table 140. The host interface 110-1 is responsible for the USB tasks of USB ports 170-1, 170-3, and 170-5, so the fields corresponding to the fields PPN "170-1", "170-3", and "170-5" The HIDs of all bits are "000300", and the field HPNs corresponding to the fields PPN "170-1", "170-3", and "170-5" are "01", "02", and "03" respectively. Use It means that the USB port number "01" in the host interface 110-1 is USB port 170-1, the USB port number "02" is USB port 170-3, and the USB port number "03" is
索引查找表140可固定在計算機裝置開機時透過微處理器120運行其韌體125時進行建立。另一方面,由於USB技術支援熱插拔,且在計算機裝置關機時,USB裝置的連接關係可能有
所改變,因此也可動態地由微處理器120運行其韌體時透過預設的屬性建立索引查找表140,或是由xHCD 11根據管理所需的分類來建立索引查找表140。
The index lookup table 140 can be established when the computer device is powered on by the
進行分類管理的屬性舉例來說可以是以效能屬性來分類,或是是以安全屬性來分類。換句話說,用於分類的前述判斷機制可由系統廠商或製造廠商的設定來進行彈性規畫設置或實現,應用本實例者並不限制用於分類管理的前述判斷機制的應用方式。例如,可將主機界面識別符「Bus0 Dev3 Func0」設定為高效能,而主機界面識別符「Bus0 Dev4 Func0」設定為一般效能;或者將主機界面識別符「Bus0 Dev3 Func0」設定為高安全性,而主機界面識別符「Bus0 Dev4 Func0」設定為低安全或是一般安全性。舉例而言,實現輸入輸出記憶體管理單元(IOMMU)或是系統記憶體管理單元(SMMU)的計算機裝置可以根據不同的主機界面識別符(或是,PCI界面的匯流排/裝置/功能(BDF))來達成屬性特徵的功能。例如,IOMMU或是SMMU可根據不同的主機界面識別符來決定系統安全性的存取權限;例如低安全性的主機界面識別符將不允許存取到高安全性資料存放的區域,故以不同的主機界面識別符來發出存取交易是達成分類屬性特徵的基本構成要件。 For example, the attributes that are classified and managed can be classified by performance attributes or safety attributes. In other words, the foregoing judgment mechanism for classification can be set or implemented by system vendors or manufacturers for flexible planning. Those who apply this example do not limit the application method of the foregoing judgment mechanism for classification management. For example, the host interface identifier "Bus0 Dev3 Func0" can be set to high performance, and the host interface identifier "Bus0 Dev4 Func0" can be set to normal performance; or the host interface identifier "Bus0 Dev3 Func0" can be set to high security. The host interface identifier "Bus0 Dev4 Func0" is set to low security or normal security. For example, a computer device that implements an input-output memory management unit (IOMMU) or a system memory management unit (SMMU) can be configured with different host interface identifiers (or bus/device/function (BDF) of the PCI interface). )) to achieve the function of attribute characteristics. For example, IOMMU or SMMU can determine system security access permissions based on different host interface identifiers; for example, a low-security host interface identifier will not allow access to an area where high-security data is stored, so different The host interface identifier to issue access transactions is the basic component to achieve classification attribute characteristics.
請參見圖2,在此假設,主機界面110-1用以處理高安全性的任務,主機界面110-2用以處理低安全性或一般安全性的任務。當具備高安全性的USB裝置(如,指紋掃瞄器)接入USB埠
170-2時,xHCD 11識別到指紋掃瞄器的設定被連接到用以處理低安全性或一般安全性的任務的主機界面110-2。因此,xHCD 11發動索引查找表140的修改指令,並如圖2虛框210所示,將欄位PPN為「170-2」的欄位HID以及欄位HPN由原本的「000400」、「01」修改成「000300」、「04」,相當於將指紋掃瞄器從主機界面110-2的USB埠編號「01」移除再***主機界面110-1的USB埠編號「04」,藉此以讓指紋掃瞄器受到主機界面110-1的控制。因此,xHCD 11可以再度重新啟動USB控制裝置100來識別指紋掃瞄器,並因安全性已經符合要求條件而順利地完成實際操作的相關功能。
Referring to Figure 2, it is assumed here that the host interface 110-1 is used to process high-security tasks, and the host interface 110-2 is used to process low-security or general security tasks. When a high-security USB device (such as a fingerprint scanner) is connected to the USB port
At 170-2, the xHCD 11 recognizes that the fingerprint scanner is configured to be connected to the host interface 110-2 for handling low security or normal security tasks. Therefore, xHCD 11 activates the modification command of the index lookup table 140, and as shown in the dotted
另一方面,當計算機裝置準備關機時,USB處理裝置110可將當前配置的索引查找表140存入計算機裝置的非揮發性記憶體裝置中(例如,基本輸入輸出系統(BIOS)、特定的硬碟區間...等)。當下次計算機裝置開機時,如果在基本輸入輸出系統(BIOS)或特定的硬碟區間中發現有效的索引查找表140時,則本實施例的USB處理裝置110可直接將前述非揮發性記憶體裝置中的內容直接載入到索引查找表140,以供USB處理裝置110使用。藉此,本發明實施例提供以軟體修改的方式修改索引查找表140,可維持USB埠在使用上的彈性。 On the other hand, when the computer device is preparing to shut down, the USB processing device 110 may store the currently configured index lookup table 140 into a non-volatile memory device of the computer device (eg, Basic Input Output System (BIOS), specific hardware disc interval...etc.). When the computer device is turned on next time, if a valid index lookup table 140 is found in the basic input and output system (BIOS) or a specific hard disk area, the USB processing device 110 of this embodiment can directly store the aforementioned non-volatile memory. The content in the device is directly loaded into the index lookup table 140 for use by the USB processing device 110 . Therefore, the embodiment of the present invention provides for modifying the index lookup table 140 in the form of software modification, which can maintain the flexibility in use of the USB port.
圖3是依照本發明一實施例的一種用於通用序列匯流排(USB)控制裝置100的控制方法的流程圖。圖3所述的方法可由圖1中USB控制裝置100中的微處理器120實現,或是,圖3
所述的方法可為微處理器120中所執行的韌體實現。於步驟S310中,可由微處理器120或是xHCD 11透過微處理器120來初始化索引查找表。如前述,在具備USB控制裝置100的計算機裝置進行開機或是USB裝置透過USB埠170-1~170-N接入USB控制裝置100時,微處理器120可根據所需的分類管理的判斷機制設定所需的索引查找表140或透過BIOS預存的內容載入來初始化索引查找表140。
FIG. 3 is a flow chart of a control method for a universal serial bus (USB)
於步驟S320中,微處理器120透過主機界面110-1~110-2接收USB任務指令。本實施例假設此USB任務指令中包含由主機界面110-1(本實施例稱為,特定主機界面)發出USB埠編號為「02」的USB任務。換句話說,xHCD 11發出USB任務指令到主機界面110-1,微處理器120透過主機界面110-1接收由主機界面110-1發出的、具備與主機界面對應的USB埠編號的USB任務。特定主機界面為主機界面110-1~110-2的其中之一。
In step S320, the
於步驟S330中,微處理器120基於索引查找表140查詢特定主機界面(主機界面110-1)的USB埠編號(「02」)為對應至特定USB埠,並依據此特定USB埠產生至少一個USB任務。詳細來說,微處理器120依據主機界面110-1對應的主機界面識別符「000300」以及USB埠編號「02」透過索引查找表140查詢第三列的資料,從而查詢與前述資訊對應且位於索引查找表140欄位PPN的USB埠170-3來作為前述特定USB埠。並且,微處理器120依據此特定USB埠(USB埠170-3)基於USB任務指令的
要求產生至少一個USB任務。本實施例的特定USB埠是USB埠170-1~170-N的其中之一。索引查找表140用以記錄每個主機界面110-1~110-2所負責的USB埠的一部分與USB埠編號之間的關係。例如,從索引查找表140可知,主機界面識別符(欄位HID)為「000300」且USB編號(對應欄位HPN)為「02」所對應的欄位PPN為「170-3」。
In step S330, the
於步驟S340中,微處理器120便將USB埠170-3的USB任務依據USB任務指令的特性且按照USB規格的定義傳遞給匯流排排程控制器130,以藉由匯流排排程控制器130以及匯流排實體層電路145以完成前述USB任務。
In step S340, the
於步驟S350中,匯流排排程控制器130根據USB任務指令的要求來完成相對應的USB任務並產生USB封包。此USB封包回傳到xHCD 11以實現與USB裝置的資料存取。在執行對應於特定USB埠(例如,USB埠170-3)的USB任務時,如果有需要發出使用或是存取系統記憶體(例如,記憶體裝置中的雙倍資料率(DDR)同步動態隨機存取記憶體(SDRAM))時,會根據索引查找表140來決定透過哪一個主機界面110-1~110-2對應的主機界面識別符且帶入存取系統記憶體的交易(transaction)中,並依據前述流程的基礎來完成USB任務。
In step S350, the
基於前述步驟與操作,本發明實施例可透過索引查找表140而實現將其餘的硬體元件(如,圖1微處理器120、匯流排排程控制器130、匯流排裝置150-1~150-3、埠路由集線器160以及
USB埠170-1~170-N...等)共享到多個主機界面(如,圖1主機界面110-1~110-2),便可利用多種判斷機制分類管理這些USB裝置,例如可透過不同的主機界面對應不同的判斷機制,並使USB控制裝置中所有的USB埠仍然具備彈性使用功能。
Based on the foregoing steps and operations, the embodiment of the present invention can use the index lookup table 140 to realize the integration of other hardware components (such as the
若以安全性作為判斷機制的舉例,計算機裝置上的作業系統在IOMMU的設定上可以規劃,圖1主機界面110-2(其主機界面識別符為「000400」)的所有交易只能存取較低安全性或是一般安全性的記憶體位址區塊。因此,故如果某一低安全性的USB裝置假設違反安全原則而希望使用高安全性的位址區塊的話,將會由IOMMU發出拒絕存取的結果。因此,xHCD 11在識別完連接至USB控制裝置100上USB埠170-1~170-N其中之一的USB裝置的設備類別之後,就會分配符合其安全性原則的記憶體區塊來操作此USB裝置,以完成符合其安全性的設定。
If security is used as an example of the judgment mechanism, the operating system on the computer device can be programmed in the settings of the IOMMU. All transactions in the host interface 110-2 in Figure 1 (its host interface identifier is "000400") can only access larger A low-security or normal-security memory address block. Therefore, if a low-security USB device violates security principles and wishes to use a high-security address block, the IOMMU will issue an access denial result. Therefore, after the xHCD 11 identifies the device type of the USB device connected to one of the USB ports 170-1~170-N on the
綜上所述,本發明實施例所述的通用序列匯流排控制裝置及其控制方法在USB控制裝置設置多個主機界面,並利用索引查找表對部分硬體元件進行配置與共享,從而利用多種判斷機制分類管理多種類別的USB裝置,並使USB控制裝置中所有的USB埠仍然具備彈性使用功能。 To sum up, the universal serial bus control device and its control method according to the embodiments of the present invention set multiple host interfaces in the USB control device, and use the index lookup table to configure and share some hardware components, thereby utilizing a variety of The judgment mechanism classifies and manages multiple types of USB devices, and enables all USB ports in the USB control device to still have flexible usage functions.
11:主機控制器驅動器 11: Host controller driver
100:通用序列匯流排(USB)控制裝置 100: Universal Serial Bus (USB) Control Device
110-1、110-2:主機界面 110-1, 110-2: Host interface
120:微處理器 120:Microprocessor
125:韌體 125:Firmware
130:匯流排排程控制器 130: Bus schedule controller
140:索引查找表 140: Index lookup table
145:匯流排實體層電路 145:Bus physical layer circuit
150-1:低速(LS)/全速(FS)匯流排裝置 150-1: Low speed (LS)/full speed (FS) bus device
150-2:高速(HS)匯流排裝置 150-2: High speed (HS) bus device
150-3:超高速(SS)匯流排裝置 150-3: Super high speed (SS) bus device
160:埠路由集線器 160:Port routing hub
170-1~170-N:USB埠 170-1~170-N: USB port
Claims (11)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211333078.6A CN115693316A (en) | 2022-02-15 | 2022-10-28 | Universal serial bus control device and control method thereof |
US18/156,391 US20230259484A1 (en) | 2022-02-15 | 2023-01-19 | Universal serial bus control device and control method thereof |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US202263310118P | 2022-02-15 | 2022-02-15 | |
US63/310,118 | 2022-02-15 |
Publications (2)
Publication Number | Publication Date |
---|---|
TW202334835A TW202334835A (en) | 2023-09-01 |
TWI829378B true TWI829378B (en) | 2024-01-11 |
Family
ID=88927491
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW111137998A TWI829378B (en) | 2022-02-15 | 2022-10-06 | Universal serial bus control device and control method therefore |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI829378B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060164454A1 (en) * | 2004-05-27 | 2006-07-27 | Silverbrook Research Pty Ltd | Method for at least partially compensating for errors in ink dot placement due to erroneous rotational displacement |
CN101620578A (en) * | 2009-06-23 | 2010-01-06 | 上海北大方正科技电脑***有限公司 | Method for managing USB equipment based on virtualized system |
TWI502352B (en) * | 2009-03-18 | 2015-10-01 | Aten Int Co Ltd | Kvm extender system and signal extending method |
TWI636396B (en) * | 2012-11-20 | 2018-09-21 | 佩多查爾斯I | Solid state drive architectures |
TWI741765B (en) * | 2020-08-28 | 2021-10-01 | 和碩聯合科技股份有限公司 | Connection device |
-
2022
- 2022-10-06 TW TW111137998A patent/TWI829378B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060164454A1 (en) * | 2004-05-27 | 2006-07-27 | Silverbrook Research Pty Ltd | Method for at least partially compensating for errors in ink dot placement due to erroneous rotational displacement |
TWI502352B (en) * | 2009-03-18 | 2015-10-01 | Aten Int Co Ltd | Kvm extender system and signal extending method |
CN101620578A (en) * | 2009-06-23 | 2010-01-06 | 上海北大方正科技电脑***有限公司 | Method for managing USB equipment based on virtualized system |
TWI636396B (en) * | 2012-11-20 | 2018-09-21 | 佩多查爾斯I | Solid state drive architectures |
TWI741765B (en) * | 2020-08-28 | 2021-10-01 | 和碩聯合科技股份有限公司 | Connection device |
Also Published As
Publication number | Publication date |
---|---|
TW202334835A (en) | 2023-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7412544B2 (en) | Reconfigurable USB I/O device persona | |
US6779083B2 (en) | Security for logical unit in storage subsystem | |
US7657727B2 (en) | Security for logical unit in storage subsystem | |
US7043575B2 (en) | Bus function authentication method, apparatus and computer program | |
US7529860B2 (en) | System and method for configuring an endpoint based on specified valid combinations of functions | |
US20080276012A1 (en) | Driver Loading via a PnP Device | |
JP4671353B2 (en) | Storage apparatus and control method thereof | |
US9223734B2 (en) | Switch with synthetic device capability | |
JP2006522414A (en) | Virtual Peripheral Component Interconnect Multifunction Device | |
EP2892212B1 (en) | Micro server and method of allocating a mac address | |
JP2003316713A (en) | Storage device system | |
US11995019B2 (en) | PCIe device with changeable function types and operating method thereof | |
US11928070B2 (en) | PCIe device | |
US11983136B2 (en) | PCIe device and operating method thereof | |
TW202240414A (en) | Pcie function and operating method thereof | |
US20230259484A1 (en) | Universal serial bus control device and control method thereof | |
US20050125538A1 (en) | Assigning logical storage units to host computers | |
TWI829378B (en) | Universal serial bus control device and control method therefore | |
US7464228B2 (en) | System and method to conserve conventional memory required to implement serial ATA advanced host controller interface | |
JP3509062B2 (en) | Remote access method and data processing system | |
US20240256320A1 (en) | Systems and methods for peripheral device control virtualization | |
US20240256319A1 (en) | Systems and methods for remote peripheral device control virtualization | |
US20230350824A1 (en) | Peripheral component interconnect express device and operating method thereof | |
JP2001023281A (en) | Magnetic disk device |