You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ry...@apache.org on 2020/01/28 09:43:26 UTC

[mynewt-nimble] branch master updated (f44bda8 -> 96cabb9)

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

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


    from f44bda8  nimble/ll: Fix misleading comment
     new a353136  nimble: Add 52 version for BT 5.2
     new b018a1a  nimble/ll: Use uint64_t for features
     new 9ae8a9a  nimble/ll: Rename feature flags related with sync transfer
     new 96cabb9  nimble/ll: Add hci set host supported features

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 | 75 ++++++++++++++++-----------
 nimble/controller/src/ble_ll.c                | 53 +++++++++++++++++--
 nimble/controller/src/ble_ll_adv.c            |  2 +-
 nimble/controller/src/ble_ll_ctrl.c           | 10 ++--
 nimble/controller/src/ble_ll_hci.c            |  5 ++
 nimble/controller/src/ble_ll_sync.c           |  2 +-
 nimble/include/nimble/hci_common.h            | 12 +++++
 nimble/syscfg.yml                             |  2 +-
 8 files changed, 116 insertions(+), 45 deletions(-)


[mynewt-nimble] 01/04: nimble: Add 52 version for BT 5.2

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit a353136211179f8b917b3fbe7d3afa49354cf9c0
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Thu Jan 2 10:41:32 2020 +0100

    nimble: Add 52 version for BT 5.2
---
 nimble/include/nimble/hci_common.h | 6 ++++++
 nimble/syscfg.yml                  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index 068e85c..d138c81 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -1479,6 +1479,7 @@ struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
 #define BLE_HCI_VER_BCS_4_2                 (8)
 #define BLE_HCI_VER_BCS_5_0                 (9)
 #define BLE_HCI_VER_BCS_5_1                 (10)
+#define BLE_HCI_VER_BCS_5_2                 (11)
 
 #define BLE_LMP_VER_BCS_1_0b                (0)
 #define BLE_LMP_VER_BCS_1_1                 (1)
@@ -1491,6 +1492,7 @@ struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
 #define BLE_LMP_VER_BCS_4_2                 (8)
 #define BLE_LMP_VER_BCS_5_0                 (9)
 #define BLE_LMP_VER_BCS_5_1                 (10)
+#define BLE_LMP_VER_BCS_5_2                 (11)
 
 /* selected HCI and LMP version */
 #if MYNEWT_VAL(BLE_VERSION) == 50
@@ -1499,6 +1501,10 @@ struct ble_hci_ev_le_subev_periodic_adv_sync_transfer {
 #elif MYNEWT_VAL(BLE_VERSION) == 51
 #define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_1
 #define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_1
+#elif MYNEWT_VAL(BLE_VERSION) == 52
+#define BLE_HCI_VER_BCS BLE_HCI_VER_BCS_5_2
+#define BLE_LMP_VER_BCS BLE_LMP_VER_BCS_5_2
+
 #endif
 
 #define BLE_HCI_DATA_HDR_SZ                 4
diff --git a/nimble/syscfg.yml b/nimble/syscfg.yml
index c07f9bc..537fd9b 100644
--- a/nimble/syscfg.yml
+++ b/nimble/syscfg.yml
@@ -75,7 +75,7 @@ syscfg.defs:
             This allows to configure supported Bluetooth Core version. Some
             features may not be available if version is too low. Version is
             integer for easy comparison.
-        range: 50, 51
+        range: 50, 51, 52
         value: 50
 
 # Allow periodic sync transfer only if 5.1 or higher


[mynewt-nimble] 04/04: nimble/ll: Add hci set host supported features

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 96cabb982247b944b57d9f234de57c54380bb3e7
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Thu Jan 2 11:06:33 2020 +0100

    nimble/ll: Add hci set host supported features
    
    With this patch, host is able to set features flags with  HCI
    command from Bluetooth v5.2
---
 nimble/controller/include/controller/ble_ll.h | 71 ++++++++++++++++-----------
 nimble/controller/src/ble_ll.c                | 43 ++++++++++++++++
 nimble/controller/src/ble_ll_hci.c            |  5 ++
 nimble/include/nimble/hci_common.h            |  6 +++
 4 files changed, 96 insertions(+), 29 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 99c0eba..d334044 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -199,34 +199,42 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #define BLE_LL_STATE_SYNC           (6)
 
 /* LL Features */
-#define BLE_LL_FEAT_LE_ENCRYPTION    (0x00000001)
-#define BLE_LL_FEAT_CONN_PARM_REQ    (0x00000002)
-#define BLE_LL_FEAT_EXTENDED_REJ     (0x00000004)
-#define BLE_LL_FEAT_SLAVE_INIT       (0x00000008)
-#define BLE_LL_FEAT_LE_PING          (0x00000010)
-#define BLE_LL_FEAT_DATA_LEN_EXT     (0x00000020)
-#define BLE_LL_FEAT_LL_PRIVACY       (0x00000040)
-#define BLE_LL_FEAT_EXT_SCAN_FILT    (0x00000080)
-#define BLE_LL_FEAT_LE_2M_PHY        (0x00000100)
-#define BLE_LL_FEAT_STABLE_MOD_ID_TX (0x00000200)
-#define BLE_LL_FEAT_STABLE_MOD_ID_RX (0x00000400)
-#define BLE_LL_FEAT_LE_CODED_PHY     (0x00000800)
-#define BLE_LL_FEAT_EXT_ADV          (0x00001000)
-#define BLE_LL_FEAT_PERIODIC_ADV     (0x00002000)
-#define BLE_LL_FEAT_CSA2             (0x00004000)
-#define BLE_LL_FEAT_LE_POWER_CLASS_1 (0x00008000)
-#define BLE_LL_FEAT_MIN_USED_CHAN    (0x00010000)
-#define BLE_LL_FEAT_CTE_REQ          (0x00020000)
-#define BLE_LL_FEAT_CTE_RSP          (0x00040000)
-#define BLE_LL_FEAT_CTE_TX           (0x00080000)
-#define BLE_LL_FEAT_CTE_RX           (0x00100000)
-#define BLE_LL_FEAT_CTE_AOD          (0x00200000)
-#define BLE_LL_FEAT_CTE_AOA          (0x00400000)
-#define BLE_LL_FEAT_CTE_RECV         (0x00800000)
-#define BLE_LL_FEAT_SYNC_TRANS_SEND  (0x01000000)
-#define BLE_LL_FEAT_SYNC_TRANS_RECV  (0x02000000)
-#define BLE_LL_FEAT_SCA_UPDATE       (0x04000000)
-#define BLE_LL_FEAT_REM_PKEY         (0x08000000)
+#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)
 
 /* This is initial mask, so if feature exchange will not happen,
  * but host will want to use this procedure, we will try. If not
@@ -234,9 +242,11 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
  * Look at LL Features above to find out what is allowed
  */
 #define BLE_LL_CONN_INITIAL_FEATURES    (0x00000022)
-
 #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)
+
 /* LL timing */
 #define BLE_LL_IFS                  (150)       /* usecs */
 #define BLE_LL_MAFS                 (300)       /* usecs */
@@ -519,6 +529,9 @@ void ble_ll_wfr_timer_exp(void *arg);
 /* Read set of features supported by the Link Layer */
 uint64_t ble_ll_read_supp_features(void);
 
+/* Set host supported features */
+int ble_ll_set_host_feat(const uint8_t *cmdbuf, uint8_t len);
+
 /* Read set of states supported by the Link Layer */
 uint64_t ble_ll_read_supp_states(void);
 
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index 8b1fb98..996ad9c 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -247,6 +247,9 @@ uint8_t g_dev_addr[BLE_DEV_ADDR_LEN];
 /** Our random address */
 uint8_t g_random_addr[BLE_DEV_ADDR_LEN];
 
+/** Our supported features which can be controller by the host */
+uint64_t g_ble_ll_supported_host_features = 0;
+
 static const uint16_t g_ble_ll_pdu_header_tx_time[BLE_PHY_NUM_MODE] =
 {
     [BLE_PHY_MODE_1M] =
@@ -1278,6 +1281,46 @@ ble_ll_read_supp_features(void)
 }
 
 /**
+ * Sets the features controlled by the host.
+ *
+ * @return HCI command status
+ */
+int
+ble_ll_set_host_feat(const uint8_t *cmdbuf, uint8_t len)
+{
+    const struct ble_hci_le_set_host_feat_cp *cmd = (const void *) cmdbuf;
+    uint64_t mask;
+
+    if (len != sizeof(*cmd)) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    if (!SLIST_EMPTY(&g_ble_ll_conn_active_list)) {
+        return BLE_ERR_CMD_DISALLOWED;
+    }
+
+    if ((cmd->bit_num > 0x3F) || (cmd->val > 1)) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    mask = (uint64_t)1 << (cmd->bit_num);
+    if (!(mask & BLE_LL_HOST_CONTROLLED_FEATURES)) {
+        return BLE_ERR_INV_HCI_CMD_PARMS;
+    }
+
+    if (!(mask & g_ble_ll_supported_host_features)) {
+        return BLE_ERR_UNSUPPORTED;
+    }
+
+    if (cmd->val == 0) {
+        g_ble_ll_data.ll_supp_features &= ~(mask);
+    } else {
+        g_ble_ll_data.ll_supp_features |= mask;
+    }
+
+    return BLE_ERR_SUCCESS;
+}
+/**
  * Flush a link layer packet queue.
  *
  * @param pktq
diff --git a/nimble/controller/src/ble_ll_hci.c b/nimble/controller/src/ble_ll_hci.c
index 50027ac..e90c42f 100644
--- a/nimble/controller/src/ble_ll_hci.c
+++ b/nimble/controller/src/ble_ll_hci.c
@@ -1144,6 +1144,11 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
         rc = ble_ll_set_default_sync_transfer_params(cmdbuf, len);
         break;
 #endif
+#if MYNEWT_VAL(BLE_VERSION) >= 52
+    case BLE_HCI_OCF_LE_SET_HOST_FEAT:
+        rc = ble_ll_set_host_feat(cmdbuf, len);
+        break;
+#endif
     default:
         rc = BLE_ERR_UNKNOWN_HCI_CMD;
         break;
diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index d138c81..c79abb3 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -825,6 +825,12 @@ struct ble_hci_le_set_default_periodic_sync_transfer_params_cp {
 #define BLE_HCI_OCF_LE_GENERATE_DHKEY_V2                 (0x005E)
 #define BLE_HCI_OCF_LE_MODIFY_SCA                        (0x005F)
 
+#define BLE_HCI_OCF_LE_SET_HOST_FEAT                     (0x0074)
+struct ble_hci_le_set_host_feat_cp {
+    uint8_t bit_num;
+    uint8_t val;
+} __attribute__((packed));
+
 /* Command Specific Definitions */
 /* --- Set controller to host flow control (OGF 0x03, OCF 0x0031) --- */
 #define BLE_HCI_CTLR_TO_HOST_FC_OFF         (0)


[mynewt-nimble] 03/04: nimble/ll: Rename feature flags related with sync transfer

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9ae8a9a186dac31a4841c8a341ce412214534951
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Mon Jan 27 16:31:59 2020 +0100

    nimble/ll: Rename feature flags related with sync transfer
    
    This patch changes name of two features related to sync
    transfer:
    
    BLE_LL_FEAT_SYNC_SEND -> BLE_LL_FEAT_SYNC_TRANS_SEND
    BLE_LL_FEAT_SYNC_RECV ->BLE_LL_FEAT_SYNC_TRANS_RECV
    
    as there is new feature call
    
    BLE_LL_FEAT_SYNC_RECV (Synchronizer receiver)
    
    added in following patch
---
 nimble/controller/include/controller/ble_ll.h | 4 ++--
 nimble/controller/src/ble_ll.c                | 4 ++--
 nimble/controller/src/ble_ll_adv.c            | 2 +-
 nimble/controller/src/ble_ll_ctrl.c           | 2 +-
 nimble/controller/src/ble_ll_sync.c           | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 75fdbac..99c0eba 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -223,8 +223,8 @@ extern STATS_SECT_DECL(ble_ll_stats) ble_ll_stats;
 #define BLE_LL_FEAT_CTE_AOD          (0x00200000)
 #define BLE_LL_FEAT_CTE_AOA          (0x00400000)
 #define BLE_LL_FEAT_CTE_RECV         (0x00800000)
-#define BLE_LL_FEAT_SYNC_SEND        (0x01000000)
-#define BLE_LL_FEAT_SYNC_RECV        (0x02000000)
+#define BLE_LL_FEAT_SYNC_TRANS_SEND  (0x01000000)
+#define BLE_LL_FEAT_SYNC_TRANS_RECV  (0x02000000)
 #define BLE_LL_FEAT_SCA_UPDATE       (0x04000000)
 #define BLE_LL_FEAT_REM_PKEY         (0x08000000)
 
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index 0968d11..8b1fb98 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -1631,8 +1631,8 @@ ble_ll_init(void)
 #endif
 
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV_SYNC_TRANSFER)
-    features |= BLE_LL_FEAT_SYNC_RECV;
-    features |= BLE_LL_FEAT_SYNC_SEND;
+    features |= BLE_LL_FEAT_SYNC_TRANS_RECV;
+    features |= BLE_LL_FEAT_SYNC_TRANS_SEND;
 #endif
 
     /* Initialize random number generation */
diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index 16cb5e5..60b60a9 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -3946,7 +3946,7 @@ ble_ll_adv_periodic_set_info_transfer(const uint8_t *cmdbuf, uint8_t len,
       *
       * Allow initiate LL procedure only if remote supports it.
       */
-     if (!(connsm->remote_features[2] & (BLE_LL_FEAT_SYNC_RECV >> (8 * 3)))) {
+     if (!(connsm->remote_features[2] & (BLE_LL_FEAT_SYNC_TRANS_RECV >> (8 * 3)))) {
          rc = BLE_ERR_UNSUPP_REM_FEATURE;
          goto done;
      }
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 789f773..d8e8a58 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -2416,7 +2416,7 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
         feature = BLE_LL_FEAT_MIN_USED_CHAN;
         break;
     case BLE_LL_CTRL_PERIODIC_SYNC_IND:
-        feature = BLE_LL_FEAT_SYNC_RECV;
+        feature = BLE_LL_FEAT_SYNC_TRANS_RECV;
         break;
     default:
         feature = 0;
diff --git a/nimble/controller/src/ble_ll_sync.c b/nimble/controller/src/ble_ll_sync.c
index 8645e91..dffe122 100644
--- a/nimble/controller/src/ble_ll_sync.c
+++ b/nimble/controller/src/ble_ll_sync.c
@@ -2166,7 +2166,7 @@ ble_ll_sync_transfer(const uint8_t *cmdbuf, uint8_t len,
      *
      * Allow initiate LL procedure only if remote supports it.
      */
-    if (!(connsm->remote_features[2] & (BLE_LL_FEAT_SYNC_RECV >> (8 * 3)))) {
+    if (!(connsm->remote_features[2] & (BLE_LL_FEAT_SYNC_TRANS_RECV >> (8 * 3)))) {
         rc = BLE_ERR_UNSUPP_REM_FEATURE;
         goto done;
     }


[mynewt-nimble] 02/04: nimble/ll: Use uint64_t for features

Posted by ry...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b018a1a71b8fc701e57f7212dd5d5b9c4e14180d
Author: Łukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Thu Jan 2 10:46:58 2020 +0100

    nimble/ll: Use uint64_t for features
    
    In Bluetooth 5.2 more than 32 bits are used for the supported
    features, therefore let us use uint64_t from now on.
---
 nimble/controller/include/controller/ble_ll.h | 4 ++--
 nimble/controller/src/ble_ll.c                | 6 +++---
 nimble/controller/src/ble_ll_ctrl.c           | 8 +++-----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 9d8c801..75fdbac 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -80,7 +80,7 @@ STAILQ_HEAD(ble_ll_pkt_q, os_mbuf_pkthdr);
 struct ble_ll_obj
 {
     /* Supported features */
-    uint32_t ll_supp_features;
+    uint64_t ll_supp_features;
 
     /* Current Link Layer state */
     uint8_t ll_state;
@@ -517,7 +517,7 @@ int ble_ll_set_random_addr(const uint8_t *cmdbuf, uint8_t len, bool hci_adv_ext)
 void ble_ll_wfr_timer_exp(void *arg);
 
 /* Read set of features supported by the Link Layer */
-uint32_t ble_ll_read_supp_features(void);
+uint64_t ble_ll_read_supp_features(void);
 
 /* Read set of states supported by the Link Layer */
 uint64_t ble_ll_read_supp_states(void);
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index 9b3fd22..0968d11 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -1269,9 +1269,9 @@ ble_ll_read_supp_states(void)
 /**
  * Returns the features supported by the link layer
  *
- * @return uint32_t bitmask of supported features.
+ * @return uint64_t bitmask of supported features.
  */
-uint32_t
+uint64_t
 ble_ll_read_supp_features(void)
 {
     return g_ble_ll_data.ll_supp_features;
@@ -1515,7 +1515,7 @@ void
 ble_ll_init(void)
 {
     int rc;
-    uint32_t features;
+    uint64_t features;
     ble_addr_t addr;
     struct ble_ll_obj *lldata;
 
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 001619a..789f773 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -1804,7 +1804,7 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
                            uint8_t *rspbuf, uint8_t opcode)
 {
     uint8_t rsp_opcode;
-    uint32_t our_feat;
+    uint64_t our_feat;
 
     /*
      * Only accept slave feature requests if we are a master and feature
@@ -1837,8 +1837,7 @@ ble_ll_ctrl_rx_feature_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
      */
     connsm->conn_features &= our_feat;
 
-    memset(rspbuf + 1, 0, 8);
-    put_le32(rspbuf + 1, our_feat);
+    put_le64(rspbuf + 1, our_feat);
     rspbuf[1] = connsm->conn_features;
 
     return rsp_opcode;
@@ -2092,8 +2091,7 @@ ble_ll_ctrl_proc_init(struct ble_ll_conn_sm *connsm, int ctrl_proc)
             } else {
                 opcode = BLE_LL_CTRL_SLAVE_FEATURE_REQ;
             }
-            memset(ctrdata, 0, BLE_LL_CTRL_FEATURE_LEN);
-            put_le32(ctrdata, ble_ll_read_supp_features());
+            put_le64(ctrdata, ble_ll_read_supp_features());
             break;
         case BLE_LL_CTRL_PROC_VERSION_XCHG:
             opcode = BLE_LL_CTRL_VERSION_IND;