From nobody Thu Feb 20 10:15:46 2025 X-Original-To: bluetooth@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz8Kb0GgFz5nfy7 for ; Thu, 20 Feb 2025 10:15:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yz8KZ6kwbz3bHM for ; Thu, 20 Feb 2025 10:15:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740046547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+NXlncZDGqWoffxCUT3Wg6ynXyB6xHo1qVOB6mA81Q8=; b=hsREX03HH4S4OP4IE16Qw9e5GcfBhm9Xf+pxomoYtQ63Vdy+gs4CAj25HtmaxCoB08oxst aNaOHVLvsvxz/4+Czke4/JemHeTJXpQ/1wbhorOs+6E00RSrwBiNINGIIADyVNhMKzGXov M/JohPCGam2CpwBPYX7CysMWN9IPNQQJ1grtG8IBfL9RFnlrBfQmO0caPFcTc2KiUM+75A FKRoLqo02+0wrV82sSruQ1Y0mbfaFXi4E6heLa/uhFN4Kim1AOSVB5mK6c1v/ymGCb5Hob b1au0asB18vpAmDuXxpOP881z6qLmyHB5nUr+WVpJdUDwNUBbL1SUwTeiZgY0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740046547; a=rsa-sha256; cv=none; b=OeAlQHmlRr1puBGyuhCDt7TqlCjz9t8sbum9/62x6X0H95/QYD5IoJ+BL2GNiF3qLvxnz4 MzHHVAZLhDgH+0RkS8J27IzhilRvv694ulfFp/8J9gQFXY7cKy47EJz/xc1L0KkWbmOTvp hyGq7PMP6mE/6mDhTG4UbsJzy2fRg7xCrDv/JMlfpbBmmhh2i+Z5ws/Diy2+/xMYJFHBLY qK7M7DGPYVdI+HcnQwh3nUeAhKJSQG08Hi0PpvjgaJRWsIjgY8b8NsZ0h2vfQ8cG44TRd4 +bkbyPuAcCuFIe3Y7qPQKf0F78BGMClBbgX0U7hcKmw4MzAkkqgpbNVWCM/f6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740046547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+NXlncZDGqWoffxCUT3Wg6ynXyB6xHo1qVOB6mA81Q8=; b=VmN3rwyH5PdmsQVSQr2TnvMomwFyjwxzzJGQnMbIYy5Gj3deuP9LULBSE5omvEW/RCUeyO upa0H+nn5V2Axn8mF4dAUA4p+qqhy5FsVxx2ABUbfi3LhYWE7sz5E4QVQkuaNpKXV5rlE6 aQOEINM0otRIXgrzLSUk24ZdGfexe2UGkI3zrXRPftIO7LjTEhLT9g8mnmFY88r8PZSkmJ ObIf8U1B4t1OLrCQ+Dh/toMD3jxVALfKGo2FMt+tOiAwMvUEHI6ZVCg1is6UGnatNDRtLJ zn++Pv0tkAszG/dc/Z6pVyqbmDFymUokdPk+Cv3O6A01eiLXA9YX30YJxiAwwQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yz8KZ6C0sznTc for ; Thu, 20 Feb 2025 10:15:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 51KAFklo096804 for ; Thu, 20 Feb 2025 10:15:46 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 51KAFkMx096803 for bluetooth@FreeBSD.org; Thu, 20 Feb 2025 10:15:46 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bluetooth@FreeBSD.org Subject: [Bug 265066] ng_hci: Add support for Bluetooth secure simple pairing Date: Thu, 20 Feb 2025 10:15:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: feature X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: malte@wendernes.com X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bz@FreeBSD.org X-Bugzilla-Flags: mfc-stable14+ X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Using Bluetooth in FreeBSD environments List-Archive: https://lists.freebsd.org/archives/freebsd-bluetooth List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bluetooth@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265066 Malte Andersson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |malte@wendernes.com --- Comment #15 from Malte Andersson --- The Good, the Bad and the Ugly - that pretty much sums up my experience with the Bluetooth stack in FreeBSD. Initially, when I started using FreeBSD 14-current in the summer of 2022, I didn't need a functional Bluetooth stack. I used the Logitech Unifying rece= iver to get my MX Keys and MX Master working on the system. Since this keyboard = and mouse support up to three connected computers, I could use the Bluetooth functionality on the MX's with other computers. One day, I discovered I had lost the pairing between the Unifying receiver = and my MX products. I first checked the handbook to set up Bluetooth, but the system never created the ubt node. Although the computer's local Bluetooth module was correctly detected as a USB device. I discovered that the Blueto= oth stack in FreeBSD wasn't compatible with newer firmware revisions. I tried progressively older revisions until I found a semi-functional version. Following the handbook, I could scan for remote Bluetooth devices, but none= of the devices I had activated for advertising showed up. While digging through the hccontrol source code, I discovered support for BLE scanning, but these commands weren't mentioned in the handbook, and the man-page didn't clearly describe how to use them. While it was possible to scan for remote Bluetooth devices in pairing/advertising mode, the local Bluetooth module frequently crashed - likely due to firmware issues. After extensive testing, I finally found the right sequence of steps to reduce the frequency of crashes. When I reached this point, I tested "LE_Connect" under hccontrol. This prov= ided a handle but nothing else. The remote device appeared briefly under "Read_Connection_List," but this pseudo-connection was lost when the remote device left advertising mode. This led me to follow Andreas approach. I wrote userspace software, created= a daemon, and patched the kernel. However, I still experienced ongoing issues with the Bluetooth module in my notebook crashing - sometimes after the fir= st HCI command, sometimes after several hours. I also received numerous warnin= gs in "/var/log/messages" related to the HCI node, along with multiple consecu= tive timeouts. This situation forced me to develop a new Bluetooth stack. Running in users= pace with the help of libusb, it supports firmware loading and manages everything related to BLE from 4.0 to 5.4, including LE audio. My recommendation for FreeBSD would be to implement the Bluetooth stack in userspace. I wrote my implementation from scratch without external librarie= s. It's POSIX-compliant where possible, and all BLE functionality works without any issues. The implementation I developed currently has limited hardware support, but adding more VID and PID entries and including the necessary firmware is all that's needed. I think it is much easier to handle everything if it exists = in the same place, like fully kernel based or fully user space based. If it is splitted it only creates more friction when a upgrade is needed.=20 And by having it fully user space based makes it ridiculously easy to provi= de upgrade for newer specifications without the need to make changes in the kernel. You can also create a configuration file where you can specify the = VID, PID and path to the firmware. And that makes it easy for users to easily en= able support for hardware that does not currently exist in the list.=20 Yeah, and I have since the summer of 2022 worked on my own fork of FBSD 14-current and moved the majority of all USB based drivers from the kernel = to the user space. This also include the 802.11 stack which allowed me to implement support for n/ac/ax in the user space. I'm currently working on a kernel module wrapper that also will allow me to implement support for PCI(= M.2) NIC in the user space. --=20 You are receiving this mail because: You are on the CC list for the bug.=