Page MenuHomeFreeBSD

bthid: Add Bluetooth HID bus driver and hidbus transport driver
Needs ReviewPublic

Authored by majedalkhaleefah_gmail.com on Aug 24 2026, 5:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 6, 3:59 AM
Unknown Object (File)
Thu, Oct 1, 8:51 AM
Unknown Object (File)
Thu, Oct 1, 4:23 AM
Unknown Object (File)
Mon, Sep 21, 3:37 PM
Unknown Object (File)
Sun, Sep 20, 6:07 AM
Unknown Object (File)
Fri, Sep 18, 3:47 AM
Unknown Object (File)
Thu, Sep 17, 3:02 AM
Unknown Object (File)
Wed, Sep 16, 10:04 PM
Subscribers

Details

Reviewers
obiwac
wulf
emax
Summary

Add a new kernel transport driver (bthid) and bus driver (bthidbus)
to interface Bluetooth HID devices directly with the hid subsystem.

bthidbus exposes a character device interface allowing a userland
process to pass established sockets and device info to the kernel
via ioctl. bthid attaches to bthidbus as a child device, routing
incoming HID reports from the interrupt socket into hidbus.

Connection establishment (pairing, SDP querying) is handled entirely
in userland; this driver only takes ownership of already-connected
sockets.

This is currently a work in progress. I still need to implement a way for userspace to send commands to disconnect devices as well as detecting when devices disconnect.

Test Plan

Tested using a Nintendo Switch Pro Controller and Dualsense. Monitored inputs via evtest and testgamecontroller. The Switch Pro Controller successfully connects and uses the hgame driver. The Dualsense also connects and uses the hgame driver, but no inputs are actually detected. This is likely due to a mismatch between the report descriptor and the actual format of the packets being sent.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped