Skip to content

Commit

Permalink
nimble/ll: Add 'targeta_resolved' flag to ble_hdr
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrzej-kaczmarek committed Jan 7, 2020
1 parent a05e3b5 commit 1909842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nimble/controller/src/ble_ll_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions nimble/include/nimble/ble.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 1909842

Please sign in to comment.