You should write a device lower filter that sits below bthusb. You are not allowed to touch hardware in AddDevice, instead implement the firmware download in EvtDevicePrepareHardware().
bluetooth USB dongle firmware download
I need to develop Bluetooth USB driver for my host controller.
Windows generic adapter driver (with bthusb.sys) should be used, but it has no firmware download function.
Should I develop new USB driver instead bthusb.sys(refer uart sample)or any way to add firmware download function based on Windows generic adapter driver?
Windows Hardware Performance
2 additional answers
Sort by: Most helpful
-
troy zhu 21 Reputation points
2022-11-29T08:12:05.277+00:00 can I put firmware download in filter driver's deviceAdd function,
Like the following sample code ?
Thank you for any help -
troy zhu 21 Reputation points
2022-11-30T02:16:42.14+00:00 Thank you
May I register the prepare hardware function in the bluetooth filter driver like the following code?
DriverEntry{
WDF_DRIVER_CONFIG_INIT(
&DriverConfig,
BthEchoSrvEvtDriverDeviceAdd
);BthEchoSrvEvtDriverDeviceAdd
{
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
pnpPowerCallbacks.EvtDevicePrepareHardware = BthFirmwareDownloadAndDeviceReset;
}The usb driver in bthusb.sys has AddDevice, BthEchoSrvEvtDriverDeviceAdd was just a patch for it
download bluetooth controller firmware and restart the chip.