Skip to content

Commit 04dc9e9

Browse files
nimble/phy: Add stats for tx_late variants
1 parent 69c8991 commit 04dc9e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

nimble/drivers/dialog_cmac/src/ble_phy.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ STATS_SECT_START(ble_phy_stats)
4646
STATS_SECT_ENTRY(tx_good)
4747
STATS_SECT_ENTRY(tx_fail)
4848
STATS_SECT_ENTRY(tx_late)
49+
STATS_SECT_ENTRY(tx_late_sched)
50+
STATS_SECT_ENTRY(tx_late_frame)
51+
STATS_SECT_ENTRY(tx_late_field)
4952
STATS_SECT_ENTRY(tx_bytes)
5053
STATS_SECT_ENTRY(rx_starts)
5154
STATS_SECT_ENTRY(rx_aborts)
@@ -63,6 +66,9 @@ STATS_NAME_START(ble_phy_stats)
6366
STATS_NAME(ble_phy_stats, tx_good)
6467
STATS_NAME(ble_phy_stats, tx_fail)
6568
STATS_NAME(ble_phy_stats, tx_late)
69+
STATS_NAME(ble_phy_stats, tx_late_sched)
70+
STATS_NAME(ble_phy_stats, tx_late_frame)
71+
STATS_NAME(ble_phy_stats, tx_late_field)
6672
STATS_NAME(ble_phy_stats, tx_bytes)
6773
STATS_NAME(ble_phy_stats, rx_starts)
6874
STATS_NAME(ble_phy_stats, rx_aborts)
@@ -1462,6 +1468,7 @@ ble_phy_tx(ble_phy_tx_pducb_t pducb, void *pducb_arg, uint8_t end_trans)
14621468
if (CMAC->CM_EXC_STAT_REG & CMAC_CM_EXC_STAT_REG_EXC_FIELD_ON_THR_EXP_Msk) {
14631469
ble_phy_disable();
14641470
g_ble_phy_data.end_transition = BLE_PHY_TRANSITION_NONE;
1471+
STATS_INC(ble_phy_stats, tx_late_field);
14651472
STATS_INC(ble_phy_stats, tx_late);
14661473
rc = BLE_PHY_ERR_RADIO_STATE;
14671474
} else {
@@ -1515,6 +1522,7 @@ ble_phy_tx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
15151522
CMAC->CM_EV_LINKUP_REG = CMAC_CM_EV_LINKUP_REG_LU_FRAME_START_2_TMR1_9_0_EQ_X_Msk;
15161523

15171524
if ((int32_t)(ll_val32 - cmac_timer_read32()) < 0) {
1525+
STATS_INC(ble_phy_stats, tx_late_sched);
15181526
goto tx_late;
15191527
}
15201528

@@ -1531,6 +1539,7 @@ ble_phy_tx_set_start_time(uint32_t cputime, uint8_t rem_usecs)
15311539
* need to assume tx_late and abort.
15321540
*/
15331541
if (CMAC->CM_EXC_STAT_REG & CMAC_CM_EXC_STAT_REG_EXC_FRAME_START_Msk) {
1542+
STATS_INC(ble_phy_stats, tx_late_frame);
15341543
goto tx_late;
15351544
}
15361545

0 commit comments

Comments
 (0)