* [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys
@ 2026-01-06 20:09 Luiz Augusto von Dentz
2026-01-06 20:09 ` [PATCH BlueZ v1 2/2] shared/bap: Fix PHY fields being treated as single value Luiz Augusto von Dentz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-01-06 20:09 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This renames the bt_iso_io_qos phy field to phys to emphasize it is
actually a bitfield rather than a single value.
---
emulator/bthost.c | 8 ++++----
lib/bluetooth/bluetooth.h | 2 +-
profiles/audio/bap.c | 4 ++--
profiles/audio/media.c | 8 ++++----
src/shared/bap.c | 16 ++++++++--------
src/shared/bap.h | 2 +-
tools/btiotest.c | 2 +-
tools/iso-tester.c | 8 ++++----
tools/isotest.c | 24 ++++++++++++------------
unit/test-bap.c | 2 +-
10 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/emulator/bthost.c b/emulator/bthost.c
index fe6ad4145673..d09ad1e76c50 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -3886,10 +3886,10 @@ void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
cp->cis[0].cis_id = cis_id;
cp->cis[0].c_sdu = qos->ucast.in.sdu;
cp->cis[0].p_sdu = qos->ucast.out.sdu;
- cp->cis[0].c_phys = qos->ucast.in.phy ? qos->ucast.in.phy :
- qos->ucast.out.phy;
- cp->cis[0].p_phys = qos->ucast.out.phy ? qos->ucast.out.phy :
- qos->ucast.in.phy;
+ cp->cis[0].c_phys = qos->ucast.in.phys ? qos->ucast.in.phys :
+ qos->ucast.out.phys;
+ cp->cis[0].p_phys = qos->ucast.out.phys ? qos->ucast.out.phys :
+ qos->ucast.in.phys;
cp->cis[0].c_rtn = qos->ucast.in.rtn;
cp->cis[0].p_rtn = qos->ucast.out.rtn;
diff --git a/lib/bluetooth/bluetooth.h b/lib/bluetooth/bluetooth.h
index 88a5d8b66134..f9f22c3f7523 100644
--- a/lib/bluetooth/bluetooth.h
+++ b/lib/bluetooth/bluetooth.h
@@ -173,7 +173,7 @@ struct bt_iso_io_qos {
uint32_t interval;
uint16_t latency;
uint16_t sdu;
- uint8_t phy;
+ uint8_t phys;
uint8_t rtn;
};
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index b6eb91ab3fb6..f015f73e3c6d 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -428,7 +428,7 @@ static gboolean get_qos(const GDBusPropertyTable *property,
return FALSE;
dict_append_entry(&dict, "Framing", DBUS_TYPE_BYTE, &qos->framing);
- dict_append_entry(&dict, "PHY", DBUS_TYPE_BYTE, &qos->phy);
+ dict_append_entry(&dict, "PHY", DBUS_TYPE_BYTE, &qos->phys);
dict_append_entry(&dict, "Retransmissions", DBUS_TYPE_BYTE, &qos->rtn);
dict_append_entry(&dict, "MaximumLatency", DBUS_TYPE_UINT16,
&qos->latency);
@@ -2242,7 +2242,7 @@ static void bap_iso_qos(struct bt_bap_qos *qos, struct bt_iso_io_qos *io)
io->interval = qos->ucast.io_qos.interval;
io->latency = qos->ucast.io_qos.latency;
io->sdu = qos->ucast.io_qos.sdu;
- io->phy = qos->ucast.io_qos.phy;
+ io->phys = qos->ucast.io_qos.phy;
io->rtn = qos->ucast.io_qos.rtn;
}
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index ad9eb7beb536..bf8be52ac960 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -1049,7 +1049,7 @@ static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
metadata->iov_len);
}
- if (qos && qos->phy) {
+ if (qos && qos->phys) {
DBusMessageIter entry, variant, qos_dict;
key = "QoS";
@@ -1065,7 +1065,7 @@ static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
&qos->framing);
g_dbus_dict_append_entry(&qos_dict, "PHY", DBUS_TYPE_BYTE,
- &qos->phy);
+ &qos->phys);
g_dbus_dict_append_entry(&qos_dict, "Retransmissions",
DBUS_TYPE_BYTE, &qos->rtn);
@@ -1810,7 +1810,7 @@ static int parse_properties(DBusMessageIter *props, const char **uuid,
} else if (strcasecmp(key, "PHY") == 0) {
if (var != DBUS_TYPE_BYTE)
return -EINVAL;
- dbus_message_iter_get_basic(&value, &qos->phy);
+ dbus_message_iter_get_basic(&value, &qos->phys);
} else if (strcasecmp(key, "Retransmissions") == 0) {
if (var != DBUS_TYPE_BYTE)
return -EINVAL;
@@ -3073,7 +3073,7 @@ static void app_register_endpoint(void *data, void *user_data)
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BYTE)
goto fail;
- dbus_message_iter_get_basic(&iter, &qos.phy);
+ dbus_message_iter_get_basic(&iter, &qos.phys);
}
if (g_dbus_proxy_get_property(proxy, "MaximumLatency", &iter)) {
diff --git a/src/shared/bap.c b/src/shared/bap.c
index 6a35e4e1d948..cb6db8765e9f 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -374,14 +374,14 @@ struct bt_iso_qos bap_sink_pa_qos = {
.interval = 10000,
.latency = 10,
.sdu = 40,
- .phy = 0x02,
+ .phys = BIT(1),
.rtn = 2,
},
.out = {
.interval = 10000,
.latency = 10,
.sdu = 40,
- .phy = 0x02,
+ .phys = BIT(1),
.rtn = 2,
}
}
@@ -1029,8 +1029,8 @@ static void stream_notify_config(struct bt_bap_stream *stream)
status->state = ep->state;
/* Initialize preferred settings if not set */
- if (!lpac->qos.phy)
- lpac->qos.phy = 0x02;
+ if (!lpac->qos.phys)
+ lpac->qos.phys = BIT(1);
if (!lpac->qos.rtn)
lpac->qos.rtn = 0x05;
@@ -1053,7 +1053,7 @@ static void stream_notify_config(struct bt_bap_stream *stream)
/* TODO:Add support for setting preferred settings on bt_bap_pac */
config = (void *)status->params;
config->framing = lpac->qos.framing;
- config->phy = lpac->qos.phy;
+ config->phy = lpac->qos.phys;
config->rtn = lpac->qos.rtn;
config->latency = cpu_to_le16(lpac->qos.latency);
put_le24(lpac->qos.pd_min, config->pd_min);
@@ -4237,7 +4237,7 @@ uint16_t bt_bap_pac_get_context(struct bt_bap_pac *pac)
struct bt_bap_pac_qos *bt_bap_pac_get_qos(struct bt_bap_pac *pac)
{
- if (!pac || !pac->qos.phy)
+ if (!pac || !pac->qos.phys)
return NULL;
return &pac->qos;
@@ -5109,7 +5109,7 @@ static void ep_status_config(struct bt_bap *bap, struct bt_bap_endpoint *ep,
/* Set preferred settings */
if (ep->stream->rpac) {
ep->stream->rpac->qos.framing = cfg->framing;
- ep->stream->rpac->qos.phy = cfg->phy;
+ ep->stream->rpac->qos.phys = cfg->phy;
ep->stream->rpac->qos.rtn = cfg->rtn;
ep->stream->rpac->qos.latency = le16_to_cpu(cfg->latency);
ep->stream->rpac->qos.pd_min = pd_min;
@@ -7861,7 +7861,7 @@ void bt_bap_iso_qos_to_bap_qos(struct bt_iso_qos *iso_qos,
bap_qos->bcast.io_qos.interval =
iso_qos->bcast.in.interval;
bap_qos->bcast.io_qos.latency = iso_qos->bcast.in.latency;
- bap_qos->bcast.io_qos.phy = iso_qos->bcast.in.phy;
+ bap_qos->bcast.io_qos.phy = iso_qos->bcast.in.phys;
bap_qos->bcast.io_qos.rtn = iso_qos->bcast.in.rtn;
bap_qos->bcast.io_qos.sdu = iso_qos->bcast.in.sdu;
}
diff --git a/src/shared/bap.h b/src/shared/bap.h
index 80e91f10a203..c1b75949f86b 100644
--- a/src/shared/bap.h
+++ b/src/shared/bap.h
@@ -55,7 +55,7 @@ extern struct bt_iso_qos bap_sink_pa_qos;
/* Local PAC related functions */
struct bt_bap_pac_qos {
uint8_t framing;
- uint8_t phy;
+ uint8_t phys;
uint8_t rtn;
uint16_t latency;
uint32_t pd_min;
diff --git a/tools/btiotest.c b/tools/btiotest.c
index f62248e32a8c..da50ad175c3f 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -35,7 +35,7 @@ static int opt_update_sec = 0;
.interval = 10000, \
.latency = 10, \
.sdu = 40, \
- .phy = 0x02, \
+ .phys = 0x02, \
.rtn = 2, \
}
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index ff5c85ae410c..b851d2cd84bc 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -43,12 +43,12 @@
#define EIR_SERVICE_DATA_16 0x16
-#define QOS_IO(_interval, _latency, _sdu, _phy, _rtn) \
+#define QOS_IO(_interval, _latency, _sdu, _phys, _rtn) \
{ \
.interval = _interval, \
.latency = _latency, \
.sdu = _sdu, \
- .phy = _phy, \
+ .phys = _phys, \
.rtn = _rtn, \
}
@@ -2171,9 +2171,9 @@ static bool check_io_qos(const struct bt_iso_io_qos *io1,
return false;
}
- if (io1->phy && io2->phy && io1->phy != io2->phy) {
+ if (io1->phys && io2->phys && io1->phys != io2->phys) {
tester_warn("Unexpected IO PHY: 0x%02x != 0x%02x",
- io1->phy, io2->phy);
+ io1->phys, io2->phys);
return false;
}
diff --git a/tools/isotest.c b/tools/isotest.c
index e3d2d63ce1ff..ca59ea5b3ea6 100644
--- a/tools/isotest.c
+++ b/tools/isotest.c
@@ -270,13 +270,13 @@ static void print_ucast_qos(int sk)
qos.ucast.packing, qos.ucast.framing);
syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.in.interval,
- qos.ucast.in.latency, qos.ucast.in.sdu, qos.ucast.in.phy,
+ "ms SDU %u PHYs 0x%02x RTN %u]", qos.ucast.in.interval,
+ qos.ucast.in.latency, qos.ucast.in.sdu, qos.ucast.in.phys,
qos.ucast.in.rtn);
syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.out.interval,
- qos.ucast.out.latency, qos.ucast.out.sdu, qos.ucast.out.phy,
+ "ms SDU %u PHYs 0x%02x RTN %u]", qos.ucast.out.interval,
+ qos.ucast.out.latency, qos.ucast.out.sdu, qos.ucast.out.phys,
qos.ucast.out.rtn);
}
@@ -311,14 +311,14 @@ static void print_bcast_qos(int sk)
qos.bcast.bcode[13], qos.bcast.bcode[14], qos.bcast.bcode[15]);
syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.in.interval,
+ "ms SDU %u PHYs 0x%02x RTN %u]", qos.bcast.in.interval,
qos.bcast.in.latency, qos.bcast.in.sdu,
- qos.bcast.in.phy, qos.bcast.in.rtn);
+ qos.bcast.in.phys, qos.bcast.in.rtn);
syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.out.interval,
+ "ms SDU %u PHYs 0x%02x RTN %u]", qos.bcast.out.interval,
qos.bcast.out.latency, qos.bcast.out.sdu,
- qos.bcast.out.phy, qos.bcast.out.rtn);
+ qos.bcast.out.phys, qos.bcast.out.rtn);
}
static int do_connect(char *peer)
@@ -350,7 +350,7 @@ static int do_connect(char *peer)
/* Set QoS if available */
if (iso_qos) {
if (!inout || !strcmp(peer, "00:00:00:00:00:00")) {
- iso_qos->ucast.in.phy = 0x00;
+ iso_qos->ucast.in.phys = 0x00;
iso_qos->ucast.in.sdu = 0;
}
@@ -1020,12 +1020,12 @@ static void multy_connect_mode(char *peer)
}
}
-#define QOS_IO(_interval, _latency, _sdu, _phy, _rtn) \
+#define QOS_IO(_interval, _latency, _sdu, _phys, _rtn) \
{ \
.interval = _interval, \
.latency = _latency, \
.sdu = _sdu, \
- .phy = _phy, \
+ .phys = _phys, \
.rtn = _rtn, \
}
@@ -1339,7 +1339,7 @@ int main(int argc, char *argv[])
case 'Y':
if (optarg)
- iso_qos->ucast.out.phy = atoi(optarg);
+ iso_qos->ucast.out.phys = atoi(optarg);
break;
case 'R':
diff --git a/unit/test-bap.c b/unit/test-bap.c
index be838cb99f24..cdd1bed7e1ff 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -101,7 +101,7 @@ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY,
3u, 26, 240);
static struct bt_bap_pac_qos lc3_qos = {
- .phy = 0x02,
+ .phys = BIT(1),
.rtn = 0x01,
.location = 0x00000003,
.supported_context = 0x0fff,
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH BlueZ v1 2/2] shared/bap: Fix PHY fields being treated as single value
2026-01-06 20:09 [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys Luiz Augusto von Dentz
@ 2026-01-06 20:09 ` Luiz Augusto von Dentz
2026-01-06 21:05 ` [BlueZ,v1,1/2] lib: Rename bt_iso_io_qos phy field to phys bluez.test.bot
2026-01-07 21:10 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-01-06 20:09 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
BP PHY fields always refer to bitfields with the exception of target
PHY field in bt_ascs_config.
---
client/player.c | 12 +++++-----
profiles/audio/bap.c | 6 ++---
profiles/audio/media.c | 2 +-
profiles/audio/transport.c | 6 ++---
src/shared/ascs.h | 6 ++---
src/shared/bap-defs.h | 8 +++----
src/shared/bap.c | 49 +++++++++++++++++++++++++-------------
src/shared/lc3.h | 4 ++--
unit/test-bap.c | 4 ++--
9 files changed, 57 insertions(+), 40 deletions(-)
diff --git a/client/player.c b/client/player.c
index d7402d19d57b..1444e939d30b 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1890,9 +1890,9 @@ static void append_io_qos(DBusMessageIter *iter, struct bt_bap_io_qos *qos)
g_dbus_dict_append_entry(iter, "Interval", DBUS_TYPE_UINT32,
&qos->interval);
- bt_shell_printf("PHY 0x%02x\n", qos->phy);
+ bt_shell_printf("PHYs 0x%02x\n", qos->phys);
- g_dbus_dict_append_entry(iter, "PHY", DBUS_TYPE_BYTE, &qos->phy);
+ g_dbus_dict_append_entry(iter, "PHY", DBUS_TYPE_BYTE, &qos->phys);
bt_shell_printf("SDU %u\n", qos->sdu);
@@ -2229,7 +2229,7 @@ static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep,
else
qos = &preset->qos.ucast.io_qos;
- if (qos->phy) {
+ if (qos->phys) {
/* Set QoS parameters */
cfg->qos = preset->qos;
/* Adjust the SDU size based on the number of
@@ -4162,9 +4162,9 @@ static void custom_phy(const char *input, void *user_data)
qos = &p->qos.ucast.io_qos;
if (!strcmp(input, "1M"))
- qos->phy = 0x01;
+ qos->phys = BIT(0);
else if (!strcmp(input, "2M"))
- qos->phy = 0x02;
+ qos->phys = BIT(1);
else {
char *endptr = NULL;
uint8_t phy = strtol(input, &endptr, 0);
@@ -4177,7 +4177,7 @@ static void custom_phy(const char *input, void *user_data)
switch (phy) {
case 0x01:
case 0x02:
- qos->phy = phy;
+ qos->phys = phy;
break;
default:
bt_shell_printf("Invalid argument: %s\n", input);
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index f015f73e3c6d..90a9786674ab 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -594,7 +594,7 @@ static int parse_io_qos(const char *key, int var, DBusMessageIter *iter,
if (var != DBUS_TYPE_BYTE)
return -EINVAL;
- dbus_message_iter_get_basic(iter, &qos->phy);
+ dbus_message_iter_get_basic(iter, &qos->phys);
} else if (!strcasecmp(key, "SDU")) {
if (var != DBUS_TYPE_UINT16)
return -EINVAL;
@@ -1145,7 +1145,7 @@ static bool match_io_qos(const struct bt_bap_io_qos *io_qos,
if (io_qos->sdu != match->sdu)
return false;
- if (io_qos->phy != match->phy)
+ if (io_qos->phys != match->phys)
return false;
if (io_qos->rtn != match->rtn)
@@ -2242,7 +2242,7 @@ static void bap_iso_qos(struct bt_bap_qos *qos, struct bt_iso_io_qos *io)
io->interval = qos->ucast.io_qos.interval;
io->latency = qos->ucast.io_qos.latency;
io->sdu = qos->ucast.io_qos.sdu;
- io->phys = qos->ucast.io_qos.phy;
+ io->phys = qos->ucast.io_qos.phys;
io->rtn = qos->ucast.io_qos.rtn;
}
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index bf8be52ac960..f153e757c06d 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -858,7 +858,7 @@ static int parse_ucast_qos(DBusMessageIter *iter, struct bt_bap_qos *qos)
if (var != DBUS_TYPE_BYTE)
goto fail;
- dbus_message_iter_get_basic(&value, &io_qos.phy);
+ dbus_message_iter_get_basic(&value, &io_qos.phys);
} else if (!strcasecmp(key, "SDU")) {
if (var != DBUS_TYPE_UINT16)
goto fail;
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index fc23cf33d2b6..baf8432dece2 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -1241,7 +1241,7 @@ static void append_io_qos(DBusMessageIter *dict, struct bt_bap_io_qos *qos)
dict_append_entry(dict, "Interval", DBUS_TYPE_UINT32, &qos->interval);
dict_append_entry(dict, "Latency", DBUS_TYPE_UINT16, &qos->latency);
dict_append_entry(dict, "SDU", DBUS_TYPE_UINT16, &qos->sdu);
- dict_append_entry(dict, "PHY", DBUS_TYPE_BYTE, &qos->phy);
+ dict_append_entry(dict, "PHY", DBUS_TYPE_BYTE, &qos->phys);
dict_append_entry(dict, "Retransmissions", DBUS_TYPE_BYTE, &qos->rtn);
}
@@ -1460,7 +1460,7 @@ static gboolean qos_ucast_exists(const GDBusPropertyTable *property, void *data)
struct media_transport *transport = data;
struct bap_transport *bap = transport->data;
- return bap->qos.ucast.io_qos.phy != 0x00;
+ return bap->qos.ucast.io_qos.phys != 0x00;
}
static const GDBusPropertyTable transport_bap_uc_properties[] = {
@@ -1533,7 +1533,7 @@ static gboolean qos_bcast_exists(const GDBusPropertyTable *property, void *data)
struct media_transport *transport = data;
struct bap_transport *bap = transport->data;
- return bap->qos.bcast.io_qos.phy != 0x00;
+ return bap->qos.bcast.io_qos.phys != 0x00;
}
static void bcast_qos_set(void *user_data, int err)
diff --git a/src/shared/ascs.h b/src/shared/ascs.h
index a409bad61681..494a153fec20 100644
--- a/src/shared/ascs.h
+++ b/src/shared/ascs.h
@@ -75,7 +75,7 @@ struct bt_ascs_ase_status {
/* ASE_State = 0x01 (Codec Configured), defined in Table 4.7. */
struct bt_ascs_ase_status_config {
uint8_t framing;
- uint8_t phy;
+ uint8_t phys;
uint8_t rtn;
uint16_t latency;
uint8_t pd_min[3];
@@ -94,7 +94,7 @@ struct bt_ascs_ase_status_qos {
uint8_t cis_id;
uint8_t interval[3];
uint8_t framing;
- uint8_t phy;
+ uint8_t phys;
uint16_t sdu;
uint8_t rtn;
uint16_t latency;
@@ -150,7 +150,7 @@ struct bt_ascs_qos {
uint8_t cis; /* CIG ID*/
uint8_t interval[3]; /* Frame interval */
uint8_t framing; /* Frame framing */
- uint8_t phy; /* PHY */
+ uint8_t phys; /* PHY */
uint16_t sdu; /* Maximum SDU Size */
uint8_t rtn; /* Retransmission Effort */
uint16_t latency; /* Transport Latency */
diff --git a/src/shared/bap-defs.h b/src/shared/bap-defs.h
index 27fefa34f1ec..e5c2accb99f7 100644
--- a/src/shared/bap-defs.h
+++ b/src/shared/bap-defs.h
@@ -35,9 +35,9 @@
#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02
#define BT_BAP_CONFIG_LATENCY_HIGH 0x03
-#define BT_BAP_CONFIG_PHY_1M 0x01
-#define BT_BAP_CONFIG_PHY_2M 0x02
-#define BT_BAP_CONFIG_PHY_CODEC 0x03
+#define BT_BAP_CONFIG_PHY_1M BIT(0)
+#define BT_BAP_CONFIG_PHY_2M BIT(1)
+#define BT_BAP_CONFIG_PHY_CODEC BIT(2)
struct bt_bap_codec {
uint8_t id;
@@ -55,7 +55,7 @@ struct bt_bap_io_qos {
uint32_t interval; /* Frame interval */
uint16_t latency; /* Transport Latency */
uint16_t sdu; /* Maximum SDU Size */
- uint8_t phy; /* PHY */
+ uint8_t phys; /* PHY */
uint8_t rtn; /* Retransmission Effort */
};
diff --git a/src/shared/bap.c b/src/shared/bap.c
index cb6db8765e9f..37b04c5c1ea8 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1053,7 +1053,7 @@ static void stream_notify_config(struct bt_bap_stream *stream)
/* TODO:Add support for setting preferred settings on bt_bap_pac */
config = (void *)status->params;
config->framing = lpac->qos.framing;
- config->phy = lpac->qos.phys;
+ config->phys = lpac->qos.phys;
config->rtn = lpac->qos.rtn;
config->latency = cpu_to_le16(lpac->qos.latency);
put_le24(lpac->qos.pd_min, config->pd_min);
@@ -1097,7 +1097,7 @@ static void stream_notify_qos(struct bt_bap_stream *stream)
qos->cig_id = stream->qos.ucast.cig_id;
put_le24(stream->qos.ucast.io_qos.interval, qos->interval);
qos->framing = stream->qos.ucast.framing;
- qos->phy = stream->qos.ucast.io_qos.phy;
+ qos->phys = stream->qos.ucast.io_qos.phys;
qos->sdu = cpu_to_le16(stream->qos.ucast.io_qos.sdu);
qos->rtn = stream->qos.ucast.io_qos.rtn;
qos->latency = cpu_to_le16(stream->qos.ucast.io_qos.latency);
@@ -1857,6 +1857,23 @@ static unsigned int bap_ucast_get_state(struct bt_bap_stream *stream)
return stream->ep->state;
}
+static uint8_t bits_to_phy(uint8_t bits)
+{
+ uint8_t phy = 0x00;
+
+ /* Convert PHY bits to PHY values on a ascending order. */
+ if (bits & BIT(0))
+ phy = 0x01; /* LE 1M */
+
+ if (bits & BIT(1))
+ phy = 0x02; /* LE 2M */
+
+ if (bits & BIT(2))
+ phy = 0x03; /* LE Coded */
+
+ return phy;
+}
+
static unsigned int bap_ucast_config(struct bt_bap_stream *stream,
struct bt_bap_qos *qos,
struct iovec *data,
@@ -1877,7 +1894,7 @@ static unsigned int bap_ucast_config(struct bt_bap_stream *stream,
config.ase = stream->ep->id;
config.latency = qos->ucast.target_latency;
- config.phy = qos->ucast.io_qos.phy;
+ config.phy = bits_to_phy(qos->ucast.io_qos.phys);
config.codec = stream->rpac->codec;
if (config.codec.id == 0xff) {
@@ -1936,7 +1953,7 @@ static unsigned int bap_ucast_qos(struct bt_bap_stream *stream,
qos.cis = data->ucast.cis_id;
put_le24(data->ucast.io_qos.interval, qos.interval);
qos.framing = data->ucast.framing;
- qos.phy = data->ucast.io_qos.phy;
+ qos.phys = data->ucast.io_qos.phys;
qos.sdu = cpu_to_le16(data->ucast.io_qos.sdu);
qos.rtn = data->ucast.io_qos.rtn;
qos.latency = cpu_to_le16(data->ucast.io_qos.latency);
@@ -3162,8 +3179,8 @@ static uint8_t ascs_config(struct bt_ascs *ascs, struct bt_bap *bap,
req = util_iov_pull_mem(iov, sizeof(*req));
- DBG(bap, "codec 0x%02x phy 0x%02x latency %u", req->codec.id, req->phy,
- req->latency);
+ DBG(bap, "codec 0x%02x phy 0x%02x latency %u", req->codec.id,
+ req->phy, req->latency);
ep = bap_get_local_endpoint_id(bap, req->ase);
if (!ep) {
@@ -3236,16 +3253,16 @@ static uint8_t ascs_qos(struct bt_ascs *ascs, struct bt_bap *bap,
qos.ucast.cis_id = req->cis;
qos.ucast.io_qos.interval = get_le24(req->interval);
qos.ucast.framing = req->framing;
- qos.ucast.io_qos.phy = req->phy;
+ qos.ucast.io_qos.phys = req->phys;
qos.ucast.io_qos.sdu = le16_to_cpu(req->sdu);
qos.ucast.io_qos.rtn = req->rtn;
qos.ucast.io_qos.latency = le16_to_cpu(req->latency);
qos.ucast.delay = get_le24(req->pd);
DBG(bap, "CIG 0x%02x CIS 0x%02x interval %u framing 0x%02x "
- "phy 0x%02x SDU %u rtn %u latency %u pd %u",
+ "phys 0x%02x SDU %u rtn %u latency %u pd %u",
req->cig, req->cis, qos.ucast.io_qos.interval,
- qos.ucast.framing, qos.ucast.io_qos.phy,
+ qos.ucast.framing, qos.ucast.io_qos.phys,
qos.ucast.io_qos.sdu, qos.ucast.io_qos.rtn,
qos.ucast.io_qos.latency, qos.ucast.delay);
@@ -5061,9 +5078,9 @@ static void ep_status_config(struct bt_bap *bap, struct bt_bap_endpoint *ep,
ppd_min = get_le24(cfg->ppd_min);
ppd_max = get_le24(cfg->ppd_max);
- DBG(bap, "codec 0x%02x framing 0x%02x phy 0x%02x rtn %u "
+ DBG(bap, "codec 0x%02x framing 0x%02x.phys 0x%02x rtn %u "
"latency %u pd %u - %u ppd %u - %u", cfg->codec.id,
- cfg->framing, cfg->phy, cfg->rtn,
+ cfg->framing, cfg->phys, cfg->rtn,
le16_to_cpu(cfg->latency),
pd_min, pd_max, ppd_min, ppd_max);
@@ -5109,7 +5126,7 @@ static void ep_status_config(struct bt_bap *bap, struct bt_bap_endpoint *ep,
/* Set preferred settings */
if (ep->stream->rpac) {
ep->stream->rpac->qos.framing = cfg->framing;
- ep->stream->rpac->qos.phys = cfg->phy;
+ ep->stream->rpac->qos.phys = cfg->phys;
ep->stream->rpac->qos.rtn = cfg->rtn;
ep->stream->rpac->qos.latency = le16_to_cpu(cfg->latency);
ep->stream->rpac->qos.pd_min = pd_min;
@@ -5175,8 +5192,8 @@ static void ep_status_qos(struct bt_bap *bap, struct bt_bap_endpoint *ep,
latency = le16_to_cpu(qos->latency);
DBG(bap, "CIG 0x%02x CIS 0x%02x interval %u framing 0x%02x "
- "phy 0x%02x rtn %u latency %u pd %u", qos->cig_id,
- qos->cis_id, interval, qos->framing, qos->phy,
+ "phys 0x%02x rtn %u latency %u pd %u", qos->cig_id,
+ qos->cis_id, interval, qos->framing, qos->phys,
qos->rtn, latency, pd);
if (!ep->stream)
@@ -5184,7 +5201,7 @@ static void ep_status_qos(struct bt_bap *bap, struct bt_bap_endpoint *ep,
ep->stream->qos.ucast.io_qos.interval = interval;
ep->stream->qos.ucast.framing = qos->framing;
- ep->stream->qos.ucast.io_qos.phy = qos->phy;
+ ep->stream->qos.ucast.io_qos.phys = qos->phys;
ep->stream->qos.ucast.io_qos.sdu = sdu;
ep->stream->qos.ucast.io_qos.rtn = qos->rtn;
ep->stream->qos.ucast.io_qos.latency = latency;
@@ -7861,7 +7878,7 @@ void bt_bap_iso_qos_to_bap_qos(struct bt_iso_qos *iso_qos,
bap_qos->bcast.io_qos.interval =
iso_qos->bcast.in.interval;
bap_qos->bcast.io_qos.latency = iso_qos->bcast.in.latency;
- bap_qos->bcast.io_qos.phy = iso_qos->bcast.in.phys;
+ bap_qos->bcast.io_qos.phys = iso_qos->bcast.in.phys;
bap_qos->bcast.io_qos.rtn = iso_qos->bcast.in.rtn;
bap_qos->bcast.io_qos.sdu = iso_qos->bcast.in.sdu;
}
diff --git a/src/shared/lc3.h b/src/shared/lc3.h
index cb78b668dbe5..e5999f88f9ee 100644
--- a/src/shared/lc3.h
+++ b/src/shared/lc3.h
@@ -491,7 +491,7 @@
.ucast.io_qos.interval = _interval, \
.ucast.io_qos.latency = _lat, \
.ucast.io_qos.sdu = _sdu, \
- .ucast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \
+ .ucast.io_qos.phys = BT_BAP_CONFIG_PHY_2M, \
.ucast.io_qos.rtn = _rtn, \
}
@@ -947,7 +947,7 @@
.bcast.io_qos.interval = _interval, \
.bcast.io_qos.latency = _lat, \
.bcast.io_qos.sdu = _sdu, \
- .bcast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \
+ .bcast.io_qos.phys = BT_BAP_CONFIG_PHY_2M, \
.bcast.io_qos.rtn = _rtn, \
}
diff --git a/unit/test-bap.c b/unit/test-bap.c
index cdd1bed7e1ff..3a67e7016e4e 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -1576,7 +1576,7 @@ static void test_disc(void)
#define QOS_BALANCED_2M \
{ \
.target_latency = BT_BAP_CONFIG_LATENCY_BALANCED, \
- .io_qos.phy = BT_BAP_CONFIG_PHY_2M, \
+ .io_qos.phys = BT_BAP_CONFIG_PHY_2M, \
}
#define QOS_UCAST \
{\
@@ -7533,7 +7533,7 @@ static struct test_config cfg_bsrc_48_6_2 = {
.bcast.io_qos.interval = 7500, \
.bcast.io_qos.latency = 10, \
.bcast.io_qos.sdu = 40, \
- .bcast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \
+ .bcast.io_qos.phys = BT_BAP_CONFIG_PHY_2M, \
.bcast.io_qos.rtn = 2, \
}
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [BlueZ,v1,1/2] lib: Rename bt_iso_io_qos phy field to phys
2026-01-06 20:09 [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys Luiz Augusto von Dentz
2026-01-06 20:09 ` [PATCH BlueZ v1 2/2] shared/bap: Fix PHY fields being treated as single value Luiz Augusto von Dentz
@ 2026-01-06 21:05 ` bluez.test.bot
2026-01-07 21:10 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-01-06 21:05 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]
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=1039131
---Test result---
Test Summary:
CheckPatch PENDING 0.33 seconds
GitLint PENDING 0.31 seconds
BuildEll PASS 20.26 seconds
BluezMake PASS 643.31 seconds
MakeCheck PASS 23.20 seconds
MakeDistcheck PASS 241.90 seconds
CheckValgrind PASS 303.74 seconds
CheckSmatch WARNING 352.34 seconds
bluezmakeextell PASS 183.09 seconds
IncrementalBuild PENDING 0.35 seconds
ScanBuild PASS 1025.81 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/bthost.c:700:28: warning: Variable length array is used.emulator/bthost.c:701:32: warning: Variable length array is used.emulator/bthost.c:918:28: warning: Variable length array is used.emulator/bthost.c:952:28: warning: Variable length array is used.emulator/bthost.c:953:32: warning: Variable length array is used.src/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:312:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys
2026-01-06 20:09 [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys Luiz Augusto von Dentz
2026-01-06 20:09 ` [PATCH BlueZ v1 2/2] shared/bap: Fix PHY fields being treated as single value Luiz Augusto von Dentz
2026-01-06 21:05 ` [BlueZ,v1,1/2] lib: Rename bt_iso_io_qos phy field to phys bluez.test.bot
@ 2026-01-07 21:10 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2026-01-07 21:10 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 6 Jan 2026 15:09:12 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This renames the bt_iso_io_qos phy field to phys to emphasize it is
> actually a bitfield rather than a single value.
> ---
> emulator/bthost.c | 8 ++++----
> lib/bluetooth/bluetooth.h | 2 +-
> profiles/audio/bap.c | 4 ++--
> profiles/audio/media.c | 8 ++++----
> src/shared/bap.c | 16 ++++++++--------
> src/shared/bap.h | 2 +-
> tools/btiotest.c | 2 +-
> tools/iso-tester.c | 8 ++++----
> tools/isotest.c | 24 ++++++++++++------------
> unit/test-bap.c | 2 +-
> 10 files changed, 38 insertions(+), 38 deletions(-)
Here is the summary with links:
- [BlueZ,v1,1/2] lib: Rename bt_iso_io_qos phy field to phys
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9247623a8d14
- [BlueZ,v1,2/2] shared/bap: Fix PHY fields being treated as single value
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=561d4e815f28
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-07 21:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-06 20:09 [PATCH BlueZ v1 1/2] lib: Rename bt_iso_io_qos phy field to phys Luiz Augusto von Dentz
2026-01-06 20:09 ` [PATCH BlueZ v1 2/2] shared/bap: Fix PHY fields being treated as single value Luiz Augusto von Dentz
2026-01-06 21:05 ` [BlueZ,v1,1/2] lib: Rename bt_iso_io_qos phy field to phys bluez.test.bot
2026-01-07 21:10 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox