From 869d3c24d7afc6876edcf93bf2b34e77751ff4b0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Sat, 7 Aug 2021 15:10:05 +0530 Subject: [PATCH] Bluetooth: Controller: Rename PKT_DC_US to PDU_MAX_US Rename PKT_DC_US to PDU_MAX_US. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/pdu.h | 36 ++++++++++---------- subsys/bluetooth/controller/ll_sw/ull_conn.c | 6 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/pdu.h b/subsys/bluetooth/controller/ll_sw/pdu.h index 2d1150d628a..9ccae9be703 100644 --- a/subsys/bluetooth/controller/ll_sw/pdu.h +++ b/subsys/bluetooth/controller/ll_sw/pdu.h @@ -142,33 +142,33 @@ (CODED_PHY_CRC_SIZE) + \ (CODED_PHY_TERM2_SIZE))<<3) -#define PKT_DC_US(octets, mic, phy) (((phy) & PHY_CODED) ? \ - ((CODED_PHY_PREAMBLE_TIME_US) + \ - (FEC_BLOCK1_TIME_US) + \ - FEC_BLOCK2_TIME_US((octets), (mic))) : \ - (((PDU_PREAMBLE_SIZE(phy) + \ +#define PDU_MAX_US(octets, mic, phy) (((phy) & PHY_CODED) ? \ + ((CODED_PHY_PREAMBLE_TIME_US) + \ + (FEC_BLOCK1_TIME_US) + \ + FEC_BLOCK2_TIME_US((octets), (mic))) : \ + (((PDU_PREAMBLE_SIZE(phy) + \ + (PDU_ACCESS_ADDR_SIZE) + \ + (PDU_HEADER_SIZE) + \ + (octets) + \ + (mic) + \ + (PDU_CRC_SIZE))<<3) / \ + BIT(((phy) & 0x03) >> 1))) + +#else /* !CONFIG_BT_CTLR_PHY_CODED */ +#define PDU_MAX_US(octets, mic, phy) (((PDU_PREAMBLE_SIZE(phy) + \ (PDU_ACCESS_ADDR_SIZE) + \ (PDU_HEADER_SIZE) + \ (octets) + \ (mic) + \ (PDU_CRC_SIZE))<<3) / \ - BIT(((phy) & 0x03) >> 1))) - -#else /* !CONFIG_BT_CTLR_PHY_CODED */ -#define PKT_DC_US(octets, mic, phy) (((PDU_PREAMBLE_SIZE(phy) + \ - (PDU_ACCESS_ADDR_SIZE) + \ - (PDU_HEADER_SIZE) + \ - (octets) + \ - (mic) + \ - (PDU_CRC_SIZE))<<3) / \ - BIT(((phy) & 0x03) >> 1)) + BIT(((phy) & 0x03) >> 1)) #endif /* !CONFIG_BT_CTLR_PHY_CODED */ -#define PKT_US(octets, phy) PKT_DC_US((octets), (PDU_MIC_SIZE), (phy)) +#define PKT_US(octets, phy) PDU_MAX_US((octets), (PDU_MIC_SIZE), (phy)) -#define PKT_AC_US(octets, phy) PKT_DC_US((octets), 0, (phy)) +#define PKT_AC_US(octets, phy) PDU_MAX_US((octets), 0, (phy)) -#define PKT_BIS_US(octets, mic, phy) PKT_DC_US((octets), (mic), (phy)) +#define PKT_BIS_US(octets, mic, phy) PDU_MAX_US((octets), (mic), (phy)) /* Extra bytes for enqueued node_rx metadata: rssi (always), resolving * index, directed adv report, and mesh channel and instant. diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index 0cc5da0ce93..051055e2581 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -7035,8 +7035,8 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate) time_incoming = (LL_LENGTH_OCTETS_RX_MAX << 3) * 1000000UL / tx_rate; - time_outgoing = PKT_DC_US(LL_LENGTH_OCTETS_RX_MAX, mic_size, phy) + - PKT_DC_US(0U, 0U, phy) + + time_outgoing = PDU_MAX_US(LL_LENGTH_OCTETS_RX_MAX, mic_size, phy) + + PDU_MAX_US(0U, 0U, phy) + (EVENT_IFS_US << 1); force_md_cnt = 0U; @@ -7045,7 +7045,7 @@ static uint8_t force_md_cnt_calc(struct lll_conn *lll_conn, uint32_t tx_rate) uint32_t time_keep_alive; delta = (time_incoming << 1) - time_outgoing; - time_keep_alive = (PKT_DC_US(0U, 0U, phy) + EVENT_IFS_US) << 1; + time_keep_alive = (PDU_MAX_US(0U, 0U, phy) + EVENT_IFS_US) << 1; force_md_cnt = (delta + (time_keep_alive - 1)) / time_keep_alive; BT_DBG("Time: incoming= %u, expected outgoing= %u, delta= %u, "