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 2020/01/07 20:07:00 UTC

[mynewt-nimble] 03/05: nimble/ll: Add 'targeta_resolved' flag to ble_hdr

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

commit 19098428ec1b1516c885c56dde5e6dc86b522157
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Jan 2 09:40:49 2020 +0100

    nimble/ll: Add 'targeta_resolved' flag to ble_hdr
    
    This has the same value as 'inita_resolved' since it's basically the
    same flag, but in scanner's context we use TargetA so using proper name
    is not confusing.
---
 nimble/controller/src/ble_ll_scan.c | 8 ++++----
 nimble/include/nimble/ble.h         | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/nimble/controller/src/ble_ll_scan.c b/nimble/controller/src/ble_ll_scan.c
index 0330081..5aeba1b 100644
--- a/nimble/controller/src/ble_ll_scan.c
+++ b/nimble/controller/src/ble_ll_scan.c
@@ -865,7 +865,7 @@ ble_ll_scan_send_adv_report(uint8_t pdu_type,
     if (BLE_MBUF_HDR_RESOLVED(hdr)) {
         adva_type += 2;
     }
-    if (BLE_MBUF_HDR_INITA_RESOLVED(hdr)) {
+    if (BLE_MBUF_HDR_TARGETA_RESOLVED(hdr)) {
         inita_type += 2;
     }
 #endif
@@ -2267,7 +2267,7 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t crcok)
                     if (!ble_ll_resolv_rpa(targeta, g_ble_ll_resolv_list[rpa_index].rl_local_irk)) {
                         goto scan_rx_isr_exit;
                     }
-                    ble_hdr->rxinfo.flags |= BLE_MBUF_HDR_F_INITA_RESOLVED;
+                    ble_hdr->rxinfo.flags |= BLE_MBUF_HDR_F_TARGETA_RESOLVED;
                 }
             } else {
                 if (chk_wl) {
@@ -2291,7 +2291,7 @@ ble_ll_scan_rx_isr_end(struct os_mbuf *rxpdu, uint8_t crcok)
                 goto scan_rx_isr_exit;
             }
 
-            ble_hdr->rxinfo.flags |= BLE_MBUF_HDR_F_INITA_RESOLVED;
+            ble_hdr->rxinfo.flags |= BLE_MBUF_HDR_F_TARGETA_RESOLVED;
         }
     }
 
@@ -2570,7 +2570,7 @@ ble_ll_hci_send_ext_adv_report(uint8_t ptype, uint8_t *adva, uint8_t adva_type,
     if (BLE_MBUF_HDR_RESOLVED(hdr)) {
         adva_type += 2;
     }
-    if (BLE_MBUF_HDR_INITA_RESOLVED(hdr)) {
+    if (BLE_MBUF_HDR_TARGETA_RESOLVED(hdr)) {
         inita_type += 2;
     }
 #endif
diff --git a/nimble/include/nimble/ble.h b/nimble/include/nimble/ble.h
index 02c3de4..e348b02 100644
--- a/nimble/include/nimble/ble.h
+++ b/nimble/include/nimble/ble.h
@@ -85,6 +85,7 @@ struct ble_mbuf_hdr_rxinfo
 #define BLE_MBUF_HDR_F_IGNORED          (0x8000)
 #define BLE_MBUF_HDR_F_SCAN_REQ_TXD     (0x4000)
 #define BLE_MBUF_HDR_F_INITA_RESOLVED   (0x2000)
+#define BLE_MBUF_HDR_F_TARGETA_RESOLVED (0x2000)
 #define BLE_MBUF_HDR_F_EXT_ADV_SEC      (0x1000)
 #define BLE_MBUF_HDR_F_EXT_ADV          (0x0800)
 #define BLE_MBUF_HDR_F_RESOLVED         (0x0400)
@@ -152,6 +153,9 @@ struct ble_mbuf_hdr
 #define BLE_MBUF_HDR_INITA_RESOLVED(hdr)      \
     (!!((hdr)->rxinfo.flags & BLE_MBUF_HDR_F_INITA_RESOLVED))
 
+#define BLE_MBUF_HDR_TARGETA_RESOLVED(hdr)      \
+    (!!((hdr)->rxinfo.flags & BLE_MBUF_HDR_F_TARGETA_RESOLVED))
+
 #define BLE_MBUF_HDR_RX_STATE(hdr)      \
     ((uint8_t)((hdr)->rxinfo.flags & BLE_MBUF_HDR_F_RXSTATE_MASK))