From: Roland Schober <rolandschober1968@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, marcel@holtmann.org,
Roland Schober <rolandschober1968@gmail.com>
Subject: [RFC PATCH 1/5] Bluetooth: hci: Add Periodic Advertising with Responses definitions
Date: Fri, 27 Nov 2026 09:53:56 +0100 [thread overview]
Message-ID: <20261127085401.263615-2-rolandschober1968@gmail.com> (raw)
In-Reply-To: <20261127085401.263615-1-rolandschober1968@gmail.com>
Add the HCI definitions of the advertiser side of Periodic Advertising
with Responses (PAwR), from the Bluetooth Core Specification 5.4:
- the LE feature bits of the PAwR advertiser and scanner;
- LE Set Periodic Advertising Parameters [v2], which adds the subevent
and response slot timing to the periodic advertising parameters;
- LE Set Periodic Advertising Subevent Data, by which the host hands
the controller the data of the next subevents;
- LE Periodic Advertising Subevent Data Request, by which the
controller asks for that data;
- LE Periodic Advertising Response Report, which carries the responses
received in the response slots of a subevent.
Assisted-by: Claude:claude-fable-5-2
Signed-off-by: Roland Schober <rolandschober1968@gmail.com>
---
include/net/bluetooth/hci.h | 59 ++++++++++++++++++++++++++++++++
include/net/bluetooth/hci_core.h | 6 ++++
2 files changed, 65 insertions(+)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index ac64780274a5..81ff64dc82ac 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -659,6 +659,8 @@ enum {
#define HCI_LE_ISO_BROADCASTER 0x40
#define HCI_LE_ISO_SYNC_RECEIVER 0x80
#define HCI_LE_LL_EXT_FEATURE 0x80
+#define HCI_LE_PAWR_ADVERTISER 0x08 /* byte 5 */
+#define HCI_LE_PAWR_SCANNER 0x10 /* byte 5 */
#define HCI_LE_CS 0x40
#define HCI_LE_CS_HOST 0x80
#define HCI_LE_SCI 0x01 /* byte 9 - Shorter Connection Intervals */
@@ -2294,6 +2296,37 @@ struct hci_cp_le_set_host_feature {
__u8 bit_value;
} __packed;
+struct hci_le_per_adv_subevent_data {
+ __u8 subevent;
+ __u8 response_slot_start;
+ __u8 response_slot_count;
+ __u8 data_len;
+ __u8 data[] __counted_by(data_len);
+} __packed;
+
+/* What fits one command next to handle and num_subevents */
+#define HCI_MAX_PER_ADV_SUBEVENT_DATA_LEN 253
+
+#define HCI_OP_LE_SET_PER_ADV_SUBEVENT_DATA 0x2082
+struct hci_cp_le_set_per_adv_subevent_data {
+ __u8 handle;
+ __u8 num_subevents;
+ __u8 subevents[];
+} __packed;
+
+#define HCI_OP_LE_SET_PER_ADV_PARAMS_V2 0x2086
+struct hci_cp_le_set_per_adv_params_v2 {
+ __u8 handle;
+ __le16 min_interval;
+ __le16 max_interval;
+ __le16 periodic_properties;
+ __u8 num_subevents;
+ __u8 subevent_interval;
+ __u8 response_slot_delay;
+ __u8 response_slot_spacing;
+ __u8 num_response_slots;
+} __packed;
+
#define HCI_OP_LE_READ_ALL_LOCAL_FEATURES 0x2087
struct hci_rp_le_read_all_local_features {
__u8 status;
@@ -3380,6 +3413,32 @@ struct hci_evt_le_big_info_adv_report {
__u8 encryption;
} __packed;
+#define HCI_EV_LE_PER_ADV_SUBEVENT_DATA_REQ 0x27
+struct hci_ev_le_per_adv_subevent_data_req {
+ __u8 handle;
+ __u8 subevent_start;
+ __u8 subevent_data_count;
+} __packed;
+
+struct hci_le_per_adv_response {
+ __s8 tx_power;
+ __s8 rssi;
+ __u8 cte_type;
+ __u8 response_slot;
+ __u8 data_status;
+ __u8 data_len;
+ __u8 data[] __counted_by(data_len);
+} __packed;
+
+#define HCI_EV_LE_PER_ADV_RESPONSE_REPORT 0x28
+struct hci_ev_le_per_adv_response_report {
+ __u8 handle;
+ __u8 subevent;
+ __u8 tx_status;
+ __u8 num_responses;
+ __u8 responses[];
+} __packed;
+
#define HCI_EVT_LE_ALL_REMOTE_FEATURES_COMPLETE 0x2b
struct hci_evt_le_read_all_remote_features_complete {
__u8 status;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4aa0b49ae104..250245186702 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2140,6 +2140,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
/* Periodic advertising support */
#define per_adv_capable(dev) (((dev)->le_features[1] & HCI_LE_PERIODIC_ADV))
+/* Periodic Advertising with Responses support */
+#define pawr_adv_capable(dev) \
+ ((dev)->le_features[5] & HCI_LE_PAWR_ADVERTISER)
+#define pawr_scan_capable(dev) \
+ ((dev)->le_features[5] & HCI_LE_PAWR_SCANNER)
+
/* CIS Master/Slave and BIS support */
#define iso_capable(dev) (cis_capable(dev) || bis_capable(dev))
#define iso_enabled(dev) (le_enabled(dev) && iso_capable(dev))
--
2.47.3
next prev parent reply other threads:[~2026-11-27 8:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 8:53 [RFC PATCH 0/5] Bluetooth: Periodic advertising and PAwR over MGMT Roland Schober
2026-11-27 8:53 ` Roland Schober [this message]
2026-11-27 13:58 ` bluez.test.bot
2026-11-27 8:53 ` [RFC PATCH 2/5] Bluetooth: hci_sync: Disable periodic advertising before removing a set Roland Schober
2026-11-27 8:53 ` [RFC PATCH 3/5] Bluetooth: MGMT: Add Add Periodic Advertising Parameters command Roland Schober
2026-11-27 8:53 ` [RFC PATCH 4/5] Bluetooth: MGMT: Add Add Periodic Advertising Data command Roland Schober
2026-11-27 8:54 ` [RFC PATCH 5/5] Bluetooth: MGMT: Add PAwR subevent data and response reports Roland Schober
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127085401.263615-2-rolandschober1968@gmail.com \
--to=rolandschober1968@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.