Skip to content
Permalink
Browse files

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 <vich@nordicsemi.no>
  • Loading branch information...
cvinayak authored and carlescufi committed Jan 26, 2019
1 parent 6fc6553 commit 705515c0925851e4c0b81cfda06ac957df575c03
@@ -97,12 +97,10 @@ struct lll_conn {
/* FIXME: END: Move to ULL? */

#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
u16_t default_tx_octets;
u16_t max_tx_octets;
u16_t max_rx_octets;

#if defined(CONFIG_BT_CTLR_PHY)
u16_t default_tx_time;
u16_t max_tx_time;
u16_t max_rx_time;
#endif /* CONFIG_BT_CTLR_PHY */
@@ -614,6 +614,12 @@ void lll_conn_pdu_tx_prep(struct lll_conn *lll, struct pdu_data **pdu_data_tx)
}
}

p->rfu = 0U;

#if !defined(CONFIG_BT_CTLR_DATA_LENGTH_CLEAR)
p->resv = 0U;
#endif /* !CONFIG_BT_CTLR_DATA_LENGTH_CLEAR */

*pdu_data_tx = p;
}

@@ -31,6 +31,7 @@

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

#if defined(CONFIG_BT_RX_BUF_LEN)
#define PDU_RX_OCTETS_MAX (CONFIG_BT_RX_BUF_LEN - 11)
#else
#define PDU_RX_OCTETS_MAX 0
#endif

#define NODE_RX_HEADER_SIZE (offsetof(struct node_rx_pdu, pdu))
@@ -571,6 +571,19 @@ u8_t ll_adv_enable(u8_t enable)
conn_lll->enc_tx = 0;
#endif /* CONFIG_BT_CTLR_LE_ENC */

#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
conn_lll->max_tx_octets = PDU_DC_PAYLOAD_SIZE_MIN;
conn_lll->max_rx_octets = PDU_DC_PAYLOAD_SIZE_MIN;

#if defined(CONFIG_BT_CTLR_PHY)
/* Use the default 1M packet max time. Value of 0 is
* equivalent to using BIT(0).
*/
conn_lll->max_tx_time = PKT_US(PDU_DC_PAYLOAD_SIZE_MIN, 0);
conn_lll->max_rx_time = PKT_US(PDU_DC_PAYLOAD_SIZE_MIN, 0);
#endif /* CONFIG_BT_CTLR_PHY */
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */

#if defined(CONFIG_BT_CTLR_PHY)
conn_lll->phy_tx = BIT(0);
conn_lll->phy_flags = 0;
@@ -625,6 +638,16 @@ u8_t ll_adv_enable(u8_t enable)
conn->llcp_conn_param.disabled = 0;
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */

#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
conn->llcp_length.req = conn->llcp_length.ack = 0U;
conn->llcp_length.pause_tx = 0U;
conn->default_tx_octets = ull_conn_default_tx_octets_get();

#if defined(CONFIG_BT_CTLR_PHY)
conn->default_tx_time = ull_conn_default_tx_time_get();
#endif /* CONFIG_BT_CTLR_PHY */
#endif /* CONFIG_BT_CTLR_DATA_LENGTH */

#if defined(CONFIG_BT_CTLR_PHY)
conn->llcp_phy.req = conn->llcp_phy.ack = 0;
conn->phy_pref_tx = ull_conn_default_phy_tx_get();

0 comments on commit 705515c

Please sign in to comment.
You can’t perform that action at this time.