Skip to content

Commit 705515c

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Data Length Update port to ULL/LLL arch
Ported implementation of Data Length Update Procedure to ULL/LLL architecture of the Link Layer. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 6fc6553 commit 705515c

File tree

8 files changed

+435
-138
lines changed

8 files changed

+435
-138
lines changed

subsys/bluetooth/controller/ll_sw/lll_conn.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,10 @@ struct lll_conn {
9797
/* FIXME: END: Move to ULL? */
9898

9999
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
100-
u16_t default_tx_octets;
101100
u16_t max_tx_octets;
102101
u16_t max_rx_octets;
103102

104103
#if defined(CONFIG_BT_CTLR_PHY)
105-
u16_t default_tx_time;
106104
u16_t max_tx_time;
107105
u16_t max_rx_time;
108106
#endif /* CONFIG_BT_CTLR_PHY */

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,12 @@ void lll_conn_pdu_tx_prep(struct lll_conn *lll, struct pdu_data **pdu_data_tx)
614614
}
615615
}
616616

617+
p->rfu = 0U;
618+
619+
#if !defined(CONFIG_BT_CTLR_DATA_LENGTH_CLEAR)
620+
p->resv = 0U;
621+
#endif /* !CONFIG_BT_CTLR_DATA_LENGTH_CLEAR */
622+
617623
*pdu_data_tx = p;
618624
}
619625

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "pdu.h"
3333
#include "ll.h"
34+
#include "ll_feat.h"
3435
#include "lll.h"
3536
#include "lll_filter.h"
3637
#include "lll_adv.h"
@@ -146,8 +147,6 @@ static MFIFO_DEFINE(ll_pdu_rx_free, sizeof(void *), LL_PDU_RX_CNT);
146147

147148
#if defined(CONFIG_BT_RX_BUF_LEN)
148149
#define PDU_RX_OCTETS_MAX (CONFIG_BT_RX_BUF_LEN - 11)
149-
#else
150-
#define PDU_RX_OCTETS_MAX 0
151150
#endif
152151

153152
#define NODE_RX_HEADER_SIZE (offsetof(struct node_rx_pdu, pdu))

subsys/bluetooth/controller/ll_sw/ull_adv.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,19 @@ u8_t ll_adv_enable(u8_t enable)
571571
conn_lll->enc_tx = 0;
572572
#endif /* CONFIG_BT_CTLR_LE_ENC */
573573

574+
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
575+
conn_lll->max_tx_octets = PDU_DC_PAYLOAD_SIZE_MIN;
576+
conn_lll->max_rx_octets = PDU_DC_PAYLOAD_SIZE_MIN;
577+
578+
#if defined(CONFIG_BT_CTLR_PHY)
579+
/* Use the default 1M packet max time. Value of 0 is
580+
* equivalent to using BIT(0).
581+
*/
582+
conn_lll->max_tx_time = PKT_US(PDU_DC_PAYLOAD_SIZE_MIN, 0);
583+
conn_lll->max_rx_time = PKT_US(PDU_DC_PAYLOAD_SIZE_MIN, 0);
584+
#endif /* CONFIG_BT_CTLR_PHY */
585+
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
586+
574587
#if defined(CONFIG_BT_CTLR_PHY)
575588
conn_lll->phy_tx = BIT(0);
576589
conn_lll->phy_flags = 0;
@@ -625,6 +638,16 @@ u8_t ll_adv_enable(u8_t enable)
625638
conn->llcp_conn_param.disabled = 0;
626639
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
627640

641+
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
642+
conn->llcp_length.req = conn->llcp_length.ack = 0U;
643+
conn->llcp_length.pause_tx = 0U;
644+
conn->default_tx_octets = ull_conn_default_tx_octets_get();
645+
646+
#if defined(CONFIG_BT_CTLR_PHY)
647+
conn->default_tx_time = ull_conn_default_tx_time_get();
648+
#endif /* CONFIG_BT_CTLR_PHY */
649+
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */
650+
628651
#if defined(CONFIG_BT_CTLR_PHY)
629652
conn->llcp_phy.req = conn->llcp_phy.ack = 0;
630653
conn->phy_pref_tx = ull_conn_default_phy_tx_get();

0 commit comments

Comments
 (0)