2023-09-27 14:29:00

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH 0/1] Bluetooth: ISO: Allow binding a bcast listener to 0 bises

Some Broadcast scenarios require for a broadcast listener to listen for
a broadcaster only for PA sync.

This patch adds support for binding to a broadcaster address without
asking for any BIS to sync with.

Iulia Tanasescu (1):
Bluetooth: ISO: Allow binding a bcast listener to 0 bises

net/bluetooth/hci_conn.c | 2 +-
net/bluetooth/iso.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)


base-commit: 091e25d6b54992d1d702ae91cbac139d4c243251
--
2.39.2


2023-09-27 17:03:22

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH 1/1] Bluetooth: ISO: Allow binding a bcast listener to 0 bises

This makes it possible to bind a broadcast listener to a broadcaster
address without asking for any BIS indexes to sync with.

Signed-off-by: Iulia Tanasescu <[email protected]>
---
net/bluetooth/hci_conn.c | 2 +-
net/bluetooth/iso.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index e62a5f368a51..c4395d34da70 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2138,7 +2138,7 @@ int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
} pdu;
int err;

- if (num_bis > sizeof(pdu.bis))
+ if (num_bis < 0x01 || num_bis > sizeof(pdu.bis))
return -EINVAL;

err = qos_set_big(hdev, qos);
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 2132a16be93c..8ab7ea5ebedf 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -790,8 +790,7 @@ static int iso_sock_bind_bc(struct socket *sock, struct sockaddr *addr,
BT_DBG("sk %p bc_sid %u bc_num_bis %u", sk, sa->iso_bc->bc_sid,
sa->iso_bc->bc_num_bis);

- if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc) ||
- sa->iso_bc->bc_num_bis < 0x01 || sa->iso_bc->bc_num_bis > 0x1f)
+ if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc))
return -EINVAL;

bacpy(&iso_pi(sk)->dst, &sa->iso_bc->bc_bdaddr);
--
2.39.2

2023-09-28 18:32:06

by Iulia Tanasescu

[permalink] [raw]
Subject: Re: [PATCH 1/1] Bluetooth: ISO: Allow binding a bcast listener to 0 bises

Hi Luiz,

> -----Original Message-----
> From: Luiz Augusto von Dentz <[email protected]>
> Sent: Thursday, September 28, 2023 12:49 AM
> To: Iulia Tanasescu <[email protected]>
> Cc: [email protected]; Claudia Cristina Draghicescu
> <[email protected]>; Mihai-Octavian Urzica <mihai-
> [email protected]>; Silviu Florian Barbulescu
> <[email protected]>; Vlad Pruteanu <[email protected]>;
> Andrei Istodorescu <[email protected]>
> Subject: Re: [PATCH 1/1] Bluetooth: ISO: Allow binding a bcast listener
> to 0 bises
>
> Hi Iulia,
>
> On Wed, Sep 27, 2023 at 12:59 AM Iulia Tanasescu <[email protected]>
> wrote:
> >
> > This makes it possible to bind a broadcast listener to a broadcaster
> > address without asking for any BIS indexes to sync with.
>
> Is the intend to use this logic for discovering broadcaster? I guess we should
> make it clearer and perhaps have iso-tester also testing its behavior.
>

I have been working on new unit tests for BASS, and some of them require
the BASS Server to only sync to the PA transmitted by a source, and not
any BIS - for example, BASS/SR/CP/BV-05-C or BASS/SR/CP/BV-06-C.

So basically the BASS Server will call bt_io_listen with defer setup enabled,
it will just perform PA sync, and it will notify the BASS Client about it
without also continuing to perform BIG sync.

I submitted a patch with an iso-tester test for this case.

> > Signed-off-by: Iulia Tanasescu <[email protected]>
> > ---
> > net/bluetooth/hci_conn.c | 2 +-
> > net/bluetooth/iso.c | 3 +--
> > 2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index
> > e62a5f368a51..c4395d34da70 100644
> > --- a/net/bluetooth/hci_conn.c
> > +++ b/net/bluetooth/hci_conn.c
> > @@ -2138,7 +2138,7 @@ int hci_le_big_create_sync(struct hci_dev *hdev,
> struct hci_conn *hcon,
> > } pdu;
> > int err;
> >
> > - if (num_bis > sizeof(pdu.bis))
> > + if (num_bis < 0x01 || num_bis > sizeof(pdu.bis))
> > return -EINVAL;
> >
> > err = qos_set_big(hdev, qos);
> > diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index
> > 2132a16be93c..8ab7ea5ebedf 100644
> > --- a/net/bluetooth/iso.c
> > +++ b/net/bluetooth/iso.c
> > @@ -790,8 +790,7 @@ static int iso_sock_bind_bc(struct socket *sock,
> struct sockaddr *addr,
> > BT_DBG("sk %p bc_sid %u bc_num_bis %u", sk, sa->iso_bc->bc_sid,
> > sa->iso_bc->bc_num_bis);
> >
> > - if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc) ||
> > - sa->iso_bc->bc_num_bis < 0x01 || sa->iso_bc->bc_num_bis > 0x1f)
> > + if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc))
> > return -EINVAL;
> >
> > bacpy(&iso_pi(sk)->dst, &sa->iso_bc->bc_bdaddr);
> > --
> > 2.39.2
> >
>
>
> --
> Luiz Augusto von Dentz

Regards,
Iulia

2023-09-29 06:25:36

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH 1/1] Bluetooth: ISO: Allow binding a bcast listener to 0 bises

Hi Iulia,

On Wed, Sep 27, 2023 at 12:59 AM Iulia Tanasescu
<[email protected]> wrote:
>
> This makes it possible to bind a broadcast listener to a broadcaster
> address without asking for any BIS indexes to sync with.

Is the intend to use this logic for discovering broadcaster? I guess
we should make it clearer and perhaps have iso-tester also testing its
behavior.

> Signed-off-by: Iulia Tanasescu <[email protected]>
> ---
> net/bluetooth/hci_conn.c | 2 +-
> net/bluetooth/iso.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
> index e62a5f368a51..c4395d34da70 100644
> --- a/net/bluetooth/hci_conn.c
> +++ b/net/bluetooth/hci_conn.c
> @@ -2138,7 +2138,7 @@ int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
> } pdu;
> int err;
>
> - if (num_bis > sizeof(pdu.bis))
> + if (num_bis < 0x01 || num_bis > sizeof(pdu.bis))
> return -EINVAL;
>
> err = qos_set_big(hdev, qos);
> diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
> index 2132a16be93c..8ab7ea5ebedf 100644
> --- a/net/bluetooth/iso.c
> +++ b/net/bluetooth/iso.c
> @@ -790,8 +790,7 @@ static int iso_sock_bind_bc(struct socket *sock, struct sockaddr *addr,
> BT_DBG("sk %p bc_sid %u bc_num_bis %u", sk, sa->iso_bc->bc_sid,
> sa->iso_bc->bc_num_bis);
>
> - if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc) ||
> - sa->iso_bc->bc_num_bis < 0x01 || sa->iso_bc->bc_num_bis > 0x1f)
> + if (addr_len > sizeof(*sa) + sizeof(*sa->iso_bc))
> return -EINVAL;
>
> bacpy(&iso_pi(sk)->dst, &sa->iso_bc->bc_bdaddr);
> --
> 2.39.2
>


--
Luiz Augusto von Dentz