diff mbox series

[BlueZ] shared/bap: make BT_BAP_* direction defines valid bitmasks

Message ID 70a822d15a7e82ec6dc83c4b42e54799c3e45e05.1718457098.git.pav@iki.fi (mailing list archive)
State Superseded
Headers show
Series [BlueZ] shared/bap: make BT_BAP_* direction defines valid bitmasks | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Pauli Virtanen June 15, 2024, 1:13 p.m. UTC
The directions appear to be intended as bitmasks, as
bt_bap_stream_io_dir() will bitwise or linked stream directions.

Fix the defines to be separate bits.

Fixes confusion due to BT_BAP_BCAST_SOURCE == BT_BAP_SINK|BT_BAP_SOURCE,
which causes e.g. unicast transports to be in PENDING state after QoS
although this does not make sense for BAP unicast Client.
---
 src/shared/bap-defs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

bluez.test.bot@gmail.com June 15, 2024, 3:04 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=862280

---Test result---

Test Summary:
CheckPatch                    PASS      0.43 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      24.74 seconds
BluezMake                     PASS      1719.34 seconds
MakeCheck                     PASS      13.74 seconds
MakeDistcheck                 PASS      180.21 seconds
CheckValgrind                 PASS      253.79 seconds
CheckSmatch                   PASS      357.19 seconds
bluezmakeextell               PASS      121.15 seconds
IncrementalBuild              PASS      1470.74 seconds
ScanBuild                     PASS      1034.61 seconds



---
Regards,
Linux Bluetooth
Luiz Augusto von Dentz June 17, 2024, 1:44 p.m. UTC | #2
Hi Pauli,

On Sat, Jun 15, 2024 at 9:14 AM Pauli Virtanen <pav@iki.fi> wrote:
>
> The directions appear to be intended as bitmasks, as
> bt_bap_stream_io_dir() will bitwise or linked stream directions.
>
> Fix the defines to be separate bits.
>
> Fixes confusion due to BT_BAP_BCAST_SOURCE == BT_BAP_SINK|BT_BAP_SOURCE,
> which causes e.g. unicast transports to be in PENDING state after QoS
> although this does not make sense for BAP unicast Client.

Nice catch.

> ---
>  src/shared/bap-defs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/shared/bap-defs.h b/src/shared/bap-defs.h
> index 2467e816f..75e6950ea 100644
> --- a/src/shared/bap-defs.h
> +++ b/src/shared/bap-defs.h
> @@ -17,8 +17,8 @@
>
>  #define BT_BAP_SINK                    0x01
>  #define        BT_BAP_SOURCE                   0x02
> -#define        BT_BAP_BCAST_SOURCE             0x03
> -#define        BT_BAP_BCAST_SINK               0x04
> +#define        BT_BAP_BCAST_SOURCE             0x04
> +#define        BT_BAP_BCAST_SINK               0x08

To make it clearer I guess we could use the BIT macro to define these.

>  #define BT_BAP_STREAM_TYPE_UCAST       0x01
>  #define        BT_BAP_STREAM_TYPE_BCAST        0x02
> --
> 2.45.2
>
>
diff mbox series

Patch

diff --git a/src/shared/bap-defs.h b/src/shared/bap-defs.h
index 2467e816f..75e6950ea 100644
--- a/src/shared/bap-defs.h
+++ b/src/shared/bap-defs.h
@@ -17,8 +17,8 @@ 
 
 #define BT_BAP_SINK			0x01
 #define	BT_BAP_SOURCE			0x02
-#define	BT_BAP_BCAST_SOURCE		0x03
-#define	BT_BAP_BCAST_SINK		0x04
+#define	BT_BAP_BCAST_SOURCE		0x04
+#define	BT_BAP_BCAST_SINK		0x08
 
 #define BT_BAP_STREAM_TYPE_UCAST	0x01
 #define	BT_BAP_STREAM_TYPE_BCAST	0x02