Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/1_0_0_b1_dev aa214cc43 -> 0874dceae


MYNEWT-486: Further fixes for ACL data buffer size/count.

While not exactly related to the ACL data buffer size, when
testing the controller-only blehci code we noticed that the number
of ACL buffers being reported by the controller and what was sent
to the host in the read buffer size command were not the same.
These changes address that issue.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/0874dcea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/0874dcea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/0874dcea

Branch: refs/heads/1_0_0_b1_dev
Commit: 0874dceae14dbc8301bed36a104f7c3f249dba49
Parents: aa214cc
Author: William San Filippo <[email protected]>
Authored: Mon Nov 14 15:48:41 2016 -0800
Committer: William San Filippo <[email protected]>
Committed: Mon Nov 14 15:51:10 2016 -0800

----------------------------------------------------------------------
 net/nimble/controller/src/ble_ll.c           |  4 ++--
 net/nimble/controller/syscfg.yml             |  9 ---------
 net/nimble/transport/ram/syscfg.yml          | 10 ++++++++++
 net/nimble/transport/uart/src/ble_hci_uart.c |  6 +++---
 net/nimble/transport/uart/syscfg.yml         | 21 ++++++++++++++++-----
 5 files changed, 31 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0874dcea/net/nimble/controller/src/ble_ll.c
----------------------------------------------------------------------
diff --git a/net/nimble/controller/src/ble_ll.c 
b/net/nimble/controller/src/ble_ll.c
index 6aaaf5f..b65aba4 100644
--- a/net/nimble/controller/src/ble_ll.c
+++ b/net/nimble/controller/src/ble_ll.c
@@ -1221,8 +1221,8 @@ ble_ll_init(void)
     lldata = &g_ble_ll_data;
 
     /* Set acl pkt size and number */
-    lldata->ll_num_acl_pkts = MYNEWT_VAL(BLE_LL_ACL_PKT_COUNT);
-    lldata->ll_acl_pkt_size = MYNEWT_VAL(BLE_LL_ACL_PKT_SIZE);
+    lldata->ll_num_acl_pkts = MYNEWT_VAL(BLE_ACL_BUF_COUNT);
+    lldata->ll_acl_pkt_size = MYNEWT_VAL(BLE_ACL_BUF_SIZE);
 
     /* Initialize eventq */
     os_eventq_init(&lldata->ll_evq);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0874dcea/net/nimble/controller/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/controller/syscfg.yml b/net/nimble/controller/syscfg.yml
index 1dac41b..1b0e7d7 100644
--- a/net/nimble/controller/syscfg.yml
+++ b/net/nimble/controller/syscfg.yml
@@ -175,12 +175,3 @@ syscfg.defs:
             policy feature. Currently, this feature is not supported by the
             nimble controller.
         value: '0'
-
-    BLE_LL_ACL_PKT_COUNT:
-        description: 'TBD'
-        value: 12
-    BLE_LL_ACL_PKT_SIZE:
-        description: >
-            This is the maximum size of the data portion of HCI ACL data
-            packets. It does not include the HCI data header (of 4 bytes).
-        value: 255

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0874dcea/net/nimble/transport/ram/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/transport/ram/syscfg.yml 
b/net/nimble/transport/ram/syscfg.yml
index b7940ed..0323ace 100644
--- a/net/nimble/transport/ram/syscfg.yml
+++ b/net/nimble/transport/ram/syscfg.yml
@@ -30,3 +30,13 @@ syscfg.defs:
     BLE_HCI_EVT_BUF_SIZE:
         description: 'Size of each event buffer, in bytes.'
         value:  70
+
+    BLE_ACL_BUF_COUNT:
+        description: 'The number of ACL data buffers'
+        value: 4
+
+    BLE_ACL_BUF_SIZE:
+        description: >
+            This is the maximum size of the data portion of HCI ACL data
+            packets. It does not include the HCI data header (of 4 bytes).
+        value: 255

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0874dcea/net/nimble/transport/uart/src/ble_hci_uart.c
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/src/ble_hci_uart.c 
b/net/nimble/transport/uart/src/ble_hci_uart.c
index 29d7f4d..87da7b5 100755
--- a/net/nimble/transport/uart/src/ble_hci_uart.c
+++ b/net/nimble/transport/uart/src/ble_hci_uart.c
@@ -972,13 +972,13 @@ ble_hci_uart_init(void)
      * maximum ACL data packet length. The ACL block size is the size of the
      * mbufs we will allocate.
      */
-    acl_data_length = MYNEWT_VAL(BLE_LL_ACL_PKT_SIZE);
+    acl_data_length = MYNEWT_VAL(BLE_ACL_BUF_SIZE);
     ble_hci_uart_max_acl_datalen = acl_data_length;
     acl_block_size = acl_data_length + BLE_MBUF_MEMBLOCK_OVERHEAD +
         BLE_HCI_DATA_HDR_SZ;
     acl_block_size = OS_ALIGN(acl_block_size, OS_ALIGNMENT);
     rc = mem_malloc_mempool(&ble_hci_uart_acl_pool,
-                            MYNEWT_VAL(BLE_HCI_ACL_BUF_COUNT),
+                            MYNEWT_VAL(BLE_ACL_BUF_COUNT),
                             acl_block_size,
                             "ble_hci_uart_acl_pool",
                             &ble_hci_uart_acl_buf);
@@ -988,7 +988,7 @@ ble_hci_uart_init(void)
     }
 
     rc = os_mbuf_pool_init(&ble_hci_uart_acl_mbuf_pool, &ble_hci_uart_acl_pool,
-                           acl_block_size, MYNEWT_VAL(BLE_HCI_ACL_BUF_COUNT));
+                           acl_block_size, MYNEWT_VAL(BLE_ACL_BUF_COUNT));
     assert(rc == 0);
 
     /*

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/0874dcea/net/nimble/transport/uart/syscfg.yml
----------------------------------------------------------------------
diff --git a/net/nimble/transport/uart/syscfg.yml 
b/net/nimble/transport/uart/syscfg.yml
index b3c6c8d..6b0673f 100644
--- a/net/nimble/transport/uart/syscfg.yml
+++ b/net/nimble/transport/uart/syscfg.yml
@@ -29,13 +29,24 @@ syscfg.defs:
     BLE_HCI_EVT_LO_BUF_COUNT:
         description: 'TBD'
         value: 8
-    BLE_HCI_ACL_BUF_COUNT:
-        description: 'TBD'
-        value: 4
+    BLE_ACL_BUF_COUNT:
+        description: 'The number of ACL data buffers'
+        value: 12
+    BLE_ACL_BUF_SIZE:
+        description: >
+            This is the maximum size of the data portion of HCI ACL data
+            packets. It does not include the HCI data header (of 4 bytes).
+        value: 255
 
     BLE_HCI_ACL_OUT_COUNT:
-        description: 'TBD'
-        value: 4
+        description: >
+            This count is used in creating a pool of elements used by the
+            code to enqueue various elements. In the case of the controller
+            only HCI, this number should be equal to the number of mbufs in
+            the msys pool. For host only, it is really dependent on the
+            number of ACL buffers that the controller tells the host it
+            has.
+        value: 12
 
     BLE_HCI_UART_PORT:
         description: 'TBD'

Reply via email to