Add support for TX timestamping in ISO/L2CAP sockets. These patches allow fixing / working around controller(?) issue where two ISO streams in same group get desynchronized. Having accurate knowledge of the packet queue lengths, user application can drop packets if it detects the ISO streams are not in sync. For using this for audio, BlueZ needs to be changed to not unconditionally terminate connections on POLLERR. It currently thinks the TX timestamp POLLERR is an error, and closes the audio channel. For BAP, BlueZ only closes the fd in this case so it accidentally works there, but for A2DP it is more thorough in tearing down the connection. Pipewire side: https://gitlab.freedesktop.org/pvir/pipewire/-/commits/iso-ts-test2 With this change, https://github.com/bluez/bluez/issues/515 is more or less fixed, and the sound server can figure out the total latency to audio rendering (tx latency + transport latency + presentation delay). For ISO, we can later use LE Read ISO TX Sync to provide hardware timestamps, but this requires figuring out the sequence number synchronization first. Pauli Virtanen (3): Bluetooth: add support for skb TX timestamping Bluetooth: ISO: add TX timestamping Bluetooth: L2CAP: add TX timestamping include/net/bluetooth/bluetooth.h | 1 + include/net/bluetooth/hci_core.h | 12 +++++ include/net/bluetooth/l2cap.h | 3 +- net/bluetooth/6lowpan.c | 2 +- net/bluetooth/hci_conn.c | 78 +++++++++++++++++++++++++++++++ net/bluetooth/hci_core.c | 5 ++ net/bluetooth/hci_event.c | 4 ++ net/bluetooth/iso.c | 24 ++++++++-- net/bluetooth/l2cap_core.c | 11 ++++- net/bluetooth/l2cap_sock.c | 15 +++++- net/bluetooth/smp.c | 2 +- 11 files changed, 148 insertions(+), 9 deletions(-) -- 2.44.0