Commit Graph
18 Commits
Author SHA1 Message Date
vighnesh-sawant 2cbf45bc81 Bluetooth: Fix L2capEndpoint::SendData() returning no of bytes sent
instead of status

Change-Id: Ic3668dec8f443853286d1c098a237c85a54a7ae4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11201
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-07-15 21:21:12 +00:00
vighnesh-sawant 94deadca17 Bluetooth: Refactor l2cap into two protocols l2cap and bluetooth
This commits splits the address handling into bluetooth protocol and
does the rest in l2cap. This is to allow for a different struct for sco
and l2cap.

Change-Id: I4c577691118613cd3be75eb7ef191fd2f07d742d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11181
Reviewed-by: waddlesplash <[email protected]>
2026-07-15 21:21:12 +00:00
vighnesh-sawant 95844c4f15 Bluetooth: Add hooks for SCO and HCI commands
Change-Id: Ib8ec5c7a7dc6245c4f69c7b2d4596bd5aca9b493
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11146
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-07-07 04:17:44 +00:00
vighnesh-sawant 7ded2f66c4 Bluetooth: Add scheduling of SCO tx to h2generic bluetooth driver
Change-Id: I298bee430a31272fe6aa6e2ba82ab1eec24d9363
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11145
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2026-07-07 04:17:44 +00:00
vighnesh-sawant 9401bd3698 Bluetooth: Add SCO rx in h2transactions in h2generic bluetooth driver
Change-Id: Id801857e3e22c52c120c3b54effa5111090d2b0d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11144
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-07-07 04:17:44 +00:00
vighnesh-sawant ca77470bdf Bluetooth: Add SCO tx in h2transactions in h2generic bluetooth driver
Change-Id: I74212f449204713449b0ce804029fc4b4a0af442
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11143
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-07-07 04:17:44 +00:00
vighnesh-sawant 7e713fa44e Bluetooth: Adds isochronous usb endpoint to bluetooth h2generic driver
This changes the driver to scan all usb interfaces.

Change-Id: Ieebbabe549ff126e4c3df1e33f2993c2da66bb1d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/11025
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-06-01 08:31:21 +00:00
vighnesh-sawant d0b0af0089 bluetooth: Split SdpServer into a different file
This is a refactor, SdpServer will have to do quite a bit of stuff and
it makes sense to split it from bluetooth_server, This does not change
any functionality except removing _USE_FAKE_SDP_SERVER macro which does
not seem to be of any use.

Change-Id: Ibbf2bbe1f59b88d68d2e7523a9a38840295ab050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10648
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-04-06 13:52:39 +00:00
vighnesh-sawant d910e4b2eb bluetooth: Fix L2capEndpoint::Shutdown() to close the socket in all
cases

Currently when a l2cap socket is in LISTEN state, shutdown only changes
it from LISTEN to BOUND, this change unbinds it also.

Change-Id: I7e5a10e453401fbed545bfc3da62a74ae6ee56b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10647
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-04-06 13:52:39 +00:00
vighnesh-sawant c122595a54 bluetooth: Make RemoteDevice::Authenticate actually pair after
connecting

Sends an auth request to the controller, if connection was initated by
us

Change-Id: I32af0a24b902d0223bb4e773258ea9e9749a899c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10527
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant aa864b9d41 bluetooth: Add support for SSP and refactor AcceptConnection and
CreateConnection

Move expecting commands from RemoteDevice::Authenticate to where they
are called.In SSP we expect for the events after ConnectionComplete.
For the state machine, LINK_KEY_NOTIFY tells us the end of the pairing
in both pairings, so we clear all expected events there for the ones we added in
ConnectionComplete, In SimplePairingComplete we clear the ones added
in IOCapabilityRequest. Tested with both bluetooth 2.1 and older pairing.

Change-Id: Ia208506c9f289d9f44dc3b8b0e4cd8a726a5d726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10526
Reviewed-by: waddlesplash <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant dbf6744326 bluetooth: Prevent duplicates in RemoteDevicesView
Loops through and compares baddr,if its matching does not add it again
and frees it.

Change-Id: I2590852fb9c4a9f21facf5a600f45e11aeecb4d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10494
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant e7eb60f1a7 bluetooth: Implement EIR parsing for HCI_EVENT_EXTENDED_INQUIRY_EVENT
This parses only EIR_NAME_SHORT and EIR_NAME_COMPLETE, others are not
yet usefull, adds a way to fetch the cached friendly name and adds a
friendlyName field to RemoteDevice. Refactors DeviceListItem to work on
RemoteDevice as it's only being used for that.Also adds a check if the
cached name is complete or not. If not ask for the complete name.

Change-Id: I7e37fb9cf44cb5598ef348fdd4d781c5ae04e24e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10489
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-16 12:19:26 +00:00
vighnesh-sawant c0336fd788 bluetooth: Add support for HCI_EVENT_EXTENDED_INQUIRY_RESULT
Follow up of a4e1f4d8ce,
this contains only response per event.

Change-Id: I6582f9530a273699048c04481fa0ef4a31a315ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10486
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-12 17:01:16 +00:00
vighnesh-sawant 230470d6d4 bluetooth: Add support for HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
Follow up of a4e1f4d8ce, details given
in that commit message on parsing of this event message

Change-Id: Icc0b54bdafe3cb167553d2fda3f62762d2d2595e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10485
Reviewed-by: waddlesplash <[email protected]>
2026-03-12 17:01:16 +00:00
vighnesh-sawant a4e1f4d8ce bluetooth: Fixes HCI_EVENT_INQUIRY_RESULT parsing when multiple
responses are returned

According to the Bluetooth Core Specification, Vol. 4, Part E, 7.7.2, for HCI_Inquiry_Result a struct of arrays is returned, and not
an array of structs. The previous code parsed it as if it is an array of
structs, so fixed that. Refactored MessageReceived so that that its
easier to implement HCI_EVENT_EXTENDED_INQUIRY_RESULT and
HCI_EVENT_INQUIRY_RESULT_WITH_RSSI going forward.

Change-Id: I9c258d1e26a4b6aa33d7acf730bddaeccf5d754b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10408
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-10 15:44:14 +00:00
vighnesh-sawant b097619769 netresolv: Add support for AI_V4MAPPED in ai_flags in getaddrinfo
Ports over the following commits from FreeBSD:
https://github.com/freebsd/freebsd-src/commit/b848a37d4eddb432629a799713cf6fb6f0fd8c3c
https://github.com/freebsd/freebsd-src/commit/2cff354f1a56af10ad02164a9ee38c013ac80688

Fixes #14323.

Change-Id: If75642a45fc76b50d4377e5a11cdb1ee64ab40ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10396
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-02-28 09:59:06 +00:00
vighnesh-sawant 902921a554 netresolv: Add support for AI_V4MAPPED in ai_flags in getaddrinfo
Ports over the following commits from FreeBSD:
https://github.com/freebsd/freebsd-src/commit/b848a37d4eddb432629a799713cf6fb6f0fd8c3c
https://github.com/freebsd/freebsd-src/commit/2cff354f1a56af10ad02164a9ee38c013ac80688

Fixes #14323.

Change-Id: I40e6f0ee132eb2d17d8ec66ba0e28566e8695d18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10358
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-02-26 11:08:16 +00:00