From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796336063; b=Tnaad/rB7e7NCPMkRn41x91X179yhAgYMkej513eJF6I1GPLzFcGNPyNV+AGZDclwFBE 6v/Gfm1L3MTGcTOZQqVF9h0bk2IFE5o1h7GZ4w0LjMbFix7vVZ0xlvJxJlmMLiElEyVMz o0zToASqRDAVnu9vKrF/M5W0ss7Ht/sCycsA6gZm3mrNO68vGBr9tKH8pU35WpT1iuKh+ oXsbp09aQch7WSLDQ9U+JpfOlYMxQ/4WTCEALciQHnKO+nUASt1H3WAvadTUjw2EJlO7y Y2aZeRQ96r4IC8i0IxKfGzN2Jg2A1V5yrx86F7ljzQWmwllUxdwvoqYZL/5it5cnNNQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796336063; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=tsSPL51FeALmAR/qfsWQKAbY9gJVU1A5IbpKy4+QT3M=; b=IB9BRlzf+Vb0wNdBYMd7OVbu7cu7oA5JL3WsEeq2T1C85FTJJ7EmhuoDT0XwHlko+8rY 4xoB0IzTZYs4GZ3oERbzyrB7R7fOri2Fj9GaFR90hNpCpxIO5Amg1VMQHryWqv+xpQHJ4 4S4M9qiEjoL2T/xxUU1EbSUV/qMAJGVtwyhqkSUF4B/Hm2hMMY0QLMyRYorh+5g+YHF+X N/u0HxpFNfxwiP3ttJDxCjdde8Se3cJdU12YjadYxIUKo9i27d5HuWWSrdzC5Vp8MG35j GLEC7YY2pO4BmZFTkasZblRpvHpl2WDMwNxt8uRIR0Lmy/T+EAXVcRh/5KQuNRX8CQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uK6P617W; arc=none smtp.remote-ip=209.85.221.44 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C03B606A32C for ; Thu, 3 Dec 2026 22:14:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0C03B606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uK6P617W Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-4a3ac4ac65bso34283f8f.2 for ; Thu, 03 Dec 2026 14:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796336061; x=1796940861; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tsSPL51FeALmAR/qfsWQKAbY9gJVU1A5IbpKy4+QT3M=; b=uK6P617W5N67q7Ngt86HIg1okXsUdScMWpJkXiK5Q1EA0czEYfE41rnhxPy/jOLC29 XjpEPfOrdFpkapLAlMaEuWvF8aoXw/qz+1nrP2P40yzxWFr7vKCdWK2uORtnMQKzaec/ 8jESnz3NyGKHY3Nh2PsxyWZoI7NTffzQzmJV+AoEZ1ExIHEU5BqTUdVc5Rsplf77vaYM SSKM5r+IoRe1/u3Q9bDVEJ/gKTDAjs9wOd2vD8UYB/6qA9JN1UxK0B0ZJ7ZoUW+bvLuN wHUUPtqRHxBk8QBAkPqSEx+iGq1bD5ZbShxQ84p1TWZ+dXLvnZ8q1peS5AZ6xN1wE2HS SYcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796336061; x=1796940861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tsSPL51FeALmAR/qfsWQKAbY9gJVU1A5IbpKy4+QT3M=; b=efjh0Chtmkg88g7ttaWpL6emteZbP/mEAIB1tuyCJdFGLktJLWkibMbvrkz/+qyNVi GCLrmnlZ2xE1dqxOdCCLWWQqFGuZaqzP9wfNcI+OlSVM1Db22BCLCI9n9AwFdSUQIIez NEN/Px6o2gM2wQvlb5Y+PAsnqmLe8d+7M9pSFcxfg57KBJTMTEIQaL1NeqThraAnECRv plllzxiKdfnOU3ccQY5BNd3nN6fbTG+EACEhmgmaizyyLSXbYBeIyIwrOhjD68gmbeVR pIYDPlbsXA7YZLZxpskQiceDGEwkTTh1JrBl0/BgO2dFCM0yhtO5LERHWOJv6dEWZfzZ KSgQ== X-Gm-Message-State: APuU4Z8+caP58jg4Fry8CkKq8cq+zuDGrSrqRIoaFYyH2rjN54u95d+0 2mhKZyxqv/hVwmMYxNGFzUnNVpnvJ9w/Qv7wEPtHv1L2Pp3MF1sEPd3EiS1HuwVk X-Gm-Gg: AZFdTZdqP7/ZHmettUYUkdnDNvcc34rw53r1KyrehP+PeyCIjmjYFpl+TVrqNxWe5LP UVjApH9VHBdcLOsZqko2ld5+PzQoVu6luWX0NiVr7FXdJWB5Wst+DXLSUrF8u32dIjIbzPl7GgC 7uMpvI8GGqeE31sCzWa+z/4HPWelf/cK4SwbWgagjLSzjLLkTtEHAvyi1vQSQw3tKrBhZkIbvB5 kSCaUNLO8ZBLSRIHplVurkpRMv7GXssGcd+5+2tTp2yeqqfVr0zdvcNhCEscoRlBvucOYlvvYcB 9EQle9J3UXUiBY7SisugLvomV8eBSiV5kf6zxqy0D8bHhwKGoyG9l+nRALbgae/y0VnhuJP29Z/ UNJpdAPUqAGnWX+MUN51qz29ml3Db9Tv124qjcMP929Ay9nXhGNgj4XGPvrz2LMWs1lUuWY3BfS 5PQXYKlPpN1TebD1/EVsE1hgOp2bJo1z1KCOVA50S6sUUSKcmtH9J2z0Gl7SL5GVZ63ERfAJ3Ek dp5RaNeuZguGTkuuzJHB6iJxCdTtF+nMdyfoowQ3JLgGwMTrIYVPSHnmaaw0PVaVJhbhUCoryrv HE1GsGOtkWQRu9g7xswWLJI833P+GNx7QqZG60jEaniXg0kF X-Received: by 2002:a05:600c:1111:b0:4bb:b884:7ec6 with SMTP id 5b1f17b1804b1-4bbeb5ffc2amr698405e9.0.1796336061487; Thu, 03 Dec 2026 14:14:21 -0800 (PST) Received: from schinder.fritz.box ([2001:9e8:b39a:7900:a13b:fe74:8c9c:c788]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe00df154sm117266225e9.14.2026.12.03.14.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 14:14:21 -0800 (PST) From: Roland Schober To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, Roland Schober Subject: [RFC PATCH v2 1/6] Bluetooth: hci: Add Periodic Advertising with Responses definitions Date: Thu, 3 Dec 2026 23:14:00 +0100 Message-ID: <20261203221405.682222-2-rolandschober1968@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261203221405.682222-1-rolandschober1968@gmail.com> References: <20261203221405.682222-1-rolandschober1968@gmail.com> X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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