With kexts, macOS would evaluate all candidate drivers and then load the most appropriate for the hardware.
But with dexts, what I observe is that all matching drivers are started. So for example, if I create two distinct dexts that will match to a USB device, both are loaded as well as any kext that also matches the device. This means that it appears to be impossible to implement the equivalent as a codeless kext in DriverKit.
How can I avoid this race condition, and ensure that the dext takes priority over a kext?
FWIW, in the specific case we have an external device that when placed in to an update mode gets assigned to the macOS Bluetooth driver (macOS 11.2 kext), which then try to use it as a wireless adapter. This stops our app from running and also breaks the Mac's Bluetooth connections in the process. We want to stop the Bluetooth stack from binding to this device.
But with dexts, what I observe is that all matching drivers are started. So for example, if I create two distinct dexts that will match to a USB device, both are loaded as well as any kext that also matches the device. This means that it appears to be impossible to implement the equivalent as a codeless kext in DriverKit.
How can I avoid this race condition, and ensure that the dext takes priority over a kext?
FWIW, in the specific case we have an external device that when placed in to an update mode gets assigned to the macOS Bluetooth driver (macOS 11.2 kext), which then try to use it as a wireless adapter. This stops our app from running and also breaks the Mac's Bluetooth connections in the process. We want to stop the Bluetooth stack from binding to this device.