bluez/emulator
Pauli Virtanen d214fe5f75 btdev: check LE Create CIS error conditions
Check LE Create CIS input parameter are valid and return correct status
codes (Core v5.3 Vol 4 Part E Sec. 7.8.99).

On current bluetooth-next kernel, this results to

ISO AC 6(i) - Success                                Failed
ISO AC 7(i) - Success                                Failed
ISO AC 8(i) - Success                                Failed
ISO AC 9(i) - Success                                Failed
ISO AC 11(i) - Success                               Failed

as in these tests the kernel is sending new Create CIS commands before
it has seen all events from the previous, which is not allowed:

< HCI Command: LE Create Co.. (0x08|0x0064) plen 9  #129 [hci0]
        Number of CIS: 2
        CIS Handle: 257
        ACL Handle: 42
        CIS Handle: 258
        ACL Handle: 42
> HCI Event: Command Status (0x0f) plen 4           #130 [hci0]
      LE Create Connected Isochronous Stream (0x08|0x0064) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 29           #131 [hci0]
      LE Connected Isochronous Stream Established (0x19)
        Status: Success (0x00)
        Connection Handle: 257
        ...
< HCI Command: LE Setup Is.. (0x08|0x006e) plen 13  #132 [hci0]
        ...
> HCI Event: Command Complete (0x0e) plen 6         #133 [hci0]
      LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1
        ...
< HCI Command: LE Create Co.. (0x08|0x0064) plen 5  #134 [hci0]
        Number of CIS: 1
        CIS Handle: 258
        ACL Handle: 42
> HCI Event: Command Status (0x0f) plen 4           #135 [hci0]
      LE Create Connected Isochronous Stream (0x08|0x0064) ncmd 1
        Status: ACL Connection Already Exists (0x0b)
> HCI Event: LE Meta Event (0x3e) plen 29           #136 [hci0]
      LE Connected Isochronous Stream Established (0x19)
        Status: Success (0x00)
        Connection Handle: 258
        ...

The emulator uses Already Exists error code here, not Command
Disallowed, since the Established events are logically generated
immediately after the first status event, even though the kernel hasn't
yet processed them.
2023-05-30 11:18:13 -07:00
..
amp.c emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
amp.h emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
b1ee.c emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
btdev.c btdev: check LE Create CIS error conditions 2023-05-30 11:18:13 -07:00
btdev.h btdev: Add support for setting bdaddr 2022-10-10 13:06:16 -07:00
bthost.c tools/iso-tester: Add Broadcast tests for encrypted BIG 2023-04-19 13:46:00 -07:00
bthost.h tools/iso-tester: Add Broadcast tests for encrypted BIG 2023-04-19 13:46:00 -07:00
hciemu.c bthost: Add support for BT_H4_ISO_PKT 2022-03-07 17:21:56 -08:00
hciemu.h emulator: Add support to get the advertising address 2021-10-25 13:38:36 -07:00
hfp.c emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
le.c build: Fix errors with glibc < 2.25 2022-02-15 13:36:35 -08:00
le.h emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
main.c emulator: Add support for vendor commands 2022-01-05 15:06:40 -08:00
phy.c build: Fix errors with glibc < 2.25 2022-02-15 13:36:35 -08:00
phy.h emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
serial.c emulator: Inclusive language changes 2021-09-21 10:51:54 +02:00
serial.h emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
server.c emulator: Fix the unchecked return value 2020-11-24 13:03:46 -08:00
server.h emulator: Add SPDX License Identifier 2020-09-21 16:19:34 -07:00
smp.c monitor: Inclusive language changes 2021-09-21 10:51:54 +02:00
vhci.c vhci: Add support to trigger devcoredump and read the dump file 2023-03-30 10:46:21 -07:00
vhci.h vhci: Add support to trigger devcoredump and read the dump file 2023-03-30 10:46:21 -07:00