Home | History | Annotate | Download | only in utils

Lines Matching refs:node

30       id_func: [USBNode -> bool] is a function that can be run on a node
31 to determine if the node represents this type of hub.
45 def IsType(self, node):
46 """Determines if the given Node is a hub of this type.
49 node: [USBNode] Node to check.
51 return self._id_func(node)
53 def GetPhysicalPortToNodeTuples(self, node):
57 node: [USBNode] Node representing a hub of this type.
64 ValueError: If the given node isn't a hub of this type.
66 if self.IsType(node):
67 for res in self._GppHelper(node, self._v2p_port):
70 raise ValueError('Node must be a hub of this type')
72 def _GppHelper(self, node, mapping):
76 rooted at the given node and the mapping between virtual and physical
80 node: [USBNode] Root of tree to search for devices.
85 and the Node connected to it.
88 if node.HasPort(virtual):
90 for res in self._GppHelper(node.PortToDevice(virtual), physical):
93 yield (physical, node.PortToDevice(virtual))
95 def _is_plugable_7port_hub(node):
96 """Check if a node is a Plugable 7-Port Hub
101 if '1a40:0101' not in node.desc:
103 if not node.HasPort(4):
105 return '1a40:0101' in node.PortToDevice(4).desc
112 def _is_plugable_7port_usb3_part2_hub(node):
113 """Check if a node is the "USB2 branch" of
118 if '2109:2811' not in node.desc:
120 if not node.HasPort(1):
122 return '2109:2811' in node.PortToDevice(1).desc
124 def _is_plugable_7port_usb3_part3_hub(node):
125 """Check if a node is the "USB3 branch" of
130 if '2109:8110' not in node.desc:
132 if not node.HasPort(1):
134 return '2109:8110' in node.PortToDevice(1).desc
136 def _is_keedox_hub(node):
137 """Check if a node is a Keedox hub.
141 if '0bda:5411' not in node.desc:
143 if not node.HasPort(4):
145 return '0bda:5411' in node.PortToDevice(4).desc
147 def _is_via_hub(node):
148 """Check if a node is a Via Labs hub.
152 if '2109:2812' not in node.desc and '2109:0812' not in node.desc:
154 if not node.HasPort(4):
156 return ('2109:2812' in node.PortToDevice(4).desc or
157 '2109:0812' in node.PortToDevice(4).desc)