Skip to content

Commit 4215854

Browse files
Andries Kruithofaescolar
authored andcommitted
Bluetooth: controller: remove refs to LLCP_LEGACY after rebase
Some recent PRs included conditional compilation for KCONFIG_BT_LL_SW_LLCP_LEGACY, which must be removed. Signed-off-by: Andries Kruithof <[email protected]>
1 parent e6a3def commit 4215854

File tree

11 files changed

+16
-96
lines changed

11 files changed

+16
-96
lines changed

samples/bluetooth/hci_rpmsg/nrf5340_cpunet_bis-bt_ll_sw_split.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ CONFIG_BT_CTLR_SCAN_UNRESERVED=y
7070
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
7171

7272
# Control Procedure
73-
CONFIG_BT_LL_SW_LLCP=y
7473
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
7574

7675
# ISO Broadcaster Controller

samples/bluetooth/hci_rpmsg/nrf5340_cpunet_cis-bt_ll_sw_split.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ CONFIG_BT_CTLR_SCAN_UNRESERVED=y
6767
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
6868

6969
# Control Procedure
70-
CONFIG_BT_LL_SW_LLCP=y
7170
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
7271

7372
# ISO Connection Oriented

samples/bluetooth/hci_rpmsg/nrf5340_cpunet_df-bt_ll_sw_split.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ CONFIG_BT_CTLR_SCAN_UNRESERVED=y
6060
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
6161

6262
# Control Procedure
63-
CONFIG_BT_LL_SW_LLCP=y
6463
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
6564

6665
# Direction Finding

samples/bluetooth/hci_rpmsg/nrf5340_cpunet_df_cis-bt_ll_sw_split.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ CONFIG_BT_CTLR_SCAN_UNRESERVED=y
6969
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
7070

7171
# Control Procedure
72-
CONFIG_BT_LL_SW_LLCP=y
7372
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
7473

7574
# Direction Finding

samples/bluetooth/hci_rpmsg/nrf5340_cpunet_iso-bt_ll_sw_split.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ CONFIG_BT_CTLR_SCAN_UNRESERVED=y
7070
CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH=y
7171

7272
# Control Procedure
73-
CONFIG_BT_LL_SW_LLCP=y
7473
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=6
7574

7675
# ISO Broadcaster Controller

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,8 +2784,7 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx)
27842784
#endif /* CONFIG_BT_CTLR_ADV_EXT */
27852785
#endif /* CONFIG_BT_OBSERVER */
27862786

2787-
#if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY) && \
2788-
defined(CONFIG_BT_CTLR_PERIPHERAL_ISO)
2787+
#if defined(CONFIG_BT_CTLR_PERIPHERAL_ISO)
27892788
case NODE_RX_TYPE_CIS_ESTABLISHED:
27902789
{
27912790
struct ll_conn *conn;
@@ -2801,7 +2800,7 @@ static inline int rx_demux_rx(memq_link_t *link, struct node_rx_hdr *rx)
28012800
ll_rx_put_sched(link, rx);
28022801
}
28032802
break;
2804-
#endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY && CONFIG_BT_CTLR_PERIPHERAL_ISO */
2803+
#endif /* CONFIG_BT_CTLR_PERIPHERAL_ISO */
28052804

28062805
#if defined(CONFIG_BT_CTLR_DF_SCAN_CTE_RX) || defined(CONFIG_BT_CTLR_DF_CONN_CTE_RX) || \
28072806
defined(CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT)

subsys/bluetooth/controller/ll_sw/ull_central.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ uint8_t ll_create_connection(uint16_t scan_interval, uint16_t scan_window,
337337
ready_delay_us = lll_radio_tx_ready_delay_get(0, 0);
338338
#endif
339339

340-
/* TODO(thoh-ot): Not entirely sure this is correct */
341340
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
342-
/* TODO: do we need to do the following? */
343341
#if defined(CONFIG_BT_CTLR_ADV_EXT)
344342
conn_lll->dle.eff.max_tx_time = MAX(conn_lll->dle.eff.max_tx_time,
345343
PDU_DC_MAX_US(PDU_DC_PAYLOAD_SIZE_MIN,

subsys/bluetooth/controller/ll_sw/ull_conn.c

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -119,41 +119,12 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate);
119119
(LL_LENGTH_OCTETS_TX_MAX + \
120120
BT_CTLR_USER_TX_BUFFER_OVERHEAD))
121121

122-
/* Encryption request is enqueued in thread context from the Tx buffer pool,
123-
* so that it is serialized alongwith the already enqueued data buffers ensuring
124-
* they are transmitted out to peer before encryption is setup.
125-
* Allocate additional Tx buffers to accommodate simultaneous encryption setup
126-
* across active connections.
127-
* TODO: verify that we don't need this for the refactored LLCP
128-
*/
129-
#define CONN_ENC_REQ_BUFFERS 0
130-
#define CONN_DATA_BUFFERS (CONFIG_BT_BUF_ACL_TX_COUNT + CONN_ENC_REQ_BUFFERS)
131-
132-
/**
133-
* One connection may take up to 4 TX buffers for procedures
134-
* simultaneously, for example 2 for encryption, 1 for termination,
135-
* and 1 one that is in flight and has not been returned to the pool
136-
*/
137-
#define CONN_TX_CTRL_BUFFERS LLCP_TX_CTRL_BUF_COUNT
138-
#define CONN_TX_CTRL_BUF_SIZE MROUND(offsetof(struct node_tx, pdu) + \
139-
offsetof(struct pdu_data, llctrl) + \
140-
PDU_DC_CTRL_TX_SIZE_MAX)
141-
142-
/* Terminate procedure state values */
143-
#define TERM_REQ 1
144-
#define TERM_ACKED 3
145-
146-
/* CIS Establishment procedure state values */
147-
#define CIS_REQUEST_AWAIT_HOST 2
122+
#define CONN_DATA_BUFFERS CONFIG_BT_BUF_ACL_TX_COUNT
148123

149-
/*
150-
* TODO: when the legacy LLCP is removed we can replace 'CONN_TX_CTRL_BUFFERS'
151-
* with 'LLCP_TX_CTRL_BUF_COUNT'
152-
*/
153124
static MFIFO_DEFINE(conn_tx, sizeof(struct lll_tx), CONN_DATA_BUFFERS);
154125
static MFIFO_DEFINE(conn_ack, sizeof(struct lll_tx),
155126
(CONN_DATA_BUFFERS +
156-
CONN_TX_CTRL_BUFFERS));
127+
LLCP_TX_CTRL_BUF_COUNT));
157128

158129
static struct {
159130
void *free;
@@ -164,7 +135,7 @@ static struct {
164135
void *free;
165136
uint8_t pool[sizeof(memq_link_t) *
166137
(CONN_DATA_BUFFERS +
167-
CONN_TX_CTRL_BUFFERS)];
138+
LLCP_TX_CTRL_BUF_COUNT)];
168139
} mem_link_tx;
169140

170141
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
@@ -984,14 +955,6 @@ void ull_conn_done(struct node_rx_event_done *done)
984955
}
985956
#endif /* CONFIG_BT_CTLR_LE_ENC */
986957

987-
/* Legacy LLCP:
988-
* Peripheral received terminate ind or
989-
* Central received ack for the transmitted terminate ind or
990-
* Central transmitted ack for the received terminate ind or
991-
* there has been MIC failure
992-
* Refactored LLCP:
993-
* reason_final is set exactly under the above conditions
994-
*/
995958
reason_final = conn->llcp_terminate.reason_final;
996959
if (reason_final) {
997960
conn_cleanup(conn, reason_final);
@@ -1568,7 +1531,7 @@ static int init_reset(void)
15681531
/* Initialize tx link pool. */
15691532
mem_init(mem_link_tx.pool, sizeof(memq_link_t),
15701533
(CONN_DATA_BUFFERS +
1571-
CONN_TX_CTRL_BUFFERS),
1534+
LLCP_TX_CTRL_BUF_COUNT),
15721535
&mem_link_tx.free);
15731536

15741537
/* Initialize control procedure system. */
@@ -1756,10 +1719,8 @@ static void conn_cleanup_iso_cis_released_cb(struct ll_conn *conn)
17561719
static void conn_cleanup_finalize(struct ll_conn *conn)
17571720
{
17581721
struct lll_conn *lll = &conn->lll;
1759-
struct node_rx_pdu *rx;
17601722
uint32_t ticker_status;
17611723

1762-
ARG_UNUSED(rx);
17631724
ull_cp_state_set(conn, ULL_CP_DISCONNECTED);
17641725

17651726
/* Update tx buffer queue handling */
@@ -1921,13 +1882,13 @@ static void tx_lll_flush(void *param)
19211882
(void **)&tx);
19221883
while (link) {
19231884
uint8_t idx;
1924-
struct lll_tx *lll_tx2;
1885+
struct lll_tx *tx_buf;
19251886

1926-
idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&lll_tx2);
1927-
LL_ASSERT(lll_tx2);
1887+
idx = MFIFO_ENQUEUE_GET(conn_ack, (void **)&tx_buf);
1888+
LL_ASSERT(tx_buf);
19281889

1929-
lll_tx2->handle = LLL_HANDLE_INVALID;
1930-
lll_tx2->node = tx;
1890+
tx_buf->handle = LLL_HANDLE_INVALID;
1891+
tx_buf->node = tx;
19311892

19321893
/* TX node UPSTREAM, i.e. Tx node ack path */
19331894
link->next = tx->next; /* Indicates ctrl pool or data pool */
@@ -1949,8 +1910,7 @@ static void tx_lll_flush(void *param)
19491910
rx->hdr.link = NULL;
19501911

19511912
/* Enqueue the terminate towards ULL context */
1952-
ull_rx_put(link, rx);
1953-
ull_rx_sched();
1913+
ull_rx_put_sched(link, rx);
19541914
}
19551915

19561916
#if defined(CONFIG_BT_CTLR_LLID_DATA_START_EMPTY)
@@ -2484,11 +2444,6 @@ void ull_dle_local_tx_update(struct ll_conn *conn, uint16_t tx_octets, uint16_t
24842444

24852445
void ull_dle_init(struct ll_conn *conn, uint8_t phy)
24862446
{
2487-
/*
2488-
* TODO:
2489-
* legacy code uses the maximum of the time for 1M phy and actual phy
2490-
* for max_time_min, to be verified if that is required here as well
2491-
*/
24922447
#if defined(CONFIG_BT_CTLR_PHY)
24932448
const uint16_t max_time_min = PDU_DC_MAX_US(PDU_DC_PAYLOAD_SIZE_MIN, phy);
24942449
const uint16_t max_time_max = PDU_DC_MAX_US(LL_LENGTH_OCTETS_RX_MAX, phy);

subsys/bluetooth/controller/ll_sw/ull_conn_iso.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -299,29 +299,6 @@ void ull_conn_iso_lll_cis_established(struct lll_conn_iso_stream *cis_lll)
299299
return;
300300
}
301301

302-
#if defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
303-
struct node_rx_conn_iso_estab *est;
304-
struct node_rx_pdu *node_rx;
305-
306-
node_rx = ull_pdu_rx_alloc();
307-
if (!node_rx) {
308-
/* No node available - try again later */
309-
return;
310-
}
311-
312-
node_rx->hdr.type = NODE_RX_TYPE_CIS_ESTABLISHED;
313-
314-
/* TODO: Send CIS_ESTABLISHED with status != 0 in error scenarios */
315-
node_rx->hdr.handle = 0xFFFF;
316-
node_rx->hdr.rx_ftr.param = cis;
317-
318-
est = (void *)node_rx->pdu;
319-
est->status = 0;
320-
est->cis_handle = cis_lll->handle;
321-
322-
ll_rx_put_sched(node_rx->hdr.link, node_rx);
323-
#endif /* !CONFIG_BT_LL_SW_LLCP_LEGACY */
324-
325302
cis->established = 1;
326303
}
327304

@@ -1074,15 +1051,13 @@ static void cis_disabled_cb(void *param)
10741051
*((uint8_t *)node_terminate->pdu) = cis->terminate_reason;
10751052

10761053
ll_rx_put_sched(node_terminate->hdr.link, node_terminate);
1077-
#if !defined(CONFIG_BT_LL_SW_LLCP_LEGACY)
10781054
} else {
10791055
conn = ll_conn_get(cis->lll.acl_handle);
10801056

10811057
/* CIS was not established - complete the procedure with error */
10821058
if (ull_cp_cc_awaiting_established(conn)) {
10831059
ull_cp_cc_established(conn, cis->terminate_reason);
10841060
}
1085-
#endif /* CONFIG_BT_LL_SW_LLCP_LEGACY */
10861061
}
10871062

10881063
if (cig->lll.resume_cis == cis->lll.handle) {

subsys/bluetooth/controller/ll_sw/ull_conn_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ enum llcp {
3333
};
3434

3535
/*
36-
* This is for the refactored LLCP
37-
*
3836
* to reduce length and unreadability of the ll_conn struct the
3937
* structures inside it have been defined first
4038
*/

0 commit comments

Comments
 (0)