Skip to content

Commit 7a14830

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Remove HCI ISO data with invalid status
Remove incorrect implementation of HCI ISO data with invalid status. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent d044dfe commit 7a14830

File tree

2 files changed

+8
-132
lines changed

2 files changed

+8
-132
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c

Lines changed: 8 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ static void isr_rx(void *param)
845845
struct lll_conn_iso_group *cig_lll;
846846
struct lll_conn *next_conn_lll;
847847
uint8_t phy;
848-
uint8_t bn;
849848

850849
/* Fetch next CIS */
851850
/* TODO: Use a new ull_conn_iso_lll_stream_get_active_by_group()
@@ -861,18 +860,6 @@ static void isr_rx(void *param)
861860
goto isr_rx_done;
862861
}
863862

864-
/* Adjust sn when flushing Tx */
865-
/* FIXME: When Flush Timeout is implemented */
866-
if (cis_lll->tx.bn_curr <= cis_lll->tx.bn) {
867-
lll_flush_tx(cis_lll);
868-
}
869-
870-
/* Adjust nesn when flushing Rx */
871-
/* FIXME: When Flush Timeout is implemented */
872-
if (cis_lll->rx.bn_curr <= cis_lll->rx.bn) {
873-
lll_flush_rx(cis_lll);
874-
}
875-
876863
/* Get reference to ACL context */
877864
next_conn_lll = ull_conn_lll_get(next_cis_lll->acl_handle);
878865

@@ -940,45 +927,17 @@ static void isr_rx(void *param)
940927
cis_lll = old_cis_lll;
941928
}
942929

943-
/* Generate ISO Data Invalid Status */
944-
bn = cis_lll->rx.bn_curr;
945-
while (bn <= cis_lll->rx.bn) {
946-
struct node_rx_iso_meta *iso_meta;
947-
struct node_rx_pdu *status_node_rx;
948-
949-
/* Ensure there is always one free for reception
950-
* of ISO PDU by the radio h/w DMA, hence peek
951-
* for two available ISO PDU when using one for
952-
* generating invalid ISO data.
953-
*/
954-
status_node_rx = ull_iso_pdu_rx_alloc_peek(2U);
955-
if (!status_node_rx) {
956-
break;
957-
}
958-
959-
status_node_rx->hdr.type = NODE_RX_TYPE_ISO_PDU;
960-
status_node_rx->hdr.handle = cis_lll->handle;
961-
iso_meta = &status_node_rx->hdr.rx_iso_meta;
962-
iso_meta->payload_number = (cis_lll->event_count *
963-
cis_lll->rx.bn) + (bn - 1U);
964-
iso_meta->timestamp =
965-
HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
966-
radio_tmr_ready_restore();
967-
iso_meta->timestamp %=
968-
HAL_TICKER_TICKS_TO_US(BIT(HAL_TICKER_CNTR_MSBIT + 1U));
969-
iso_meta->status = 1U;
970-
971-
ull_iso_pdu_rx_alloc();
972-
iso_rx_put(status_node_rx->hdr.link, status_node_rx);
973-
974-
bn++;
930+
/* Adjust sn when flushing Tx */
931+
/* FIXME: When Flush Timeout is implemented */
932+
if (cis_lll->tx.bn_curr <= cis_lll->tx.bn) {
933+
lll_flush_tx(cis_lll);
975934
}
976935

977-
#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
978-
if (bn != cis_lll->rx.bn_curr) {
979-
iso_rx_sched();
936+
/* Adjust nesn when flushing Rx */
937+
/* FIXME: When Flush Timeout is implemented */
938+
if (cis_lll->rx.bn_curr <= cis_lll->rx.bn) {
939+
lll_flush_rx(cis_lll);
980940
}
981-
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
982941

983942
/* Reset indices for the next CIS */
984943
se_curr = 0U; /* isr_prepare_subevent() will increase se_curr */
@@ -1176,7 +1135,6 @@ static void isr_done(void *param)
11761135
{
11771136
struct lll_conn_iso_stream *cis_lll;
11781137
struct event_done_extra *e;
1179-
uint8_t bn;
11801138

11811139
lll_isr_status_reset();
11821140

@@ -1195,45 +1153,6 @@ static void isr_done(void *param)
11951153
lll_flush_rx(cis_lll);
11961154
}
11971155

1198-
/* Generate ISO Data Invalid Status */
1199-
bn = cis_lll->rx.bn_curr;
1200-
while (bn <= cis_lll->rx.bn) {
1201-
struct node_rx_iso_meta *iso_meta;
1202-
struct node_rx_pdu *node_rx;
1203-
1204-
/* Ensure there is always one free for reception of ISO PDU by
1205-
* the radio h/w DMA, hence peek for two available ISO PDU when
1206-
* using one for generating invalid ISO data.
1207-
*/
1208-
node_rx = ull_iso_pdu_rx_alloc_peek(2U);
1209-
if (!node_rx) {
1210-
break;
1211-
}
1212-
1213-
node_rx->hdr.type = NODE_RX_TYPE_ISO_PDU;
1214-
node_rx->hdr.handle = cis_lll->handle;
1215-
iso_meta = &node_rx->hdr.rx_iso_meta;
1216-
iso_meta->payload_number = (cis_lll->event_count *
1217-
cis_lll->rx.bn) + (bn - 1U);
1218-
iso_meta->timestamp =
1219-
HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
1220-
radio_tmr_ready_restore();
1221-
iso_meta->timestamp %=
1222-
HAL_TICKER_TICKS_TO_US(BIT(HAL_TICKER_CNTR_MSBIT + 1U));
1223-
iso_meta->status = 1U;
1224-
1225-
ull_iso_pdu_rx_alloc();
1226-
iso_rx_put(node_rx->hdr.link, node_rx);
1227-
1228-
bn++;
1229-
}
1230-
1231-
#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
1232-
if (bn != cis_lll->rx.bn_curr) {
1233-
iso_rx_sched();
1234-
}
1235-
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
1236-
12371156
e = ull_event_done_extra_get();
12381157
LL_ASSERT(e);
12391158

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,6 @@ static void isr_done(void *param)
12291229
{
12301230
struct lll_conn_iso_stream *cis_lll;
12311231
struct event_done_extra *e;
1232-
uint8_t bn;
12331232

12341233
lll_isr_status_reset();
12351234

@@ -1242,48 +1241,6 @@ static void isr_done(void *param)
12421241
lll_flush_rx(cis_lll);
12431242
}
12441243

1245-
/* Generate ISO Data Invalid Status */
1246-
bn = cis_lll->rx.bn_curr;
1247-
while (bn <= cis_lll->rx.bn) {
1248-
struct node_rx_iso_meta *iso_meta;
1249-
struct node_rx_pdu *node_rx;
1250-
1251-
node_rx = ull_iso_pdu_rx_alloc_peek(2U);
1252-
if (!node_rx) {
1253-
break;
1254-
}
1255-
1256-
node_rx->hdr.type = NODE_RX_TYPE_ISO_PDU;
1257-
node_rx->hdr.handle = cis_lll->handle;
1258-
iso_meta = &node_rx->hdr.rx_iso_meta;
1259-
iso_meta->payload_number = (cis_lll->event_count *
1260-
cis_lll->rx.bn) + (bn - 1U);
1261-
if (trx_performed_bitmask) {
1262-
iso_meta->timestamp = cis_lll->offset +
1263-
HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
1264-
radio_tmr_aa_restore() - cis_offset_first -
1265-
addr_us_get(cis_lll->rx.phy);
1266-
} else {
1267-
iso_meta->timestamp = cis_lll->offset +
1268-
HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
1269-
radio_tmr_ready_restore() - cis_offset_first;
1270-
}
1271-
iso_meta->timestamp %=
1272-
HAL_TICKER_TICKS_TO_US(BIT(HAL_TICKER_CNTR_MSBIT + 1U));
1273-
iso_meta->status = 1U;
1274-
1275-
ull_iso_pdu_rx_alloc();
1276-
iso_rx_put(node_rx->hdr.link, node_rx);
1277-
1278-
bn++;
1279-
}
1280-
1281-
#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
1282-
if (bn != cis_lll->rx.bn_curr) {
1283-
iso_rx_sched();
1284-
}
1285-
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
1286-
12871244
e = ull_event_done_extra_get();
12881245
LL_ASSERT(e);
12891246

0 commit comments

Comments
 (0)