Merge pull request #445 from google/gbg/driver-probe-fix

fix intel driver probe
This commit is contained in:
Gilles Boccon-Gibod
2024-03-12 12:51:08 -07:00
committed by GitHub
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -53,8 +53,12 @@ class Driver(common.Driver):
self.host = host
@classmethod
async def for_host(cls, host, force=False): # type: ignore
return cls(host)
async def for_host(cls, host): # type: ignore
# Only instantiate this driver if explicitly selected
if host.hci_metadata.get("driver") == "intel":
return cls(host)
return None
async def init_controller(self):
self.host.ready = True
+1 -1
View File
@@ -498,7 +498,7 @@ class Host(AbortableEventEmitter):
def controller(self, controller) -> None:
self.set_packet_sink(controller)
if controller:
controller.set_packet_sink(self)
self.set_packet_source(controller)
def set_packet_sink(self, sink: Optional[TransportSink]) -> None:
self.hci_sink = sink
+1 -1
View File
@@ -10,7 +10,7 @@ used with particular HCI controller.
When the transport for an HCI controller is instantiated from a transport name,
a driver may also be forced by specifying ``driver=<driver-name>`` in the optional
metadata portion of the transport name. For example,
``usb:[driver=-rtk]0`` indicates that the ``rtk`` driver should be used with the
``usb:[driver=rtk]0`` indicates that the ``rtk`` driver should be used with the
first USB device, even if a normal probe would not have selected it based on the
USB vendor ID and product ID.