|
| 1 | +/* |
| 2 | + * Copyright (c) 2021 Demant |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | + |
| 7 | +struct node_tx_iso { |
| 8 | + union { |
| 9 | + void *next; |
| 10 | + memq_link_t *link; |
| 11 | + }; |
| 12 | + |
| 13 | + uint64_t payload_number : 39; /* cisPayloadNumber */ |
| 14 | + uint8_t pdu[]; |
| 15 | +}; |
| 16 | + |
| 17 | +struct lll_conn_iso_stream_rxtx { |
| 18 | + uint8_t phy; /* PHY */ |
| 19 | + uint8_t burst_number; /* Burst number (BN) */ |
| 20 | + uint8_t flush_timeout; /* Flush timeout (FT) */ |
| 21 | + uint8_t max_octets; /* Maximum PDU size */ |
| 22 | +}; |
| 23 | + |
| 24 | +struct lll_conn_iso_stream { |
| 25 | + /* Link to ACL connection (for encryption, channel map, crc init) */ |
| 26 | + struct lll_conn *conn; |
| 27 | + |
| 28 | + /* Connection parameters */ |
| 29 | + uint8_t access_addr[4]; /* Access address */ |
| 30 | + uint32_t offset; /* Offset of CIS from start of CIG in us */ |
| 31 | + uint32_t sub_interval; /* Interval between subevents in us */ |
| 32 | + uint32_t subevent_length; /* Length of subevent in us */ |
| 33 | + uint8_t num_subevents; /* Number of subevents */ |
| 34 | + struct lll_conn_iso_stream_rxtx rx; /* RX parameters */ |
| 35 | + struct lll_conn_iso_stream_rxtx tx; /* TX parameters */ |
| 36 | + |
| 37 | + /* Event and payload counters */ |
| 38 | + uint64_t event_count : 39; /* cisEventCount */ |
| 39 | + uint64_t rx_payload_number : 39; /* cisPayloadNumber */ |
| 40 | + |
| 41 | + /* Acknowledgment and flow control */ |
| 42 | + uint8_t sn:1; /* Sequence number */ |
| 43 | + uint8_t nesn:1; /* Next expected sequence number */ |
| 44 | + uint8_t cie:1; /* Close isochronous event */ |
| 45 | + |
| 46 | + /* Resumption information */ |
| 47 | + uint8_t next_subevent; /* Next subevent to schedule */ |
| 48 | + |
| 49 | + /* Transmission queue */ |
| 50 | + MEMQ_DECLARE(tx); |
| 51 | + memq_link_t link_tx; |
| 52 | + memq_link_t *link_tx_free; |
| 53 | +}; |
| 54 | + |
| 55 | +struct lll_conn_iso_group { |
| 56 | + struct lll_hdr hdr; |
| 57 | + |
| 58 | + uint8_t num_cis; /* Number of CISes in this CIG */ |
| 59 | +#if defined(CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP) |
| 60 | + struct lll_conn_iso_stream *streams |
| 61 | + [CONFIG_BT_CTLR_CONN_ISO_STREAMS_PER_GROUP]; |
| 62 | +#endif /* CONFIG_BT_CTLR_CONN_ISO_STREAMS */ |
| 63 | + |
| 64 | + /* Resumption information */ |
| 65 | + uint8_t next_cis; /* Next CIS to schedule */ |
| 66 | + uint32_t next_time; /* When to trigger next activity in the CIG */ |
| 67 | +}; |
| 68 | + |
| 69 | +int lll_conn_iso_init(void); |
| 70 | +int lll_conn_iso_reset(void); |
| 71 | +void lll_conn_iso_flush(uint16_t handle, struct lll_conn_iso_stream *lll); |
0 commit comments