Bluetooth: controller: Fix ISO Broadcast control subevent channel
- Calculate broadcaster channel for control subevent - Calculate sync receiver channel for control subevent - Fix broadcast CSTF only set in first subevent - Remove ctrl_chan_use from LLL, as there is no longer a reason for storing it. Signed-off-by: Morten Priess <mtpr@oticon.com>
This commit is contained in:
parent
7845c0e3d6
commit
14191f11fd
4 changed files with 22 additions and 9 deletions
|
|
@ -74,7 +74,6 @@ struct lll_adv_iso {
|
|||
uint8_t term_ack:1;
|
||||
uint8_t term_reason;
|
||||
|
||||
uint8_t ctrl_chan_use;
|
||||
uint8_t ctrl_expire;
|
||||
uint16_t ctrl_instant;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ struct lll_sync_iso {
|
|||
|
||||
uint8_t term_reason;
|
||||
|
||||
uint8_t ctrl_chan_use;
|
||||
uint16_t ctrl_instant;
|
||||
|
||||
uint8_t stream_count;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,6 @@ static int prepare_cb_common(struct lll_prepare_param *p)
|
|||
lll->cssn++;
|
||||
}
|
||||
|
||||
lll->ctrl_chan_use = data_chan_use;
|
||||
pdu->cstf = 1U;
|
||||
} else {
|
||||
pdu->cstf = 0U;
|
||||
|
|
@ -463,11 +462,11 @@ static void isr_tx_common(void *param,
|
|||
radio_isr_cb_t isr_done)
|
||||
{
|
||||
struct pdu_bis *pdu = NULL;
|
||||
uint8_t data_chan_use = 0;
|
||||
struct lll_adv_iso *lll;
|
||||
uint8_t access_addr[4];
|
||||
uint64_t payload_count;
|
||||
uint16_t data_chan_id;
|
||||
uint8_t data_chan_use;
|
||||
uint8_t crc_init[3];
|
||||
uint8_t bis;
|
||||
|
||||
|
|
@ -528,7 +527,6 @@ static void isr_tx_common(void *param,
|
|||
/* control subevent to use bis = 0 and se_n = 1 */
|
||||
bis = 0U;
|
||||
payload_count = lll->payload_count - lll->bn;
|
||||
data_chan_use = lll->ctrl_chan_use;
|
||||
|
||||
} else if (((lll->chm_req - lll->chm_ack) & CHM_STATE_MASK) ==
|
||||
CHM_STATE_SEND) {
|
||||
|
|
@ -552,7 +550,6 @@ static void isr_tx_common(void *param,
|
|||
/* control subevent to use bis = 0 and se_n = 1 */
|
||||
bis = 0U;
|
||||
payload_count = lll->payload_count - lll->bn;
|
||||
data_chan_use = lll->ctrl_chan_use;
|
||||
|
||||
} else {
|
||||
struct lll_adv_iso_stream *stream;
|
||||
|
|
@ -658,7 +655,7 @@ static void isr_tx_common(void *param,
|
|||
pdu = (void *)tx->pdu;
|
||||
}
|
||||
pdu->cssn = lll->cssn;
|
||||
pdu->cstf = 0U;
|
||||
pdu->cstf = (lll->term_req || !!(lll->chm_req - lll->chm_ack));
|
||||
|
||||
#else /* TEST_WITH_DUMMY_PDU */
|
||||
pdu = radio_pkt_scratch_get();
|
||||
|
|
@ -687,6 +684,17 @@ static void isr_tx_common(void *param,
|
|||
}
|
||||
pdu->rfu = 0U;
|
||||
|
||||
if (!bis) {
|
||||
const uint16_t event_counter = payload_count / lll->bn;
|
||||
|
||||
/* Calculate the radio channel to use for ISO event */
|
||||
data_chan_use = lll_chan_iso_event(event_counter, data_chan_id,
|
||||
lll->data_chan_map,
|
||||
lll->data_chan_count,
|
||||
&lll->data_chan_prn_s,
|
||||
&lll->data_chan_remap_idx);
|
||||
}
|
||||
|
||||
lll_chan_set(data_chan_use);
|
||||
|
||||
/* Encryption */
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@ static int prepare_cb_common(struct lll_prepare_param *p)
|
|||
lll->data_chan_count,
|
||||
&lll->data_chan_prn_s,
|
||||
&lll->data_chan_remap_idx);
|
||||
lll->ctrl_chan_use = data_chan_use;
|
||||
|
||||
/* Initialize stream current */
|
||||
lll->stream_curr = 0U;
|
||||
|
|
@ -876,7 +875,15 @@ isr_rx_next_subevent:
|
|||
|
||||
/* Set the channel to use */
|
||||
if (!bis) {
|
||||
data_chan_use = lll->ctrl_chan_use;
|
||||
const uint16_t event_counter =
|
||||
(lll->payload_count / lll->bn) - 1U;
|
||||
|
||||
/* Calculate the radio channel to use for ISO event */
|
||||
data_chan_use = lll_chan_iso_event(event_counter, data_chan_id,
|
||||
lll->data_chan_map,
|
||||
lll->data_chan_count,
|
||||
&lll->data_chan_prn_s,
|
||||
&lll->data_chan_remap_idx);
|
||||
} else if (!skipped) {
|
||||
data_chan_use = lll->next_chan_use;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue