You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2015/11/25 23:11:25 UTC

[3/3] incubator-mynewt-larva git commit: Modify host ble to account for latest mbuf changes

Modify host ble to account for latest mbuf changes


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/7a99eecd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/7a99eecd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/7a99eecd

Branch: refs/heads/master
Commit: 7a99eecdcd02bde898eb1d128944e64718990367
Parents: 4e597f5
Author: Christopher Collins <cc...@gmail.com>
Authored: Wed Nov 25 14:10:38 2015 -0800
Committer: Christopher Collins <cc...@gmail.com>
Committed: Wed Nov 25 14:10:38 2015 -0800

----------------------------------------------------------------------
 net/nimble/host/src/ble_hs.c               |  6 +--
 net/nimble/host/src/ble_hs_att.c           | 33 +++++++-------
 net/nimble/host/src/ble_hs_att_cmd.c       |  1 -
 net/nimble/host/src/ble_l2cap.c            | 24 +++++-----
 net/nimble/host/src/ble_l2cap_util.c       | 58 -------------------------
 net/nimble/host/src/ble_l2cap_util.h       | 27 ------------
 net/nimble/host/src/host_hci.c             |  4 +-
 net/nimble/host/src/test/ble_hs_att_test.c | 12 ++---
 net/nimble/host/src/test/ble_hs_test.c     |  4 +-
 net/nimble/host/src/test/ble_l2cap_test.c  |  8 ++--
 10 files changed, 45 insertions(+), 132 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_hs.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs.c b/net/nimble/host/src/ble_hs.c
index 8e2aaab..0d8f2d2 100644
--- a/net/nimble/host/src/ble_hs.c
+++ b/net/nimble/host/src/ble_hs.c
@@ -173,7 +173,7 @@ ble_hs_rx_data(struct os_mbuf *om)
 
     pkt = os_memblock_get(&ble_hs_pkt_pool);
     if (pkt == NULL) {
-        os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+        os_mbuf_free_chain(om);
         return ENOMEM;
     }
 
@@ -190,7 +190,7 @@ ble_hs_tx_data(struct os_mbuf *om)
 
     pkt = os_memblock_get(&ble_hs_pkt_pool);
     if (pkt == NULL) {
-        os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+        os_mbuf_free_chain(om);
         return ENOMEM;
     }
 
@@ -258,7 +258,7 @@ ble_hs_init(uint8_t prio)
         rc = EINVAL; // XXX
         goto err;
     }
-    rc = os_mbuf_pool_init(&ble_hs_mbuf_pool, &ble_hs_mbuf_mempool, 0,
+    rc = os_mbuf_pool_init(&ble_hs_mbuf_pool, &ble_hs_mbuf_mempool,
                            BLE_HS_MBUF_MEMBLOCK_SIZE, BLE_HS_NUM_MBUFS);
     if (rc != 0) {
         rc = EINVAL; // XXX

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_hs_att.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_att.c b/net/nimble/host/src/ble_hs_att.c
index 4594600..c15c00a 100644
--- a/net/nimble/host/src/ble_hs_att.c
+++ b/net/nimble/host/src/ble_hs_att.c
@@ -21,7 +21,6 @@
 #include "nimble/ble.h"
 #include "host/ble_hs.h"
 #include "ble_l2cap.h"
-#include "ble_l2cap_util.h"
 #include "ble_hs_conn.h"
 #include "ble_hs_uuid.h"
 #include "ble_hs_att_cmd.h"
@@ -459,13 +458,13 @@ ble_hs_att_fill_info(struct ble_hs_att_find_info_req *req, struct os_mbuf *om,
                 }
 
                 htole16(&handle_id, ha->ha_handle_id);
-                rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &handle_id, 2);
+                rc = os_mbuf_append(om, &handle_id, 2);
                 if (rc != 0) {
                     goto done;
                 }
 
                 htole16(&uuid16, uuid16);
-                rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &uuid16, 2);
+                rc = os_mbuf_append(om, &uuid16, 2);
                 if (rc != 0) {
                     goto done;
                 }
@@ -484,12 +483,12 @@ ble_hs_att_fill_info(struct ble_hs_att_find_info_req *req, struct os_mbuf *om,
                 }
 
                 htole16(&handle_id, ha->ha_handle_id);
-                rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &handle_id, 2);
+                rc = os_mbuf_append(om, &handle_id, 2);
                 if (rc != 0) {
                     goto done;
                 }
 
-                rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &ha->ha_uuid,
+                rc = os_mbuf_append(om, &ha->ha_uuid,
                                     16);
                 if (rc != 0) {
                     goto done;
@@ -550,7 +549,7 @@ ble_hs_att_rx_find_info_req(struct ble_hs_conn *conn,
         goto err;
     }
 
-    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     if (txom == NULL) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
         goto err;
@@ -563,7 +562,7 @@ ble_hs_att_rx_find_info_req(struct ble_hs_conn *conn,
     rc = ble_hs_att_find_info_rsp_write(buf, BLE_HS_ATT_FIND_INFO_RSP_MIN_SZ,
                                         &rsp);
     assert(rc == 0);
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, txom, buf,
+    rc = os_mbuf_append(txom, buf,
                         BLE_HS_ATT_FIND_INFO_RSP_MIN_SZ);
     if (rc != 0) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
@@ -589,7 +588,7 @@ ble_hs_att_rx_find_info_req(struct ble_hs_conn *conn,
     return 0;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, txom);
+    os_mbuf_free_chain(txom);
     ble_hs_att_tx_error_rsp(chan, BLE_HS_ATT_OP_FIND_INFO_REQ,
                             req.bhafq_start_handle, rc);
 
@@ -634,14 +633,14 @@ ble_hs_att_fill_type_value_no_match(struct os_mbuf *om, uint16_t *first,
 
     u16 = *first;
     htole16(&u16, u16);
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &u16, 2);
+    rc = os_mbuf_append(om, &u16, 2);
     if (rc != 0) {
         return ENOMEM;
     }
 
     u16 = *prev;
     htole16(&u16, u16);
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, om, &u16, 2);
+    rc = os_mbuf_append(om, &u16, 2);
     if (rc != 0) {
         return ENOMEM;
     }
@@ -840,7 +839,7 @@ ble_hs_att_rx_find_type_value_req(struct ble_hs_conn *conn,
         goto err;
     }
 
-    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     if (txom == NULL) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
         goto err;
@@ -848,7 +847,7 @@ ble_hs_att_rx_find_type_value_req(struct ble_hs_conn *conn,
 
     /* Write the response base at the start of the buffer. */
     buf[0] = BLE_HS_ATT_OP_FIND_TYPE_VALUE_RSP;
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, txom, buf,
+    rc = os_mbuf_append(txom, buf,
                         BLE_HS_ATT_FIND_TYPE_VALUE_RSP_MIN_SZ);
     if (rc != 0) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
@@ -872,7 +871,7 @@ ble_hs_att_rx_find_type_value_req(struct ble_hs_conn *conn,
     return 0;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, txom);
+    os_mbuf_free_chain(txom);
     ble_hs_att_tx_error_rsp(chan, BLE_HS_ATT_OP_FIND_TYPE_VALUE_REQ,
                             req.bhavq_start_handle, rc);
     return rc;
@@ -887,14 +886,14 @@ ble_hs_att_tx_read_rsp(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
     uint8_t op;
     int rc;
 
-    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    txom = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     if (txom == NULL) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
         goto err;
     }
 
     op = BLE_HS_ATT_OP_READ_RSP;
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, txom, &op, 1);
+    rc = os_mbuf_append(txom, &op, 1);
     if (rc != 0) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
         goto err;
@@ -907,7 +906,7 @@ ble_hs_att_tx_read_rsp(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
         data_len = attr_len;
     }
 
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, txom, attr_data, data_len);
+    rc = os_mbuf_append(txom, attr_data, data_len);
     if (rc != 0) {
         rc = BLE_HS_ATT_ERR_INSUFFICIENT_RES;
         goto err;
@@ -922,7 +921,7 @@ ble_hs_att_tx_read_rsp(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
     return 0;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, txom);
+    os_mbuf_free_chain(txom);
     return rc;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_hs_att_cmd.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_hs_att_cmd.c b/net/nimble/host/src/ble_hs_att_cmd.c
index f811100..9573f7e 100644
--- a/net/nimble/host/src/ble_hs_att_cmd.c
+++ b/net/nimble/host/src/ble_hs_att_cmd.c
@@ -18,7 +18,6 @@
 #include "os/os.h"
 #include "nimble/ble.h"
 #include "ble_l2cap.h"
-#include "ble_l2cap_util.h"
 #include "ble_hs_att_cmd.h"
 
 int

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_l2cap.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap.c b/net/nimble/host/src/ble_l2cap.c
index 6f09b32..b3823ae 100644
--- a/net/nimble/host/src/ble_l2cap.c
+++ b/net/nimble/host/src/ble_l2cap.c
@@ -103,7 +103,7 @@ ble_l2cap_prepend_hdr(struct os_mbuf *om,
     uint8_t buf[BLE_L2CAP_HDR_SZ];
     int rc;
 
-    om = os_mbuf_prepend(&ble_hs_mbuf_pool, om, BLE_L2CAP_HDR_SZ);
+    om = os_mbuf_prepend(om, BLE_L2CAP_HDR_SZ);
     if (om == NULL) {
         goto err;
     }
@@ -111,7 +111,7 @@ ble_l2cap_prepend_hdr(struct os_mbuf *om,
     htole16(buf + 0, l2cap_hdr->blh_len);
     htole16(buf + 2, l2cap_hdr->blh_cid);
 
-    rc = os_mbuf_copyinto(&ble_hs_mbuf_pool, om, 0, buf, sizeof buf);
+    rc = os_mbuf_copyinto(om, 0, buf, sizeof buf);
     if (rc != 0) {
         goto err;
     }
@@ -119,7 +119,7 @@ ble_l2cap_prepend_hdr(struct os_mbuf *om,
     return om;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
     return NULL;
 }
 
@@ -137,7 +137,7 @@ ble_l2cap_rx_payload(struct ble_hs_conn *conn, struct ble_l2cap_chan *chan,
 
     /* XXX: Check that complete SDU has been received. */
     rc = chan->blc_rx_fn(conn, chan, chan->blc_rx_buf);
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, chan->blc_rx_buf);
+    os_mbuf_free_chain(chan->blc_rx_buf);
     chan->blc_rx_buf = NULL;
     if (rc != 0) {
         return rc;
@@ -154,13 +154,13 @@ ble_l2cap_rx_payload_flat(struct ble_hs_conn *conn,
     struct os_mbuf *om;
     int rc;
 
-    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     if (om == NULL) {
         rc = ENOMEM;
         goto err;
     }
 
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, om, data, len);
+    rc = os_mbuf_append(om, data, len);
     if (rc != 0) {
         rc = ENOMEM;
         goto err;
@@ -176,7 +176,7 @@ ble_l2cap_rx_payload_flat(struct ble_hs_conn *conn,
     return 0;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
     return rc;
 }
 
@@ -195,7 +195,7 @@ ble_l2cap_rx(struct ble_hs_conn *conn,
     }
 
     /* Strip L2CAP header from the front of the mbuf. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, om, BLE_L2CAP_HDR_SZ);
+    os_mbuf_adj(om, BLE_L2CAP_HDR_SZ);
 
     if (l2cap_hdr.blh_len != hci_hdr->hdh_len - BLE_L2CAP_HDR_SZ) {
         return EMSGSIZE;
@@ -246,7 +246,7 @@ ble_l2cap_tx(struct ble_l2cap_chan *chan, struct os_mbuf *om)
     return 0;
 
 err:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
     return rc;
 }
 
@@ -265,13 +265,13 @@ ble_l2cap_tx_flat(struct ble_l2cap_chan *chan, void *payload, int len)
     struct os_mbuf *om;
     int rc;
 
-    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     if (om == NULL) {
         rc = ENOMEM;
         goto done;
     }
 
-    rc = os_mbuf_append(&ble_hs_mbuf_pool, om, payload, len);
+    rc = os_mbuf_append(om, payload, len);
     if (rc != 0) {
         goto done;
     }
@@ -285,7 +285,7 @@ ble_l2cap_tx_flat(struct ble_l2cap_chan *chan, void *payload, int len)
     rc = 0;
 
 done:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
     return rc;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_l2cap_util.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_util.c b/net/nimble/host/src/ble_l2cap_util.c
deleted file mode 100644
index df1dcd0..0000000
--- a/net/nimble/host/src/ble_l2cap_util.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (c) 2015 Runtime Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "os/os.h"
-#include "nimble/ble.h"
-#include "ble_l2cap.h"
-#include "ble_l2cap_util.h"
-
-/**
- * Reads a uint16 from the specified L2CAP channel's buffer and converts it to
- * little endian.
- *
- * @return                      0 on success; nonzero if the channel buffer
- *                                  did not contain the requested data.
- */
-int
-ble_l2cap_read_uint16(const struct ble_l2cap_chan *chan, int off,
-                      uint16_t *u16)
-{
-    int rc;
-
-    rc = os_mbuf_copydata(chan->blc_rx_buf, off, sizeof *u16, u16);
-    if (rc != 0) {
-        return -1;
-    }
-
-    *u16 = le16toh((void *)u16);
-
-    return 0;
-}
-
-/**
- * Removes the specified number of bytes from the front of an L2CAP channel's
- * buffer.  If the buffer is empty as a result, it is freed.
- */
-void
-ble_l2cap_strip(struct ble_l2cap_chan *chan, int delta)
-{
-    os_mbuf_adj(&ble_l2cap_mbuf_pool, chan->blc_rx_buf, delta);
-
-    if (OS_MBUF_PKTHDR(chan->blc_rx_buf)->omp_len == 0) {
-        os_mbuf_free_chain(&ble_l2cap_mbuf_pool, chan->blc_rx_buf);
-        chan->blc_rx_buf = NULL;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/ble_l2cap_util.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_l2cap_util.h b/net/nimble/host/src/ble_l2cap_util.h
deleted file mode 100644
index ff30c8c..0000000
--- a/net/nimble/host/src/ble_l2cap_util.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2015 Runtime Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_BLE_L2CAP_
-#define H_BLE_L2CAP_
-
-#include <inttypes.h>
-struct ble_l2cap_chan;
-
-int ble_l2cap_read_uint16(const struct ble_l2cap_chan *chan, int off,
-                          uint16_t *u16);
-void ble_l2cap_strip(struct ble_l2cap_chan *chan, int delta);
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/host_hci.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/host_hci.c b/net/nimble/host/src/host_hci.c
index 82d6b71..6e833b5 100644
--- a/net/nimble/host/src/host_hci.c
+++ b/net/nimble/host/src/host_hci.c
@@ -363,7 +363,7 @@ host_hci_data_hdr_strip(struct os_mbuf *om, struct hci_data_hdr *hdr)
 
     /* Strip HCI ACL data header from the front of the packet. */
     /* XXX: This is probably the wrong mbuf pool. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, om, BLE_HCI_DATA_HDR_SZ);
+    os_mbuf_adj(om, BLE_HCI_DATA_HDR_SZ);
 
     hdr->hdh_handle_pb_bc = le16toh(&hdr->hdh_handle_pb_bc);
     hdr->hdh_len = le16toh(&hdr->hdh_len);
@@ -400,7 +400,7 @@ host_hci_data_rx(struct os_mbuf *om)
     om = NULL;
 
 done:
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om); /* XXX: Wrong pool. */
+    os_mbuf_free_chain(om); /* XXX: Wrong pool. */
     return rc;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/test/ble_hs_att_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_hs_att_test.c b/net/nimble/host/src/test/ble_hs_att_test.c
index cebf5f7..29f1bab 100644
--- a/net/nimble/host/src/test/ble_hs_att_test.c
+++ b/net/nimble/host/src/test/ble_hs_att_test.c
@@ -123,7 +123,7 @@ ble_hs_att_test_misc_verify_tx_err_rsp(struct ble_l2cap_chan *chan,
     TEST_ASSERT(rsp.bhaep_error_code == error_code);
 
     /* Remove the error response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx,
+    os_mbuf_adj(ble_hs_test_util_prev_tx,
                 BLE_HS_ATT_ERROR_RSP_SZ);
 }
 
@@ -149,7 +149,7 @@ ble_hs_att_test_misc_verify_tx_read_rsp(struct ble_l2cap_chan *chan,
     TEST_ASSERT(rc != 0);
 
     /* Remove the read response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx, attr_len + 1);
+    os_mbuf_adj(ble_hs_test_util_prev_tx, attr_len + 1);
 }
 
 static void
@@ -163,7 +163,7 @@ ble_hs_att_test_misc_verify_tx_write_rsp(struct ble_l2cap_chan *chan)
     TEST_ASSERT(u8 == BLE_HS_ATT_OP_WRITE_RSP);
 
     /* Remove the write response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx,
+    os_mbuf_adj(ble_hs_test_util_prev_tx,
                 BLE_HS_ATT_WRITE_RSP_SZ);
 }
 
@@ -184,7 +184,7 @@ ble_hs_att_test_misc_verify_tx_mtu_rsp(struct ble_l2cap_chan *chan)
     TEST_ASSERT(rsp.bhamc_mtu == chan->blc_my_mtu);
 
     /* Remove the write response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx,
+    os_mbuf_adj(ble_hs_test_util_prev_tx,
                 BLE_HS_ATT_MTU_CMD_SZ);
 }
 
@@ -250,7 +250,7 @@ ble_hs_att_test_misc_verify_tx_find_info_rsp(
     TEST_ASSERT(off == OS_MBUF_PKTHDR(ble_hs_test_util_prev_tx)->omp_len);
 
     /* Remove the response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx, off);
+    os_mbuf_adj(ble_hs_test_util_prev_tx, off);
 }
 
 struct ble_hs_att_test_type_value_entry {
@@ -295,7 +295,7 @@ ble_hs_att_test_misc_verify_tx_find_type_value_rsp(
     TEST_ASSERT(off == OS_MBUF_PKTHDR(ble_hs_test_util_prev_tx)->omp_len);
 
     /* Remove the response from the buffer. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx, off);
+    os_mbuf_adj(ble_hs_test_util_prev_tx, off);
 }
 
 static void

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/test/ble_hs_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_hs_test.c b/net/nimble/host/src/test/ble_hs_test.c
index 4a1a4bd..885fc38 100644
--- a/net/nimble/host/src/test/ble_hs_test.c
+++ b/net/nimble/host/src/test/ble_hs_test.c
@@ -24,11 +24,11 @@
 void
 ble_hs_test_pkt_txed(struct os_mbuf *om)
 {
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, ble_hs_test_util_prev_tx);
+    os_mbuf_free_chain(ble_hs_test_util_prev_tx);
     ble_hs_test_util_prev_tx = om;
 
     /* XXX: For now, just strip the L2CAP header. */
-    os_mbuf_adj(&ble_hs_mbuf_pool, om, BLE_L2CAP_HDR_SZ);
+    os_mbuf_adj(om, BLE_L2CAP_HDR_SZ);
 }
 
 #ifdef PKG_TEST

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7a99eecd/net/nimble/host/src/test/ble_l2cap_test.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/test/ble_l2cap_test.c b/net/nimble/host/src/test/ble_l2cap_test.c
index 729ebea..a603634 100644
--- a/net/nimble/host/src/test/ble_l2cap_test.c
+++ b/net/nimble/host/src/test/ble_l2cap_test.c
@@ -44,7 +44,7 @@ TEST_CASE(l2cap_test_bad_header)
     /*** HCI header indicates a length of 10, but L2CAP header has a length
      *   of 0.
      */
-    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     TEST_ASSERT_FATAL(om != NULL);
 
     l2cap_hdr.blh_len = 0;
@@ -56,10 +56,10 @@ TEST_CASE(l2cap_test_bad_header)
     rc = ble_l2cap_rx(conn, &hci_hdr, om);
     TEST_ASSERT(rc == EMSGSIZE);
 
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
 
     /*** Length is correct; specified channel doesn't exist. */
-    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool);
+    om = os_mbuf_get_pkthdr(&ble_hs_mbuf_pool, 0);
     TEST_ASSERT_FATAL(om != NULL);
 
     l2cap_hdr.blh_len = 6;
@@ -71,7 +71,7 @@ TEST_CASE(l2cap_test_bad_header)
     rc = ble_l2cap_rx(conn, &hci_hdr, om);
     TEST_ASSERT(rc == ENOENT);
 
-    os_mbuf_free_chain(&ble_hs_mbuf_pool, om);
+    os_mbuf_free_chain(om);
 }
 
 TEST_SUITE(l2cap_gen)