* [PATCH BlueZ v1] monitor: Add sequence number and SDU length to ISO packets
@ 2025-07-14 15:36 Luiz Augusto von Dentz
2025-07-14 17:14 ` [BlueZ,v1] " bluez.test.bot
2025-07-14 21:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-14 15:36 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This prints sequence number and SDU length of ISO packets:
> ISO Data RX: Handle 2304 SN 48 flags 0x02 dlen 64 slen 60
---
lib/hci.h | 5 +++++
monitor/packet.c | 51 ++++++++++++++++++++++++++++++++----------------
2 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/lib/hci.h b/lib/hci.h
index 96733efc1e3b..8f59a535a7fa 100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -2327,6 +2327,11 @@ typedef struct {
#define acl_handle(h) (h & 0x0fff)
#define acl_flags(h) (h >> 12)
+/* ISO handle and flags pack/unpack */
+#define iso_flags_pb(f) (f & 0x0003)
+#define iso_flags_ts(f) ((f >> 2) & 0x0001)
+#define iso_flags_pack(pb, ts) ((pb & 0x03) | ((ts & 0x01) << 2))
+
#endif /* _NO_HCI_DEFS */
/* HCI Socket options */
diff --git a/monitor/packet.c b/monitor/packet.c
index 21df067b19ce..90a82b1af4ff 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -14050,9 +14050,10 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
bool in, const void *data, uint16_t size)
{
const struct bt_hci_iso_hdr *hdr = data;
+ const struct bt_hci_iso_data_start *start;
uint16_t handle = le16_to_cpu(hdr->handle);
uint8_t flags = acl_flags(handle);
- char handle_str[22], extra_str[32];
+ char handle_str[36], extra_str[33];
struct index_buf_pool *pool = &index_list[index].iso;
if (index >= MAX_INDEX) {
@@ -14062,27 +14063,32 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
index_list[index].frame++;
- if (size < sizeof(*hdr)) {
- if (in)
- print_packet(tv, cred, '*', index, NULL, COLOR_ERROR,
- "Malformed ISO Data RX packet", NULL, NULL);
- else
- print_packet(tv, cred, '*', index, NULL, COLOR_ERROR,
- "Malformed ISO Data TX packet", NULL, NULL);
- packet_hexdump(data, size);
- return;
- }
+ if (size < sizeof(*hdr))
+ goto malformed;
data += sizeof(*hdr);
size -= sizeof(*hdr);
- if (!in && pool->total)
- sprintf(handle_str, "Handle %d [%u/%u]", acl_handle(handle),
- ++pool->tx, pool->total);
- else
- sprintf(handle_str, "Handle %d", acl_handle(handle));
+ /* Detect if timestamp field is preset */
+ if (iso_flags_ts(flags)) {
+ if (size < sizeof(uint32_t))
+ goto malformed;
- sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, hdr->dlen);
+ data += sizeof(uint32_t);
+ size -= sizeof(uint32_t);
+ }
+
+ start = data;
+
+ if (!in && pool->total)
+ sprintf(handle_str, "Handle %d [%u/%u] SN %u",
+ acl_handle(handle), ++pool->tx, pool->total, start->sn);
+ else
+ sprintf(handle_str, "Handle %u SN %u", acl_handle(handle),
+ start->sn);
+
+ sprintf(extra_str, "flags 0x%2.2x dlen %u slen %u", flags, hdr->dlen,
+ start->slen);
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_ISODATA,
in ? "ISO Data RX" : "ISO Data TX",
@@ -14101,6 +14107,17 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
if (filter_mask & PACKET_FILTER_SHOW_ISO_DATA)
packet_hexdump(data, size);
+
+ return;
+
+malformed:
+ if (in)
+ print_packet(tv, cred, '*', index, NULL, COLOR_ERROR,
+ "Malformed ISO Data RX packet", NULL, NULL);
+ else
+ print_packet(tv, cred, '*', index, NULL, COLOR_ERROR,
+ "Malformed ISO Data TX packet", NULL, NULL);
+ packet_hexdump(data, size);
}
void packet_ctrl_open(struct timeval *tv, struct ucred *cred, uint16_t index,
--
2.50.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ,v1] monitor: Add sequence number and SDU length to ISO packets
2025-07-14 15:36 [PATCH BlueZ v1] monitor: Add sequence number and SDU length to ISO packets Luiz Augusto von Dentz
@ 2025-07-14 17:14 ` bluez.test.bot
2025-07-14 21:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-07-14 17:14 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1633 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=982133
---Test result---
Test Summary:
CheckPatch PENDING 0.27 seconds
GitLint PENDING 0.30 seconds
BuildEll PASS 20.95 seconds
BluezMake PASS 3160.57 seconds
MakeCheck PASS 20.24 seconds
MakeDistcheck PASS 185.29 seconds
CheckValgrind PASS 240.59 seconds
CheckSmatch WARNING 305.79 seconds
bluezmakeextell PASS 130.22 seconds
IncrementalBuild PENDING 0.25 seconds
ScanBuild PASS 934.23 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:
monitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1918:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3822:52: 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] 3+ messages in thread
* Re: [PATCH BlueZ v1] monitor: Add sequence number and SDU length to ISO packets
2025-07-14 15:36 [PATCH BlueZ v1] monitor: Add sequence number and SDU length to ISO packets Luiz Augusto von Dentz
2025-07-14 17:14 ` [BlueZ,v1] " bluez.test.bot
@ 2025-07-14 21:00 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-14 21:00 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 14 Jul 2025 11:36:23 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This prints sequence number and SDU length of ISO packets:
>
> > ISO Data RX: Handle 2304 SN 48 flags 0x02 dlen 64 slen 60
> ---
> lib/hci.h | 5 +++++
> monitor/packet.c | 51 ++++++++++++++++++++++++++++++++----------------
> 2 files changed, 39 insertions(+), 17 deletions(-)
Here is the summary with links:
- [BlueZ,v1] monitor: Add sequence number and SDU length to ISO packets
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=468c5877c3ba
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] 3+ messages in thread
end of thread, other threads:[~2025-07-14 20:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 15:36 [PATCH BlueZ v1] monitor: Add sequence number and SDU length to ISO packets Luiz Augusto von Dentz
2025-07-14 17:14 ` [BlueZ,v1] " bluez.test.bot
2025-07-14 21:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.