This patch adds support for creating multiple BIGs. According to spec, each BIG shall have an unique handle, and each BIG should be associated with a different advertising handle. Otherwise, the LE Create BIG command will fail, with error code Command Disallowed (for reusing a BIG handle), or Unknown Advertising Identifier (for reusing an advertising handle). Currently, if the user tries to connect 2 sockets with the BIG/BIS QoS fields unset, the kernel will assign the same BIG handle for every BIG, as seen in the btmon log below: < HCI Command: LE Create Broadcast Isochronous Group (0x08|0x0068) plen 31 Handle: 0x00 Advertising Handle: 0x01 Number of BIS: 1 SDU Interval: 10000 us (0x002710) Maximum SDU size: 40 Maximum Latency: 10 ms (0x000a) RTN: 0x02 PHY: LE 2M (0x02) Packing: Sequential (0x00) Framing: Unframed (0x00) Encryption: 0x00 Broadcast Code: 00000000000000000000000000000000 > HCI Event: Command Status (0x0f) plen 4 LE Create Broadcast Isochronous Group (0x08|0x0068) ncmd 1 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 21 LE Broadcast Isochronous Group Complete (0x1b) Status: Success (0x00) Handle: 0x00 BIG Synchronization Delay: 912 us (0x000390) Transport Latency: 912 us (0x000390) PHY: LE 2M (0x02) NSE: 3 BN: 1 PTO: 1 IRC: 3 Maximum PDU: 40 ISO Interval: 10.00 msec (0x0008) Connection Handle #0: 10 < HCI Command: LE Create Broadcast Isochronous Group (0x08|0x0068) Handle: 0x00 Advertising Handle: 0x01 Number of BIS: 1 SDU Interval: 10000 us (0x002710) Maximum SDU size: 40 Maximum Latency: 10 ms (0x000a) RTN: 0x02 PHY: LE 2M (0x02) Packing: Sequential (0x00) Framing: Unframed (0x00) Encryption: 0x00 Broadcast Code: 00000000000000000000000000000000 > HCI Event: Command Status (0x0f) plen 4 LE Create Broadcast Isochronous Group (0x08|0x0068) ncmd 1 Status: Command Disallowed (0x0c) Since different BIGs need to be associated with different advertising handles, this patch also adds support for starting multiple periodic advertising instances. If an avertising instance has the periodic flag set, the enabled flag will be used to indicate whether both extended and periodic advertising are enabled for that handle. Iulia Tanasescu (1): Bluetooth: ISO: Support multiple BIGs include/net/bluetooth/hci_core.h | 5 ++-- net/bluetooth/hci_conn.c | 40 ++++++++++++++------------------ net/bluetooth/hci_event.c | 35 +++++++++++++++++++++++----- net/bluetooth/hci_sync.c | 28 +++++++++++----------- 4 files changed, 63 insertions(+), 45 deletions(-) base-commit: 817efd3cad7481ce2ee25fac5108afecbad56228 -- 2.34.1