Bluetooth: eir: Add helpers for managing service data
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH v2 1/8 Bluetooth: eir: Add helpers for managing service data
From: Luiz Augusto von Dentz <[email protected]>
This adds helpers for accessing and appending service data (0x16) ad type.
---
v2: Fixes CI/kernel test robot findings
include/net/bluetooth/hci.h | 1 + net/bluetooth/eir.c | 31 +++++++++++++++++++++++++++++++ net/bluetooth/eir.h | 4 ++++ 3 files changed, 36 insertions(+)
include/net/bluetooth/hci.h +1 -0
@@ -625,6 +625,7 @@ enum {#define EIR_SSP_RAND_R192 0x0F/* Simple Pairing Randomizer R-192 */ #define EIR_DEVICE_ID 0x10/* device ID */ #define EIR_APPEARANCE 0x19/* Device appearance */ +#define EIR_SERVICE_DATA 0x16/* Service Data */ #define EIR_LE_BDADDR 0x1B/* LE Bluetooth device address */ #define EIR_LE_ROLE 0x1C/* LE role */ #define EIR_SSP_HASH_C256 0x1D/* Simple Pairing Hash C-256 */
net/bluetooth/eir.c +31 -0
@@ -55,6 +55,19 @@ u8 eir_append_appearance(struct hci_dev *hdev, u8 *ptr, u8 ad_len)return eir_append_le16 (ptr, ad_len,EIR_APPEARANCE , hdev->appearance); } +u8 eir_append_service_data (u8 *eir,u16 eir_len,u16 uuid,u8 *data, +u8 data_len) +{ + eir[eir_len++] =sizeof (u8) +sizeof (uuid) + data_len; + eir[eir_len++] =EIR_SERVICE_DATA ; +put_unaligned_le16 (uuid, &eir[eir_len]); + eir_len +=sizeof (uuid); +memcpy (&eir[eir_len], data, data_len); + eir_len += data_len; + +return eir_len; +} +static u8 *create_uuid16_list (struct hci_dev *hdev,u8 *data,ptrdiff_t len) {u8 *ptr = data, *uuids_start =NULL ;
@@ -333,3 +346,21 @@ u8 eir_create_scan_rsp(struct hci_dev *hdev, u8 instance, u8 *ptr)return scan_rsp_len; } + +void *eir_get_service_data (u8 *eir,size_t eir_len,u16 uuid,size_t *len) +{ +while ((eir =eir_get_data (eir, eir_len,EIR_SERVICE_DATA , len))) { +u16 value =get_unaligned_le16 (eir); + +if (uuid == value) { +if (len) + *len -=2 ; +return &eir[2 ]; + } + + eir += *len; + eir_len -= *len; + } + +return NULL ; +}
net/bluetooth/eir.h +4 -0
@@ -14,6 +14,8 @@ u8 eir_create_scan_rsp(struct hci_dev *hdev, u8 instance, u8 *ptr);u8 eir_append_local_name (struct hci_dev *hdev,u8 *eir,u8 ad_len);u8 eir_append_appearance (struct hci_dev *hdev,u8 *ptr,u8 ad_len); +u8 eir_append_service_data (u8 *eir,u16 eir_len,u16 uuid,u8 *data, +u8 data_len);static inline u16 eir_precalc_len (u8 data_len) {
@@ -92,3 +94,5 @@ static inline void *eir_get_data(u8 *eir, size_t eir_len, u8 type,return NULL ; } + +void *eir_get_service_data (u8 *eir,size_t eir_len,u16 uuid,size_t *len);
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 2/8 Bluetooth: hci_core: Introduce hci_recv_event_data
From: Luiz Augusto von Dentz <[email protected]>
This introduces hci_recv_event_data to make it simpler to access the contents of last received event rather than having to pass its contents to the likes of *_ind/*_cfm callbacks.
--- include/net/bluetooth/hci_core.h | 2 ++ net/bluetooth/hci_core.c | 32 ++++++++++++++++++++++++++++++++ net/bluetooth/hci_event.c | 3 +++ 3 files changed, 37 insertions(+)
include/net/bluetooth/hci_core.h +2 -0
@@ -516,6 +516,7 @@ struct hci_dev {struct sk_buff_head cmd_q;struct sk_buff *sent_cmd; +struct sk_buff *recv_event;struct mutex req_lock;wait_queue_head_t req_wait_q;
@@ -1739,6 +1740,7 @@ void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags);void hci_send_sco (struct hci_conn *conn,struct sk_buff *skb);void *hci_sent_cmd_data (struct hci_dev *hdev,__u16 opcode); +void *hci_recv_event_data (struct hci_dev *hdev,__u8 event);u32 hci_conn_get_phy (struct hci_conn *conn);
net/bluetooth/hci_core.c +32 -0
@@ -2738,6 +2738,7 @@ void hci_release_dev(struct hci_dev *hdev)ida_simple_remove (&hci_index_ida, hdev->id);kfree_skb (hdev->sent_cmd); +kfree_skb (hdev->recv_event);kfree (hdev); }EXPORT_SYMBOL (hci_release_dev);
@@ -3022,6 +3023,37 @@ void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode)return hdev->sent_cmd->data +HCI_COMMAND_HDR_SIZE ; } +/* Get data from last received event */ +void *hci_recv_event_data (struct hci_dev *hdev,__u8 event) +{ +struct hci_event_hdr *hdr; +int offset; + +if (!hdev->recv_event) +return NULL ; + + hdr = (void *)hdev->recv_event->data; + offset =sizeof (*hdr); + +if (hdr->evt != event) { +/* In case of LE metaevent check the subevent match */ +if (hdr->evt ==HCI_EV_LE_META ) { +struct hci_ev_le_meta *ev; + + ev = (void *)hdev->recv_event->data + offset; + offset +=sizeof (*ev); +if (ev->subevent == event) + goto found; + } +return NULL ; + } + +found: +bt_dev_dbg (hdev,"event 0x%2.2x" , event); + +return hdev->recv_event->data + offset; +} +/* Send ACL data */ static void hci_add_acl_hdr (struct sk_buff *skb,__u16 handle,__u16 flags) {
net/bluetooth/hci_event.c +3 -0
@@ -6933,6 +6933,9 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) goto done; } +kfree_skb (hdev->recv_event); + hdev->recv_event =skb_clone (skb,GFP_KERNEL ); + event = hdr->evt;if (!event) { bt_dev_warn(hdev, "Received unexpected HCI Event 0x%2.2x",
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 3/8 Bluetooth: Add initial implementation of CIS connections
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This adds the initial implementation of CIS connections and introduces the ISO packets/links.
== Central: Set CIG Parameters, create a CIS and Setup Data Path ==
Quoted 1 line
tools/isotest-s <address>
< HCI Command: LE Extended Create... (0x08|0x0043) plen 26
...
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Extended Create Connection (0x08|0x0043) ncmd 1
Status: Success (0x00)Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 31
LE Enhanced Connection Complete (0x0a)
...< HCI Command: LE Create Connected... (0x08|0x0064) plen 5
...
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Create Connected Isochronous Stream (0x08|0x0064) ncmd 1
Status: Success (0x00)Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 29
LE Connected Isochronous Stream Established (0x19)
...< HCI Command: LE Setup Isochronou.. (0x08|0x006e) plen 13
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 6
LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
Status: Success (0x00)
Handle: 257< HCI Command: LE Setup Isochronou.. (0x08|0x006e) plen 13
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 6
LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
Status: Success (0x00)
Handle: 257== Peripheral: Accept CIS and Setup Data Path ==
Quoted 1 line
tools/isotest-d
HCI Event: LE Meta Event (0x3e) plen 7
LE Connected Isochronous Stream Request (0x1a)
...
< HCI Command: LE Accept Co.. (0x08|0x0066) plen 2
...
Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 29
LE Connected Isochronous Stream Established (0x19)
...
< HCI Command: LE Setup Is.. (0x08|0x006e) plen 13
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 6
LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
Status: Success (0x00)
Handle: 257< HCI Command: LE Setup Is.. (0x08|0x006e) plen 13
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 6
LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
Status: Success (0x00)
Handle: 257--- include/net/bluetooth/bluetooth.h | 33 ++- include/net/bluetooth/hci.h | 28 +- include/net/bluetooth/hci_core.h | 107 +++++++- include/net/bluetooth/hci_sock.h | 2 + include/net/bluetooth/hci_sync.h | 3 + net/bluetooth/Kconfig | 1 + net/bluetooth/hci_conn.c | 434 ++++++++++++++++++++++++++++++ net/bluetooth/hci_core.c | 230 ++++++++++++---- net/bluetooth/hci_event.c | 307 ++++++++++++++++++++- net/bluetooth/hci_sync.c | 49 +++- 10 files changed, 1139 insertions(+), 55 deletions(-)
include/net/bluetooth/bluetooth.h +32 -1
@@ -55,6 +55,8 @@#define BTPROTO_CMTP 5#define BTPROTO_HIDP 6#define BTPROTO_AVDTP 7 +#define BTPROTO_ISO 8 +#define BTPROTO_LAST BTPROTO_ISO#define SOL_HCI 0#define SOL_L2CAP 6
@@ -149,10 +151,39 @@ struct bt_voice {#define BT_MODE_LE_FLOWCTL 0x03#define BT_MODE_EXT_FLOWCTL 0x04 -#define BT_PKT_STATUS 16 +#define BT_PKT_STATUS 16#define BT_SCM_PKT_STATUS 0x03 +#define BT_ISO_QOS 17 + +#define BT_ISO_QOS_CIG_UNSET 0xff +#define BT_ISO_QOS_CIS_UNSET 0xff + +struct bt_iso_io_qos { +__u32 interval; +__u16 latency; +__u16 sdu; +__u8 phy; +__u8 rtn; +}; + +struct bt_iso_qos { +__u8 cig; +__u8 cis; +__u8 sca; +__u8 packing; +__u8 framing; +struct bt_iso_io_qos in; +struct bt_iso_io_qos out; +}; + +#define BT_ISO_PHY_1M 0x01 +#define BT_ISO_PHY_2M 0x02 +#define BT_ISO_PHY_CODED 0x04 +#define BT_ISO_PHY_ANY (BT_ISO_PHY_1M | BT_ISO_PHY_2M | \ + BT_ISO_PHY_CODED) +#define BT_CODEC 19struct bt_codec_caps {
include/net/bluetooth/hci.h +26 -2
@@ -1998,7 +1998,7 @@ struct hci_rp_le_read_iso_tx_sync {struct hci_cis_params {__u8 cis_id;__le16 c_sdu; -__le16 p_pdu; +__le16 p_sdu;__u8 c_phy;__u8 p_phy;__u8 c_rtn;
@@ -2009,7 +2009,7 @@ struct hci_cp_le_set_cig_params {__u8 cig_id;__u8 c_interval[3 ];__u8 p_interval[3 ]; -__u8 wc_sca; +__u8 sca;__u8 packing;__u8 framing;__le16 c_latency;
@@ -2052,6 +2052,30 @@ struct hci_cp_le_reject_cis {__u8 reason; } __packed; +#define HCI_OP_LE_SETUP_ISO_PATH 0x206e +struct hci_cp_le_setup_iso_path { +__le16 handle; +__u8 direction; +__u8 path; +__u8 codec; +__le16 codec_cid; +__le16 codec_vid; +__u8 delay[3 ]; +__u8 codec_cfg_len; +__u8 codec_cfg[0 ]; +} __packed; + +struct hci_rp_le_setup_iso_path { +__u8 status; +__le16 handle; +} __packed; + +#define HCI_OP_LE_SET_HOST_FEATURE 0x2074 +struct hci_cp_le_set_host_feature { +__u8 bit_number; +__u8 bit_value; +} __packed; +/* ---- HCI Events ---- */ struct hci_ev_status {__u8 status;
include/net/bluetooth/hci_core.h +106 -1
216 lines not on this page · raw message
include/net/bluetooth/hci_sock.h +2 -0
@@ -124,6 +124,8 @@ struct hci_dev_info {__u16 acl_pkts;__u16 sco_mtu;__u16 sco_pkts; +__u16 iso_mtu; +__u16 iso_pkts;struct hci_dev_stats stat; };
include/net/bluetooth/hci_sync.h +3 -0
@@ -106,3 +106,6 @@ int hci_resume_sync(struct hci_dev *hdev);struct hci_conn ;int hci_le_create_conn_sync (struct hci_dev *hdev,struct hci_conn *conn); + +int hci_le_remove_cig_sync (struct hci_dev *hdev,u8 handle); +int hci_le_remove_cig (struct hci_dev *hdev,u8 handle);
net/bluetooth/Kconfig +1 -0
@@ -29,6 +29,7 @@ menuconfig BT SCO audio links L2CAP (Logical Link Control and Adaptation Protocol) SMP (Security Manager Protocol) on LE (Low Energy) links + ISO isochronous links HCI Device drivers (Interface to the hardware) RFCOMM Module (RFCOMM Protocol) BNEP Module (Bluetooth Network Encapsulation Protocol)
net/bluetooth/hci_conn.c +434 -0
452 lines not on this page · raw message
net/bluetooth/hci_core.c +183 -47
292 lines not on this page · raw message
net/bluetooth/hci_event.c +304 -3
355 lines not on this page · raw message
net/bluetooth/hci_sync.c +48 -1
88 lines not on this page · raw message
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 4/8 Bluetooth: Add BTPROTO_ISO socket type
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This introduces a new socket type BTPROTO_ISO which can be enabled with use of ISO Socket experiemental UUID, it can used to initiate/accept connections and transfer packets between userspace and kernel similarly to how BTPROTO_SCO works:
Central -> uses connect with address set to destination bdaddr:
Quoted 1 line
tools/isotest-s 00:AA:01:00:00:00
Peripheral -> uses listen:
Quoted 1 line
tools/isotest-d
--- include/net/bluetooth/bluetooth.h | 21 + include/net/bluetooth/hci_core.h | 18 +- include/net/bluetooth/iso.h | 21 + net/bluetooth/Makefile | 1 + net/bluetooth/af_bluetooth.c | 4 +- net/bluetooth/hci_core.c | 6 +- net/bluetooth/hci_event.c | 4 +- net/bluetooth/iso.c | 1452 +++++++++++++++++++++++++++++ net/bluetooth/mgmt.c | 69 +- 9 files changed, 1589 insertions(+), 7 deletions(-) create mode 100644 include/net/bluetooth/iso.h create mode 100644 net/bluetooth/iso.c
include/net/bluetooth/bluetooth.h +21 -0
@@ -589,6 +589,27 @@ static inline void sco_exit(void) }#endif +#if IS_ENABLED (CONFIG_BT_LE ) +int iso_init (void ); +int iso_exit (void ); +bool iso_enabled (void ); +#else +static inline int iso_init (void ) +{ +return 0 ; +} + +static inline int iso_exit (void ) +{ +return 0 ; +} + +static inline bool iso_enabled (void ) +{ +return false; +} +#endif +int mgmt_init (void );void mgmt_exit (void );
include/net/bluetooth/hci_core.h +16 -2
@@ -834,6 +834,21 @@ static inline void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) }#endif +#if IS_ENABLED (CONFIG_BT_LE ) +int iso_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr,__u8 *flags); +void iso_recv (struct hci_conn *hcon,struct sk_buff *skb,u16 flags); +#else +static inline int iso_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr, +__u8 *flags) +{ +return 0 ; +} +static inline void iso_recv (struct hci_conn *hcon,struct sk_buff *skb, +u16 flags) +{ +} +#endif +/* ----- Inquiry cache ----- */ #define INQUIRY_CACHE_AGE_MAX (HZ*30)/* 30 seconds */ #define INQUIRY_ENTRY_AGE_MAX (HZ*60)/* 60 seconds */
@@ -1632,8 +1647,7 @@ static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,return sco_connect_ind (hdev, bdaddr, flags);case ISO_LINK : -/* TODO: Handle connection indication */ -return -EINVAL ; +return iso_connect_ind (hdev, bdaddr, flags);default :BT_ERR ("unknown link type %d" , type);
include/net/bluetooth/iso.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* BlueZ - Bluetooth protocol stack for Linux +* +* Copyright (C) 2022 Intel Corporation +*/ + +#ifndef __ISO_H +#define __ISO_H + +/* ISO defaults */ +#define ISO_DEFAULT_MTU 251 + +/* ISO socket address */ +struct sockaddr_iso { +sa_family_t iso_family; +bdaddr_t iso_bdaddr; +__u8 iso_bdaddr_type; +}; + +#endif /* __ISO_H */
net/bluetooth/Makefile +1 -0
@@ -18,6 +18,7 @@ bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ eir.o hci_sync.o bluetooth-$(CONFIG_BT_BREDR) += sco.o +bluetooth-$(CONFIG_BT_LE) += iso.o bluetooth-$(CONFIG_BT_HS) += a2mp.o amp.o bluetooth-$(CONFIG_BT_LEDS) += leds.o bluetooth-$(CONFIG_BT_MSFTEXT) += msft.o
net/bluetooth/af_bluetooth.c +3 -1
@@ -38,7 +38,7 @@#include "selftest.h" /* Bluetooth sockets */ -#define BT_MAX_PROTO 8 +#define BT_MAX_PROTO (BTPROTO_LAST + 1)static const struct net_proto_family *bt_proto[BT_MAX_PROTO ];static DEFINE_RWLOCK (bt_proto_lock);
@@ -52,6 +52,7 @@ static const char *const bt_key_strings[BT_MAX_PROTO] = {"sk_lock-AF_BLUETOOTH-BTPROTO_CMTP" ,"sk_lock-AF_BLUETOOTH-BTPROTO_HIDP" ,"sk_lock-AF_BLUETOOTH-BTPROTO_AVDTP" , + "sk_lock-AF_BLUETOOTH-BTPROTO_ISO", };static struct lock_class_key bt_slock_key[BT_MAX_PROTO ];
@@ -64,6 +65,7 @@ static const char *const bt_slock_key_strings[BT_MAX_PROTO] = {"slock-AF_BLUETOOTH-BTPROTO_CMTP" ,"slock-AF_BLUETOOTH-BTPROTO_HIDP" ,"slock-AF_BLUETOOTH-BTPROTO_AVDTP" , + "slock-AF_BLUETOOTH-BTPROTO_ISO", };void bt_sock_reclassify_lock (struct sock *sk,int proto)
net/bluetooth/hci_core.c +5 -1
@@ -3826,12 +3826,16 @@ static void hci_isodata_packet(struct hci_dev *hdev, struct sk_buff *skb) conn =hci_conn_hash_lookup_handle (hdev, handle);hci_dev_unlock (hdev); -/* TODO: Send to upper protocol */ if (!conn) {bt_dev_err (hdev,"ISO packet for unknown connection handle %d" , handle); + goto drop; } +/* Send to upper protocol */ +iso_recv (conn, skb, flags); +return ; + drop:kfree_skb (skb); }
net/bluetooth/hci_event.c +2 -2
@@ -3827,8 +3827,8 @@ static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data, conn->handle =__le16_to_cpu (rp->handle[i++]); -BT_DBG ("%p handle 0x%4.4x link %p state %u" , conn, conn->handle, - conn->link, conn->link->state); +bt_dev_dbg (hdev,"%p handle 0x%4.4x link %p state %u" , conn, + conn->handle, conn->link, conn->link->state);/* Create CIS if LE is already connected */ if (conn->link->state ==BT_CONNECTED )
net/bluetooth/iso.c new file +1452 -0
1,452 lines not on this page · raw message
net/bluetooth/mgmt.c +68 -1
96 lines not on this page · raw message
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 5/8 Bluetooth: Add initial implementation of BIS connections
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This adds initial support for BIS/BIG which includes:
== Broadcaster role: Setup a periodic advertising and create a BIG ==
Quoted 1 line
tools/isotest-s 00:00:00:00:00:00
isotest[63]: Connected [00:00:00:00:00:00]
isotest[63]: QoS BIG 0x00 BIS 0x00 Packing 0x00 Framing 0x00] isotest[63]: Output QoS [Interval 10000 us Latency 10 ms SDU 40 PHY 0x02 RTN 2]
isotest[63]: Sending ...
isotest[63]: Number of packets: 1
isotest[63]: Socket jitter buffer: 80 buffer
< HCI Command: LE Set Perio.. (0x08|0x003e) plen 7
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
LE Set Periodic Advertising Parameters (0x08|0x003e) ncmd 1
Status: Success (0x00)< HCI Command: LE Set Perio.. (0x08|0x003f) plen 7
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
LE Set Periodic Advertising Data (0x08|0x003f) ncmd 1
Status: Success (0x00)< HCI Command: LE Set Perio.. (0x08|0x0040) plen 2
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
LE Set Periodic Advertising Enable (0x08|0x0040) ncmd 1
Status: Success (0x00)< HCI Command: LE Create B.. (0x08|0x0068) plen 31
...
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Create Broadcast Isochronous Group (0x08|0x0068) ncmd 1
Status: Success (0x00)Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 21
LE Broadcast Isochronous Group Complete (0x1b)
...== Broadcast Receiver role: Create a PA Sync and BIG Sync ==
Quoted 1 line
tools/isotest-i hci1 -d 00:AA:01:00:00:00
isotest[66]: Waiting for connection 00:AA:01:00:00:00... < HCI Command: LE Periodic Advert.. (0x08|0x0044) plen 14
...
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Periodic Advertising Create Sync (0x08|0x0044) ncmd 1
Status: Success (0x00)< HCI Command: LE Set Extended Sca.. (0x08|0x0041) plen 8
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1
Status: Success (0x00)< HCI Command: LE Set Extended Sca.. (0x08|0x0042) plen 6
...
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 4
LE Set Extended Scan Enable (0x08|0x0042) ncmd 1
Status: Success (0x00)Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 29
LE Extended Advertising Report (0x0d)
...Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 16
LE Periodic Advertising Sync Established (0x0e)
...< HCI Command: LE Broadcast Isoch.. (0x08|0x006b) plen 25
...
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Broadcast Isochronous Group Create Sync (0x08|0x006b) ncmd 1
Status: Success (0x00)Quoted 1 line
HCI Event: LE Meta Event (
0x3e) plen 17
LE Broadcast Isochronous Group Sync Estabilished (0x1d)
...--- include/net/bluetooth/bluetooth.h | 18 +- include/net/bluetooth/hci.h | 162 ++++++++- include/net/bluetooth/hci_core.h | 89 ++++- include/net/bluetooth/hci_sync.h | 12 +- net/bluetooth/eir.c | 21 ++ net/bluetooth/eir.h | 1 + net/bluetooth/hci_conn.c | 560 +++++++++++++++++++++++++++--- net/bluetooth/hci_core.c | 89 +++-- net/bluetooth/hci_event.c | 206 +++++++++++ net/bluetooth/hci_request.c | 36 +- net/bluetooth/hci_request.h | 9 + net/bluetooth/hci_sync.c | 250 ++++++++++++- net/bluetooth/mgmt.c | 15 +- 13 files changed, 1337 insertions(+), 131 deletions(-)
include/net/bluetooth/bluetooth.h +15 -3
@@ -160,6 +160,9 @@ struct bt_voice {#define BT_ISO_QOS_CIG_UNSET 0xff#define BT_ISO_QOS_CIS_UNSET 0xff +#define BT_ISO_QOS_BIG_UNSET 0xff +#define BT_ISO_QOS_BIS_UNSET 0xff +struct bt_iso_io_qos {__u32 interval;__u16 latency;
@@ -169,9 +172,18 @@ struct bt_iso_io_qos { };struct bt_iso_qos { -__u8 cig; -__u8 cis; -__u8 sca; +union { +__u8 cig; +__u8 big; + }; +union { +__u8 cis; +__u8 bis; + }; +union { +__u8 sca; +__u8 sync_interval; + };__u8 packing;__u8 framing;struct bt_iso_io_qos in;
include/net/bluetooth/hci.h +155 -7
219 lines not on this page · raw message
include/net/bluetooth/hci_core.h +80 -9
167 lines not on this page · raw message
include/net/bluetooth/hci_sync.h +11 -1
@@ -65,6 +65,10 @@ int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance);int hci_enable_advertising_sync (struct hci_dev *hdev);int hci_enable_advertising (struct hci_dev *hdev); +int hci_start_per_adv_sync (struct hci_dev *hdev,u8 instance,u8 data_len, +u8 *data,u32 flags,u16 min_interval, +u16 max_interval,u16 sync_interval); +int hci_remove_advertising_sync (struct hci_dev *hdev,struct sock *sk,u8 instance,bool force);int hci_disable_advertising_sync (struct hci_dev *hdev);
@@ -82,6 +86,7 @@ int hci_update_scan_sync(struct hci_dev *hdev);int hci_write_le_host_supported_sync (struct hci_dev *hdev,u8 le,u8 simul);int hci_remove_ext_adv_instance_sync (struct hci_dev *hdev,u8 instance,struct sock *sk); +int hci_remove_ext_adv_instance (struct hci_dev *hdev,u8 instance);struct sk_buff *hci_read_local_oob_data_sync (struct hci_dev *hdev,bool ext,struct sock *sk);
@@ -108,4 +113,9 @@ struct hci_conn;int hci_le_create_conn_sync (struct hci_dev *hdev,struct hci_conn *conn);int hci_le_remove_cig_sync (struct hci_dev *hdev,u8 handle); -int hci_le_remove_cig (struct hci_dev *hdev,u8 handle); + +int hci_le_terminate_big_sync (struct hci_dev *hdev,u8 handle,u8 reason); + +int hci_le_big_terminate_sync (struct hci_dev *hdev,u8 handle); + +int hci_le_pa_terminate_sync (struct hci_dev *hdev,u16 handle);
net/bluetooth/eir.c +21 -0
@@ -225,6 +225,27 @@ void eir_create(struct hci_dev *hdev, u8 *data) ptr =create_uuid128_list (hdev, ptr,HCI_MAX_EIR_LENGTH - (ptr - data)); } +u8 eir_create_per_adv_data (struct hci_dev *hdev,u8 instance,u8 *ptr) +{ +struct adv_info *adv =NULL ; +u8 ad_len =0 ; + +/* Return 0 when the current instance identifier is invalid. */ +if (instance) { + adv =hci_find_adv_instance (hdev, instance); +if (!adv) +return 0 ; + } + +if (adv) { +memcpy (ptr, adv->per_adv_data, adv->per_adv_data_len); + ad_len += adv->per_adv_data_len; + ptr += adv->per_adv_data_len; + } + +return ad_len; +} +u8 eir_create_adv_data (struct hci_dev *hdev,u8 instance,u8 *ptr) {struct adv_info *adv =NULL ;
net/bluetooth/eir.h +1 -0
@@ -11,6 +11,7 @@ void eir_create(struct hci_dev *hdev, u8 *data);u8 eir_create_adv_data (struct hci_dev *hdev,u8 instance,u8 *ptr);u8 eir_create_scan_rsp (struct hci_dev *hdev,u8 instance,u8 *ptr); +u8 eir_create_per_adv_data (struct hci_dev *hdev,u8 instance,u8 *ptr);u8 eir_append_local_name (struct hci_dev *hdev,u8 *eir,u8 ad_len);u8 eir_append_appearance (struct hci_dev *hdev,u8 *ptr,u8 ad_len);
net/bluetooth/hci_conn.c +507 -53
621 lines not on this page · raw message
net/bluetooth/hci_core.c +54 -35
117 lines not on this page · raw message
net/bluetooth/hci_event.c +206 -0
248 lines not on this page · raw message
net/bluetooth/hci_request.c +21 -15
@@ -827,7 +827,6 @@ void __hci_req_disable_advertising(struct hci_request *req) {if (ext_adv_capable (req->hdev)) {__hci_req_disable_ext_adv_instance (req,0x00 ); - }else {u8 enable =0x00 ;
@@ -1338,15 +1337,15 @@ int __hci_req_setup_ext_adv_instance(struct hci_request *req, u8 instance)bdaddr_t random_addr;u8 own_addr_type;int err; -struct adv_info *adv_instance; -bool secondary_adv; +struct adv_info *adv; +bool secondary_adv, require_privacy;if (instance >0 ) { - adv_instance =hci_find_adv_instance (hdev, instance); -if (!adv_instance) + adv =hci_find_adv_instance (hdev, instance); +if (!adv)return -EINVAL ; }else { - adv_instance =NULL ; + adv =NULL ; } flags =hci_adv_instance_flags (hdev, instance);
@@ -1364,18 +1363,24 @@ int __hci_req_setup_ext_adv_instance(struct hci_request *req, u8 instance)* advertising is used. In that case it is fine to use a * non-resolvable private address. */ - err =hci_get_random_address (hdev, !connectable, -adv_use_rpa (hdev, flags), adv_instance, + require_privacy = !connectable; + +/* Don't require privacy for periodic adv? */ +if (adv && adv->periodic) + require_privacy = false; + + err =hci_get_random_address (hdev, require_privacy, +adv_use_rpa (hdev, flags), adv, &own_addr_type, &random_addr);if (err <0 )return err;memset (&cp,0 ,sizeof (cp)); -if (adv_instance) { -hci_cpu_to_le24 (adv_instance->min_interval, cp.min_interval); -hci_cpu_to_le24 (adv_instance->max_interval, cp.max_interval); - cp.tx_power = adv_instance->tx_power; +if (adv) { +hci_cpu_to_le24 (adv->min_interval, cp.min_interval); +hci_cpu_to_le24 (adv->max_interval, cp.max_interval); + cp.tx_power = adv->tx_power; }else {hci_cpu_to_le24 (hdev->le_adv_min_interval, cp.min_interval);hci_cpu_to_le24 (hdev->le_adv_max_interval, cp.max_interval);
@@ -1396,7 +1401,8 @@ int __hci_req_setup_ext_adv_instance(struct hci_request *req, u8 instance)else cp.evt_properties =cpu_to_le16 (LE_LEGACY_ADV_SCAN_IND ); }else { -if (secondary_adv) +/* Secondary and periodic cannot use legacy PDUs */ +if (secondary_adv || (adv && adv->periodic)) cp.evt_properties =cpu_to_le16 (LE_EXT_ADV_NON_CONN_IND );else cp.evt_properties =cpu_to_le16 (LE_LEGACY_NONCONN_IND );
@@ -1426,8 +1432,8 @@ int __hci_req_setup_ext_adv_instance(struct hci_request *req, u8 instance)struct hci_cp_le_set_adv_set_rand_addr cp;/* Check if random address need to be updated */ -if (adv_instance) { -if (!bacmp (&random_addr, &adv_instance->random_addr)) +if (adv) { +if (!bacmp (&random_addr, &adv->random_addr))return 0 ; }else {if (!bacmp (&random_addr, &hdev->random_addr))
net/bluetooth/hci_request.h +9 -0
@@ -85,6 +85,9 @@ void __hci_req_enable_advertising(struct hci_request *req);void __hci_req_disable_advertising (struct hci_request *req);void __hci_req_update_adv_data (struct hci_request *req,u8 instance);int hci_req_update_adv_data (struct hci_dev *hdev,u8 instance); +int hci_req_start_per_adv (struct hci_dev *hdev,u8 instance,u32 flags, +u16 min_interval,u16 max_interval, +u16 sync_interval);void __hci_req_update_scan_rsp_data (struct hci_request *req,u8 instance); int __hci_req_schedule_adv_instance(struct hci_request *req, u8 instance,
@@ -94,8 +97,14 @@ void hci_req_clear_adv_instance(struct hci_dev *hdev, struct sock *sk, bool force);int __hci_req_setup_ext_adv_instance (struct hci_request *req,u8 instance); +int __hci_req_setup_per_adv_instance (struct hci_request *req,u8 instance, +u16 min_interval,u16 max_interval);int __hci_req_start_ext_adv (struct hci_request *req,u8 instance); +int __hci_req_start_per_adv (struct hci_request *req,u8 instance,u32 flags, +u16 min_interval,u16 max_interval, +u16 sync_interval);int __hci_req_enable_ext_advertising (struct hci_request *req,u8 instance); +int __hci_req_enable_per_advertising (struct hci_request *req,u8 instance);int __hci_req_disable_ext_adv_instance (struct hci_request *req,u8 instance);int __hci_req_remove_ext_adv_instance (struct hci_request *req,u8 instance);void __hci_req_clear_ext_adv_sets (struct hci_request *req);
net/bluetooth/hci_sync.c +249 -1
277 lines not on this page · raw message
net/bluetooth/mgmt.c +8 -7
@@ -8148,7 +8148,7 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,u16 timeout, duration;unsigned int prev_instance_cnt;u8 schedule_instance =0 ; -struct adv_info *next_instance; +struct adv_info *adv, *next_instance;int err;struct mgmt_pending_cmd *cmd;
@@ -8199,7 +8199,7 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev, prev_instance_cnt = hdev->adv_instance_cnt; - err = hci_add_adv_instance(hdev, cp->instance, flags, + adv = hci_add_adv_instance(hdev, cp->instance, flags, cp->adv_data_len, cp->data, cp->scan_rsp_len, cp->data + cp->adv_data_len,
@@ -8207,7 +8207,7 @@ static int add_advertising(struct sock *sk, struct hci_dev *hdev,HCI_ADV_TX_POWER_NO_PREFERENCE , hdev->le_adv_min_interval, hdev->le_adv_max_interval); -if (err <0 ) { +if (IS_ERR (adv)) { err =mgmt_cmd_status (sk, hdev->id,MGMT_OP_ADD_ADVERTISING ,MGMT_STATUS_FAILED ); goto unlock;
@@ -8338,6 +8338,7 @@ static int add_ext_adv_params(struct sock *sk, struct hci_dev *hdev,struct mgmt_cp_add_ext_adv_params *cp = data;struct mgmt_rp_add_ext_adv_params rp;struct mgmt_pending_cmd *cmd =NULL ; +struct adv_info *adv;u32 flags, min_interval, max_interval;u16 timeout, duration;u8 status;
@@ -8407,11 +8408,11 @@ static int add_ext_adv_params(struct sock *sk, struct hci_dev *hdev,HCI_ADV_TX_POWER_NO_PREFERENCE ;/* Create advertising instance with no advertising or response data */ - err =hci_add_adv_instance (hdev, cp->instance, flags, -0 ,NULL ,0 ,NULL , timeout, duration, - tx_power, min_interval, max_interval); + adv =hci_add_adv_instance (hdev, cp->instance, flags,0 ,NULL ,0 ,NULL , + timeout, duration, tx_power, min_interval, + max_interval); -if (err <0 ) { +if (IS_ERR (adv)) { err =mgmt_cmd_status (sk, hdev->id,MGMT_OP_ADD_EXT_ADV_PARAMS ,MGMT_STATUS_FAILED ); goto unlock;
Signature · 1 line
2.35.1
Dan Carpenter
build botRe: [PATCH v2 5/8] Bluetooth: Add initial implementation of BIS connections
CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com In-Reply-To: <[email protected]> References: <[email protected]> TO: Luiz Augusto von Dentz…
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Luiz Augusto von Dentz <[email protected]>
TO: linux-bluetooth(a)vger.kernel.org
Hi Luiz,
I love your patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on bluetooth/master v5.18-rc6 next-20220511] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Luiz-Augusto-von-Dentz/Bluetooth-eir-Add-helpers-for-managing-service-data/20220507-060014 base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: csky-randconfig-m031-20220508 (https://download.01.org/0day-ci/archive/20220512/202205121532.jtQf7nFA-lkp(a)intel.com/config)
compiler: csky-linux-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag as appropriate
New smatch warnings:net/bluetooth/hci_sync.c:1110 hci_start_per_adv_sync() warn: passing zero to 'PTR_ERR'
Old smatch warnings:net/bluetooth/hci_sync.c:195 __hci_cmd_sync_sk() error: (-2147483647) too low for ERR_PTR net/bluetooth/hci_sync.c:2027 hci_resume_advertising_sync() error: uninitialized symbol 'err'.
vim +/PTR_ERR +1110 net/bluetooth/hci_sync.c
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1090
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1091 int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1092 u8 *data, u32 flags, u16 min_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1093 u16 max_interval, u16 sync_interval)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1094 {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1095 struct adv_info *adv = NULL;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1096 int err;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1097 bool added = false;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1098
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1099 hci_disable_per_advertising_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1100
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1101 if (instance) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1102 adv = hci_find_adv_instance(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1103 /* Create an instance if that could not be found */
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1104 if (!adv) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1105 adv = hci_add_per_instance(hdev, instance, flags,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1106 data_len, data,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1107 sync_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1108 sync_interval);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1109 if (IS_ERR_OR_NULL(adv))
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 @1110 return PTR_ERR(adv);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1111 added = true;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1112 }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1113 }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1114
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1115 /* Only start advertising if instance 0 or if a dedicated instance has
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1116 * been added.
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1117 */
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1118 if (!adv || added) {
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1119 err = hci_start_ext_adv_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1120 if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1121 goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1122
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1123 err = hci_adv_bcast_annoucement(hdev, adv);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1124 if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1125 goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1126 }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1127
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1128 err = hci_set_per_adv_params_sync(hdev, instance, min_interval,
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1129 max_interval);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1130 if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1131 goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1132
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1133 err = hci_set_per_adv_data_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1134 if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1135 goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1136
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1137 err = hci_enable_per_advertising_sync(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1138 if (err < 0)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1139 goto fail;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1140
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1141 return 0;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1142
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1143 fail:
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1144 if (added)
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1145 hci_remove_adv_instance(hdev, instance);
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1146
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1147 return err;
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1148 }
2f80269de71810 Luiz Augusto von Dentz 2022-05-06 1149 Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
Luiz Augusto von Dentz
maintainerPATCH v2 6/8 Bluetooth: ISO: Add broadcast support
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This adds broadcast support for BTPROTO_ISO by extending the sockaddr_iso with a new struct sockaddr_iso_bc where the socket user can set the broadcast address when receiving, the SID and the BIS indexes it wants to synchronize.
When using BTPROTO_ISO for broadcast the roles are:
Broadcaster -> uses connect with address set to BDADDR_ANY:
Quoted 1 line
tools/isotest-s 00:00:00:00:00:00
Broadcast Receiver -> uses listen with address set to broadcaster:
Quoted 1 line
tools/isotest-d 00:AA:01:00:00:00
--- include/net/bluetooth/bluetooth.h | 2 + include/net/bluetooth/iso.h | 11 + net/bluetooth/iso.c | 391 +++++++++++++++++++++++++++--- 3 files changed, 370 insertions(+), 34 deletions(-)
include/net/bluetooth/bluetooth.h +2 -0
@@ -220,6 +220,8 @@ struct bt_codecs {#define BT_CODEC_TRANSPARENT 0x03#define BT_CODEC_MSBC 0x05 +#define BT_ISO_BASE 20 + __printf(1, 2)void bt_info (const char *fmt, ...);__printf (1 ,2 )
include/net/bluetooth/iso.h +11 -0
@@ -10,12 +10,23 @@/* ISO defaults */ #define ISO_DEFAULT_MTU 251 +#define ISO_MAX_NUM_BIS 0x1f + +/* ISO socket broadcast address */ +struct sockaddr_iso_bc { +bdaddr_t bc_bdaddr; +__u8 bc_bdaddr_type; +__u8 bc_sid; +__u8 bc_num_bis; +__u8 bc_bis[ISO_MAX_NUM_BIS ]; +};/* ISO socket address */ struct sockaddr_iso {sa_family_t iso_family;bdaddr_t iso_bdaddr;__u8 iso_bdaddr_type; +struct sockaddr_iso_bc iso_bc[]; };#endif /* __ISO_H */
net/bluetooth/iso.c +357 -34
532 lines not on this page · raw message
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 7/8 Bluetooth: btusb: Add support for ISO packets
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This enabled btusb driver to properly transmit ISO packets.
--- drivers/bluetooth/btusb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/bluetooth/btusb.c +14 -0
@@ -1762,6 +1762,13 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) hdev->stat.sco_tx++;return submit_tx_urb (hdev, urb); + +case HCI_ISODATA_PKT : + urb =alloc_bulk_urb (hdev, skb); +if (IS_ERR (urb)) +return PTR_ERR (urb); + +return submit_or_queue_tx_urb (hdev, urb); }return -EILSEQ ;
@@ -2255,6 +2262,13 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) hdev->stat.sco_tx++;return submit_tx_urb (hdev, urb); + +case HCI_ISODATA_PKT : + urb =alloc_bulk_urb (hdev, skb); +if (IS_ERR (urb)) +return PTR_ERR (urb); + +return submit_or_queue_tx_urb (hdev, urb); }return -EILSEQ ;
Signature · 1 line
2.35.1
Luiz Augusto von Dentz
maintainerPATCH v2 8/8 Bluetooth: btusb: Detect if an ACL packet is in fact an ISO packet
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
Fix up the packet type if ISO packets are sent over the bulk endpoint.
Note: This is a stopgap since the Bluetooth specification currently doesn't define any endpoint to transport ISO packets.
--- drivers/bluetooth/btusb.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/bluetooth/btusb.c +10 -0
@@ -893,11 +893,21 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)hci_skb_expect (skb) -= len;if (skb->len ==HCI_ACL_HDR_SIZE ) { +__u16 handle =__le16_to_cpu (hci_acl_hdr (skb)->handle);__le16 dlen =hci_acl_hdr (skb)->dlen; +__u8 type;/* Complete ACL header */ hci_skb_expect (skb) =__le16_to_cpu (dlen); +/* Detect if ISO packet has been sent over bulk */ +if (hci_conn_num (data->hdev,ISO_LINK )) { + type =hci_conn_lookup_type (data->hdev, +hci_handle (handle)); +if (type ==ISO_LINK ) +hci_skb_pkt_type (skb) =HCI_ISODATA_PKT ; + } +if (skb_tailroom (skb) <hci_skb_expect (skb)) {kfree_skb (skb); skb =NULL ;
Signature · 1 line
2.35.1
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=639251
---Test result---
Test Summary:
CheckPatch FAIL 17.02 seconds GitLint PASS 8.58 seconds SubjectPrefix PASS 7.54 seconds BuildKernel PASS 30.93 seconds BuildKernel32 PASS 29.11 seconds Incremental Build with patchesPASS 186.72 seconds TestRunner: Setup PASS 468.99 seconds TestRunner: l2cap-tester PASS 16.91 seconds TestRunner: bnep-tester PASS 5.90 seconds TestRunner: mgmt-tester FAIL 99.29 seconds TestRunner: rfcomm-tester PASS 9.70 seconds TestRunner: sco-tester PASS 9.19 seconds TestRunner: smp-tester PASS 9.46 seconds TestRunner: userchan-tester PASS 6.02 seconds
Details
##############################
Test: CheckPatch - FAIL - 17.02 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
[v2,4/8] Bluetooth: Add BTPROTO_ISO socket type\Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
File "scripts/spdxcheck.py", line 6, in <module>
from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #177:
new file mode 100644
total: 0 errors, 1 warnings, 0 checks, 1682 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/12841667.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[v2,5/8] Bluetooth: Add initial implementation of BIS connections\WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #848: FILE: net/bluetooth/hci_conn.c:814:
+ * */
total: 0 errors, 1 warnings, 0 checks, 1885 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/12841668.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: TestRunner: mgmt-tester - FAIL - 99.29 seconds Run test-runner with mgmt-tester
Total: 493, Passed: 491 (99.6%), Failed: 2, Not Run: 0
Failed Test Cases
Read Exp Feature - Success Failed 0.087 seconds Read Exp Feature - Success (Index None) Failed 0.087 seconds
---
Regards,
Linux Bluetooth
This series was applied to bluetooth/bluetooth-next.git (master) by Marcel Holtmann <[email protected]>:
Hello:
This series was applied to bluetooth/bluetooth-next.git (master) by Marcel Holtmann <[email protected]>:
Quoted 8 lines · On Fri, 6 May 2022 14:57:36 -0700 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
This adds helpers for accessing and appending service data (
0x16) ad type.Signed-off-by Luiz Augusto von Dentz <[email protected]>[...]
Here is the summary with links:
- [v2,1/8] Bluetooth: eir: Add helpers for managing service data
https://git.kernel.org/bluetooth/bluetooth-next/c/8f9ae5b3ae80
- [v2,2/8] Bluetooth: hci_core: Introduce hci_recv_event_data (no matching commit)
- [v2,3/8] Bluetooth: Add initial implementation of CIS connections (no matching commit)
- [v2,4/8] Bluetooth: Add BTPROTO_ISO socket type
(no matching commit)
- [v2,5/8] Bluetooth: Add initial implementation of BIS connections (no matching commit)
- [v2,6/8] Bluetooth: ISO: Add broadcast support
(no matching commit)
- [v2,7/8] Bluetooth: btusb: Add support for ISO packets
(no matching commit)
- [v2,8/8] Bluetooth: btusb: Detect if an ACL packet is in fact an ISO packet (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html