Bluetooth driver crash after firmware load

Hi All,
I am new to the driver stuff.
Normally BT driver load/unload firmware is fine and no issue with that. But issue comes when i am trying to trigger load/unload from inside the driver code.

While unloading radio firmware turning off BT interrupt and then doing unload operation similarly while loading firmware calling load and then enabling the BT interrupt.
But after loading the firmware its disabling the BT device…

Below are the last log messages where device is exiting fully:
PdoDevD0Exit: D0 → D4
FdoDevD0Exit D0-> D3

My question is:

  1. What are the things need to reset/on/off before turning the firmware load/unload? like interrupt etc… any other?
  2. How to understand HCI command and HCI event stuff?
  3. Understand the interrupt routine for driver? any sequence for in/out etc…

Thanks in advance.
Tany

Any help plz?

Little more about the issue and error logs proviced:
I am changing the BT switch off (default host will not unload BT firmware) and ON(default host will not unload BT firmware) through the BT setting in windows.
Once BT switch is turn off radio firmware gets unloaded and similarly while turning ON BT switch trying to load radio firmware…but its crashing before completely up.

Am I missing something to reset before unload/load of radio firmware??? any dependencies??

Below is TraceView logs in sequence of: Installed BT driver → BT switch OFF → BT switch ON (crashing here)…

https://github.com/Microsoft/Windows-driver-samples/files/2836179/Log_TraceView.txt

Thanks,

Tany

Any help guys?