Skip to content

Commit

Permalink
Bluetooth: ISO: Don't reject BT_ISO_QOS if parameters are unset
Browse files Browse the repository at this point in the history
Consider certain values (0x00) as unset and load proper default if
an application has not set them properly.

Fixes: 0fe8c8d ("Bluetooth: Split bt_iso_qos into dedicated structures")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Vudentz committed Apr 10, 2024
1 parent 19fa4f2 commit b37cab5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/bluetooth/iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,8 @@ static bool check_ucast_qos(struct bt_iso_qos *qos)

static bool check_bcast_qos(struct bt_iso_qos *qos)
{
if (qos->bcast.sync_factor == 0x00)
return false;
if (!qos->bcast.sync_factor)
qos->bcast.sync_factor = 0x01;

if (qos->bcast.packing > 0x01)
return false;
Expand All @@ -1475,6 +1475,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
if (qos->bcast.skip > 0x01f3)
return false;

if (!qos->bcast.sync_timeout)
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;

if (qos->bcast.sync_timeout < 0x000a || qos->bcast.sync_timeout > 0x4000)
return false;

Expand All @@ -1484,6 +1487,9 @@ static bool check_bcast_qos(struct bt_iso_qos *qos)
if (qos->bcast.mse > 0x1f)
return false;

if (!qos->bcast.timeout)
qos->bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT;

if (qos->bcast.timeout < 0x000a || qos->bcast.timeout > 0x4000)
return false;

Expand Down

0 comments on commit b37cab5

Please sign in to comment.