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 2021/11/23 08:11:10 UTC

[mynewt-nimble] 01/02: nimble/ll: Use 'vs' for vendor specific HCI consistently

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 89ac67032e382a0c9a92b0798d1e877d252f6f00
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Nov 9 15:03:54 2021 +0100

    nimble/ll: Use 'vs' for vendor specific HCI consistently
---
 nimble/controller/include/controller/ble_ll.h      |  2 +-
 nimble/controller/include/controller/ble_ll_ctrl.h |  6 +++---
 nimble/controller/src/ble_ll_ctrl.c                | 10 ++++++----
 nimble/controller/src/ble_ll_hci_ev.c              | 14 +++++++-------
 nimble/controller/syscfg.yml                       |  8 ++++++--
 nimble/include/nimble/hci_common.h                 |  4 ++--
 6 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/nimble/controller/include/controller/ble_ll.h b/nimble/controller/include/controller/ble_ll.h
index 5568834..dfda8cf 100644
--- a/nimble/controller/include/controller/ble_ll.h
+++ b/nimble/controller/include/controller/ble_ll.h
@@ -48,7 +48,7 @@ extern "C" {
         if (hal_debugger_connected()) { \
             assert(0);\
         } else {\
-            ble_ll_hci_ev_send_vendor_err(__FILE__, __LINE__); \
+            ble_ll_hci_ev_send_vs_assert(__FILE__, __LINE__); \
             while(1) {}\
         }\
     }
diff --git a/nimble/controller/include/controller/ble_ll_ctrl.h b/nimble/controller/include/controller/ble_ll_ctrl.h
index bd38e58..62e1a53 100644
--- a/nimble/controller/include/controller/ble_ll_ctrl.h
+++ b/nimble/controller/include/controller/ble_ll_ctrl.h
@@ -315,9 +315,9 @@ int ble_ll_hci_ev_phy_update(struct ble_ll_conn_sm *connsm, uint8_t status);
 void ble_ll_calc_session_key(struct ble_ll_conn_sm *connsm);
 void ble_ll_ctrl_phy_update_proc_complete(struct ble_ll_conn_sm *connsm);
 void ble_ll_ctrl_initiate_dle(struct ble_ll_conn_sm *connsm);
-void ble_ll_hci_ev_send_vendor_err(const char *file, uint32_t line);
-void ble_ll_hci_ev_send_llcp_trace(uint8_t type, uint16_t handle, uint16_t count,
-                                   void *pdu, size_t length);
+void ble_ll_hci_ev_send_vs_assert(const char *file, uint32_t line);
+void ble_ll_hci_ev_send_vs_llcp_trace(uint8_t type, uint16_t handle, uint16_t count,
+                                      void *pdu, size_t length);
 
 uint8_t ble_ll_ctrl_phy_tx_transition_get(uint8_t phy_mask);
 uint8_t ble_ll_ctrl_phy_from_phy_mask(uint8_t phy_mask);
diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index b6c6036..94d73a9 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -2469,8 +2469,9 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
     opcode = dptr[2];
 
 #if MYNEWT_VAL(BLE_LL_HCI_LLCP_TRACE)
-    ble_ll_hci_ev_send_llcp_trace(0x03, connsm->conn_handle, connsm->event_cntr,
-                                  &dptr[2], len);
+    ble_ll_hci_ev_send_vs_llcp_trace(0x03, connsm->conn_handle,
+                                     connsm->event_cntr,
+                                     &dptr[2], len);
 #endif
 
     /*
@@ -2803,8 +2804,9 @@ ble_ll_ctrl_tx_done(struct os_mbuf *txpdu, struct ble_ll_conn_sm *connsm)
     uint8_t opcode;
 
 #if MYNEWT_VAL(BLE_LL_HCI_LLCP_TRACE)
-    ble_ll_hci_ev_send_llcp_trace(0x04, connsm->conn_handle, connsm->event_cntr,
-                                  txpdu->om_data, txpdu->om_len);
+    ble_ll_hci_ev_send_vs_llcp_trace(0x04, connsm->conn_handle,
+                                     connsm->event_cntr,
+                                     txpdu->om_data, txpdu->om_len);
 #endif
 
     rc = 0;
diff --git a/nimble/controller/src/ble_ll_hci_ev.c b/nimble/controller/src/ble_ll_hci_ev.c
index ccbb1aa..9d6c39e 100644
--- a/nimble/controller/src/ble_ll_hci_ev.c
+++ b/nimble/controller/src/ble_ll_hci_ev.c
@@ -493,9 +493,9 @@ ble_ll_hci_ev_sca_update(struct ble_ll_conn_sm *connsm, uint8_t status,
 #endif
 
 void
-ble_ll_hci_ev_send_vendor_err(const char *file, uint32_t line)
+ble_ll_hci_ev_send_vs_assert(const char *file, uint32_t line)
 {
-    struct ble_hci_ev_vendor_debug *ev;
+    struct ble_hci_ev_vs_debug *ev;
     struct ble_hci_ev *hci_ev;
     unsigned int str_len;
     bool skip = true;
@@ -510,7 +510,7 @@ ble_ll_hci_ev_send_vendor_err(const char *file, uint32_t line)
 
     hci_ev = (void *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_EVT_HI);
     if (hci_ev) {
-        hci_ev->opcode = BLE_HCI_EVCODE_VENDOR_DEBUG;
+        hci_ev->opcode = BLE_HCI_EVCODE_VS_DEBUG;
         hci_ev->length = sizeof(*ev);
         ev = (void *) hci_ev->data;
 
@@ -554,15 +554,15 @@ ble_ll_hci_ev_send_vendor_err(const char *file, uint32_t line)
 
 #if MYNEWT_VAL(BLE_LL_HCI_LLCP_TRACE)
 void
-ble_ll_hci_ev_send_llcp_trace(uint8_t type, uint16_t handle, uint16_t count,
-                              void *pdu, size_t length)
+ble_ll_hci_ev_send_vs_llcp_trace(uint8_t type, uint16_t handle, uint16_t count,
+                                 void *pdu, size_t length)
 {
-    struct ble_hci_ev_vendor_debug *ev;
+    struct ble_hci_ev_vs_debug *ev;
     struct ble_hci_ev *hci_ev;
 
     hci_ev = (void *)ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_EVT_LO);
     if (hci_ev) {
-        hci_ev->opcode = BLE_HCI_EVCODE_VENDOR_DEBUG;
+        hci_ev->opcode = BLE_HCI_EVCODE_VS_DEBUG;
         hci_ev->length = sizeof(*ev) + 8 + length;
         ev = (void *) hci_ev->data;
 
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index de6e688..d60e18f 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -348,7 +348,7 @@ syscfg.defs:
              depending on specified HCI command length.
         value: 0
 
-    BLE_LL_VND_EVENT_ON_ASSERT:
+    BLE_LL_HCI_VS_EVENT_ON_ASSERT:
         description: >
             This options enables controller to send a vendor-specific event on
             an assertion in controller code. The event contains file name and
@@ -438,6 +438,10 @@ syscfg.defs:
         description: use BLE_LL_SCA instead
         value: 60
         deprecated: 1
+    BLE_LL_VND_EVENT_ON_ASSERT:
+        description: use BLE_LL_HCI_VS_EVENT_ON_ASSERT
+        value: 0
+        deprecated: 1
 
 # defunct settings (to be removed eventually)
     BLE_DEVICE:
@@ -466,7 +470,7 @@ syscfg.vals.BLE_LL_CFG_FEAT_LL_EXT_ADV:
 # Enable vendor event on assert in standalone build to make failed assertions in
 # controller code visible when connected to external host
 syscfg.vals.!BLE_HOST:
-    BLE_LL_VND_EVENT_ON_ASSERT: 1
+    BLE_LL_HCI_VS_EVENT_ON_ASSERT: 1
 
 syscfg.restrictions:
     - OS_CPUTIME_FREQ == 32768
diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h
index 9acb762..b6f9869 100644
--- a/nimble/include/nimble/hci_common.h
+++ b/nimble/include/nimble/hci_common.h
@@ -1446,8 +1446,8 @@ struct ble_hci_ev_auth_pyld_tmo {
 
 #define BLE_HCI_EVCODE_SAM_STATUS_CHG       (0x58)
 
-#define BLE_HCI_EVCODE_VENDOR_DEBUG         (0xFF)
-struct ble_hci_ev_vendor_debug {
+#define BLE_HCI_EVCODE_VS_DEBUG             (0xFF)
+struct ble_hci_ev_vs_debug {
     uint8_t id;
     uint8_t data[0];
 } __attribute__((packed));