Some Bluetooth controllers may expose hci0 even when the firmware
initialization has not completed correctly. In that state, the init
script may report success but bluetoothd cannot use the controller.
Validate the controller through the kernel management interface before
accepting the initialization as successful. This matches the interface
used by bluetoothd and catches controllers that are visible through HCI
but not registered in MGMT yet.
Use a timeout for the MGMT query so a broken controller state cannot
block the init script instead of falling back to the retry loop.
https://onedigi.atlassian.net/browse/DEL-9512
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
Consolidate the init script for platforms based on the same driver with
the same logic.
The btbmc and hciuart drivers are used in the ccmp1 and cc95.
The btnxpuart driver is used in the cc91 and cc93.
The btdigi driver is used in the cc8 platforms with the qca65x4 driver.
https://onedigi.atlassian.net/browse/DEL-9949
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>