You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/02/01 13:28:31 UTC

[mynewt-nimble] branch master updated: nimble/phy/cmac: Fix unexpected match on resolving list

This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new b8c1d51  nimble/phy/cmac: Fix unexpected match on resolving list
b8c1d51 is described below

commit b8c1d516d9c7d4c8c41a55f940f2a4f23bbac9bf
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Feb 1 10:58:25 2022 +0100

    nimble/phy/cmac: Fix unexpected match on resolving list
    
    During scan window we restart rx after PDU without reinitializing phy,
    this means we do not reenable resolving list. On CMAC this means flags
    in resolver are not cleared so once we matched one device, we will
    return match for all subsequent devices in that window. So we just need
    to clear flag before starting any rx.
---
 nimble/drivers/dialog_cmac/src/ble_hw.c      | 6 ++++++
 nimble/drivers/dialog_cmac/src/ble_hw_priv.h | 1 +
 nimble/drivers/dialog_cmac/src/ble_phy.c     | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/nimble/drivers/dialog_cmac/src/ble_hw.c b/nimble/drivers/dialog_cmac/src/ble_hw.c
index 98c8144..763de8d 100644
--- a/nimble/drivers/dialog_cmac/src/ble_hw.c
+++ b/nimble/drivers/dialog_cmac/src/ble_hw.c
@@ -306,6 +306,12 @@ ble_hw_resolv_proc_disable(void)
 }
 
 void
+ble_hw_resolv_proc_reset(const uint8_t *addr)
+{
+    g_ble_hw_resolv_proc.f_match = 0;
+}
+
+void
 ble_hw_resolv_proc_start(const uint8_t *addr)
 {
     assert(g_ble_hw_resolv_proc.f_configured);
diff --git a/nimble/drivers/dialog_cmac/src/ble_hw_priv.h b/nimble/drivers/dialog_cmac/src/ble_hw_priv.h
index 627994f..7595a20 100644
--- a/nimble/drivers/dialog_cmac/src/ble_hw_priv.h
+++ b/nimble/drivers/dialog_cmac/src/ble_hw_priv.h
@@ -24,6 +24,7 @@
 
 void ble_hw_resolv_proc_enable(void);
 void ble_hw_resolv_proc_disable(void);
+void ble_hw_resolv_proc_reset(void);
 void ble_hw_resolv_proc_start(const uint8_t *addr);
 
 #endif /* _BLE_HW_PRIV_H_ */
diff --git a/nimble/drivers/dialog_cmac/src/ble_phy.c b/nimble/drivers/dialog_cmac/src/ble_phy.c
index 212d19b..1b1d821 100644
--- a/nimble/drivers/dialog_cmac/src/ble_phy.c
+++ b/nimble/drivers/dialog_cmac/src/ble_phy.c
@@ -1347,6 +1347,10 @@ ble_phy_rx_setup_xcvr(void)
 {
     uint8_t rf_chan = g_ble_phy_chan_to_rf[g_ble_phy_data.channel];
 
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
+    ble_hw_resolv_proc_reset();
+#endif
+
     CMAC->CM_EV_SET_REG = CMAC_CM_EV_SET_REG_EV1C_CALLBACK_VALID_SET_Msk;
 
     ble_rf_setup_rx(rf_chan, g_ble_phy_data.phy_mode_rx);