For understanding Haiku Bluetooth stack - local BT device, driver part

Ahoy @waddlesplash !

I would like to know better, or rather say, understand better, what should be done to local BT devices would be detectable by Haiku kernel (or Bluetooth Kit ?) and come up in Bluetooth preflet ?

I checked the wiki page for BT support ( HardwareInfo → Bluetooth ), where I saw enlisted the Bt stack’s parts as implemented in Haiku.
I found the driver part (at least I assume so)

H2generic under
src/add-ons/kernel/drivers/bluetooth
The USB driver, implementing the H2 transport Bluetooth kit under src/kit/bluetooth C++ implementation based on JSR82 api

So the JSR82 api , that is mainly developed for mobile phones, to have BT support, is the base for Haiku driver implementation, but written in C++, if I understood well.
Also there is bluetooth_server, that I can launch via Bluetooth preflet, and via this service the BT device would be detectable, changed the setting, register internal BT devices, paired them with external BT devices – this is actually works in my Haiku, but found no detectable BT hw device - at all.

Bluetooth Server under
src/servers/bluetooth
Basically handling opened devices (local connected, physically in our system) and forwarding kit calls to them

It’s clear.

01)) So, I checked is there any BT device driver active in the running system on my Dell Precision M6800

   user  ~    02:42    listimage kernel|grep drivers
  123 0xffffffff8215a000 0xffffffff82162000     0          0 /boot/system/add-ons/kernel/drivers/disk/virtual/ram_disk
  139 0xffffffff82163000 0xffffffff82166000     0          0 /boot/system/add-ons/kernel/drivers/dev/pty
  141 0xffffffff82167000 0xffffffff82168000     0          0 /boot/system/add-ons/kernel/drivers/dev/null
  142 0xffffffff82519000 0xffffffff8251a000     0          0 /boot/system/add-ons/kernel/drivers/dev/dprintf
  143 0xffffffff8251b000 0xffffffff8251d000     0          0 /boot/system/add-ons/kernel/drivers/dev/console
  737 0xffffffff821c1000 0xffffffff821c3000     0          0 /boot/system/add-ons/kernel/drivers/power/acpi_button
 4548 0xffffffff8256b000 0xffffffff8256f000     0          0 /boot/system/add-ons/kernel/drivers/wmi
 4882 0xffffffff821c4000 0xffffffff821c7000     0          0 /boot/system/add-ons/kernel/drivers/power/acpi_battery
 4990 0xffffffff82570000 0xffffffff82572000     0          0 /boot/system/add-ons/kernel/drivers/power/acpi_thermal
 6778 0xffffffff80375000 0xffffffff80404000     0          0 /boot/system/add-ons/kernel/drivers/dev/net/ipro1000
 7155 0xffffffff80794000 0xffffffff8079c000     0          0 /boot/system/add-ons/kernel/drivers/dev/graphics/radeon_hd
 7172 0xffffffff8079f000 0xffffffff807aa000     0          0 /boot/system/add-ons/kernel/drivers/dev/graphics/intel_extreme
 7182 0xffffffff80409000 0xffffffff8040b000     0          0 /boot/system/add-ons/kernel/drivers/dev/graphics/framebuffer
 7731 0xffffffffb376a000 0xffffffffb377b000     0          0 /boot/system/add-ons/kernel/drivers/dev/input/usb_hid
 8127 0xffffffff82610000 0xffffffff82613000     0          0 /boot/system/add-ons/kernel/drivers/dev/bus/usb_raw
 8295 0xffffffffb37d1000 0xffffffffb37df000     0          0 /boot/system/add-ons/kernel/drivers/dev/audio/hmulti/hda
 8429 0xffffffff8214a000 0xffffffff8214b000     0          0 /boot/system/add-ons/kernel/drivers/dev/oss/oss_loader
   user  ~    02:54   

02)) I also went after : Is there any generic BT device shown on OS level, shipped with Haiku x86_64, and I looked into the default directories for devices

   user  ~    02:54    ls -l /dev
total 0
drwxr-xr-x 1 user root      0 júl.    4 22:36 acpi
drwxr-xr-x 1 user root      0 júl.    4 22:37 audio
drwxr-xr-x 1 user root      0 júl.    5 02:35 bluetooth
drwxr-xr-x 1 user root      0 júl.    4 20:37 bus
crw-r--r-- 1 user root      0 júl.    4 22:36 console
drwxr-xr-x 1 user root      0 júl.    4 22:36 disk
crw-r--r-- 1 user root      0 júl.    4 22:36 dprintf
drwxr-xr-x 1 user root      0 júl.    4 22:36 dvb
crw-r--r-- 1 user root      0 júl.    4 22:36 full
drwxr-xr-x 1 user root      0 júl.    4 20:36 graphics
drwxr-xr-x 1 user root      0 júl.    4 20:37 input
drwxr-xr-x 1 user root      0 júl.    4 22:36 midi
drwxr-xr-x 1 user root      0 júl.    4 22:36 misc
crw-r--r-- 1 user root      0 júl.    4 22:37 mixer
drwxr-xr-x 1 user root      0 júl.    4 20:36 net
crw-r--r-- 1 user root      0 júl.    4 22:36 null
drwxr-xr-x 1 user root      0 júl.    4 22:36 oss
drwxr-xr-x 1 user root      0 júl.    4 22:36 ports
drwxr-xr-x 1 user root      0 júl.    4 22:36 power
drwxr-xr-x 1 user root      0 júl.    4 22:36 pt
crw-r--r-- 1 user root      0 júl.    4 22:36 ptmx
crw-r--r-- 1 user root      0 júl.    4 22:36 random
crw-r--r-- 1 user root      0 júl.    4 22:37 sndstat
drwxr-xr-x 1 user root      0 júl.    4 22:36 tt
crw-r--r-- 1 user root      0 júl.    4 22:36 tty
crw-r--r-- 1 user root      0 júl.    4 22:36 urandom
crw-r--r-- 1 user root      0 júl.    4 22:36 zero
   user  ~    02:55    ls -l /dev/bluetooth/
total 0
drwxr-xr-x 1 user root 0 júl.    5 02:35 h2
drwxr-xr-x 1 user root 0 júl.    5 02:35 h3
drwxr-xr-x 1 user root 0 júl.    5 02:35 h4
drwxr-xr-x 1 user root 0 júl.    5 02:35 h5
   user  ~    02:55    ls -l /dev/bluetooth/h*
/dev/bluetooth/h2:
total 0

/dev/bluetooth/h3:
total 0

/dev/bluetooth/h4:
total 0

/dev/bluetooth/h5:
total 0
   user  ~    02:55    

So seemed directories prepared for BT devices, but none of them existed …

03)) Now then I looked after the h2generic USB driver existed or not, among drivers, which shipped with the Haiku x86_64 (it is hrev59820 actually)

   user  ~    02:55    ls -l /boot/system/add-ons/kernel/drivers/dev/bluetooth/
total 0
dr-xr-xr-x 1 user root 0 júl.    1 08:20 h2
   user  ~    03:36    ls -l /boot/system/add-ons/kernel/drivers/dev/bluetooth/h2/
total 1
lr-xr-xr-x 1 user root 22 júl.    1 08:20 h2generic -> ../../../bin/h2generic
   user  ~    03:36    ls -l h2generic
ls: cannot access 'h2generic': No such file or directory
   user  ~    03:37    ls -l /boot/system/add-ons/kernel/drivers
total 26
dr-xr-xr-x 1 user root     0 júl.    1 08:20 bin
dr-xr-xr-x 1 user root     0 júl.    1 08:20 dev
dr-xr-xr-x 1 user root     0 júl.    1 08:20 disk
dr-xr-xr-x 1 user root     0 júl.    1 08:20 graphics
dr-xr-xr-x 1 user root     0 júl.    1 08:20 hyperv
dr-xr-xr-x 1 user root     0 júl.    1 08:20 input
dr-xr-xr-x 1 user root     0 júl.    1 08:20 network
dr-xr-xr-x 1 user root     0 júl.    1 08:20 power
dr-xr-xr-x 1 user root     0 júl.    1 08:20 sensor
-r-xr-xr-x 1 user root 26547 júl.    1 08:16 wmi
   user  ~    03:38    ls -l /boot/system/add-ons/kernel/drivers/bin/h2generic
-r-xr-xr-x 1 user root 32179 júl.    1 08:17 /boot/system/add-ons/kernel/drivers/bin/h2generic
   user  ~    03:38    

Right, h2generic USB bus BT driver implementation finally exist within Haiku. So I might unlucky with my BT device.

   user  ~    22:42    listusb
0781:5595 /dev/bus/usb/0/15 "SanDisk Corp." "Ultra USB 3.0" ver. 0100
04e8:6300 /dev/bus/usb/0/16 "Samsung Electronics Co., Ltd" "Flash Drive FIT" ver. 1100
046d:c52b /dev/bus/usb/0/4/0 "Logitech, Inc." "Unifying Receiver" ver. 1201
046d:c52b /dev/bus/usb/0/4/1 "Logitech, Inc." "Unifying Receiver" ver. 1201
05e3:0608 /dev/bus/usb/0/4/hub "Genesys Logic, Inc." "Hub" ver. 7764
0000:0000 /dev/bus/usb/0/hub "HAIKU Inc." "XHCI RootHub" ver. 0300
1bcf:2984 /dev/bus/usb/1/0/4 "Sunplus Innovation Technology Inc." "Laptop_Integrated_Webcam_HD" ver. 3503
8087:8008 /dev/bus/usb/1/0/hub "Intel Corp." "Integrated Rate Matching Hub" ver. 0004
0000:0000 /dev/bus/usb/1/hub "HAIKU Inc." "EHCI RootHub" ver. 0200
413c:8143 /dev/bus/usb/2/0/4 "Dell Computer Corp." "Broadcom BCM20702A0 Bluetooth" ver. 0112 
0a5c:5800 /dev/bus/usb/2/0/7 "Broadcom Corp." "BCM5880 Secure Applications Processor" ver. 0101
8087:8000 /dev/bus/usb/2/0/hub "Intel Corp." "Integrated Rate Matching Hub" ver. 0004
0000:0000 /dev/bus/usb/2/hub "HAIKU Inc." "EHCI RootHub" ver. 0200
   user  ~    02:36    listusb -v /dev/bus/usb/2/0/4
[Device /dev/bus/usb/2/0/4]
    Class .................. 0xff Vendor Specific Class ()
    Subclass ............... 0x01 (Unknown) (255:1:0)
    Protocol ............... 0x01 (Unknown) (255:1:1)
    Max Endpoint 0 Packet .. 64
    USB Version ............ 2.0
    Vendor ID .............. 0x413c (Dell Computer Corp.)
    Product ID ............. 0x8143 (Broadcom BCM20702A0 Bluetooth)
    Product Version ........ 0x0112
    Manufacturer String .... "Broadcom Corp"
    Product String ......... "BCM20702A0"
    Serial Number .......... "3052CBEA81BC"
    [Configuration 0]
        Configuration String . ""
        [Interface 0]
            [Alternate 0 active]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 16 bytes
                    Interval ......... 1
                    Type ............. Interrupt
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 64 bytes
                    Interval ......... 1
                    Type ............. Bulk
                    Direction ........ Input
                [Endpoint 2]
                    MaxPacketSize .... 1x 64 bytes
                    Interval ......... 1
                    Type ............. Bulk
                    Direction ........ Output
        [Interface 1]
            [Alternate 0 active]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 0 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 0 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
            [Alternate 1]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 9 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 9 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
            [Alternate 2]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 17 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 17 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
            [Alternate 3]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 25 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 25 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
            [Alternate 4]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 33 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 33 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
            [Alternate 5]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0x01 (Unknown) (255:1:0)
                Protocol ........... 0x01 (Unknown) (255:1:1)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 49 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 49 bytes
                    Interval ......... 1
                    Type ............. Isochronous
                    Direction ........ Output
        [Interface 2]
            [Alternate 0 active]
                Class .............. 0xff Vendor Specific Class ()
                Subclass ........... 0xff Vendor Specific Class (Vendor Specific Subclass)
                Protocol ........... 0xff Vendor Specific Class (Vendor Specific Subclass, Vendor Specific Protocol)
                Interface String ... ""
                [Endpoint 0]
                    MaxPacketSize .... 1x 32 bytes
                    Interval ......... 1
                    Type ............. Bulk
                    Direction ........ Input
                [Endpoint 1]
                    MaxPacketSize .... 1x 32 bytes
                    Interval ......... 1
                    Type ............. Bulk
                    Direction ........ Output
        [Interface 3]
            [Alternate 0 active]
                Class .............. 0xfe Application Specific Interface ()
                Subclass ........... 0x01 Application Specific Interface (Device Firmware Update)
                Protocol ........... 0x01 Application Specific Interface (Device Firmware Update)
                Interface String ... ""
                [Descriptor 0]
                    Length ........... 0x09
                    Type ............. 0x21
                    Data ............. 05 88 13 40 00 10 01 
   user  ~    03:55    

… as it is Broadcom, and requires firmware to load to be opened/initialized/activated/detected (select the appropriate term!), and maybe requires to load Wifi card firmware before as well, to be detected, as if this specific one amongst Wifi/BT combo Broadcom devices that requires that too…

I dunno.

So, one thing I saw on Wiki page - FreeBSD was also enlisted among sources of development ..
… and as I know network devices uses FreeBSD/OpenBSD drives via FreeBSD compatibility layer of Haiku - a question came up to check

how about Broadcom BT devices support for FreeBSD, OpenBSD, and maybe NetBSD (as I saw some network stuff came from there)

To enable Broadcom Bluetooth on FreeBSD, load the ng_ubt and ubtbcmfw modules. Specific firmware must be loaded for most Broadcom controllers to function. The Bluetooth stack in FreeBSD uses the Netgraph framework, which requires manual configuration of system files. [1, 2]

OpenBSD removed its Bluetooth stack in 2014. Consequently, native Bluetooth is not supported, including Broadcom adapters. Broadcom Wi-Fi/Bluetooth combo cards require an alternate approach: Wi-Fi might work via the bwfm driver, but Bluetooth requires using a supported USB audio dongle or a wired connection. [1, 2, 3, 4, 5]

NetBSD supports many Broadcom Bluetooth USB adapters using the ubt(4) driver. However, Broadcom devices commonly require vendor-specific firmware to be uploaded to the controller before they can function. You can manage and load this firmware via the bcmfw tool found in pkgsrc.

Now in summary

I would like to know

A)) Is the BT driver would work like in any of BSD above, so need some BSD stuff to work my Broadcom device, or just need the proper firmwares ?

B)) If only the proper firmwares should be added to Haiku in a Broadcom hpkg, and I have those proper firmwares for Wifi Card and BT device supplied by Broadcom for Linux … is it suitable for Haiku as well? or needed a different one ?

C)) Or Haiku implementation does work quite different, and I slipped on somehing ?

Thank you in advance for any reply.