GKI cleanup - moved GKI buffer allocation wrappers to OSI
* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()
For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.
* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE
* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.
* Removed some of the GKI-related references
* Removed file include/gki_target.h
Change-Id: Ie87830e73143de200746d54235aa99f228a95024
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 9408a4f..7b29399 100644
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -62,7 +62,7 @@
#include "btif_util.h"
#include "btu.h"
#include "device/include/controller.h"
-#include "gki.h"
+#include "bt_common.h"
#include "osi/include/fixed_queue.h"
#include "osi/include/future.h"
#include "osi/include/log.h"
@@ -210,7 +210,7 @@
BTIF_TRACE_VERBOSE("btif_transfer_context event %d, len %d", event, param_len);
/* allocate and send message that will be executed in btif context */
- if ((p_msg = (tBTIF_CONTEXT_SWITCH_CBACK *) GKI_getbuf(sizeof(tBTIF_CONTEXT_SWITCH_CBACK) + param_len)) != NULL)
+ if ((p_msg = (tBTIF_CONTEXT_SWITCH_CBACK *) osi_getbuf(sizeof(tBTIF_CONTEXT_SWITCH_CBACK) + param_len)) != NULL)
{
p_msg->hdr.event = BT_EVT_CONTEXT_SWITCH_EVT; /* internal event */
p_msg->p_cb = p_cback;
@@ -308,7 +308,7 @@
BTIF_TRACE_ERROR("unhandled btif event (%d)", p_msg->event & BT_EVT_MASK);
break;
}
- GKI_freebuf(p_msg);
+ osi_freebuf(p_msg);
}
/*******************************************************************************