Bluetooth: controller: split: Fix missing slave latency impl.

Port the missing slave latency implementation from legacy
controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2019-10-03 14:00:55 +05:30 committed by Carles Cufí
commit 5dff214d57

View file

@ -945,13 +945,27 @@ void ull_conn_done(struct node_rx_event_done *done)
return; return;
} }
/* Slave drift compensation calc or master terminate acked */ /* Events elapsed used in timeout checks below */
latency_event = lll->latency_event;
elapsed_event = latency_event + 1;
/* Slave drift compensation calc and new latency or
* master terminate acked
*/
ticks_drift_plus = 0U; ticks_drift_plus = 0U;
ticks_drift_minus = 0U; ticks_drift_minus = 0U;
if (done->extra.trx_cnt) { if (done->extra.trx_cnt) {
if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && lll->role) { if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && lll->role) {
ull_slave_done(done, &ticks_drift_plus, ull_slave_done(done, &ticks_drift_plus,
&ticks_drift_minus); &ticks_drift_minus);
if (conn->tx_head || memq_peek(lll->memq_tx.head,
lll->memq_tx.tail,
NULL)) {
lll->latency_event = 0;
} else {
lll->latency_event = lll->latency;
}
} else if (reason_peer) { } else if (reason_peer) {
lll->master.terminate_ack = 1; lll->master.terminate_ack = 1;
} }
@ -960,10 +974,6 @@ void ull_conn_done(struct node_rx_event_done *done)
conn->connect_expire = 0U; conn->connect_expire = 0U;
} }
/* Events elapsed used in timeout checks below */
latency_event = lll->latency_event;
elapsed_event = latency_event + 1;
/* Reset supervision countdown */ /* Reset supervision countdown */
if (done->extra.crc_valid) { if (done->extra.crc_valid) {
conn->supervision_expire = 0U; conn->supervision_expire = 0U;