Bluetooth: Controller: Fix CIS payload count under skipped events
Fix CIS payload count calculation under skipped events that caused CIS disconnection with reason MIC failure. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
3399e0614a
commit
ad6c0512ad
2 changed files with 16 additions and 16 deletions
|
|
@ -1253,8 +1253,10 @@ static void payload_count_lazy_update(struct lll_conn_iso_stream *cis_lll, uint1
|
||||||
u = cis_lll->nse - ((cis_lll->nse / cis_lll->tx.bn) *
|
u = cis_lll->nse - ((cis_lll->nse / cis_lll->tx.bn) *
|
||||||
(cis_lll->tx.bn - 1U -
|
(cis_lll->tx.bn - 1U -
|
||||||
(payload_count % cis_lll->tx.bn)));
|
(payload_count % cis_lll->tx.bn)));
|
||||||
while (((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) <
|
while ((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) <
|
||||||
(cis_lll->event_count + 1U)) {
|
cis_lll->event_count) ||
|
||||||
|
((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) ==
|
||||||
|
cis_lll->event_count) && (u <= cis_lll->nse))) {
|
||||||
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
||||||
cis_lll->sn++;
|
cis_lll->sn++;
|
||||||
cis_lll->tx.bn_curr++;
|
cis_lll->tx.bn_curr++;
|
||||||
|
|
@ -1281,8 +1283,10 @@ static void payload_count_lazy_update(struct lll_conn_iso_stream *cis_lll, uint1
|
||||||
u = cis_lll->nse - ((cis_lll->nse / cis_lll->rx.bn) *
|
u = cis_lll->nse - ((cis_lll->nse / cis_lll->rx.bn) *
|
||||||
(cis_lll->rx.bn - 1U -
|
(cis_lll->rx.bn - 1U -
|
||||||
(payload_count % cis_lll->rx.bn)));
|
(payload_count % cis_lll->rx.bn)));
|
||||||
while (((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) <
|
while ((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) <
|
||||||
(cis_lll->event_count + 1U)) {
|
cis_lll->event_count) ||
|
||||||
|
((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) ==
|
||||||
|
cis_lll->event_count) && (u <= cis_lll->nse))) {
|
||||||
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
||||||
cis_lll->nesn++;
|
cis_lll->nesn++;
|
||||||
cis_lll->rx.bn_curr++;
|
cis_lll->rx.bn_curr++;
|
||||||
|
|
|
||||||
|
|
@ -1359,12 +1359,10 @@ static void payload_count_lazy(struct lll_conn_iso_stream *cis_lll, uint16_t laz
|
||||||
u = cis_lll->nse - ((cis_lll->nse / cis_lll->tx.bn) *
|
u = cis_lll->nse - ((cis_lll->nse / cis_lll->tx.bn) *
|
||||||
(cis_lll->tx.bn - 1U -
|
(cis_lll->tx.bn - 1U -
|
||||||
(payload_count % cis_lll->tx.bn)));
|
(payload_count % cis_lll->tx.bn)));
|
||||||
while (((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) <
|
while ((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) <
|
||||||
(cis_lll->event_count + 1U)) ||
|
cis_lll->event_count) ||
|
||||||
((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) ==
|
((((cis_lll->tx.payload_count / cis_lll->tx.bn) + cis_lll->tx.ft) ==
|
||||||
(cis_lll->event_count + 1U)) && (u < (cis_lll->nse + 1U)))) &&
|
cis_lll->event_count) && (u < cis_lll->nse))) {
|
||||||
((cis_lll->tx.payload_count / cis_lll->tx.bn) <
|
|
||||||
cis_lll->event_count)) {
|
|
||||||
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
||||||
cis_lll->sn++;
|
cis_lll->sn++;
|
||||||
cis_lll->tx.bn_curr++;
|
cis_lll->tx.bn_curr++;
|
||||||
|
|
@ -1391,12 +1389,10 @@ static void payload_count_lazy(struct lll_conn_iso_stream *cis_lll, uint16_t laz
|
||||||
u = cis_lll->nse - ((cis_lll->nse / cis_lll->rx.bn) *
|
u = cis_lll->nse - ((cis_lll->nse / cis_lll->rx.bn) *
|
||||||
(cis_lll->rx.bn - 1U -
|
(cis_lll->rx.bn - 1U -
|
||||||
(payload_count % cis_lll->rx.bn)));
|
(payload_count % cis_lll->rx.bn)));
|
||||||
while (((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) <
|
while ((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) <
|
||||||
(cis_lll->event_count + 1U)) ||
|
cis_lll->event_count) ||
|
||||||
((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) ==
|
((((cis_lll->rx.payload_count / cis_lll->rx.bn) + cis_lll->rx.ft) ==
|
||||||
(cis_lll->event_count + 1U)) && (u <= (cis_lll->nse + 1U)))) &&
|
cis_lll->event_count) && (u <= cis_lll->nse))) {
|
||||||
((cis_lll->rx.payload_count / cis_lll->rx.bn) <
|
|
||||||
cis_lll->event_count)) {
|
|
||||||
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
/* sn and nesn are 1-bit, only Least Significant bit is needed */
|
||||||
cis_lll->nesn++;
|
cis_lll->nesn++;
|
||||||
cis_lll->rx.bn_curr++;
|
cis_lll->rx.bn_curr++;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue