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/09 11:38:41 UTC

[mynewt-nimble] branch master updated (4ac4eec -> cd1706b)

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

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


    from 4ac4eec  nimble/ports: Refresh syscfg
     new 957edb7  nimble/ll: Update LL features list to 5.3
     new 55cedd2  nimble/ll: Update LLC PDU defs to 5.3
     new 4edf16f  nimble/ll: Update role names to 5.3
     new cd1706b  nimble/ll: Fix master/slave in comments

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/controller/include/controller/ble_ll.h      |  79 +++---
 nimble/controller/include/controller/ble_ll_conn.h |  24 +-
 nimble/controller/include/controller/ble_ll_ctrl.h |  21 +-
 .../controller/include/controller/ble_ll_sched.h   |   6 +-
 .../controller/include/controller/ble_ll_utils.h   |   2 +-
 nimble/controller/include/controller/ble_phy.h     |   2 +-
 nimble/controller/src/ble_ll.c                     | 110 ++++-----
 nimble/controller/src/ble_ll_adv.c                 |  15 +-
 nimble/controller/src/ble_ll_conn.c                | 267 ++++++++++-----------
 nimble/controller/src/ble_ll_conn_hci.c            |  70 +++---
 nimble/controller/src/ble_ll_conn_priv.h           |  14 +-
 nimble/controller/src/ble_ll_ctrl.c                | 211 ++++++++--------
 nimble/controller/src/ble_ll_hci_ev.c              |   2 +-
 nimble/controller/src/ble_ll_sched.c               |  60 ++---
 nimble/controller/src/ble_ll_sync.c                |   2 +-
 nimble/controller/src/ble_ll_utils.c               |   4 +-
 nimble/controller/syscfg.yml                       |   7 +-
 nimble/drivers/nrf5340/src/ble_phy.c               |   4 +-
 18 files changed, 467 insertions(+), 433 deletions(-)

[mynewt-nimble] 01/04: nimble/ll: Update LL features list to 5.3

Posted by an...@apache.org.
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 957edb7233a2c42eaeed61e3e1139373c600e5a3
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Feb 7 12:47:19 2022 +0100

    nimble/ll: Update LL features list to 5.3
---
 nimble/controller/include/controller/ble_ll.h | 79 ++++++++++++++-------------
 1 file changed, 42 insertions(+), 37 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index c51d410..3b7e376 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -235,42 +235,46 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #endif
 
 /* LL Features */
-#define BLE_LL_FEAT_LE_ENCRYPTION    (0x0000000001)
-#define BLE_LL_FEAT_CONN_PARM_REQ    (0x0000000002)
-#define BLE_LL_FEAT_EXTENDED_REJ     (0x0000000004)
-#define BLE_LL_FEAT_SLAVE_INIT       (0x0000000008)
-#define BLE_LL_FEAT_LE_PING          (0x0000000010)
-#define BLE_LL_FEAT_DATA_LEN_EXT     (0x0000000020)
-#define BLE_LL_FEAT_LL_PRIVACY       (0x0000000040)
-#define BLE_LL_FEAT_EXT_SCAN_FILT    (0x0000000080)
-#define BLE_LL_FEAT_LE_2M_PHY        (0x0000000100)
-#define BLE_LL_FEAT_STABLE_MOD_ID_TX (0x0000000200)
-#define BLE_LL_FEAT_STABLE_MOD_ID_RX (0x0000000400)
-#define BLE_LL_FEAT_LE_CODED_PHY     (0x0000000800)
-#define BLE_LL_FEAT_EXT_ADV          (0x0000001000)
-#define BLE_LL_FEAT_PERIODIC_ADV     (0x0000002000)
-#define BLE_LL_FEAT_CSA2             (0x0000004000)
-#define BLE_LL_FEAT_LE_POWER_CLASS_1 (0x0000008000)
-#define BLE_LL_FEAT_MIN_USED_CHAN    (0x0000010000)
-#define BLE_LL_FEAT_CTE_REQ          (0x0000020000)
-#define BLE_LL_FEAT_CTE_RSP          (0x0000040000)
-#define BLE_LL_FEAT_CTE_TX           (0x0000080000)
-#define BLE_LL_FEAT_CTE_RX           (0x0000100000)
-#define BLE_LL_FEAT_CTE_AOD          (0x0000200000)
-#define BLE_LL_FEAT_CTE_AOA          (0x0000400000)
-#define BLE_LL_FEAT_CTE_RECV         (0x0000800000)
-#define BLE_LL_FEAT_SYNC_TRANS_SEND  (0x0001000000)
-#define BLE_LL_FEAT_SYNC_TRANS_RECV  (0x0002000000)
-#define BLE_LL_FEAT_SCA_UPDATE       (0x0004000000)
-#define BLE_LL_FEAT_REM_PKEY         (0x0008000000)
-#define BLE_LL_FEAT_CIS_MASTER       (0x0010000000)
-#define BLE_LL_FEAT_CIS_SLAVE        (0x0020000000)
-#define BLE_LL_FEAT_ISO_BROADCASTER  (0x0040000000)
-#define BLE_LL_FEAT_SYNC_RECV        (0x0080000000)
-#define BLE_LL_FEAT_ISO_HOST_SUPPORT (0x0100000000)
-#define BLE_LL_FEAT_POWER_CTRL_REQ   (0x0200000000)
-#define BLE_LL_FEAT_POWER_CHANGE_IND (0x0400000000)
-#define BLE_LL_FEAT_PATH_LOSS_MON    (0x0800000000)
+#define BLE_LL_FEAT_LE_ENCRYPTION       (0x0000000001)
+#define BLE_LL_FEAT_CONN_PARM_REQ       (0x0000000002)
+#define BLE_LL_FEAT_EXTENDED_REJ        (0x0000000004)
+#define BLE_LL_FEAT_SLAVE_INIT          (0x0000000008)
+#define BLE_LL_FEAT_LE_PING             (0x0000000010)
+#define BLE_LL_FEAT_DATA_LEN_EXT        (0x0000000020)
+#define BLE_LL_FEAT_LL_PRIVACY          (0x0000000040)
+#define BLE_LL_FEAT_EXT_SCAN_FILT       (0x0000000080)
+#define BLE_LL_FEAT_LE_2M_PHY           (0x0000000100)
+#define BLE_LL_FEAT_STABLE_MOD_ID_TX    (0x0000000200)
+#define BLE_LL_FEAT_STABLE_MOD_ID_RX    (0x0000000400)
+#define BLE_LL_FEAT_LE_CODED_PHY        (0x0000000800)
+#define BLE_LL_FEAT_EXT_ADV             (0x0000001000)
+#define BLE_LL_FEAT_PERIODIC_ADV        (0x0000002000)
+#define BLE_LL_FEAT_CSA2                (0x0000004000)
+#define BLE_LL_FEAT_LE_POWER_CLASS_1    (0x0000008000)
+#define BLE_LL_FEAT_MIN_USED_CHAN       (0x0000010000)
+#define BLE_LL_FEAT_CTE_REQ             (0x0000020000)
+#define BLE_LL_FEAT_CTE_RSP             (0x0000040000)
+#define BLE_LL_FEAT_CTE_TX              (0x0000080000)
+#define BLE_LL_FEAT_CTE_RX              (0x0000100000)
+#define BLE_LL_FEAT_CTE_AOD             (0x0000200000)
+#define BLE_LL_FEAT_CTE_AOA             (0x0000400000)
+#define BLE_LL_FEAT_CTE_RECV            (0x0000800000)
+#define BLE_LL_FEAT_SYNC_TRANS_SEND     (0x0001000000)
+#define BLE_LL_FEAT_SYNC_TRANS_RECV     (0x0002000000)
+#define BLE_LL_FEAT_SCA_UPDATE          (0x0004000000)
+#define BLE_LL_FEAT_REM_PKEY            (0x0008000000)
+#define BLE_LL_FEAT_CIS_MASTER          (0x0010000000)
+#define BLE_LL_FEAT_CIS_SLAVE           (0x0020000000)
+#define BLE_LL_FEAT_ISO_BROADCASTER     (0x0040000000)
+#define BLE_LL_FEAT_SYNC_RECV           (0x0080000000)
+#define BLE_LL_FEAT_CIS_HOST            (0x0100000000)
+#define BLE_LL_FEAT_POWER_CTRL_REQ      (0x0200000000)
+#define BLE_LL_FEAT_POWER_CHANGE_IND    (0x0400000000)
+#define BLE_LL_FEAT_PATH_LOSS_MON       (0x0800000000)
+#define BLE_LL_FEAT_PERIODIC_ADV_ADI    (0x1000000000)
+#define BLE_LL_FEAT_CONN_SUBRATING      (0x2000000000)
+#define BLE_LL_FEAT_CONN_SUBRATING_HOST (0x4000000000)
+#define BLE_LL_FEAT_CHANNEL_CLASS       (0x8000000000)
 
 /* This is initial mask, so if feature exchange will not happen,
  * but host will want to use this procedure, we will try. If not
@@ -281,7 +285,8 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #define BLE_LL_CONN_CLEAR_FEATURE(connsm, feature)   (connsm->conn_features &= ~(feature))
 
 /* All the features which can be controlled by the Host */
-#define BLE_LL_HOST_CONTROLLED_FEATURES (BLE_LL_FEAT_ISO_HOST_SUPPORT)
+#define BLE_LL_HOST_CONTROLLED_FEATURES (BLE_LL_FEAT_CIS_HOST | \
+                                         BLE_LL_FEAT_CONN_SUBRATING_HOST)
 
 /* LL timing */
 #define BLE_LL_IFS                  (150)       /* usecs */

[mynewt-nimble] 03/04: nimble/ll: Update role names to 5.3

Posted by an...@apache.org.
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 4edf16ff27bb876eab0dee4e0bf43f1138ef8eba
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Feb 7 16:46:28 2022 +0100

    nimble/ll: Update role names to 5.3
    
    This only changes code, comments will be changed in separate commit.
---
 nimble/controller/include/controller/ble_ll.h      |   6 +-
 nimble/controller/include/controller/ble_ll_conn.h |  24 +--
 nimble/controller/include/controller/ble_ll_ctrl.h |   4 +-
 .../controller/include/controller/ble_ll_sched.h   |   6 +-
 .../controller/include/controller/ble_ll_utils.h   |   2 +-
 nimble/controller/include/controller/ble_phy.h     |   2 +-
 nimble/controller/src/ble_ll.c                     | 110 +++++------
 nimble/controller/src/ble_ll_adv.c                 |  13 +-
 nimble/controller/src/ble_ll_conn.c                | 203 ++++++++++-----------
 nimble/controller/src/ble_ll_conn_hci.c            |  46 ++---
 nimble/controller/src/ble_ll_conn_priv.h           |  14 +-
 nimble/controller/src/ble_ll_ctrl.c                | 114 ++++++------
 nimble/controller/src/ble_ll_hci_ev.c              |   2 +-
 nimble/controller/src/ble_ll_sched.c               |  18 +-
 nimble/controller/src/ble_ll_utils.c               |   4 +-
 nimble/controller/syscfg.yml                       |   7 +-
 nimble/drivers/nrf5340/src/ble_phy.c               |   4 +-
 17 files changed, 291 insertions(+), 288 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 3b7e376..fb731ab 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -238,7 +238,7 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #define BLE_LL_FEAT_LE_ENCRYPTION       (0x0000000001)
 #define BLE_LL_FEAT_CONN_PARM_REQ       (0x0000000002)
 #define BLE_LL_FEAT_EXTENDED_REJ        (0x0000000004)
-#define BLE_LL_FEAT_SLAVE_INIT          (0x0000000008)
+#define BLE_LL_FEAT_PERIPH_INIT         (0x0000000008)
 #define BLE_LL_FEAT_LE_PING             (0x0000000010)
 #define BLE_LL_FEAT_DATA_LEN_EXT        (0x0000000020)
 #define BLE_LL_FEAT_LL_PRIVACY          (0x0000000040)
@@ -263,8 +263,8 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #define BLE_LL_FEAT_SYNC_TRANS_RECV     (0x0002000000)
 #define BLE_LL_FEAT_SCA_UPDATE          (0x0004000000)
 #define BLE_LL_FEAT_REM_PKEY            (0x0008000000)
-#define BLE_LL_FEAT_CIS_MASTER          (0x0010000000)
-#define BLE_LL_FEAT_CIS_SLAVE           (0x0020000000)
+#define BLE_LL_FEAT_CIS_CENTRAL         (0x0010000000)
+#define BLE_LL_FEAT_CIS_PERIPH          (0x0020000000)
 #define BLE_LL_FEAT_ISO_BROADCASTER     (0x0040000000)
 #define BLE_LL_FEAT_SYNC_RECV           (0x0080000000)
 #define BLE_LL_FEAT_CIS_HOST            (0x0100000000)
diff --git a/nimble/controller/include/controller/ble_ll_conn.h b/nimble/controller/include/controller/ble_ll_conn.h
index c3073c6..cd219cb 100644
--- a/nimble/controller/include/controller/ble_ll_conn.h
+++ b/nimble/controller/include/controller/ble_ll_conn.h
@@ -36,10 +36,10 @@ extern "C" {
 #define BLE_LL_CONN_ROLE_NONE           (0)
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-#define BLE_LL_CONN_ROLE_MASTER         (1)
+#define BLE_LL_CONN_ROLE_CENTRAL        (1)
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define BLE_LL_CONN_ROLE_SLAVE          (2)
+#define BLE_LL_CONN_ROLE_PERIPHERAL     (2)
 #endif
 
 /* Connection states */
@@ -106,8 +106,8 @@ union ble_ll_conn_sm_flags {
         uint32_t terminate_ind_txd:1;
         uint32_t terminate_ind_rxd:1;
         uint32_t terminate_ind_rxd_acked:1;
-        uint32_t allow_slave_latency:1;
-        uint32_t slave_set_last_anchor:1;
+        uint32_t allow_periph_latency:1;
+        uint32_t periph_set_last_anchor:1;
         uint32_t awaiting_host_reply:1;
         uint32_t terminate_started:1;
         uint32_t conn_update_sched:1;
@@ -249,7 +249,7 @@ struct ble_ll_conn_sm
     /* connection event mgmt */
     uint8_t reject_reason;
     uint8_t host_reply_opcode;
-    uint8_t master_sca;
+    uint8_t central_sca;
     uint8_t tx_win_size;
     uint8_t cur_ctrl_proc;
     uint8_t disconnect_reason;
@@ -273,7 +273,7 @@ struct ble_ll_conn_sm
 
     /* Connection timing */
     uint16_t conn_itvl;
-    uint16_t slave_latency;
+    uint16_t periph_latency;
     uint16_t supervision_tmo;
     uint16_t min_ce_len;
     uint16_t max_ce_len;
@@ -283,8 +283,8 @@ struct ble_ll_conn_sm
     uint8_t conn_itvl_usecs;
     uint32_t conn_itvl_ticks;
     uint32_t last_anchor_point;     /* Slave only */
-    uint32_t slave_cur_tx_win_usecs;
-    uint32_t slave_cur_window_widening;
+    uint32_t periph_cur_tx_win_usecs;
+    uint32_t periph_cur_window_widening;
     uint32_t last_rxd_pdu_cputime;  /* Used exclusively for supervision timer */
 
     /*
@@ -376,15 +376,15 @@ struct ble_ll_conn_sm
 
 /* Role */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-#define CONN_IS_MASTER(csm)         (csm->conn_role == BLE_LL_CONN_ROLE_MASTER)
+#define CONN_IS_CENTRAL(csm)        (csm->conn_role == BLE_LL_CONN_ROLE_CENTRAL)
 #else
-#define CONN_IS_MASTER(csm)         (false)
+#define CONN_IS_CENTRAL(csm)        (false)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define CONN_IS_SLAVE(csm)          (csm->conn_role == BLE_LL_CONN_ROLE_SLAVE)
+#define CONN_IS_PERIPHERAL(csm)     (csm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL)
 #else
-#define CONN_IS_SLAVE(csm)          (false)
+#define CONN_IS_PERIPHERAL(csm)     (false)
 #endif
 
 /*
diff --git a/nimble/controller/include/controller/ble_ll_ctrl.h b/nimble/controller/include/controller/ble_ll_ctrl.h
index 047d349..ebac33d 100644
--- a/nimble/controller/include/controller/ble_ll_ctrl.h
+++ b/nimble/controller/include/controller/ble_ll_ctrl.h
@@ -70,7 +70,7 @@ extern "C" {
 #define BLE_LL_CTRL_PAUSE_ENC_RSP       (0x0B)
 #define BLE_LL_CTRL_VERSION_IND         (0x0C)
 #define BLE_LL_CTRL_REJECT_IND          (0x0D)
-#define BLE_LL_CTRL_SLAVE_FEATURE_REQ   (0x0E)
+#define BLE_LL_CTRL_PERIPH_FEATURE_REQ   (0x0E)
 #define BLE_LL_CTRL_CONN_PARM_REQ       (0x0F)
 #define BLE_LL_CTRL_CONN_PARM_RSP       (0x10)
 #define BLE_LL_CTRL_REJECT_IND_EXT      (0x11)
@@ -205,7 +205,7 @@ struct ble_ll_version_ind
  * LL control slave feature req
  *  -> 8 bytes of data containing features supported by device.
  */
-#define BLE_LL_CTRL_SLAVE_FEATURE_REQ_LEN   (8)
+#define BLE_LL_CTRL_PERIPH_FEATURE_REQ_LEN   (8)
 
 /* LL control connection param req and connection param rsp */
 struct ble_ll_conn_params
diff --git a/nimble/controller/include/controller/ble_ll_sched.h b/nimble/controller/include/controller/ble_ll_sched.h
index 4ce687e..56399d2 100644
--- a/nimble/controller/include/controller/ble_ll_sched.h
+++ b/nimble/controller/include/controller/ble_ll_sched.h
@@ -143,11 +143,11 @@ void ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb);
 
 /* Schedule a new master connection */
 struct ble_ll_conn_sm;
-int ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
-                            struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len);
+int ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
+                                  struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len);
 
 /* Schedule a new slave connection */
-int ble_ll_sched_slave_new(struct ble_ll_conn_sm *connsm);
+int ble_ll_sched_conn_periph_new(struct ble_ll_conn_sm *connsm);
 
 struct ble_ll_adv_sm;
 typedef void ble_ll_sched_adv_new_cb(struct ble_ll_adv_sm *advsm,
diff --git a/nimble/controller/include/controller/ble_ll_utils.h b/nimble/controller/include/controller/ble_ll_utils.h
index 2483090..e0b1646 100644
--- a/nimble/controller/include/controller/ble_ll_utils.h
+++ b/nimble/controller/include/controller/ble_ll_utils.h
@@ -26,4 +26,4 @@ uint8_t ble_ll_utils_calc_dci_csa2(uint16_t event_cntr, uint16_t channel_id,
 uint8_t ble_ll_utils_calc_num_used_chans(const uint8_t *chanmap);
 uint32_t ble_ll_utils_calc_window_widening(uint32_t anchor_point,
                                            uint32_t last_anchor_point,
-                                           uint8_t master_sca);
+                                           uint8_t central_sca);
diff --git a/nimble/controller/include/controller/ble_phy.h b/nimble/controller/include/controller/ble_phy.h
index 47f3afd..3d32bd6 100644
--- a/nimble/controller/include/controller/ble_phy.h
+++ b/nimble/controller/include/controller/ble_phy.h
@@ -164,7 +164,7 @@ uint32_t ble_phy_access_addr_get(void);
 
 /* Enable encryption */
 void ble_phy_encrypt_enable(uint64_t pkt_counter, uint8_t *iv, uint8_t *key,
-                            uint8_t is_master);
+                            uint8_t is_central);
 
 /* Disable encryption */
 void ble_phy_encrypt_disable(void);
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index 34c0c77..ec40925 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -98,9 +98,9 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define BLE_LL_S_SLAVE                  ((uint64_t)1 << 7)
+#define BLE_LL_S_PERIPH                 ((uint64_t)1 << 7)
 #else
-#define BLE_LL_S_SLAVE                  ((uint64_t)0 << 7)
+#define BLE_LL_S_PERIPH                  ((uint64_t)0 << 7)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER) && MYNEWT_VAL(BLE_LL_ROLE_OBSERVER)
@@ -138,21 +138,21 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER) && MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
 #define BLE_LL_S_NCA_INIT               ((uint64_t)1 << 16)
 #define BLE_LL_S_SA_INIT                ((uint64_t)1 << 17)
-#define BLE_LL_S_NCA_MASTER             ((uint64_t)1 << 18)
-#define BLE_LL_S_SA_MASTER              ((uint64_t)1 << 19)
+#define BLE_LL_S_NCA_CENTRAL            ((uint64_t)1 << 18)
+#define BLE_LL_S_SA_CENTRAL             ((uint64_t)1 << 19)
 #else
 #define BLE_LL_S_NCA_INIT               ((uint64_t)0 << 16)
 #define BLE_LL_S_SA_INIT                ((uint64_t)0 << 17)
-#define BLE_LL_S_NCA_MASTER             ((uint64_t)0 << 18)
-#define BLE_LL_S_SA_MASTER              ((uint64_t)0 << 19)
+#define BLE_LL_S_NCA_CENTRAL             ((uint64_t)0 << 18)
+#define BLE_LL_S_SA_CENTRAL              ((uint64_t)0 << 19)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER) && MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define BLE_LL_S_NCA_SLAVE              ((uint64_t)1 << 20)
-#define BLE_LL_S_SA_SLAVE               ((uint64_t)1 << 21)
+#define BLE_LL_S_NCA_PERIPH             ((uint64_t)1 << 20)
+#define BLE_LL_S_SA_PERIPH               ((uint64_t)1 << 21)
 #else
-#define BLE_LL_S_NCA_SLAVE              ((uint64_t)0 << 20)
-#define BLE_LL_S_SA_SLAVE               ((uint64_t)0 << 21)
+#define BLE_LL_S_NCA_PERIPH              ((uint64_t)0 << 20)
+#define BLE_LL_S_SA_PERIPH               ((uint64_t)0 << 21)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_OBSERVER) && MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
@@ -160,27 +160,27 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
 #define BLE_LL_S_PS_INIT                ((uint64_t)0 << 22)
 /* We do not support active scanning while initiating yet */
 #define BLE_LL_S_AS_INIT                ((uint64_t)0 << 23)
-#define BLE_LL_S_PS_MASTER              ((uint64_t)1 << 24)
-#define BLE_LL_S_AS_MASTER              ((uint64_t)1 << 25)
+#define BLE_LL_S_PS_CENTRAL             ((uint64_t)1 << 24)
+#define BLE_LL_S_AS_CENTRAL             ((uint64_t)1 << 25)
 #else
 #define BLE_LL_S_PS_INIT                ((uint64_t)0 << 22)
 #define BLE_LL_S_AS_INIT                ((uint64_t)0 << 23)
-#define BLE_LL_S_PS_MASTER              ((uint64_t)0 << 24)
-#define BLE_LL_S_AS_MASTER              ((uint64_t)0 << 25)
+#define BLE_LL_S_PS_CENTRAL              ((uint64_t)0 << 24)
+#define BLE_LL_S_AS_CENTRAL              ((uint64_t)0 << 25)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_OBSERVER) && MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define BLE_LL_S_PS_SLAVE               ((uint64_t)1 << 26)
-#define BLE_LL_S_AS_SLAVE               ((uint64_t)1 << 27)
+#define BLE_LL_S_PS_PERIPH              ((uint64_t)1 << 26)
+#define BLE_LL_S_AS_PERIPH              ((uint64_t)1 << 27)
 #else
-#define BLE_LL_S_PS_SLAVE               ((uint64_t)0 << 26)
-#define BLE_LL_S_AS_SLAVE               ((uint64_t)0 << 27)
+#define BLE_LL_S_PS_PERIPH               ((uint64_t)0 << 26)
+#define BLE_LL_S_AS_PERIPH               ((uint64_t)0 << 27)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-#define BLE_LL_S_INIT_MASTER            ((uint64_t)1 << 28)
+#define BLE_LL_S_INIT_CENTRAL           ((uint64_t)1 << 28)
 #else
-#define BLE_LL_S_INIT_MASTER            ((uint64_t)0 << 28)
+#define BLE_LL_S_INIT_CENTRAL            ((uint64_t)0 << 28)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
@@ -208,29 +208,29 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-#define BLE_LL_S_CA_MASTER              ((uint64_t)1 << 35)
-#define BLE_LL_S_HDCA_MASTER            ((uint64_t)1 << 36)
-#define BLE_LL_S_LDCA_MASTER            ((uint64_t)1 << 37)
+#define BLE_LL_S_CA_CENTRAL             ((uint64_t)1 << 35)
+#define BLE_LL_S_HDCA_CENTRAL           ((uint64_t)1 << 36)
+#define BLE_LL_S_LDCA_CENTRAL           ((uint64_t)1 << 37)
 #else
-#define BLE_LL_S_CA_MASTER              ((uint64_t)0 << 35)
-#define BLE_LL_S_HDCA_MASTER            ((uint64_t)0 << 36)
-#define BLE_LL_S_LDCA_MASTER            ((uint64_t)0 << 37)
+#define BLE_LL_S_CA_CENTRAL              ((uint64_t)0 << 35)
+#define BLE_LL_S_HDCA_CENTRAL            ((uint64_t)0 << 36)
+#define BLE_LL_S_LDCA_CENTRAL            ((uint64_t)0 << 37)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-#define BLE_LL_S_CA_SLAVE               ((uint64_t)1 << 38)
-#define BLE_LL_S_HDCA_SLAVE             ((uint64_t)1 << 39)
-#define BLE_LL_S_LDCA_SLAVE             ((uint64_t)1 << 40)
+#define BLE_LL_S_CA_PERIPH              ((uint64_t)1 << 38)
+#define BLE_LL_S_HDCA_PERIPH            ((uint64_t)1 << 39)
+#define BLE_LL_S_LDCA_PERIPH            ((uint64_t)1 << 40)
 #else
-#define BLE_LL_S_CA_SLAVE               ((uint64_t)0 << 38)
-#define BLE_LL_S_HDCA_SLAVE             ((uint64_t)0 << 39)
-#define BLE_LL_S_LDCA_SLAVE             ((uint64_t)0 << 40)
+#define BLE_LL_S_CA_PERIPH               ((uint64_t)0 << 38)
+#define BLE_LL_S_HDCA_PERIPH             ((uint64_t)0 << 39)
+#define BLE_LL_S_LDCA_PERIPH             ((uint64_t)0 << 40)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) && MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-#define BLE_LL_S_INIT_SLAVE             ((uint64_t)1 << 41)
+#define BLE_LL_S_INIT_PERIPH            ((uint64_t)1 << 41)
 #else
-#define BLE_LL_S_INIT_SLAVE             ((uint64_t)0 << 41)
+#define BLE_LL_S_INIT_PERIPH             ((uint64_t)0 << 41)
 #endif
 
 #define BLE_LL_SUPPORTED_STATES             \
@@ -242,7 +242,7 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
     BLE_LL_S_PS                     |       \
     BLE_LL_S_AS                     |       \
     BLE_LL_S_INIT                   |       \
-    BLE_LL_S_SLAVE                  |       \
+    BLE_LL_S_PERIPH                  |       \
     BLE_LL_S_NCA_PS                 |       \
     BLE_LL_S_SA_PS                  |       \
     BLE_LL_S_CA_PS                  |       \
@@ -253,30 +253,30 @@ int8_t g_ble_ll_tx_power = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
     BLE_LL_S_HDCA_AS                |       \
     BLE_LL_S_NCA_INIT               |       \
     BLE_LL_S_SA_INIT                |       \
-    BLE_LL_S_NCA_MASTER             |       \
-    BLE_LL_S_SA_MASTER              |       \
-    BLE_LL_S_NCA_SLAVE              |       \
-    BLE_LL_S_SA_SLAVE               |       \
+    BLE_LL_S_NCA_CENTRAL             |       \
+    BLE_LL_S_SA_CENTRAL              |       \
+    BLE_LL_S_NCA_PERIPH              |       \
+    BLE_LL_S_SA_PERIPH               |       \
     BLE_LL_S_PS_INIT                |       \
     BLE_LL_S_AS_INIT                |       \
-    BLE_LL_S_PS_MASTER              |       \
-    BLE_LL_S_AS_MASTER              |       \
-    BLE_LL_S_PS_SLAVE               |       \
-    BLE_LL_S_AS_SLAVE               |       \
-    BLE_LL_S_INIT_MASTER            |       \
+    BLE_LL_S_PS_CENTRAL              |       \
+    BLE_LL_S_AS_CENTRAL              |       \
+    BLE_LL_S_PS_PERIPH               |       \
+    BLE_LL_S_AS_PERIPH               |       \
+    BLE_LL_S_INIT_CENTRAL            |       \
     BLE_LL_S_LDCA                   |       \
     BLE_LL_S_LDCA_PS                |       \
     BLE_LL_S_LDCA_AS                |       \
     BLE_LL_S_CA_INIT                |       \
     BLE_LL_S_HDCA_INIT              |       \
     BLE_LL_S_LDCA_INIT              |       \
-    BLE_LL_S_CA_MASTER              |       \
-    BLE_LL_S_HDCA_MASTER            |       \
-    BLE_LL_S_LDCA_MASTER            |       \
-    BLE_LL_S_CA_SLAVE               |       \
-    BLE_LL_S_HDCA_SLAVE             |       \
-    BLE_LL_S_LDCA_SLAVE             |       \
-    BLE_LL_S_INIT_SLAVE)
+    BLE_LL_S_CA_CENTRAL              |       \
+    BLE_LL_S_HDCA_CENTRAL            |       \
+    BLE_LL_S_LDCA_CENTRAL            |       \
+    BLE_LL_S_CA_PERIPH               |       \
+    BLE_LL_S_HDCA_PERIPH             |       \
+    BLE_LL_S_LDCA_PERIPH             |       \
+    BLE_LL_S_INIT_PERIPH)
 
 /* The global BLE LL data object */
 struct ble_ll_obj g_ble_ll_data;
@@ -1866,8 +1866,8 @@ ble_ll_init(void)
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_CONN_PARAM_REQ)
     features |= BLE_LL_FEAT_CONN_PARM_REQ;
 #endif
-#if MYNEWT_VAL(BLE_LL_CFG_FEAT_SLAVE_INIT_FEAT_XCHG)
-    features |= BLE_LL_FEAT_SLAVE_INIT;
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_PERIPH_INIT_FEAT_XCHG)
+    features |= BLE_LL_FEAT_PERIPH_INIT;
 #endif
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
     features |= BLE_LL_FEAT_LE_ENCRYPTION;
@@ -1916,8 +1916,8 @@ ble_ll_init(void)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
-    features |= BLE_LL_FEAT_CIS_MASTER;
-    features |= BLE_LL_FEAT_CIS_SLAVE;
+    features |= BLE_LL_FEAT_CIS_CENTRAL;
+    features |= BLE_LL_FEAT_CIS_PERIPH;
     features |= BLE_LL_FEAT_ISO_BROADCASTER;
     features |= BLE_LL_FEAT_ISO_HOST_SUPPORT;
 #endif
diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index 61f3059..5f024da 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -1374,10 +1374,10 @@ ble_ll_adv_aux_calculate(struct ble_ll_adv_sm *advsm,
     aux->chan = ble_ll_utils_calc_dci_csa2(advsm->event_cntr++,
                                            advsm->channel_id,
                                            g_ble_ll_conn_params.num_used_chans,
-                                           g_ble_ll_conn_params.master_chan_map);
+                                           g_ble_ll_conn_params.central_chan_map);
 #else
     aux->chan = ble_ll_utils_remapped_channel(ble_ll_rand() % BLE_PHY_NUM_DATA_CHANS,
-                                              g_ble_ll_conn_params.master_chan_map);
+                                              g_ble_ll_conn_params.central_chan_map);
 #endif
 
     rem_aux_data_len = AUX_DATA_LEN(advsm) - aux_data_offset;
@@ -2546,7 +2546,7 @@ ble_ll_adv_sm_start_periodic(struct ble_ll_adv_sm *advsm)
     advsm->periodic_adv_active = 1;
 
     /* keep channel map since we cannot change it later on */
-    memcpy(advsm->periodic_chanmap, g_ble_ll_conn_params.master_chan_map,
+    memcpy(advsm->periodic_chanmap, g_ble_ll_conn_params.central_chan_map,
            BLE_LL_CONN_CHMAP_LEN);
     advsm->periodic_num_used_chans = g_ble_ll_conn_params.num_used_chans;
     advsm->periodic_event_cntr = 0;
@@ -4118,7 +4118,7 @@ ble_ll_adv_already_connected(const uint8_t* addr, uint8_t addr_type)
 {
     struct ble_ll_conn_sm *connsm;
 
-    /* extracted from ble_ll_conn_slave_start function */
+    /* extracted from ble_ll_conn_periph_start function */
     SLIST_FOREACH(connsm, &g_ble_ll_conn_active_list, act_sle) {
         if (!memcmp(&connsm->peer_addr, addr, BLE_DEV_ADDR_LEN)) {
             if (addr_type == BLE_ADDR_RANDOM) {
@@ -4401,8 +4401,9 @@ ble_ll_adv_conn_req_rxd(uint8_t *rxbuf, struct ble_mbuf_hdr *hdr,
 #endif
 
         /* Try to start slave connection. If successful, stop advertising */
-        valid = ble_ll_conn_slave_start(rxbuf, addr_type, hdr,
-                          !(advsm->props & BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY));
+        valid = ble_ll_conn_periph_start(rxbuf, addr_type, hdr,
+                                         !(advsm->props &
+                                           BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY));
         if (valid) {
             /* stop advertising only if not transmitting connection response */
             if (!(advsm->flags & BLE_LL_ADV_SM_FLAG_CONN_RSP_TXD)) {
diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 7e3baab..7824f1d 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -170,8 +170,8 @@ STATS_SECT_START(ble_ll_conn_stats)
     STATS_SECT_ENTRY(no_free_conn_sm)
     STATS_SECT_ENTRY(rx_data_pdu_no_conn)
     STATS_SECT_ENTRY(rx_data_pdu_bad_aa)
-    STATS_SECT_ENTRY(slave_rxd_bad_conn_req_params)
-    STATS_SECT_ENTRY(slave_ce_failures)
+    STATS_SECT_ENTRY(periph_rxd_bad_conn_req_params)
+    STATS_SECT_ENTRY(periph_ce_failures)
     STATS_SECT_ENTRY(data_pdu_rx_dup)
     STATS_SECT_ENTRY(data_pdu_txg)
     STATS_SECT_ENTRY(data_pdu_txf)
@@ -203,8 +203,8 @@ STATS_NAME_START(ble_ll_conn_stats)
     STATS_NAME(ble_ll_conn_stats, no_free_conn_sm)
     STATS_NAME(ble_ll_conn_stats, rx_data_pdu_no_conn)
     STATS_NAME(ble_ll_conn_stats, rx_data_pdu_bad_aa)
-    STATS_NAME(ble_ll_conn_stats, slave_rxd_bad_conn_req_params)
-    STATS_NAME(ble_ll_conn_stats, slave_ce_failures)
+    STATS_NAME(ble_ll_conn_stats, periph_rxd_bad_conn_req_params)
+    STATS_NAME(ble_ll_conn_stats, periph_ce_failures)
     STATS_NAME(ble_ll_conn_stats, data_pdu_rx_dup)
     STATS_NAME(ble_ll_conn_stats, data_pdu_txg)
     STATS_NAME(ble_ll_conn_stats, data_pdu_txf)
@@ -694,7 +694,7 @@ ble_ll_conn_start_rx_encrypt(void *arg)
     ble_phy_encrypt_enable(connsm->enc_data.rx_pkt_cntr,
                            connsm->enc_data.iv,
                            connsm->enc_data.enc_block.cipher_text,
-                           !CONN_IS_MASTER(connsm));
+                           !CONN_IS_CENTRAL(connsm));
 }
 
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
@@ -738,7 +738,7 @@ ble_ll_conn_continue_rx_encrypt(void *arg)
 
     connsm = (struct ble_ll_conn_sm *)arg;
     ble_phy_encrypt_set_pkt_cntr(connsm->enc_data.rx_pkt_cntr,
-                                 !CONN_IS_MASTER(connsm));
+                                 !CONN_IS_CENTRAL(connsm));
 }
 #endif
 
@@ -963,9 +963,9 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
          * LL_ENC_RSP is sent.
          */
         if (((connsm->enc_data.enc_state > CONN_ENC_S_ENCRYPTED) &&
-             CONN_IS_MASTER(connsm)) ||
+             CONN_IS_CENTRAL(connsm)) ||
             ((connsm->enc_data.enc_state > CONN_ENC_S_ENC_RSP_TO_BE_SENT) &&
-             CONN_IS_SLAVE(connsm))) {
+             CONN_IS_PERIPHERAL(connsm))) {
             if (!ble_ll_ctrl_enc_allowed_pdu_tx(pkthdr)) {
                 CONN_F_EMPTY_PDU_TXD(connsm) = 1;
                 goto conn_tx_pdu;
@@ -978,7 +978,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
              * packets can be let go.
              */
             if (nextpkthdr && !ble_ll_ctrl_enc_allowed_pdu_tx(nextpkthdr)
-                && (CONN_IS_MASTER(connsm) ||
+                && (CONN_IS_CENTRAL(connsm) ||
                     !ble_ll_ctrl_is_start_enc_rsp(m))) {
                 nextpkthdr = NULL;
             }
@@ -1025,7 +1025,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
                 /* We will allow a next packet if it itself is allowed */
                 pkthdr = OS_MBUF_PKTHDR(connsm->cur_tx_pdu);
                 if (nextpkthdr && !ble_ll_ctrl_enc_allowed_pdu_tx(nextpkthdr)
-                    && (CONN_IS_MASTER(connsm) ||
+                    && (CONN_IS_CENTRAL(connsm) ||
                         !ble_ll_ctrl_is_start_enc_rsp(connsm->cur_tx_pdu))) {
                     nextpkthdr = NULL;
                 }
@@ -1095,7 +1095,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
             ble_ll_pdu_tx_time_get(cur_txlen, tx_phy_mode);
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
             ticks += (BLE_LL_IFS + connsm->eff_max_rx_time);
         }
 #endif
@@ -1154,7 +1154,7 @@ conn_tx_pdu:
      *  overrun next scheduled item.
      */
     if ((connsm->csmflags.cfbit.terminate_ind_rxd) ||
-        (CONN_IS_SLAVE(connsm) && (md == 0) &&
+        (CONN_IS_PERIPHERAL(connsm) && (md == 0) &&
          (connsm->cons_rxd_bad_crc == 0) &&
          ((connsm->last_rxd_hdr_byte & BLE_LL_DATA_HDR_MD_MASK) == 0) &&
          !ble_ll_ctrl_is_terminate_ind(hdr_byte, m->om_data[0]))) {
@@ -1187,7 +1187,7 @@ conn_tx_pdu:
         ble_phy_encrypt_enable(connsm->enc_data.tx_pkt_cntr,
                                connsm->enc_data.iv,
                                connsm->enc_data.enc_block.cipher_text,
-                               CONN_IS_MASTER(connsm));
+                               CONN_IS_CENTRAL(connsm));
     } else if (is_ctrl && (opcode == BLE_LL_CTRL_START_ENC_REQ)) {
         /*
          * Only the slave sends this and it gets sent unencrypted but
@@ -1209,7 +1209,7 @@ conn_tx_pdu:
          */
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        case BLE_LL_CONN_ROLE_MASTER:
+        case BLE_LL_CONN_ROLE_CENTRAL:
             CONN_F_ENCRYPTED(connsm) = 0;
             connsm->enc_data.enc_state = CONN_ENC_S_PAUSED;
             connsm->enc_data.tx_encrypted = 0;
@@ -1217,13 +1217,13 @@ conn_tx_pdu:
             break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        case BLE_LL_CONN_ROLE_SLAVE:
+        case BLE_LL_CONN_ROLE_PERIPHERAL:
             CONN_F_ENCRYPTED(connsm) = 1;
             connsm->enc_data.tx_encrypted = 1;
             ble_phy_encrypt_enable(connsm->enc_data.tx_pkt_cntr,
                                    connsm->enc_data.iv,
                                    connsm->enc_data.enc_block.cipher_text,
-                                   CONN_IS_MASTER(connsm));
+                                   CONN_IS_CENTRAL(connsm));
             if (txend_func == NULL) {
                 txend_func = ble_ll_conn_start_rx_unencrypt;
             } else {
@@ -1240,7 +1240,7 @@ conn_tx_pdu:
         if (CONN_F_ENCRYPTED(connsm)) {
             connsm->enc_data.tx_encrypted = 1;
             ble_phy_encrypt_set_pkt_cntr(connsm->enc_data.tx_pkt_cntr,
-                                         CONN_IS_MASTER(connsm));
+                                         CONN_IS_CENTRAL(connsm));
             if (txend_func == NULL) {
                 txend_func = ble_ll_conn_continue_rx_encrypt;
             }
@@ -1335,7 +1335,7 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         /* Set start time of transmission */
         start = sch->start_time + g_ble_ll_sched_offset_ticks;
         rc = ble_phy_tx_set_start_time(start, sch->remainder);
@@ -1364,7 +1364,7 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
         if (CONN_F_ENCRYPTED(connsm)) {
             ble_phy_encrypt_enable(connsm->enc_data.rx_pkt_cntr,
@@ -1381,14 +1381,14 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
         rc = ble_phy_rx_set_start_time(start, sch->remainder);
         if (rc) {
             /* End the connection event as we have no more buffers */
-            STATS_INC(ble_ll_conn_stats, slave_ce_failures);
+            STATS_INC(ble_ll_conn_stats, periph_ce_failures);
             rc = BLE_LL_SCHED_STATE_DONE;
         } else {
             /*
              * Set flag that tells slave to set last anchor point if a packet
              * has been received.
              */
-            connsm->csmflags.cfbit.slave_set_last_anchor = 1;
+            connsm->csmflags.cfbit.periph_set_last_anchor = 1;
 
             /*
              * Set the wait for response time. The anchor point is when we
@@ -1414,8 +1414,8 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
              * 2) The address rx time and jitter is accounted for in the
              * phy function
              */
-            usecs = connsm->slave_cur_tx_win_usecs + 61 +
-                (2 * connsm->slave_cur_window_widening);
+            usecs = connsm->periph_cur_tx_win_usecs + 61 +
+                    (2 * connsm->periph_cur_window_widening);
             ble_phy_wfr_enable(BLE_PHY_WFR_ENABLE_RX, 0, usecs);
             /* Set next wakeup time to connection event end time */
             rc = BLE_LL_SCHED_STATE_RUNNING;
@@ -1475,7 +1475,7 @@ ble_ll_conn_can_send_next_pdu(struct ble_ll_conn_sm *connsm, uint32_t begtime,
 #endif
 
     rc = 1;
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         /* Get next scheduled item time */
         next_sched_time = ble_ll_conn_get_next_sched_time(connsm);
 
@@ -1557,11 +1557,11 @@ ble_ll_conn_auth_pyld_timer_start(struct ble_ll_conn_sm *connsm)
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
 static void
-ble_ll_conn_master_common_init(struct ble_ll_conn_sm *connsm)
+ble_ll_conn_central_common_init(struct ble_ll_conn_sm *connsm)
 {
 
-    /* Set master role */
-    connsm->conn_role = BLE_LL_CONN_ROLE_MASTER;
+    /* Set central role */
+    connsm->conn_role = BLE_LL_CONN_ROLE_CENTRAL;
 
     /* Set default ce parameters */
 
@@ -1571,14 +1571,14 @@ ble_ll_conn_master_common_init(struct ble_ll_conn_sm *connsm)
      */
     connsm->tx_win_size = BLE_LL_CONN_TX_WIN_MIN + 1;
     connsm->tx_win_off = 0;
-    connsm->master_sca = BLE_LL_SCA_ENUM;
+    connsm->central_sca = BLE_LL_SCA_ENUM;
 
     /* Hop increment is a random value between 5 and 16. */
     connsm->hop_inc = (ble_ll_rand() % 12) + 5;
 
     /* Set channel map to map requested by host */
     connsm->num_used_chans = g_ble_ll_conn_params.num_used_chans;
-    memcpy(connsm->chanmap, g_ble_ll_conn_params.master_chan_map,
+    memcpy(connsm->chanmap, g_ble_ll_conn_params.central_chan_map,
            BLE_LL_CONN_CHMAP_LEN);
 
     /*  Calculate random access address and crc initialization value */
@@ -1598,12 +1598,12 @@ ble_ll_conn_master_common_init(struct ble_ll_conn_sm *connsm)
  * @param hcc
  */
 void
-ble_ll_conn_master_init(struct ble_ll_conn_sm *connsm,
-                        struct ble_ll_conn_create_scan *cc_scan,
-                        struct ble_ll_conn_create_params *cc_params)
+ble_ll_conn_central_init(struct ble_ll_conn_sm *connsm,
+                         struct ble_ll_conn_create_scan *cc_scan,
+                         struct ble_ll_conn_create_params *cc_params)
 {
 
-    ble_ll_conn_master_common_init(connsm);
+    ble_ll_conn_central_common_init(connsm);
 
     connsm->own_addr_type = cc_scan->own_addr_type;
     memcpy(&connsm->peer_addr, &cc_scan->peer_addr, BLE_DEV_ADDR_LEN);
@@ -1612,7 +1612,7 @@ ble_ll_conn_master_init(struct ble_ll_conn_sm *connsm,
     connsm->conn_itvl = cc_params->conn_itvl;
     connsm->conn_itvl_ticks = cc_params->conn_itvl_ticks;
     connsm->conn_itvl_usecs = cc_params->conn_itvl_usecs;
-    connsm->slave_latency = cc_params->conn_latency;
+    connsm->periph_latency = cc_params->conn_latency;
     connsm->supervision_tmo = cc_params->supervision_timeout;
     connsm->min_ce_len = cc_params->min_ce_len;
     connsm->max_ce_len = cc_params->max_ce_len;
@@ -1681,7 +1681,7 @@ ble_ll_conn_create_set_params(struct ble_ll_conn_sm *connsm, uint8_t phy)
 
     cc_params = &g_ble_ll_conn_create_sm.params[phy - 1];
 
-    connsm->slave_latency = cc_params->conn_latency;
+    connsm->periph_latency = cc_params->conn_latency;
     connsm->supervision_tmo = cc_params->supervision_timeout;
 
     connsm->conn_itvl = cc_params->conn_itvl;
@@ -2038,12 +2038,12 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
         ble_ll_ctrl_terminate_start(connsm);
     }
 
-    if (CONN_F_TERMINATE_STARTED(connsm) && CONN_IS_SLAVE(connsm)) {
+    if (CONN_F_TERMINATE_STARTED(connsm) && CONN_IS_PERIPHERAL(connsm)) {
         /* Some of the devices waits whole connection interval to ACK our
          * TERMINATE_IND sent as a Slave. Since we are here it means we are still waiting for ACK.
          * Make sure we catch it in next connection event.
          */
-        connsm->slave_latency = 0;
+        connsm->periph_latency = 0;
     }
 
     /*
@@ -2061,12 +2061,12 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
     /* Set event counter to the next connection event that we will tx/rx in */
     itvl = connsm->conn_itvl * BLE_LL_CONN_ITVL_USECS;
     latency = 1;
-    if (connsm->csmflags.cfbit.allow_slave_latency      &&
+    if (connsm->csmflags.cfbit.allow_periph_latency     &&
         !connsm->csmflags.cfbit.conn_update_sched       &&
         !CONN_F_PHY_UPDATE_SCHED(connsm)                &&
         !connsm->csmflags.cfbit.chanmap_update_scheduled) {
         if (connsm->csmflags.cfbit.pkt_rxd) {
-            latency += connsm->slave_latency;
+            latency += connsm->periph_latency;
             itvl = itvl * latency;
         }
     }
@@ -2094,19 +2094,19 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
 
         /* Set flag so we send connection update event */
         upd = &connsm->conn_update_req;
-        if (CONN_IS_MASTER(connsm) ||
-            (CONN_IS_SLAVE(connsm) &&
+        if (CONN_IS_CENTRAL(connsm) ||
+            (CONN_IS_PERIPHERAL(connsm) &&
              IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ)) ||
-            (connsm->conn_itvl != upd->interval)            ||
-            (connsm->slave_latency != upd->latency)         ||
+            (connsm->conn_itvl != upd->interval) ||
+            (connsm->periph_latency != upd->latency) ||
             (connsm->supervision_tmo != upd->timeout)) {
             connsm->csmflags.cfbit.host_expects_upd_event = 1;
         }
 
         connsm->supervision_tmo = upd->timeout;
-        connsm->slave_latency = upd->latency;
+        connsm->periph_latency = upd->latency;
         connsm->tx_win_size = upd->winsize;
-        connsm->slave_cur_tx_win_usecs =
+        connsm->periph_cur_tx_win_usecs =
             connsm->tx_win_size * BLE_LL_CONN_TX_WIN_USECS;
         connsm->tx_win_off = upd->winoffset;
         connsm->conn_itvl = upd->interval;
@@ -2216,8 +2216,8 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
     }
 
     /*
-     * Calculate ce end time. For a slave, we need to add window widening and
-     * the transmit window if we still have one.
+     * Calculate ce end time. For a peripgheral, we need to add window widening
+     * and the transmit window if we still have one.
      */
 #if MYNEWT_VAL(BLE_LL_STRICT_CONN_SCHEDULING)
     itvl = g_ble_ll_sched_data.sch_ticks_per_period;
@@ -2226,18 +2226,18 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
                           BLE_LL_SCHED_USECS_PER_SLOT);
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
 
         cur_ww = ble_ll_utils_calc_window_widening(connsm->anchor_point,
                                                    connsm->last_anchor_point,
-                                                   connsm->master_sca);
+                                                   connsm->central_sca);
         max_ww = (connsm->conn_itvl * (BLE_LL_CONN_ITVL_USECS/2)) - BLE_LL_IFS;
         if (cur_ww >= max_ww) {
             return -1;
         }
         cur_ww += BLE_LL_JITTER_USECS;
-        connsm->slave_cur_window_widening = cur_ww;
-        itvl += ble_ll_tmr_u2t(cur_ww + connsm->slave_cur_tx_win_usecs);
+        connsm->periph_cur_window_widening = cur_ww;
+        itvl += ble_ll_tmr_u2t(cur_ww + connsm->periph_cur_tx_win_usecs);
     }
 #endif
     itvl -= g_ble_ll_sched_offset_ticks;
@@ -2296,7 +2296,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
      */
     rc = 1;
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
         /*
          * With a 32.768 kHz crystal we dont care about the remaining usecs
          * when setting last anchor point. The only thing last anchor is used
@@ -2331,23 +2331,22 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
         ble_ll_tmr_add(&connsm->anchor_point, &connsm->anchor_point_usecs,
                        usecs);
 
-        connsm->slave_cur_tx_win_usecs =
+        connsm->periph_cur_tx_win_usecs =
             connsm->tx_win_size * BLE_LL_CONN_TX_WIN_USECS;
 #if MYNEWT_VAL(BLE_LL_STRICT_CONN_SCHEDULING)
         connsm->ce_end_time = connsm->anchor_point +
             g_ble_ll_sched_data.sch_ticks_per_period +
-            ble_ll_tmr_u2t(connsm->slave_cur_tx_win_usecs) + 1;
+            ble_ll_tmr_u2t(connsm->periph_cur_tx_win_usecs) + 1;
 
 #else
         connsm->ce_end_time = connsm->anchor_point +
                               ble_ll_tmr_u2t(MYNEWT_VAL(BLE_LL_CONN_INIT_SLOTS) *
                                              BLE_LL_SCHED_USECS_PER_SLOT +
-                                             connsm->slave_cur_tx_win_usecs) + 1;
+                                             connsm->periph_cur_tx_win_usecs) + 1;
 #endif
-        connsm->slave_cur_window_widening = BLE_LL_JITTER_USECS;
 
         /* Start the scheduler for the first connection event */
-        while (ble_ll_sched_slave_new(connsm)) {
+        while (ble_ll_sched_conn_periph_new(connsm)) {
             if (ble_ll_conn_next_event(connsm)) {
                 STATS_INC(ble_ll_conn_stats, cant_set_sched);
                 rc = 0;
@@ -2374,7 +2373,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
 #endif
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        case BLE_LL_CONN_ROLE_MASTER:
+        case BLE_LL_CONN_ROLE_CENTRAL:
             evbuf = ble_ll_init_get_conn_comp_ev();
             ble_ll_conn_comp_event_send(connsm, BLE_ERR_SUCCESS, evbuf, NULL);
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CSA2)
@@ -2384,8 +2383,8 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
             /*
              * Initiate features exchange
              *
-             * XXX we do this only as a master as it was observed that sending
-             * LL_SLAVE_FEATURE_REQ after connection breaks some recent iPhone
+             * XXX we do this only as a central as it was observed that sending
+             * LL_PERIPH_FEATURE_REQ after connection breaks some recent iPhone
              * models; for slave just assume master will initiate features xchg
              * if it has some additional features to use.
              */
@@ -2393,7 +2392,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
             break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        case BLE_LL_CONN_ROLE_SLAVE:
+        case BLE_LL_CONN_ROLE_PERIPHERAL:
             ble_ll_adv_send_conn_comp_ev(connsm, rxhdr);
             break;
 #endif
@@ -2472,7 +2471,7 @@ ble_ll_conn_event_end(struct ble_npl_event *ev)
      * usecs to 0 since we dont need to listen in the transmit window.
      */
     if (connsm->csmflags.cfbit.pkt_rxd) {
-        connsm->slave_cur_tx_win_usecs = 0;
+        connsm->periph_cur_tx_win_usecs = 0;
     }
 
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_PING)
@@ -2679,10 +2678,10 @@ ble_ll_conn_tx_connect_ind_pducb(uint8_t *dptr, void *pducb_arg, uint8_t *hdr_by
     dptr[7] = connsm->tx_win_size;
     put_le16(dptr + 8, connsm->tx_win_off);
     put_le16(dptr + 10, connsm->conn_itvl);
-    put_le16(dptr + 12, connsm->slave_latency);
+    put_le16(dptr + 12, connsm->periph_latency);
     put_le16(dptr + 14, connsm->supervision_tmo);
     memcpy(dptr + 16, &connsm->chanmap, BLE_LL_CONN_CHMAP_LEN);
-    dptr[21] = connsm->hop_inc | (connsm->master_sca << 5);
+    dptr[21] = connsm->hop_inc | (connsm->central_sca << 5);
 
     *hdr_byte = pdu_data->hdr_byte;
 
@@ -2736,7 +2735,7 @@ ble_ll_conn_send_connect_req(struct os_mbuf *rxpdu,
     }
 #endif
 
-    if (ble_ll_sched_master_new(connsm, rxhdr, 0)) {
+    if (ble_ll_sched_conn_central_new(connsm, rxhdr, 0)) {
         return -1;
     }
 
@@ -2778,8 +2777,8 @@ ble_ll_conn_send_connect_req_cancel(void)
 }
 
 static void
-ble_ll_conn_master_start(uint8_t phy, uint8_t csa,
-                         struct ble_ll_scan_addr_data *addrd, uint8_t *targeta)
+ble_ll_conn_central_start(uint8_t phy, uint8_t csa,
+                          struct ble_ll_scan_addr_data *addrd, uint8_t *targeta)
 {
     struct ble_ll_conn_sm *connsm;
 
@@ -2824,7 +2823,7 @@ ble_ll_conn_created_on_legacy(struct os_mbuf *rxpdu,
     rxbuf = rxpdu->om_data;
     csa = rxbuf[0] & BLE_ADV_PDU_HDR_CHSEL_MASK;
 
-    ble_ll_conn_master_start(BLE_PHY_1M, csa, addrd, targeta);
+    ble_ll_conn_central_start(BLE_PHY_1M, csa, addrd, targeta);
 }
 #endif
 
@@ -2847,7 +2846,7 @@ ble_ll_conn_created_on_aux(struct os_mbuf *rxpdu,
     phy = BLE_PHY_1M;
 #endif
 
-    ble_ll_conn_master_start(phy, 1, addrd, targeta);
+    ble_ll_conn_central_start(phy, 1, addrd, targeta);
 }
 #endif
 #endif /* BLE_LL_CFG_FEAT_LL_EXT_ADV */
@@ -2925,8 +2924,8 @@ ble_ll_conn_rx_isr_start(struct ble_mbuf_hdr *rxhdr, uint32_t aa)
         connsm->conn_state = BLE_LL_CONN_STATE_ESTABLISHED;
 
         /* Set anchor point (and last) if 1st rxd frame in connection event */
-        if (connsm->csmflags.cfbit.slave_set_last_anchor) {
-            connsm->csmflags.cfbit.slave_set_last_anchor = 0;
+        if (connsm->csmflags.cfbit.periph_set_last_anchor) {
+            connsm->csmflags.cfbit.periph_set_last_anchor = 0;
             connsm->last_anchor_point = rxhdr->beg_cputime;
             connsm->anchor_point = connsm->last_anchor_point;
             connsm->anchor_point_usecs = rxhdr->rem_usecs;
@@ -2991,9 +2990,9 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
      * Reference: Core 5.0, Vol 6, Part B, 5.1.3.1
      */
     if ((connsm->enc_data.enc_state > CONN_ENC_S_PAUSE_ENC_RSP_WAIT &&
-         CONN_IS_MASTER(connsm)) ||
+         CONN_IS_CENTRAL(connsm)) ||
         (connsm->enc_data.enc_state >= CONN_ENC_S_ENC_RSP_TO_BE_SENT &&
-         CONN_IS_SLAVE(connsm))) {
+         CONN_IS_PERIPHERAL(connsm))) {
         if (!ble_ll_ctrl_enc_allowed_pdu_rx(rxpdu)) {
             ble_ll_conn_timeout(connsm, BLE_ERR_CONN_TERM_MIC);
             goto conn_rx_data_pdu_end;
@@ -3021,9 +3020,9 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
      * once we have received a NESN of 1 from the master
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
         if (hdr_byte & BLE_LL_DATA_HDR_NESN_MASK) {
-            connsm->csmflags.cfbit.allow_slave_latency = 1;
+            connsm->csmflags.cfbit.allow_periph_latency = 1;
         }
     }
 #endif
@@ -3212,13 +3211,13 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
         } else {
             switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-            case BLE_LL_CONN_ROLE_MASTER:
+            case BLE_LL_CONN_ROLE_CENTRAL:
                 reply = CONN_F_LAST_TXD_MD(connsm);
                 break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            case BLE_LL_CONN_ROLE_SLAVE:
-                /* A slave always responds with a packet */
+            case BLE_LL_CONN_ROLE_PERIPHERAL:
+                /* A peripheral always responds with a packet */
                 reply = 1;
                 break;
 #endif
@@ -3337,7 +3336,7 @@ ble_ll_conn_rx_isr_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
 
 #if (BLE_LL_BT5_PHY_SUPPORTED == 1)
                         if (BLE_LL_LLID_IS_CTRL(hdr_byte) &&
-                            CONN_IS_SLAVE(connsm) &&
+                            CONN_IS_PERIPHERAL(connsm) &&
                             (opcode == BLE_LL_CTRL_PHY_UPDATE_IND)) {
                             connsm->phy_tx_transition =
                                     ble_ll_ctrl_phy_tx_transition_get(rxbuf[3]);
@@ -3364,13 +3363,13 @@ chk_rx_terminate_ind:
 
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        case BLE_LL_CONN_ROLE_MASTER:
+        case BLE_LL_CONN_ROLE_CENTRAL:
             reply = CONN_F_LAST_TXD_MD(connsm) || (hdr_byte & BLE_LL_DATA_HDR_MD_MASK);
             break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        case BLE_LL_CONN_ROLE_SLAVE:
-            /* A slave always replies */
+        case BLE_LL_CONN_ROLE_PERIPHERAL:
+            /* A peripheral always replies */
             reply = 1;
             break;
 #endif
@@ -3465,7 +3464,7 @@ ble_ll_conn_enqueue_pkt(struct ble_ll_conn_sm *connsm, struct os_mbuf *om,
                 break;
             case BLE_LL_CTRL_PAUSE_ENC_RSP:
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-                if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+                if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
                     lifo = 1;
                 }
 #endif
@@ -3556,18 +3555,18 @@ ble_ll_conn_set_global_chanmap(uint8_t num_used_chans, const uint8_t *chanmap)
 
     /* Do nothing if same channel map */
     conn_params = &g_ble_ll_conn_params;
-    if (!memcmp(conn_params->master_chan_map, chanmap, BLE_LL_CONN_CHMAP_LEN)) {
+    if (!memcmp(conn_params->central_chan_map, chanmap, BLE_LL_CONN_CHMAP_LEN)) {
         return;
     }
 
     /* Change channel map and cause channel map update procedure to start */
     conn_params->num_used_chans = num_used_chans;
-    memcpy(conn_params->master_chan_map, chanmap, BLE_LL_CONN_CHMAP_LEN);
+    memcpy(conn_params->central_chan_map, chanmap, BLE_LL_CONN_CHMAP_LEN);
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
     /* Perform channel map update */
     SLIST_FOREACH(connsm, &g_ble_ll_conn_active_list, act_sle) {
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
             ble_ll_ctrl_proc_start(connsm, BLE_LL_CTRL_PROC_CHAN_MAP_UPD);
         }
     }
@@ -3590,8 +3589,8 @@ ble_ll_conn_set_global_chanmap(uint8_t num_used_chans, const uint8_t *chanmap)
  */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
 int
-ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
-                        bool force_csa2)
+ble_ll_conn_periph_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
+                         bool force_csa2)
 {
     int rc;
     uint32_t temp;
@@ -3634,26 +3633,26 @@ ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
     connsm->tx_win_size = dptr[7];
     connsm->tx_win_off = get_le16(dptr + 8);
     connsm->conn_itvl = get_le16(dptr + 10);
-    connsm->slave_latency = get_le16(dptr + 12);
+    connsm->periph_latency = get_le16(dptr + 12);
     connsm->supervision_tmo = get_le16(dptr + 14);
     memcpy(&connsm->chanmap, dptr + 16, BLE_LL_CONN_CHMAP_LEN);
     connsm->hop_inc = dptr[21] & 0x1F;
-    connsm->master_sca = dptr[21] >> 5;
+    connsm->central_sca = dptr[21] >> 5;
 
     /* Error check parameters */
     if ((connsm->tx_win_off > connsm->conn_itvl) ||
         (connsm->conn_itvl < BLE_HCI_CONN_ITVL_MIN) ||
         (connsm->conn_itvl > BLE_HCI_CONN_ITVL_MAX) ||
         (connsm->tx_win_size < BLE_LL_CONN_TX_WIN_MIN) ||
-        (connsm->slave_latency > BLE_LL_CONN_SLAVE_LATENCY_MAX)) {
-        goto err_slave_start;
+        (connsm->periph_latency > BLE_LL_CONN_PERIPH_LATENCY_MAX)) {
+        goto err_periph_start;
     }
 
     /* Slave latency cannot cause a supervision timeout */
-    temp = (connsm->slave_latency + 1) * (connsm->conn_itvl * 2) *
-            BLE_LL_CONN_ITVL_USECS;
+    temp = (connsm->periph_latency + 1) * (connsm->conn_itvl * 2) *
+           BLE_LL_CONN_ITVL_USECS;
     if ((connsm->supervision_tmo * 10000) <= temp ) {
-        goto err_slave_start;
+        goto err_periph_start;
     }
 
     /*
@@ -3665,7 +3664,7 @@ ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
         temp = 8;
     }
     if (connsm->tx_win_size > temp) {
-        goto err_slave_start;
+        goto err_periph_start;
     }
 
     /* Set the address of device that we are connecting with */
@@ -3675,14 +3674,14 @@ ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
     /* Calculate number of used channels; make sure it meets min requirement */
     connsm->num_used_chans = ble_ll_utils_calc_num_used_chans(connsm->chanmap);
     if (connsm->num_used_chans < 2) {
-        goto err_slave_start;
+        goto err_periph_start;
     }
 
     ble_ll_conn_itvl_to_ticks(connsm->conn_itvl, &connsm->conn_itvl_ticks,
                               &connsm->conn_itvl_usecs);
 
     /* Start the connection state machine */
-    connsm->conn_role = BLE_LL_CONN_ROLE_SLAVE;
+    connsm->conn_role = BLE_LL_CONN_ROLE_PERIPHERAL;
     ble_ll_conn_sm_new(connsm);
 
 #if (BLE_LL_BT5_PHY_SUPPORTED == 1)
@@ -3702,9 +3701,9 @@ ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat, struct ble_mbuf_hdr *rxhdr,
     }
     return rc;
 
-err_slave_start:
+err_periph_start:
     STAILQ_INSERT_TAIL(&g_ble_ll_conn_free_list, connsm, free_stqe);
-    STATS_INC(ble_ll_conn_stats, slave_rxd_bad_conn_req_params);
+    STATS_INC(ble_ll_conn_stats, periph_rxd_bad_conn_req_params);
     return 0;
 }
 #endif
@@ -3791,8 +3790,8 @@ ble_ll_conn_module_reset(void)
 
     /* Mask in all channels by default */
     conn_params->num_used_chans = BLE_PHY_NUM_DATA_CHANS;
-    memset(conn_params->master_chan_map, 0xff, BLE_LL_CONN_CHMAP_LEN - 1);
-    conn_params->master_chan_map[4] = 0x1f;
+    memset(conn_params->central_chan_map, 0xff, BLE_LL_CONN_CHMAP_LEN - 1);
+    conn_params->central_chan_map[4] = 0x1f;
 
     /* Reset statistics */
     STATS_RESET(ble_ll_conn_stats);
diff --git a/nimble/controller/src/ble_ll_conn_hci.c b/nimble/controller/src/ble_ll_conn_hci.c
index bee9a56..8a90ed7 100644
--- a/nimble/controller/src/ble_ll_conn_hci.c
+++ b/nimble/controller/src/ble_ll_conn_hci.c
@@ -162,7 +162,7 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
 
             switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-            case BLE_LL_CONN_ROLE_MASTER:
+            case BLE_LL_CONN_ROLE_CENTRAL:
                 if (connsm->inita_identity_used) {
                     /* We used identity address in CONNECT_IND which can be just
                      * fine if
@@ -180,7 +180,7 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
                 break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            case BLE_LL_CONN_ROLE_SLAVE:
+            case BLE_LL_CONN_ROLE_PERIPHERAL:
                 rpa = ble_ll_adv_get_local_rpa(advsm);
                 break;
 #endif
@@ -203,12 +203,12 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
              if (enh_ev->peer_addr_type > BLE_HCI_CONN_PEER_ADDR_RANDOM) {
                  switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-                 case BLE_LL_CONN_ROLE_MASTER:
+                 case BLE_LL_CONN_ROLE_CENTRAL:
                      rpa = ble_ll_scan_get_peer_rpa();
                      break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-                 case BLE_LL_CONN_ROLE_SLAVE:
+                 case BLE_LL_CONN_ROLE_PERIPHERAL:
                      rpa = ble_ll_adv_get_peer_rpa(advsm);
                  break;
 #endif
@@ -221,11 +221,11 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
              }
 
             enh_ev->conn_itvl = htole16(connsm->conn_itvl);
-            enh_ev->conn_latency = htole16(connsm->slave_latency);
+            enh_ev->conn_latency = htole16(connsm->periph_latency);
             enh_ev->supervision_timeout = htole16(connsm->supervision_tmo);
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
-                enh_ev->mca = connsm->master_sca;
+            if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
+                enh_ev->mca = connsm->central_sca;
             }
 #endif
         }
@@ -250,11 +250,11 @@ ble_ll_conn_comp_event_send(struct ble_ll_conn_sm *connsm, uint8_t status,
             ev->peer_addr_type = connsm->peer_addr_type;
             memcpy(ev->peer_addr, connsm->peer_addr, BLE_DEV_ADDR_LEN);
             ev->conn_itvl = htole16(connsm->conn_itvl);
-            ev->conn_latency = htole16(connsm->slave_latency);
+            ev->conn_latency = htole16(connsm->periph_latency);
             ev->supervision_timeout = htole16(connsm->supervision_tmo);
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
-                ev->mca = connsm->master_sca;
+            if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
+                ev->mca = connsm->central_sca;
             }
 #endif
         }
@@ -583,7 +583,7 @@ ble_ll_conn_hci_create(const uint8_t *cmdbuf, uint8_t len)
     }
 
     /* Initialize state machine in master role and start state machine */
-    ble_ll_conn_master_init(connsm, &cc_scan, &cc_params);
+    ble_ll_conn_central_init(connsm, &cc_scan, &cc_params);
     ble_ll_conn_sm_new(connsm);
 
     /* Start scanning */
@@ -771,8 +771,8 @@ ble_ll_conn_hci_ext_create(const uint8_t *cmdbuf, uint8_t len)
     }
 
     /* Initialize state machine in master role and start state machine */
-    ble_ll_conn_master_init(connsm, &cc_scan,
-                            &g_ble_ll_conn_create_sm.params[0]);
+    ble_ll_conn_central_init(connsm, &cc_scan,
+                             &g_ble_ll_conn_create_sm.params[0]);
     ble_ll_conn_sm_new(connsm);
 
     /* Start scanning */
@@ -854,8 +854,8 @@ ble_ll_conn_hci_read_rem_features(const uint8_t *cmdbuf, uint8_t len)
     if (!connsm->csmflags.cfbit.rxd_features &&
                 !IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_FEATURE_XCHG)) {
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        if ((connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) &&
-            !(ble_ll_read_supp_features() & BLE_LL_FEAT_SLAVE_INIT)) {
+        if ((connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) &&
+            !(ble_ll_read_supp_features() & BLE_LL_FEAT_PERIPH_INIT)) {
                 return BLE_ERR_CMD_DISALLOWED;
         }
 #endif
@@ -910,7 +910,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
     /* See if this feature is supported on both sides */
     if ((connsm->conn_features & BLE_LL_FEAT_CONN_PARM_REQ) == 0) {
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
             return BLE_ERR_UNSUPP_REM_FEATURE;
         }
 #endif
@@ -928,7 +928,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
     if (connsm->csmflags.cfbit.awaiting_host_reply) {
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        case BLE_LL_CONN_ROLE_MASTER:
+        case BLE_LL_CONN_ROLE_CENTRAL:
             connsm->csmflags.cfbit.awaiting_host_reply = 0;
 
             /* XXX: If this fails no reject ind will be sent! */
@@ -937,7 +937,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
             break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        case BLE_LL_CONN_ROLE_SLAVE:
+        case BLE_LL_CONN_ROLE_PERIPHERAL:
             return BLE_ERR_LMP_COLLISION;
         break;
 #endif
@@ -953,7 +953,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     if (connsm->csmflags.cfbit.chanmap_update_scheduled) {
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
             return BLE_ERR_DIFF_TRANS_COLL;
         }
     }
@@ -1468,7 +1468,7 @@ ble_ll_conn_hci_le_start_encrypt(const uint8_t *cmdbuf, uint8_t len)
     if (!connsm) {
         rc = BLE_ERR_UNK_CONN_ID;
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    } else if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+    } else if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
         rc = BLE_ERR_UNSPECIFIED;
 #endif
     } else if (connsm->cur_ctrl_proc == BLE_LL_CTRL_PROC_ENCRYPT) {
@@ -1525,7 +1525,7 @@ ble_ll_conn_hci_le_ltk_reply(const uint8_t *cmdbuf, uint8_t len,
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
     /* Should never get this if we are a master! */
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         rc = BLE_ERR_UNSPECIFIED;
         goto ltk_key_cmd_complete;
     }
@@ -1584,7 +1584,7 @@ ble_ll_conn_hci_le_ltk_neg_reply(const uint8_t *cmdbuf, uint8_t len,
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
     /* Should never get this if we are a master! */
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         rc = BLE_ERR_UNSPECIFIED;
         goto ltk_key_cmd_complete;
     }
@@ -1717,7 +1717,7 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, uint8_t len,
          */
         tmo = le16toh(cmd->tmo);
         min_tmo = (uint32_t)connsm->conn_itvl * BLE_LL_CONN_ITVL_USECS;
-        min_tmo *= (connsm->slave_latency + 1);
+        min_tmo *= (connsm->periph_latency + 1);
         min_tmo /= 10000;
 
         if (tmo < min_tmo) {
diff --git a/nimble/controller/src/ble_ll_conn_priv.h b/nimble/controller/src/ble_ll_conn_priv.h
index 73e4106..c51aef9 100644
--- a/nimble/controller/src/ble_ll_conn_priv.h
+++ b/nimble/controller/src/ble_ll_conn_priv.h
@@ -47,7 +47,7 @@ extern "C" {
 #define BLE_LL_CONN_TX_OFF_USECS            (1250)
 #define BLE_LL_CONN_CE_USECS                (625)
 #define BLE_LL_CONN_TX_WIN_MIN              (1)         /* in tx win units */
-#define BLE_LL_CONN_SLAVE_LATENCY_MAX       (499)
+#define BLE_LL_CONN_PERIPH_LATENCY_MAX       (499)
 
 /* Connection handle range */
 #define BLE_LL_CONN_MAX_CONN_HANDLE         (0x0EFF)
@@ -62,7 +62,7 @@ extern "C" {
 /* Global Link Layer connection parameters */
 struct ble_ll_conn_global_params
 {
-    uint8_t master_chan_map[BLE_LL_CONN_CHMAP_LEN];
+    uint8_t central_chan_map[BLE_LL_CONN_CHMAP_LEN];
     uint8_t num_used_chans;
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL) || MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     uint8_t supp_max_tx_octets;
@@ -154,16 +154,16 @@ void ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err);
 void ble_ll_conn_enqueue_pkt(struct ble_ll_conn_sm *connsm, struct os_mbuf *om,
                              uint8_t hdr_byte, uint16_t length);
 struct ble_ll_conn_sm *ble_ll_conn_sm_get(void);
-void ble_ll_conn_master_init(struct ble_ll_conn_sm *connsm,
-                             struct ble_ll_conn_create_scan *cc_scan,
-                             struct ble_ll_conn_create_params *cc_params);
+void ble_ll_conn_central_init(struct ble_ll_conn_sm *connsm,
+                              struct ble_ll_conn_create_scan *cc_scan,
+                              struct ble_ll_conn_create_params *cc_params);
 
 struct ble_ll_conn_sm *ble_ll_conn_find_active_conn(uint16_t handle);
 void ble_ll_conn_update_eff_data_len(struct ble_ll_conn_sm *connsm);
 
 /* Advertising interface */
-int ble_ll_conn_slave_start(uint8_t *rxbuf, uint8_t pat,
-                            struct ble_mbuf_hdr *rxhdr, bool force_csa2);
+int ble_ll_conn_periph_start(uint8_t *rxbuf, uint8_t pat,
+                             struct ble_mbuf_hdr *rxhdr, bool force_csa2);
 
 /* Link Layer interface */
 void ble_ll_conn_module_init(void);
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index aef2d02..609fc5d 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -98,7 +98,7 @@ const uint8_t g_ble_ll_ctrl_pkt_lengths[BLE_LL_CTRL_OPCODES] =
     BLE_LL_CTRL_PAUSE_ENC_RSP_LEN,
     BLE_LL_CTRL_VERSION_IND_LEN,
     BLE_LL_CTRL_REJ_IND_LEN,
-    BLE_LL_CTRL_SLAVE_FEATURE_REQ_LEN,
+    BLE_LL_CTRL_PERIPH_FEATURE_REQ_LEN,
     BLE_LL_CTRL_CONN_PARAMS_LEN,
     BLE_LL_CTRL_CONN_PARAMS_LEN,
     BLE_LL_CTRL_REJECT_IND_EXT_LEN,
@@ -311,7 +311,7 @@ ble_ll_ctrl_conn_param_pdu_proc(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         if ((connsm->conn_itvl >= req->interval_min) &&
             (connsm->conn_itvl <= req->interval_max) &&
             (connsm->supervision_tmo == req->timeout) &&
-            (connsm->slave_latency == req->latency)) {
+            (connsm->periph_latency == req->latency)) {
             indicate = 0;
             goto conn_parm_req_do_indicate;
         }
@@ -324,7 +324,7 @@ ble_ll_ctrl_conn_param_pdu_proc(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
      * update the connection parameters. This means that the previous
      * check is all we need for a master (when receiving a request).
      */
-    if (CONN_IS_SLAVE(connsm) || (opcode == BLE_LL_CTRL_CONN_PARM_RSP)) {
+    if (CONN_IS_PERIPHERAL(connsm) || (opcode == BLE_LL_CTRL_CONN_PARM_RSP)) {
         /*
          * Not sure what to do about the slave. It is possible that the
          * current connection parameters are not the same ones as the local host
@@ -408,7 +408,7 @@ ble_ll_ctrl_conn_upd_make(struct ble_ll_conn_sm *connsm, uint8_t *pyld,
      * request will actually get sent. We add one more event plus the
      * minimum as per the spec of 6 connection events.
      */
-    instant = connsm->event_cntr + connsm->slave_latency + 6 + 1;
+    instant = connsm->event_cntr + connsm->periph_latency + 6 + 1;
 
     /*
      * XXX: This should change in the future, but for now we will just
@@ -491,14 +491,14 @@ ble_ll_ctrl_proc_unk_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr, uint8_t *
     case BLE_LL_CTRL_CONN_UPDATE_IND:
         ctrl_proc = BLE_LL_CTRL_PROC_CONN_UPDATE;
         break;
-    case BLE_LL_CTRL_SLAVE_FEATURE_REQ:
+    case BLE_LL_CTRL_PERIPH_FEATURE_REQ:
         ctrl_proc = BLE_LL_CTRL_PROC_FEATURE_XCHG;
-        BLE_LL_CONN_CLEAR_FEATURE(connsm, BLE_LL_FEAT_SLAVE_INIT);
+        BLE_LL_CONN_CLEAR_FEATURE(connsm, BLE_LL_FEAT_PERIPH_INIT);
         break;
     case BLE_LL_CTRL_CONN_PARM_REQ:
         BLE_LL_CONN_CLEAR_FEATURE(connsm, BLE_LL_FEAT_CONN_PARM_REQ);
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
             ble_ll_ctrl_conn_upd_make(connsm, rspdata, NULL);
             connsm->reject_reason = BLE_ERR_SUCCESS;
             return BLE_LL_CTRL_CONN_UPDATE_IND;
@@ -723,19 +723,19 @@ ble_ll_ctrl_find_new_phy(uint8_t phy_mask_prefs)
  * @param connsm Pointer to connection state machine
  * @param dptr Pointer to PHY_REQ or PHY_RSP data.
  * @param ctrdata: Pointer to where CtrData of UPDATE_IND pdu starts
- * @param slave_req flag denoting if slave requested this. 0: no 1:yes
+ * @param periph_req flag denoting if slave requested this. 0: no 1:yes
  */
 
 static void
 ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
-                                uint8_t *ctrdata, int slave_req)
+                                uint8_t *ctrdata, int periph_req)
 {
     uint8_t m_to_s;
     uint8_t s_to_m;
     uint8_t tx_phys;
     uint8_t rx_phys;
     uint16_t instant;
-    uint8_t is_slave_sym = 0;
+    uint8_t is_periph_sym = 0;
 
     /* Get preferences from PDU */
     tx_phys = dptr[0];
@@ -743,14 +743,14 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 
     /* If we are master, check if slave requested symmetric PHY */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
-        is_slave_sym = tx_phys == rx_phys;
-        is_slave_sym &= __builtin_popcount(tx_phys) == 1;
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
+        is_periph_sym = tx_phys == rx_phys;
+        is_periph_sym &= __builtin_popcount(tx_phys) == 1;
     }
 #endif
 
     /* Get m_to_s and s_to_m masks */
-    if (slave_req) {
+    if (periph_req) {
         m_to_s = connsm->phy_data.host_pref_tx_phys_mask & rx_phys;
         s_to_m = connsm->phy_data.host_pref_rx_phys_mask & tx_phys;
     } else {
@@ -758,7 +758,7 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         s_to_m = connsm->phy_data.req_pref_rx_phys_mask & tx_phys;
     }
 
-    if (is_slave_sym) {
+    if (is_periph_sym) {
         /*
          * If either s_to_m or m_to_s is 0, it means for at least one direction
          * requested PHY is not our preferred one so make sure we keep current
@@ -811,7 +811,7 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         instant = 0;
     } else {
         /* Determine instant we will use. 6 more is minimum */
-        instant = connsm->event_cntr + connsm->slave_latency + 6 + 1;
+        instant = connsm->event_cntr + connsm->periph_latency + 6 + 1;
         connsm->phy_instant = instant;
         CONN_F_PHY_UPDATE_SCHED(connsm) = 1;
 
@@ -890,7 +890,7 @@ ble_ll_ctrl_rx_phy_req(struct ble_ll_conn_sm *connsm, uint8_t *req,
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         if (err) {
             ble_ll_ctrl_rej_ext_ind_make(BLE_LL_CTRL_PHY_REQ, err, rsp);
             rsp_opcode = BLE_LL_CTRL_REJECT_IND_EXT;
@@ -906,7 +906,7 @@ ble_ll_ctrl_rx_phy_req(struct ble_ll_conn_sm *connsm, uint8_t *req,
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         /* XXX: deal with other control procedures that we need to stop */
         if (err) {
             if (connsm->cur_ctrl_proc == BLE_LL_CTRL_PROC_PHY_UPDATE) {
@@ -963,7 +963,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         if (connsm->cur_ctrl_proc == BLE_LL_CTRL_PROC_PHY_UPDATE) {
             ble_ll_ctrl_phy_update_ind_make(connsm, dptr, rsp, 0);
             ble_npl_callout_stop(&connsm->ctrl_proc_rsp_timer);
@@ -979,7 +979,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         rsp_opcode = BLE_LL_CTRL_UNKNOWN_RSP;
         break;
 #endif
@@ -1015,7 +1015,7 @@ ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
     uint16_t delta;
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 #endif
@@ -1117,8 +1117,8 @@ static uint8_t
 ble_ll_ctrl_rx_sca_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
                        uint8_t *rsp)
 {
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
-        connsm->master_sca = dptr[0];
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
+        connsm->central_sca = dptr[0];
     }
 
     ble_ll_ctrl_sca_req_rsp_make(connsm, rsp);
@@ -1141,8 +1141,8 @@ ble_ll_ctrl_rx_sca_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
-        connsm->master_sca = dptr[0];
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
+        connsm->central_sca = dptr[0];
     }
 
     ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_SCA_UPDATE);
@@ -1486,7 +1486,7 @@ ble_ll_ctrl_rx_enc_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
                        uint8_t *rspdata)
 {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 #endif
@@ -1535,7 +1535,7 @@ ble_ll_ctrl_rx_start_enc_req(struct ble_ll_conn_sm *connsm)
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         /* We only want to send a START_ENC_RSP if we havent yet */
         if (connsm->enc_data.enc_state == CONN_ENC_S_START_ENC_REQ_WAIT) {
             connsm->enc_data.enc_state = CONN_ENC_S_START_ENC_RSP_WAIT;
@@ -1544,7 +1544,7 @@ ble_ll_ctrl_rx_start_enc_req(struct ble_ll_conn_sm *connsm)
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         rc = BLE_LL_CTRL_UNKNOWN_RSP;
         break;
 #endif
@@ -1567,7 +1567,7 @@ ble_ll_ctrl_rx_pause_enc_req(struct ble_ll_conn_sm *connsm)
      * ignore it...
      */
     rc = BLE_ERR_MAX;
-    if (CONN_IS_SLAVE(connsm) &&
+    if (CONN_IS_PERIPHERAL(connsm) &&
         (connsm->enc_data.enc_state == CONN_ENC_S_ENCRYPTED)) {
         rc = BLE_LL_CTRL_PAUSE_ENC_RSP;
     } else {
@@ -1592,12 +1592,12 @@ ble_ll_ctrl_rx_pause_enc_rsp(struct ble_ll_conn_sm *connsm)
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         rc = BLE_LL_CTRL_PAUSE_ENC_RSP;
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         if (connsm->enc_data.enc_state == CONN_ENC_S_PAUSE_ENC_RSP_WAIT) {
                 /* Master sends back unencrypted LL_PAUSE_ENC_RSP.
                  * From this moment encryption is paused.
@@ -1638,7 +1638,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_ENCRYPT);
 
         /* We are encrypted */
@@ -1650,7 +1650,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         /* Procedure has completed but slave needs to send START_ENC_RSP */
         rc = BLE_LL_CTRL_START_ENC_RSP;
 
@@ -1750,11 +1750,11 @@ static void
 ble_ll_ctrl_chanmap_req_make(struct ble_ll_conn_sm *connsm, uint8_t *pyld)
 {
     /* Copy channel map that host desires into request */
-    memcpy(pyld, g_ble_ll_conn_params.master_chan_map, BLE_LL_CONN_CHMAP_LEN);
+    memcpy(pyld, g_ble_ll_conn_params.central_chan_map, BLE_LL_CONN_CHMAP_LEN);
     memcpy(connsm->req_chanmap, pyld, BLE_LL_CONN_CHMAP_LEN);
 
     /* Place instant into request */
-    connsm->chanmap_instant = connsm->event_cntr + connsm->slave_latency + 6 + 1;
+    connsm->chanmap_instant = connsm->event_cntr + connsm->periph_latency + 6 + 1;
     put_le16(pyld + BLE_LL_CONN_CHMAP_LEN, connsm->chanmap_instant);
 
     /* Set scheduled flag */
@@ -1779,14 +1779,14 @@ ble_ll_ctrl_conn_param_reply(struct ble_ll_conn_sm *connsm, uint8_t *rsp,
 
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         /* Create a connection update pdu */
         ble_ll_ctrl_conn_upd_make(connsm, rsp + 1, req);
         rsp_opcode = BLE_LL_CTRL_CONN_UPDATE_IND;
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
         /* Create a connection parameter response */
         ble_ll_ctrl_conn_param_pdu_make(connsm, rsp + 1, req);
         rsp_opcode = BLE_LL_CTRL_CONN_PARM_RSP;
@@ -1829,7 +1829,7 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         if (opcode == BLE_LL_CTRL_REJECT_IND_EXT) {
             switch (connsm->conn_role) {
         #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-            case BLE_LL_CONN_ROLE_MASTER:
+            case BLE_LL_CONN_ROLE_CENTRAL:
                 /* As a master we should send connection update indication in this point */
                 rsp_opcode = BLE_LL_CTRL_CONN_UPDATE_IND;
                 ble_ll_ctrl_conn_upd_make(connsm, rspdata, NULL);
@@ -1837,7 +1837,7 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
                 break;
         #endif
         #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            case BLE_LL_CONN_ROLE_SLAVE:
+            case BLE_LL_CONN_ROLE_PERIPHERAL:
                 ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ);
                 ble_ll_hci_ev_conn_update(connsm, ble_error);
                 break;
@@ -1898,7 +1898,7 @@ ble_ll_ctrl_rx_conn_update(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
 
     /* Only a slave should receive this */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 #endif
@@ -2019,13 +2019,13 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
      * Only accept slave feature requests if we are a master and feature
      * requests if we are a slave.
      */
-    if (opcode ==  BLE_LL_CTRL_SLAVE_FEATURE_REQ) {
-        if (!CONN_IS_MASTER(connsm)) {
+    if (opcode == BLE_LL_CTRL_PERIPH_FEATURE_REQ) {
+        if (!CONN_IS_CENTRAL(connsm)) {
             return BLE_LL_CTRL_UNKNOWN_RSP;
         }
     } else {
         /* XXX: not sure this is correct but do it anyway */
-        if (!CONN_IS_SLAVE(connsm)) {
+        if (!CONN_IS_PERIPHERAL(connsm)) {
             return BLE_LL_CTRL_UNKNOWN_RSP;
         }
     }
@@ -2127,7 +2127,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
     if (IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ)) {
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-        case BLE_LL_CONN_ROLE_MASTER:
+        case BLE_LL_CONN_ROLE_CENTRAL:
             /* The master sends reject ind ext w/error code 0x23 */
             rsp_opcode = BLE_LL_CTRL_REJECT_IND_EXT;
             rspbuf[1] = BLE_LL_CTRL_CONN_PARM_REQ;
@@ -2135,7 +2135,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
             return rsp_opcode;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-        case BLE_LL_CONN_ROLE_SLAVE:
+        case BLE_LL_CONN_ROLE_PERIPHERAL:
             ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ);
             ble_ll_hci_ev_conn_update(connsm, BLE_ERR_LMP_COLLISION);
             break;
@@ -2151,7 +2151,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
      * update procedure we need to return an error
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if ((connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) &&
+    if ((connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) &&
         (connsm->csmflags.cfbit.chanmap_update_scheduled)) {
         rsp_opcode = BLE_LL_CTRL_REJECT_IND_EXT;
         rspbuf[1] = BLE_LL_CTRL_CONN_PARM_REQ;
@@ -2174,7 +2174,7 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 
     /* A slave should never receive this response */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 #endif
@@ -2252,7 +2252,7 @@ ble_ll_ctrl_rx_chanmap_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
     uint16_t conn_events;
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    if (connsm->conn_role == BLE_LL_CONN_ROLE_MASTER) {
+    if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
     }
 #endif
@@ -2312,13 +2312,13 @@ ble_ll_ctrl_proc_init(struct ble_ll_conn_sm *connsm, int ctrl_proc)
         case BLE_LL_CTRL_PROC_FEATURE_XCHG:
             switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-            case BLE_LL_CONN_ROLE_MASTER:
+            case BLE_LL_CONN_ROLE_CENTRAL:
                 opcode = BLE_LL_CTRL_FEATURE_REQ;
                 break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-            case BLE_LL_CONN_ROLE_SLAVE:
-                opcode = BLE_LL_CTRL_SLAVE_FEATURE_REQ;
+            case BLE_LL_CONN_ROLE_PERIPHERAL:
+                opcode = BLE_LL_CTRL_PERIPH_FEATURE_REQ;
                 break;
 #endif
             default:
@@ -2645,8 +2645,8 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
     case BLE_LL_CTRL_LENGTH_REQ:
         feature = BLE_LL_FEAT_DATA_LEN_EXT;
         break;
-    case BLE_LL_CTRL_SLAVE_FEATURE_REQ:
-        feature = BLE_LL_FEAT_SLAVE_INIT;
+    case BLE_LL_CTRL_PERIPH_FEATURE_REQ:
+        feature = BLE_LL_FEAT_PERIPH_INIT;
         break;
     case BLE_LL_CTRL_CONN_PARM_REQ:
     case BLE_LL_CTRL_CONN_PARM_RSP:
@@ -2759,7 +2759,7 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
     case BLE_LL_CTRL_VERSION_IND:
         rsp_opcode = ble_ll_ctrl_rx_version_ind(connsm, dptr, rspdata);
         break;
-    case BLE_LL_CTRL_SLAVE_FEATURE_REQ:
+    case BLE_LL_CTRL_PERIPH_FEATURE_REQ:
         rsp_opcode = ble_ll_ctrl_rx_feature_req(connsm, dptr, rspbuf, opcode);
         break;
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
@@ -2986,7 +2986,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
         break;
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     case BLE_LL_CTRL_START_ENC_RSP:
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
             connsm->enc_data.enc_state = CONN_ENC_S_ENCRYPTED;
             if (CONN_F_LE_PING_SUPP(connsm)) {
                 ble_ll_conn_auth_pyld_timer_start(connsm);
@@ -2994,7 +2994,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
         }
         break;
     case BLE_LL_CTRL_PAUSE_ENC_RSP:
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
             connsm->enc_data.enc_state = CONN_ENC_S_PAUSE_ENC_RSP_WAIT;
         }
         break;
@@ -3003,7 +3003,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
 #if (BLE_LL_BT5_PHY_SUPPORTED == 1)
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     case BLE_LL_CTRL_PHY_REQ:
-        if (connsm->conn_role == BLE_LL_CONN_ROLE_SLAVE) {
+        if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
             connsm->phy_tx_transition =
                     ble_ll_ctrl_phy_tx_transition_get(
                             connsm->phy_data.req_pref_tx_phys_mask);
diff --git a/nimble/controller/src/ble_ll_hci_ev.c b/nimble/controller/src/ble_ll_hci_ev.c
index 9d6c39e..c39a833 100644
--- a/nimble/controller/src/ble_ll_hci_ev.c
+++ b/nimble/controller/src/ble_ll_hci_ev.c
@@ -117,7 +117,7 @@ ble_ll_hci_ev_conn_update(struct ble_ll_conn_sm *connsm, uint8_t status)
             ev->status = status;
             ev->conn_handle = htole16(connsm->conn_handle);
             ev->conn_itvl = htole16(connsm->conn_itvl);
-            ev->conn_latency = htole16(connsm->slave_latency);
+            ev->conn_latency = htole16(connsm->periph_latency);
             ev->supervision_timeout = htole16(connsm->supervision_tmo);
 
             ble_ll_hci_event_send(hci_ev);
diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 8f9a2d5..4a7051c 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -370,13 +370,13 @@ ble_ll_sched_conn_reschedule(struct ble_ll_conn_sm *connsm)
     sch->start_time = connsm->anchor_point - g_ble_ll_sched_offset_ticks;
     switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    case BLE_LL_CONN_ROLE_MASTER:
+    case BLE_LL_CONN_ROLE_CENTRAL:
         sch->remainder = connsm->anchor_point_usecs;
         break;
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
-    case BLE_LL_CONN_ROLE_SLAVE:
-        usecs = connsm->slave_cur_window_widening;
+    case BLE_LL_CONN_ROLE_PERIPHERAL:
+        usecs = connsm->periph_cur_window_widening;
         sch->start_time -= (ble_ll_tmr_u2t(usecs) + 1);
         sch->remainder = 0;
         break;
@@ -422,8 +422,8 @@ ble_ll_sched_conn_reschedule(struct ble_ll_conn_sm *connsm)
  */
 #if MYNEWT_VAL(BLE_LL_STRICT_CONN_SCHEDULING)
 int
-ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
-                        struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len)
+ble_ll_sched_central_new(struct ble_ll_conn_sm *connsm,
+                         struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len)
 {
     int rc;
     os_sr_t sr;
@@ -656,8 +656,8 @@ ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
 }
 #else
 int
-ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
-                        struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len)
+ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
+                              struct ble_mbuf_hdr *ble_hdr, uint8_t pyld_len)
 {
     struct ble_ll_sched_item *sch;
     uint32_t orig_start_time;
@@ -790,7 +790,7 @@ ble_ll_sched_master_new(struct ble_ll_conn_sm *connsm,
  * @return int
  */
 int
-ble_ll_sched_slave_new(struct ble_ll_conn_sm *connsm)
+ble_ll_sched_conn_periph_new(struct ble_ll_conn_sm *connsm)
 {
     struct ble_ll_sched_item *sch;
     os_sr_t sr;
@@ -807,7 +807,7 @@ ble_ll_sched_slave_new(struct ble_ll_conn_sm *connsm)
      * usecs to ticks could be off by up to 1 tick.
      */
     sch->start_time = connsm->anchor_point - g_ble_ll_sched_offset_ticks -
-                      ble_ll_tmr_u2t(connsm->slave_cur_window_widening) - 1;
+                      ble_ll_tmr_u2t(connsm->periph_cur_window_widening) - 1;
     sch->end_time = connsm->ce_end_time;
     sch->remainder = 0;
 
diff --git a/nimble/controller/src/ble_ll_utils.c b/nimble/controller/src/ble_ll_utils.c
index e2fe50c..66ca3e2 100644
--- a/nimble/controller/src/ble_ll_utils.c
+++ b/nimble/controller/src/ble_ll_utils.c
@@ -281,7 +281,7 @@ ble_ll_utils_calc_dci_csa2(uint16_t event_cntr, uint16_t channel_id,
 uint32_t
 ble_ll_utils_calc_window_widening(uint32_t anchor_point,
                                   uint32_t last_anchor_point,
-                                  uint8_t master_sca)
+                                  uint8_t central_sca)
 {
     uint32_t total_sca_ppm;
     uint32_t window_widening;
@@ -293,7 +293,7 @@ ble_ll_utils_calc_window_widening(uint32_t anchor_point,
     time_since_last_anchor = (int32_t)(anchor_point - last_anchor_point);
     if (time_since_last_anchor > 0) {
         delta_msec = ble_ll_tmr_t2u(time_since_last_anchor) / 1000;
-        total_sca_ppm = g_ble_sca_ppm_tbl[master_sca] + MYNEWT_VAL(BLE_LL_SCA);
+        total_sca_ppm = g_ble_sca_ppm_tbl[central_sca] + MYNEWT_VAL(BLE_LL_SCA);
         window_widening = (total_sca_ppm * delta_msec) / 1000;
     }
 
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index 9f17350..e628a8a 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -219,7 +219,7 @@ syscfg.defs:
             by default.
         value: 'MYNEWT_VAL_BLE_LL_ROLE_CENTRAL || MYNEWT_VAL_BLE_LL_ROLE_PERIPHERAL'
 
-    BLE_LL_CFG_FEAT_SLAVE_INIT_FEAT_XCHG:
+    BLE_LL_CFG_FEAT_PERIPH_INIT_FEAT_XCHG:
         description: >
             This option allows a slave to initiate the feature exchange
             procedure.  This feature is implemented but currently has no impact
@@ -503,7 +503,10 @@ syscfg.defs:
         description: use BLE_LL_SCA instead
         value: 4
         defunct: 1
-
+    BLE_LL_CFG_FEAT_SLAVE_INIT_FEAT_XCHG:
+        description: Superseded by BLE_LL_CFG_FEAT_PERIPH_INIT_FEAT_XCHG
+        value: 0
+        defaunt: 1
 
 syscfg.vals.BLE_LL_CFG_FEAT_LL_EXT_ADV:
     BLE_LL_CFG_FEAT_LE_CSA2: 1
diff --git a/nimble/drivers/nrf5340/src/ble_phy.c b/nimble/drivers/nrf5340/src/ble_phy.c
index 8ec90cd..9734e88 100644
--- a/nimble/drivers/nrf5340/src/ble_phy.c
+++ b/nimble/drivers/nrf5340/src/ble_phy.c
@@ -1526,12 +1526,12 @@ ble_phy_rx(void)
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
 void
 ble_phy_encrypt_enable(uint64_t pkt_counter, uint8_t *iv, uint8_t *key,
-                       uint8_t is_master)
+                       uint8_t is_central)
 {
     memcpy(nrf_ccm_data.key, key, 16);
     nrf_ccm_data.pkt_counter = pkt_counter;
     memcpy(nrf_ccm_data.iv, iv, 8);
-    nrf_ccm_data.dir_bit = is_master;
+    nrf_ccm_data.dir_bit = is_central;
     g_ble_phy_data.phy_encrypted = 1;
     /* Enable the module (AAR cannot be on while CCM on) */
     NRF_AAR_NS->ENABLE = AAR_ENABLE_ENABLE_Disabled;

[mynewt-nimble] 04/04: nimble/ll: Fix master/slave in comments

Posted by an...@apache.org.
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 cd1706b91722dc13c710541b7d11e470c1dd80b3
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Feb 8 13:24:51 2022 +0100

    nimble/ll: Fix master/slave in comments
---
 nimble/controller/src/ble_ll_adv.c      |  2 +-
 nimble/controller/src/ble_ll_conn.c     | 64 ++++++++++++-------------
 nimble/controller/src/ble_ll_conn_hci.c | 24 +++++-----
 nimble/controller/src/ble_ll_ctrl.c     | 82 ++++++++++++++++-----------------
 nimble/controller/src/ble_ll_sched.c    | 42 ++++++++---------
 nimble/controller/src/ble_ll_sync.c     |  2 +-
 6 files changed, 108 insertions(+), 108 deletions(-)

diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index 5f024da..d8d251b 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -4400,7 +4400,7 @@ ble_ll_adv_conn_req_rxd(uint8_t *rxbuf, struct ble_mbuf_hdr *hdr,
         }
 #endif
 
-        /* Try to start slave connection. If successful, stop advertising */
+        /* Try to start peripheral connection. If successful, stop advertising */
         valid = ble_ll_conn_periph_start(rxbuf, addr_type, hdr,
                                          !(advsm->props &
                                            BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY));
diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 7824f1d..33a666a 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -62,8 +62,8 @@ extern void bletest_completed_pkt(uint16_t handle);
  * 2) Make sure we check incoming data packets for size and all that. You
  * know, supported octets and all that. For both rx and tx.
  *
- * 3) Make sure we are setting the schedule end time properly for both slave
- * and master. We should just set this to the end of the connection event.
+ * 3) Make sure we are setting the schedule end time properly for both peripheral
+ * and central. We should just set this to the end of the connection event.
  * We might want to guarantee a IFS time as well since the next event needs
  * to be scheduled prior to the start of the event to account for the time it
  * takes to get a frame ready (which is pretty much the IFS time).
@@ -83,15 +83,15 @@ extern void bletest_completed_pkt(uint16_t handle);
  *
  * 8) Right now I use a fixed definition for required slots. CHange this.
  *
- * 10) See what connection state machine elements are purely master and
- * purely slave. We can make a union of them.
+ * 10) See what connection state machine elements are purely central and
+ * purely peripheral. We can make a union of them.
  *
  * 11) Not sure I am dealing with the connection terminate timeout perfectly.
  * I may extend a connection event too long although if it is always in terms
  * of connection events I am probably fine. Checking at end that the next
  * connection event will occur past terminate timeould would be fine.
  *
- * 12) When a slave receives a data packet in a connection it has to send a
+ * 12) When a peripheral receives a data packet in a connection it has to send a
  * response. Well, it should. If this packet will overrun the next scheduled
  * event, what should we do? Transmit anyway? Not transmit? For now, we just
  * transmit.
@@ -666,7 +666,7 @@ ble_ll_conn_wfr_timer_exp(void)
 }
 
 /**
- * Callback for slave when it transmits a data pdu and the connection event
+ * Callback for peripheral when it transmits a data pdu and the connection event
  * ends after the transmission.
  *
  * Context: Interrupt
@@ -973,8 +973,8 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
 
             /*
              * We will allow a next packet if it itself is allowed or we are
-             * a slave and we are sending the START_ENC_RSP. The master has
-             * to wait to receive the START_ENC_RSP from the slave before
+             * a peripheral and we are sending the START_ENC_RSP. The central has
+             * to wait to receive the START_ENC_RSP from the peripheral before
              * packets can be let go.
              */
             if (nextpkthdr && !ble_ll_ctrl_enc_allowed_pdu_tx(nextpkthdr)
@@ -1064,7 +1064,7 @@ ble_ll_conn_tx_pdu(struct ble_ll_conn_sm *connsm)
          *  -> wait IFS, send the next frame.
          *  -> wait IFS, receive a maximum size frame.
          *
-         *  For slave:
+         *  For peripheral:
          *  -> wait IFS, send current frame.
          *  -> wait IFS, receive maximum size frame.
          *  -> wait IFS, send next frame.
@@ -1141,13 +1141,13 @@ conn_tx_pdu:
     ble_hdr->txinfo.hdr_byte = hdr_byte;
 
     /*
-     * If we are a slave, check to see if this transmission will end the
+     * If we are a peripheral, check to see if this transmission will end the
      * connection event. We will end the connection event if we have
      * received a valid frame with the more data bit set to 0 and we dont
      * have more data.
      *
-     * XXX: for a slave, we dont check to see if we can:
-     *  -> wait IFS, rx frame from master (either big or small).
+     * XXX: for a peripheral, we dont check to see if we can:
+     *  -> wait IFS, rx frame from central (either big or small).
      *  -> wait IFS, send empty pdu or next pdu.
      *
      *  We could do this. Now, we just keep going and hope that we dont
@@ -1179,7 +1179,7 @@ conn_tx_pdu:
 
     if (is_ctrl && (opcode == BLE_LL_CTRL_START_ENC_RSP)) {
         /*
-         * Both master and slave send the START_ENC_RSP encrypted and receive
+         * Both central and peripheral send the START_ENC_RSP encrypted and receive
          * encrypted
          */
         CONN_F_ENCRYPTED(connsm) = 1;
@@ -1190,7 +1190,7 @@ conn_tx_pdu:
                                CONN_IS_CENTRAL(connsm));
     } else if (is_ctrl && (opcode == BLE_LL_CTRL_START_ENC_REQ)) {
         /*
-         * Only the slave sends this and it gets sent unencrypted but
+         * Only the peripheral sends this and it gets sent unencrypted but
          * we receive encrypted
          */
         CONN_F_ENCRYPTED(connsm) = 0;
@@ -1204,7 +1204,7 @@ conn_tx_pdu:
         }
     } else if (is_ctrl && (opcode == BLE_LL_CTRL_PAUSE_ENC_RSP)) {
         /*
-         * The slave sends the PAUSE_ENC_RSP encrypted. The master sends
+         * The peripheral sends the PAUSE_ENC_RSP encrypted. The central sends
          * it unencrypted (note that link was already set unencrypted).
          */
         switch (connsm->conn_role) {
@@ -1376,7 +1376,7 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
         }
 #endif
 
-        /* XXX: what is this really for the slave? */
+        /* XXX: what is this really for the peripheral? */
         start = sch->start_time + g_ble_ll_sched_offset_ticks;
         rc = ble_phy_rx_set_start_time(start, sch->remainder);
         if (rc) {
@@ -1385,14 +1385,14 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
             rc = BLE_LL_SCHED_STATE_DONE;
         } else {
             /*
-             * Set flag that tells slave to set last anchor point if a packet
+             * Set flag that tells peripheral to set last anchor point if a packet
              * has been received.
              */
             connsm->csmflags.cfbit.periph_set_last_anchor = 1;
 
             /*
              * Set the wait for response time. The anchor point is when we
-             * expect the master to start transmitting. Worst-case, we expect
+             * expect the central to start transmitting. Worst-case, we expect
              * to hear a reply within the anchor point plus:
              *  -> current tx window size
              *  -> current window widening amount (includes +/- 16 usec jitter)
@@ -1441,9 +1441,9 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
 
 /**
  * Called to determine if the device is allowed to send the next pdu in the
- * connection event. This will always return 'true' if we are a slave. If we
- * are a master, we must be able to send the next fragment and get a minimum
- * sized response from the slave.
+ * connection event. This will always return 'true' if we are a peripheral. If we
+ * are a central, we must be able to send the next fragment and get a minimum
+ * sized response from the peripheral.
  *
  * Context: Interrupt context (rx end isr).
  *
@@ -1590,7 +1590,7 @@ ble_ll_conn_central_common_init(struct ble_ll_conn_sm *connsm)
 }
 /**
  * Called when a create connection command has been received. This initializes
- * a connection state machine in the master role.
+ * a connection state machine in the central role.
  *
  * NOTE: Must be called before the state machine is started
  *
@@ -1715,7 +1715,7 @@ ble_ll_conn_set_csa(struct ble_ll_conn_sm *connsm, bool chsel)
 /**
  * Create a new connection state machine. This is done once per
  * connection when the HCI command "create connection" is issued to the
- * controller or when a slave receives a connect request.
+ * controller or when a peripheral receives a connect request.
  *
  * Context: Link Layer task
  *
@@ -2053,9 +2053,9 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
      */
 
     /*
-     * XXX TODO: I think this is technically incorrect. We can allow slave
+     * XXX TODO: I think this is technically incorrect. We can allow peripheral
      * latency if we are doing one of these updates as long as we
-     * know that the master has received the ACK to the PDU that set
+     * know that the central has received the ACK to the PDU that set
      * the instant
      */
     /* Set event counter to the next connection event that we will tx/rx in */
@@ -2140,9 +2140,9 @@ ble_ll_conn_next_event(struct ble_ll_conn_sm *connsm)
         ((int16_t)(connsm->chanmap_instant - connsm->event_cntr) <= 0)) {
 
         /* XXX: there is a chance that the control packet is still on
-         * the queue of the master. This means that we never successfully
+         * the queue of the central. This means that we never successfully
          * transmitted update request. Would end up killing connection
-           on slave side. Could ignore it or see if still enqueued. */
+           on peripheral side. Could ignore it or see if still enqueued. */
         connsm->num_used_chans =
             ble_ll_utils_calc_num_used_chans(connsm->req_chanmap);
         memcpy(connsm->chanmap, connsm->req_chanmap, BLE_LL_CONN_CHMAP_LEN);
@@ -2290,7 +2290,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
     connsm->last_rxd_pdu_cputime = connsm->last_scheduled;
 
     /*
-     * Set first connection event time. If slave the endtime is the receive end
+     * Set first connection event time. If peripheral the endtime is the receive end
      * time of the connect request. The actual connection starts 1.25 msecs plus
      * the transmit window offset from the end of the connection request.
      */
@@ -2385,7 +2385,7 @@ ble_ll_conn_created(struct ble_ll_conn_sm *connsm, struct ble_mbuf_hdr *rxhdr)
              *
              * XXX we do this only as a central as it was observed that sending
              * LL_PERIPH_FEATURE_REQ after connection breaks some recent iPhone
-             * models; for slave just assume master will initiate features xchg
+             * models; for peripheral just assume central will initiate features xchg
              * if it has some additional features to use.
              */
             ble_ll_ctrl_proc_start(connsm, BLE_LL_CTRL_PROC_FEATURE_XCHG);
@@ -3016,8 +3016,8 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
     connsm->conn_rssi = hdr->rxinfo.rssi;
 
     /*
-     * If we are a slave, we can only start to use slave latency
-     * once we have received a NESN of 1 from the master
+     * If we are a peripheral, we can only start to use peripheral latency
+     * once we have received a NESN of 1 from the central
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
@@ -3577,7 +3577,7 @@ ble_ll_conn_set_global_chanmap(uint8_t num_used_chans, const uint8_t *chanmap)
 /**
  * Called when a device has received a connect request while advertising and
  * the connect request has passed the advertising filter policy and is for
- * us. This will start a connection in the slave role assuming that we dont
+ * us. This will start a connection in the peripheral role assuming that we dont
  * already have a connection with this device and that the connect request
  * parameters are valid.
  *
diff --git a/nimble/controller/src/ble_ll_conn_hci.c b/nimble/controller/src/ble_ll_conn_hci.c
index 8a90ed7..6664458 100644
--- a/nimble/controller/src/ble_ll_conn_hci.c
+++ b/nimble/controller/src/ble_ll_conn_hci.c
@@ -582,7 +582,7 @@ ble_ll_conn_hci_create(const uint8_t *cmdbuf, uint8_t len)
         return BLE_ERR_CONN_LIMIT;
     }
 
-    /* Initialize state machine in master role and start state machine */
+    /* Initialize state machine in central role and start state machine */
     ble_ll_conn_central_init(connsm, &cc_scan, &cc_params);
     ble_ll_conn_sm_new(connsm);
 
@@ -770,7 +770,7 @@ ble_ll_conn_hci_ext_create(const uint8_t *cmdbuf, uint8_t len)
         return BLE_ERR_CONN_LIMIT;
     }
 
-    /* Initialize state machine in master role and start state machine */
+    /* Initialize state machine in central role and start state machine */
     ble_ll_conn_central_init(connsm, &cc_scan,
                              &g_ble_ll_conn_create_sm.params[0]);
     ble_ll_conn_sm_new(connsm);
@@ -886,7 +886,7 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
     struct hci_conn_update *hcu;
 
     /*
-     * XXX: must deal with slave not supporting this feature and using
+     * XXX: must deal with peripheral not supporting this feature and using
      * conn update! Right now, we only check if WE support the connection
      * parameters request procedure. We dont check if the remote does.
      * We should also be able to deal with sending the parameter request,
@@ -920,10 +920,10 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
     }
 
     /*
-     * If we are a slave and the master has initiated the procedure already
-     * we should deny the slave request for now. If we are a master and the
-     * slave has initiated the procedure, we need to send a reject to the
-     * slave.
+     * If we are a peripheral and the central has initiated the procedure already
+     * we should deny the peripheral request for now. If we are a central and the
+     * peripheral has initiated the procedure, we need to send a reject to the
+     * peripheral.
      */
     if (connsm->csmflags.cfbit.awaiting_host_reply) {
         switch (connsm->conn_role) {
@@ -948,8 +948,8 @@ ble_ll_conn_hci_update(const uint8_t *cmdbuf, uint8_t len)
     }
 
     /*
-     * If we are a slave and the master has initiated the channel map
-     * update procedure we should deny the slave request for now.
+     * If we are a peripheral and the central has initiated the channel map
+     * update procedure we should deny the peripheral request for now.
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     if (connsm->csmflags.cfbit.chanmap_update_scheduled) {
@@ -1524,7 +1524,7 @@ ble_ll_conn_hci_le_ltk_reply(const uint8_t *cmdbuf, uint8_t len,
     }
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    /* Should never get this if we are a master! */
+    /* Should never get this if we are a central! */
     if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         rc = BLE_ERR_UNSPECIFIED;
         goto ltk_key_cmd_complete;
@@ -1583,7 +1583,7 @@ ble_ll_conn_hci_le_ltk_neg_reply(const uint8_t *cmdbuf, uint8_t len,
     }
 
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
-    /* Should never get this if we are a master! */
+    /* Should never get this if we are a central! */
     if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         rc = BLE_ERR_UNSPECIFIED;
         goto ltk_key_cmd_complete;
@@ -1713,7 +1713,7 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, uint8_t len,
     } else {
         /*
          * The timeout is in units of 10 msecs. We need to make sure that the
-         * timeout is greater than or equal to connItvl * (1 + slaveLatency)
+         * timeout is greater than or equal to connItvl * (1 + peripheralLatency)
          */
         tmo = le16toh(cmd->tmo);
         min_tmo = (uint32_t)connsm->conn_itvl * BLE_LL_CONN_ITVL_USECS;
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 609fc5d..62272d7 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -319,14 +319,14 @@ ble_ll_ctrl_conn_param_pdu_proc(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 
     /*
      * A change has been requested. Is it within the values specified by
-     * the host? Note that for a master we will not be processing a
-     * connect param request from a slave if we are currently trying to
+     * the host? Note that for a central we will not be processing a
+     * connect param request from a peripheral if we are currently trying to
      * update the connection parameters. This means that the previous
-     * check is all we need for a master (when receiving a request).
+     * check is all we need for a central (when receiving a request).
      */
     if (CONN_IS_PERIPHERAL(connsm) || (opcode == BLE_LL_CTRL_CONN_PARM_RSP)) {
         /*
-         * Not sure what to do about the slave. It is possible that the
+         * Not sure what to do about the peripheral. It is possible that the
          * current connection parameters are not the same ones as the local host
          * has provided? Not sure what to do here. Do we need to remember what
          * host sent us? For now, I will assume that we need to remember what
@@ -403,7 +403,7 @@ ble_ll_ctrl_conn_upd_make(struct ble_ll_conn_sm *connsm, uint8_t *pyld,
 
     /*
      * Set instant. We set the instant to the current event counter plus
-     * the amount of slave latency as the slave may not be listening
+     * the amount of peripheral latency as the peripheral may not be listening
      * at every connection interval and we are not sure when the connect
      * request will actually get sent. We add one more event plus the
      * minimum as per the spec of 6 connection events.
@@ -723,7 +723,7 @@ ble_ll_ctrl_find_new_phy(uint8_t phy_mask_prefs)
  * @param connsm Pointer to connection state machine
  * @param dptr Pointer to PHY_REQ or PHY_RSP data.
  * @param ctrdata: Pointer to where CtrData of UPDATE_IND pdu starts
- * @param periph_req flag denoting if slave requested this. 0: no 1:yes
+ * @param periph_req flag denoting if peripheral requested this. 0: no 1:yes
  */
 
 static void
@@ -741,7 +741,7 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
     tx_phys = dptr[0];
     rx_phys = dptr[1];
 
-    /* If we are master, check if slave requested symmetric PHY */
+    /* If we are central, check if peripheral requested symmetric PHY */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
     if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         is_periph_sym = tx_phys == rx_phys;
@@ -765,9 +765,9 @@ ble_ll_ctrl_phy_update_ind_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
          * PHY in both directions
          *
          * Core 5.2, Vol 6, PartB, 5.1.10
-         *     If the slave specified a single PHY in both the TX_PHYS and
-         *     RX_PHYS fields and both fields are the same, the master shall
-         *     either select the PHY specified by the slave for both directions
+         *     If the peripheral specified a single PHY in both the TX_PHYS and
+         *     RX_PHYS fields and both fields are the same, the central shall
+         *     either select the PHY specified by the peripheral for both directions
          *     or shall leave both directions unchanged.
          */
         if ((s_to_m == 0) || (m_to_s == 0)) {
@@ -924,7 +924,7 @@ ble_ll_ctrl_rx_phy_req(struct ble_ll_conn_sm *connsm, uint8_t *req,
         /* XXX: TODO: if we started another procedure with an instant
          * why are we doing this? Need to look into this.*/
 
-        /* Respond to master's phy update procedure */
+        /* Respond to central's phy update procedure */
         CONN_F_PEER_PHY_UPDATE(connsm) = 1;
         ble_ll_ctrl_phy_req_rsp_make(connsm, rsp);
         rsp_opcode = BLE_LL_CTRL_PHY_RSP;
@@ -988,7 +988,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         break;
     }
 
-    /* NOTE: slave should never receive one of these */
+    /* NOTE: peripheral should never receive one of these */
 
     return rsp_opcode;
 }
@@ -996,7 +996,7 @@ ble_ll_ctrl_rx_phy_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 /**
  * Called when a LL_PHY_UPDATE_IND pdu is received
  *
- * NOTE: slave is the only device that should receive this.
+ * NOTE: peripheral is the only device that should receive this.
  *
  * @param connsm
  * @param dptr
@@ -1044,8 +1044,8 @@ ble_ll_ctrl_rx_phy_update_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
     } else {
         no_change = 0;
         /*
-         * NOTE: from the slaves perspective, the m to s phy is the one
-         * that the slave will receive on; s to m is the one it will
+         * NOTE: from the peripherals perspective, the m to s phy is the one
+         * that the peripheral will receive on; s to m is the one it will
          * transmit on
          */
         new_rx_phy = ble_ll_ctrl_phy_from_phy_mask(new_m_to_s_mask);
@@ -1239,7 +1239,7 @@ ble_ll_calc_session_key(struct ble_ll_conn_sm *connsm)
  * XXX: the current code may actually allow some control pdu's to be sent
  * in states where they shouldnt. I dont expect those states to occur so I
  * dont try to check for them but we could do more... for example there are
- * different PDUs allowed for master/slave and TX/RX
+ * different PDUs allowed for central/peripheral and TX/RX
  *
  * @param llid
  * @param opcode
@@ -1398,7 +1398,7 @@ ble_ll_ctrl_cis_create(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
  *      IVm     (4)
  *
  * The random number and encrypted diversifier come from the host command.
- * Controller generates master portion of SDK and IV.
+ * Controller generates central portion of SDK and IV.
  *
  * NOTE: this function does not set the LL data pdu header nor does it
  * set the opcode in the buffer.
@@ -1428,7 +1428,7 @@ ble_ll_ctrl_enc_req_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
 }
 
 /**
- * Called when LL_ENC_RSP is received by the master.
+ * Called when LL_ENC_RSP is received by the central.
  *
  * Context: Link Layer Task.
  *
@@ -1436,7 +1436,7 @@ ble_ll_ctrl_enc_req_make(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
  *      SKDs (8)
  *      IVs  (4)
  *
- *  The master now has the long term key (from the start encrypt command)
+ *  The central now has the long term key (from the start encrypt command)
  *  and the SKD (stored in the plain text encryption block). From this the
  *  sessionKey is generated.
  *
@@ -1462,7 +1462,7 @@ ble_ll_ctrl_rx_enc_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
 
 /**
  * Called when we have received a LL control encryption request PDU. This
- * should only be received by a slave.
+ * should only be received by a peripheral.
  *
  * The LL_ENC_REQ PDU format is:
  *      Rand    (8)
@@ -1474,7 +1474,7 @@ ble_ll_ctrl_rx_enc_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
  * but it could be a reject ind. Note that the caller of this function
  * will send the REJECT_IND_EXT if supported by remote.
  *
- * NOTE: if this is received by a master we will silently discard the PDU
+ * NOTE: if this is received by a central we will silently discard the PDU
  * (denoted by return BLE_ERR_MAX).
  *
  * @param connsm
@@ -1530,7 +1530,7 @@ ble_ll_ctrl_rx_start_enc_req(struct ble_ll_conn_sm *connsm)
 {
     int rc;
 
-    /* Only master should receive start enc request */
+    /* Only central should receive start enc request */
     rc = BLE_ERR_MAX;
 
     switch (connsm->conn_role) {
@@ -1651,7 +1651,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
 #endif
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     case BLE_LL_CONN_ROLE_PERIPHERAL:
-        /* Procedure has completed but slave needs to send START_ENC_RSP */
+        /* Procedure has completed but peripheral needs to send START_ENC_RSP */
         rc = BLE_LL_CTRL_START_ENC_RSP;
 
         /* Stop timer if it was started when sending START_ENC_REQ */
@@ -1667,7 +1667,7 @@ ble_ll_ctrl_rx_start_enc_rsp(struct ble_ll_conn_sm *connsm)
 
     /*
      * XXX: for now, a Slave sends this event when it receivest the
-     * START_ENC_RSP from the master. It might be technically incorrect
+     * START_ENC_RSP from the central. It might be technically incorrect
      * to send it before we transmit our own START_ENC_RSP.
      */
     ble_ll_hci_ev_encrypt_chg(connsm, BLE_ERR_SUCCESS);
@@ -1830,7 +1830,7 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
             switch (connsm->conn_role) {
         #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
             case BLE_LL_CONN_ROLE_CENTRAL:
-                /* As a master we should send connection update indication in this point */
+                /* As a central we should send connection update indication in this point */
                 rsp_opcode = BLE_LL_CTRL_CONN_UPDATE_IND;
                 ble_ll_ctrl_conn_upd_make(connsm, rspdata, NULL);
                 connsm->reject_reason = BLE_ERR_SUCCESS;
@@ -1896,7 +1896,7 @@ ble_ll_ctrl_rx_conn_update(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
     uint16_t conn_events;
     struct ble_ll_conn_upd_req *reqdata;
 
-    /* Only a slave should receive this */
+    /* Only a peripheral should receive this */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
     if (connsm->conn_role == BLE_LL_CONN_ROLE_CENTRAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
@@ -1996,7 +1996,7 @@ ble_ll_ctrl_update_features(struct ble_ll_conn_sm *connsm, uint8_t *feat)
 }
 
 /**
- * Called when we receive a feature request or a slave initiated feature
+ * Called when we receive a feature request or a peripheral initiated feature
  * request.
  *
  *
@@ -2016,8 +2016,8 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
     uint64_t our_feat;
 
     /*
-     * Only accept slave feature requests if we are a master and feature
-     * requests if we are a slave.
+     * Only accept peripheral feature requests if we are a central and feature
+     * requests if we are a peripheral.
      */
     if (opcode == BLE_LL_CTRL_PERIPH_FEATURE_REQ) {
         if (!CONN_IS_CENTRAL(connsm)) {
@@ -2106,7 +2106,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         return BLE_ERR_MAX;
     }
 
-    /* XXX: remember to deal with this on the master: if the slave has
+    /* XXX: remember to deal with this on the central: if the peripheral has
      * initiated a procedure we may have received its connection parameter
      * update request and have signaled the host with an event. If that
      * is the case, we will need to drop the host command when we get it
@@ -2116,19 +2116,19 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
      * be pending (a connection update) that will cause collisions and the
        behavior below. */
     /*
-     * Check for procedure collision (Vol 6 PartB 5.3). If we are a slave
-     * and we receive a request we "consider the slave initiated
+     * Check for procedure collision (Vol 6 PartB 5.3). If we are a peripheral
+     * and we receive a request we "consider the peripheral initiated
      * procedure as complete". This means send a connection update complete
      * event (with error).
      *
-     * If a master, we send reject with a
+     * If a central, we send reject with a
      * transaction collision error code.
      */
     if (IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ)) {
         switch (connsm->conn_role) {
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
         case BLE_LL_CONN_ROLE_CENTRAL:
-            /* The master sends reject ind ext w/error code 0x23 */
+            /* The central sends reject ind ext w/error code 0x23 */
             rsp_opcode = BLE_LL_CTRL_REJECT_IND_EXT;
             rspbuf[1] = BLE_LL_CTRL_CONN_PARM_REQ;
             rspbuf[2] = BLE_ERR_LMP_COLLISION;
@@ -2147,7 +2147,7 @@ ble_ll_ctrl_rx_conn_param_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
     }
 
     /*
-     * If we are a master and we currently performing a channel map
+     * If we are a central and we currently performing a channel map
      * update procedure we need to return an error
      */
 #if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
@@ -2172,7 +2172,7 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 {
     uint8_t rsp_opcode;
 
-    /* A slave should never receive this response */
+    /* A peripheral should never receive this response */
 #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
     if (connsm->conn_role == BLE_LL_CONN_ROLE_PERIPHERAL) {
         return BLE_LL_CTRL_UNKNOWN_RSP;
@@ -2180,9 +2180,9 @@ ble_ll_ctrl_rx_conn_param_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
 #endif
 
     /*
-     * This case should never happen! It means that the slave initiated a
-     * procedure and the master initiated one as well. If we do get in this
-     * state just clear the awaiting reply. The slave will hopefully stop its
+     * This case should never happen! It means that the peripheral initiated a
+     * procedure and the central initiated one as well. If we do get in this
+     * state just clear the awaiting reply. The peripheral will hopefully stop its
      * procedure when we reply.
      */
     if (connsm->csmflags.cfbit.awaiting_host_reply) {
@@ -2562,7 +2562,7 @@ ble_ll_ctrl_chk_proc_start(struct ble_ll_conn_sm *connsm)
  * NOTE: this function uses the received PDU for the response in some cases. If
  * the received PDU is not used it needs to be freed here.
  *
- * XXX: may want to check, for both master and slave, whether the control
+ * XXX: may want to check, for both central and peripheral, whether the control
  * pdu should be received by that role. Might make for less code...
  * Context: Link Layer
  *
@@ -2954,7 +2954,7 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
     case BLE_LL_CTRL_REJECT_IND_EXT:
         if (connsm->cur_ctrl_proc == BLE_LL_CTRL_PROC_CONN_PARAM_REQ) {
             /* If rejecting opcode is BLE_LL_CTRL_PROC_CONN_PARAM_REQ and
-             * reason is LMP collision that means we are master on the link and
+             * reason is LMP collision that means we are central on the link and
              * peer wanted to start procedure which we already started.
              * Let's wait for response and do not close procedure. */
             if (txpdu->om_data[1] == BLE_LL_CTRL_CONN_PARM_REQ &&
diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 4a7051c..b7d8cf6 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -410,7 +410,7 @@ ble_ll_sched_conn_reschedule(struct ble_ll_conn_sm *connsm)
 }
 
 /**
- * Called to schedule a connection when the current role is master.
+ * Called to schedule a connection when the current role is central.
  *
  * Context: Interrupt
  *
@@ -452,8 +452,8 @@ ble_ll_sched_central_new(struct ble_ll_conn_sm *connsm,
 
     /* XXX:
      * The calculations for the 32kHz crystal bear alot of explanation. The
-     * earliest possible time that the master can start the connection with a
-     * slave is 1.25 msecs from the end of the connection request. The
+     * earliest possible time that the central can start the connection with a
+     * peripheral is 1.25 msecs from the end of the connection request. The
      * connection request is sent an IFS time from the end of the advertising
      * packet that was received plus the time it takes to send the connection
      * request. At 1 Mbps, this is 1752 usecs, or 57.41 ticks. Using 57 ticks
@@ -462,32 +462,32 @@ ble_ll_sched_central_new(struct ble_ll_conn_sm *connsm,
      * the advertising PDU is 'now' (we call os_cputime_get32). We dont know
      * how much time it will take to service the ISR but if we are more than the
      * rx to tx time of the chip we will not be successful transmitting the
-     * connect request. All this means is that we presume that the slave will
+     * connect request. All this means is that we presume that the peripheral will
      * receive the connect request later than we expect but no earlier than
      * 13 usecs before (this is important).
      *
      * The code then attempts to schedule the connection at the
      * earliest time although this may not be possible. When the actual
-     * schedule start time is determined, the master has to determine if this
+     * schedule start time is determined, the central has to determine if this
      * time is more than a transmit window offset interval (1.25 msecs). The
-     * master has to tell the slave how many transmit window offsets there are
+     * central has to tell the peripheral how many transmit window offsets there are
      * from the earliest possible time to when the actual transmit start will
      * occur. Later in this function you will see the calculation. The actual
      * transmission start has to occur within the transmit window. The transmit
      * window interval is in units of 1.25 msecs and has to be at least 1. To
-     * make things a bit easier (but less power efficient for the slave), we
+     * make things a bit easier (but less power efficient for the peripheral), we
      * use a transmit window of 2. We do this because we dont quite know the
      * exact start of the transmission and if we are too early or too late we
      * could miss the transmit window. A final note: the actual transmission
      * start (the anchor point) is sched offset ticks from the schedule start
      * time. We dont add this to the calculation when calculating the window
      * offset. The reason we dont do this is we want to insure we transmit
-     * after the window offset we tell the slave. For example, say we think
+     * after the window offset we tell the peripheral. For example, say we think
      * we are transmitting 1253 usecs from the earliest start. This would cause
      * us to send a transmit window offset of 1. Since we are actually
-     * transmitting earlier than the slave thinks we could end up transmitting
+     * transmitting earlier than the peripheral thinks we could end up transmitting
      * before the window offset. Transmitting later is fine since we have the
-     * transmit window to do so. Transmitting before is bad, since the slave
+     * transmit window to do so. Transmitting before is bad, since the peripheral
      * wont be listening. We could do better calculation if we wanted to use
      * a transmit window of 1 as opposed to 2, but for now we dont care.
      */
@@ -673,8 +673,8 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
 
     /* XXX:
      * The calculations for the 32kHz crystal bear alot of explanation. The
-     * earliest possible time that the master can start the connection with a
-     * slave is 1.25 msecs from the end of the connection request. The
+     * earliest possible time that the central can start the connection with a
+     * peripheral is 1.25 msecs from the end of the connection request. The
      * connection request is sent an IFS time from the end of the advertising
      * packet that was received plus the time it takes to send the connection
      * request. At 1 Mbps, this is 1752 usecs, or 57.41 ticks. Using 57 ticks
@@ -683,32 +683,32 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
      * the advertising PDU is 'now' (we call os_cputime_get32). We dont know
      * how much time it will take to service the ISR but if we are more than the
      * rx to tx time of the chip we will not be successful transmitting the
-     * connect request. All this means is that we presume that the slave will
+     * connect request. All this means is that we presume that the peripheral will
      * receive the connect request later than we expect but no earlier than
      * 13 usecs before (this is important).
      *
      * The code then attempts to schedule the connection at the
      * earliest time although this may not be possible. When the actual
-     * schedule start time is determined, the master has to determine if this
+     * schedule start time is determined, the central has to determine if this
      * time is more than a transmit window offset interval (1.25 msecs). The
-     * master has to tell the slave how many transmit window offsets there are
+     * central has to tell the peripheral how many transmit window offsets there are
      * from the earliest possible time to when the actual transmit start will
      * occur. Later in this function you will see the calculation. The actual
      * transmission start has to occur within the transmit window. The transmit
      * window interval is in units of 1.25 msecs and has to be at least 1. To
-     * make things a bit easier (but less power efficient for the slave), we
+     * make things a bit easier (but less power efficient for the peripheral), we
      * use a transmit window of 2. We do this because we dont quite know the
      * exact start of the transmission and if we are too early or too late we
      * could miss the transmit window. A final note: the actual transmission
      * start (the anchor point) is sched offset ticks from the schedule start
      * time. We dont add this to the calculation when calculating the window
      * offset. The reason we dont do this is we want to insure we transmit
-     * after the window offset we tell the slave. For example, say we think
+     * after the window offset we tell the peripheral. For example, say we think
      * we are transmitting 1253 usecs from the earliest start. This would cause
      * us to send a transmit window offset of 1. Since we are actually
-     * transmitting earlier than the slave thinks we could end up transmitting
+     * transmitting earlier than the peripheral thinks we could end up transmitting
      * before the window offset. Transmitting later is fine since we have the
-     * transmit window to do so. Transmitting before is bad, since the slave
+     * transmit window to do so. Transmitting before is bad, since the peripheral
      * wont be listening. We could do better calculation if we wanted to use
      * a transmit window of 1 as opposed to 2, but for now we dont care.
      */
@@ -781,7 +781,7 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
 #endif
 
 /**
- * Schedules a slave connection for the first time.
+ * Schedules a peripheral connection for the first time.
  *
  * Context: Link Layer
  *
@@ -801,7 +801,7 @@ ble_ll_sched_conn_periph_new(struct ble_ll_conn_sm *connsm)
 
     /* Set schedule start and end times */
     /*
-     * XXX: for now, we dont care about anchor point usecs for the slave. It
+     * XXX: for now, we dont care about anchor point usecs for the peripheral. It
      * does not matter if we turn on the receiver up to one tick before w
      * need to. We also subtract one extra tick since the conversion from
      * usecs to ticks could be off by up to 1 tick.
diff --git a/nimble/controller/src/ble_ll_sync.c b/nimble/controller/src/ble_ll_sync.c
index 31e9984..8912cec 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -900,7 +900,7 @@ ble_ll_sync_schedule_chain(struct ble_ll_sync_sm *sm, struct ble_mbuf_hdr *hdr,
         return -1;
     }
 
-    /* chain should use same PHY as master PDU */
+    /* chain should use same PHY as central PDU */
     if (phy != ble_ll_sync_phy_mode_to_aux_phy(sm->phy_mode)) {
         return -1;
     }

[mynewt-nimble] 02/04: nimble/ll: Update LLC PDU defs to 5.3

Posted by an...@apache.org.
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 55cedd2060bcbcacf6d87fcb0111b3b8946453b9
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Feb 7 16:53:47 2022 +0100

    nimble/ll: Update LLC PDU defs to 5.3
---
 nimble/controller/include/controller/ble_ll_ctrl.h | 17 ++++++++++++++++-
 nimble/controller/src/ble_ll_ctrl.c                | 17 ++++++++++++++---
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll_ctrl.h b/nimble/controller/include/controller/ble_ll_ctrl.h
index 62e1a53..047d349 100644
--- a/nimble/controller/include/controller/ble_ll_ctrl.h
+++ b/nimble/controller/include/controller/ble_ll_ctrl.h
@@ -91,9 +91,16 @@ extern "C" {
 #define BLE_LL_CTRL_CIS_RSP             (0x20)
 #define BLE_LL_CTRL_CIS_IND             (0x21)
 #define BLE_LL_CTRL_CIS_TERMINATE_IND   (0x22)
+#define BLE_LL_CTRL_POWER_CONTROL_REQ   (0x23)
+#define BLE_LL_CTRL_POWER_CONTROL_RSP   (0x24)
+#define BLE_LL_CTRL_POWER_CHANGE_IND    (0x25)
+#define BLE_LL_CTRL_SUBRATE_REQ         (0x26)
+#define BLE_LL_CTRL_SUBRATE_IND         (0x27)
+#define BLE_LL_CTRL_CHAN_REPORTING_IND  (0x28)
+#define BLE_LL_CTRL_CHAN_STATUS_IND     (0x29)
 
 /* Maximum opcode value */
-#define BLE_LL_CTRL_OPCODES             (BLE_LL_CTRL_CIS_TERMINATE_IND + 1)
+#define BLE_LL_CTRL_OPCODES             (BLE_LL_CTRL_CHAN_STATUS_IND + 1)
 
 extern const uint8_t g_ble_ll_ctrl_pkt_lengths[BLE_LL_CTRL_OPCODES];
 
@@ -275,6 +282,14 @@ struct ble_ll_len_req
 #define BLE_LL_CTRL_CIS_IND_LEN         (15)
 #define BLE_LL_CTRL_CIS_TERMINATE_LEN   (3)
 
+#define BLE_LL_CTRL_POWER_CONTROL_REQ_LEN       (3)
+#define BLE_LL_CTRL_POWER_CONTROL_RSP_LEN       (4)
+#define BLE_LL_CTRL_POWER_CHANGE_IND_LEN        (4)
+#define BLE_LL_CTRL_SUBRATE_REQ_LEN             (10)
+#define BLE_LL_CTRL_SUBRATE_IND_LEN             (10)
+#define BLE_LL_CTRL_CHAN_REPORTING_IND_LEN      (3)
+#define BLE_LL_CTRL_CHAN_STATUS_IND_LEN         (10)
+
 /* API */
 struct ble_ll_conn_sm;
 void ble_ll_ctrl_proc_start(struct ble_ll_conn_sm *connsm, int ctrl_proc);
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 919f4a5..aef2d02 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -118,7 +118,14 @@ const uint8_t g_ble_ll_ctrl_pkt_lengths[BLE_LL_CTRL_OPCODES] =
     BLE_LL_CTRL_CIS_REQ_LEN,
     BLE_LL_CTRL_CIS_RSP_LEN,
     BLE_LL_CTRL_CIS_IND_LEN,
-    BLE_LL_CTRL_CIS_TERMINATE_LEN
+    BLE_LL_CTRL_CIS_TERMINATE_LEN,
+    BLE_LL_CTRL_POWER_CONTROL_REQ_LEN,
+    BLE_LL_CTRL_POWER_CONTROL_RSP_LEN,
+    BLE_LL_CTRL_POWER_CHANGE_IND_LEN,
+    BLE_LL_CTRL_SUBRATE_REQ_LEN,
+    BLE_LL_CTRL_SUBRATE_IND_LEN,
+    BLE_LL_CTRL_CHAN_REPORTING_IND_LEN,
+    BLE_LL_CTRL_CHAN_STATUS_IND_LEN,
 };
 
 /**
@@ -2565,8 +2572,8 @@ ble_ll_ctrl_chk_proc_start(struct ble_ll_conn_sm *connsm)
 int
 ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
 {
-    uint32_t features;
-    uint32_t feature;
+    uint64_t features;
+    uint64_t feature;
     uint8_t len;
     uint8_t opcode;
     uint8_t rsp_opcode;
@@ -2662,6 +2669,10 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
     case BLE_LL_CTRL_PERIODIC_SYNC_IND:
         feature = BLE_LL_FEAT_SYNC_TRANS_RECV;
         break;
+    case BLE_LL_CTRL_SUBRATE_REQ:
+    case BLE_LL_CTRL_SUBRATE_IND:
+        feature = BLE_LL_FEAT_CONN_SUBRATING;
+        break;
     default:
         feature = 0;
         break;