Commit a11035b5 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

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
parent 40f3f2dc
......@@ -95,7 +95,6 @@ LOCAL_C_INCLUDES+= . \
$(LOCAL_PATH)/hh \
$(LOCAL_PATH)/../ \
$(LOCAL_PATH)/../btcore/include \
$(LOCAL_PATH)/../gki/common \
$(LOCAL_PATH)/../hci/include \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../stack/include \
......
......@@ -100,7 +100,6 @@ static_library("bta") {
"sys",
"//",
"//btcore/include",
"//gki/common",
"//hci/include",
"//include",
"//stack/include",
......
......@@ -28,7 +28,7 @@
#include "bta_sys.h"
#include "bta_ag_api.h"
#include "bta_ag_int.h"
#include "gki.h"
#include "bt_common.h"
#include <string.h>
/*****************************************************************************
......@@ -72,7 +72,7 @@ tBTA_STATUS BTA_AgEnable(tBTA_AG_PARSE_MODE parse_mode, tBTA_AG_CBACK *p_cback)
/* register with BTA system manager */
bta_sys_register(BTA_ID_AG, &bta_ag_reg);
if ((p_buf = (tBTA_AG_API_ENABLE *) GKI_getbuf(sizeof(tBTA_AG_API_ENABLE))) != NULL)
if ((p_buf = (tBTA_AG_API_ENABLE *) osi_getbuf(sizeof(tBTA_AG_API_ENABLE))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_ENABLE_EVT;
p_buf->parse_mode = parse_mode;
......@@ -98,7 +98,7 @@ void BTA_AgDisable(void)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_API_DISABLE_EVT;
bta_sys_sendmsg(p_buf);
......@@ -121,7 +121,7 @@ void BTA_AgRegister(tBTA_SERVICE_MASK services, tBTA_SEC sec_mask,tBTA_AG_FEAT f
tBTA_AG_API_REGISTER *p_buf;
int i;
if ((p_buf = (tBTA_AG_API_REGISTER *) GKI_getbuf(sizeof(tBTA_AG_API_REGISTER))) != NULL)
if ((p_buf = (tBTA_AG_API_REGISTER *) osi_getbuf(sizeof(tBTA_AG_API_REGISTER))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_REGISTER_EVT;
p_buf->features = features;
......@@ -158,7 +158,7 @@ void BTA_AgDeregister(UINT16 handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_API_DEREGISTER_EVT;
p_buf->layer_specific = handle;
......@@ -183,7 +183,7 @@ void BTA_AgOpen(UINT16 handle, BD_ADDR bd_addr, tBTA_SEC sec_mask, tBTA_SERVICE_
{
tBTA_AG_API_OPEN *p_buf;
if ((p_buf = (tBTA_AG_API_OPEN *) GKI_getbuf(sizeof(tBTA_AG_API_OPEN))) != NULL)
if ((p_buf = (tBTA_AG_API_OPEN *) osi_getbuf(sizeof(tBTA_AG_API_OPEN))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_OPEN_EVT;
p_buf->hdr.layer_specific = handle;
......@@ -209,7 +209,7 @@ void BTA_AgClose(UINT16 handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_API_CLOSE_EVT;
p_buf->layer_specific = handle;
......@@ -232,7 +232,7 @@ void BTA_AgAudioOpen(UINT16 handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_API_AUDIO_OPEN_EVT;
p_buf->layer_specific = handle;
......@@ -255,7 +255,7 @@ void BTA_AgAudioClose(UINT16 handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_API_AUDIO_CLOSE_EVT;
p_buf->layer_specific = handle;
......@@ -280,7 +280,7 @@ void BTA_AgResult(UINT16 handle, tBTA_AG_RES result, tBTA_AG_RES_DATA *p_data)
{
tBTA_AG_API_RESULT *p_buf;
if ((p_buf = (tBTA_AG_API_RESULT *) GKI_getbuf(sizeof(tBTA_AG_API_RESULT))) != NULL)
if ((p_buf = (tBTA_AG_API_RESULT *) osi_getbuf(sizeof(tBTA_AG_API_RESULT))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_RESULT_EVT;
p_buf->hdr.layer_specific = handle;
......@@ -309,7 +309,7 @@ void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec)
{
tBTA_AG_API_SETCODEC *p_buf;
if ((p_buf = (tBTA_AG_API_SETCODEC *) GKI_getbuf(sizeof(tBTA_AG_API_SETCODEC))) != NULL)
if ((p_buf = (tBTA_AG_API_SETCODEC *) osi_getbuf(sizeof(tBTA_AG_API_SETCODEC))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_SETCODEC_EVT;
p_buf->hdr.layer_specific = handle;
......
......@@ -23,7 +23,7 @@
******************************************************************************/
#include <string.h>
#include "gki.h"
#include "bt_common.h"
#include "bta_ag_at.h"
#include "utl.h"
......@@ -63,7 +63,7 @@ void bta_ag_at_reinit(tBTA_AG_AT_CB *p_cb)
{
if (p_cb->p_cmd_buf != NULL)
{
GKI_freebuf(p_cb->p_cmd_buf);
osi_freebuf(p_cb->p_cmd_buf);
p_cb->p_cmd_buf = NULL;
}
p_cb->cmd_pos = 0;
......@@ -192,9 +192,9 @@ void bta_ag_at_parse(tBTA_AG_AT_CB *p_cb, char *p_buf, UINT16 len)
if (p_cb->p_cmd_buf == NULL)
{
if ((p_cb->p_cmd_buf = (char *) GKI_getbuf(p_cb->cmd_max_len)) == NULL)
if ((p_cb->p_cmd_buf = (char *) osi_getbuf(p_cb->cmd_max_len)) == NULL)
{
APPL_TRACE_ERROR("%s: GKI_getbuf() failed allocation", __func__);
APPL_TRACE_ERROR("%s: osi_getbuf() failed allocation", __func__);
return;
}
p_cb->cmd_pos = 0;
......
......@@ -23,7 +23,7 @@
*
******************************************************************************/
#include "gki.h"
#include "bt_common.h"
#include "bta_api.h"
#include "bta_ag_api.h"
......
......@@ -27,7 +27,7 @@
#include "bta_ag_api.h"
#include "bta_ag_int.h"
#include "bta_ag_ci.h"
#include "gki.h"
#include "bt_common.h"
/******************************************************************************
**
......@@ -54,7 +54,7 @@ void bta_ag_ci_rx_write(UINT16 handle, char *p_data, UINT16 len)
if (len_remaining < len)
len = len_remaining;
if ((p_buf = (tBTA_AG_CI_RX_WRITE *) GKI_getbuf((UINT16)(sizeof(tBTA_AG_CI_RX_WRITE) + len + 1))) != NULL)
if ((p_buf = (tBTA_AG_CI_RX_WRITE *) osi_getbuf((UINT16)(sizeof(tBTA_AG_CI_RX_WRITE) + len + 1))) != NULL)
{
p_buf->hdr.event = BTA_AG_CI_RX_WRITE_EVT;
p_buf->hdr.layer_specific = handle;
......@@ -89,7 +89,7 @@ void bta_ag_ci_slc_ready(UINT16 handle)
{
tBTA_AG_DATA *p_buf;
if ((p_buf = (tBTA_AG_DATA *)GKI_getbuf(sizeof(tBTA_AG_DATA))) != NULL)
if ((p_buf = (tBTA_AG_DATA *)osi_getbuf(sizeof(tBTA_AG_DATA))) != NULL)
{
p_buf->hdr.event = BTA_AG_CI_SLC_READY_EVT;
p_buf->hdr.layer_specific = handle;
......
......@@ -32,7 +32,7 @@
#include "bta_ag_int.h"
#include "bta_api.h"
#include "bta_sys.h"
#include "gki.h"
#include "bt_common.h"
#include "port_api.h"
#include "utl.h"
......
......@@ -287,7 +287,7 @@ static void bta_ag_timer_cback(void *p)
BT_HDR *p_buf;
timer_entry_t *p_te = (timer_entry_t *) p;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = p_te->event;
p_buf->layer_specific = bta_ag_scb_to_idx((tBTA_AG_SCB *) p_te->param);
......
......@@ -32,7 +32,7 @@
#include "btm_api.h"
#include "port_api.h"
#include "rfcdefs.h"
#include "gki.h"
#include "bt_common.h"
#include "utl.h"
/* Event mask for RfCOMM port callback */
......@@ -101,7 +101,7 @@ static void bta_ag_port_cback(UINT32 code, UINT16 port_handle, UINT16 handle)
return;
}
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_RFC_DATA_EVT;
p_buf->layer_specific = handle;
......@@ -174,7 +174,7 @@ static void bta_ag_mgmt_cback(UINT32 code, UINT16 port_handle, UINT16 handle)
event = BTA_AG_RFC_SRV_CLOSE_EVT;
}
if ((p_buf = (tBTA_AG_RFC *) GKI_getbuf(sizeof(tBTA_AG_RFC))) != NULL)
if ((p_buf = (tBTA_AG_RFC *) osi_getbuf(sizeof(tBTA_AG_RFC))) != NULL)
{
p_buf->hdr.event = event;
p_buf->hdr.layer_specific = handle;
......@@ -414,7 +414,7 @@ void bta_ag_rfc_do_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
/* Close API was called while AG is in Opening state. */
/* Need to trigger the state machine to send callback to the app */
/* and move back to INIT state. */
if ((p_buf = (tBTA_AG_RFC *) GKI_getbuf(sizeof(tBTA_AG_RFC))) != NULL)
if ((p_buf = (tBTA_AG_RFC *) osi_getbuf(sizeof(tBTA_AG_RFC))) != NULL)
{
p_buf->hdr.event = BTA_AG_RFC_CLOSE_EVT;
p_buf->hdr.layer_specific = bta_ag_scb_to_idx(p_scb);
......
......@@ -31,7 +31,7 @@
#endif
#include "bta_ag_int.h"
#include "btm_api.h"
#include "gki.h"
#include "bt_common.h"
#include "utl.h"
#ifndef BTA_AG_SCO_DEBUG
......@@ -172,7 +172,7 @@ static void bta_ag_sco_conn_cback(UINT16 sco_idx)
if (handle != 0)
{
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_SCO_OPEN_EVT;
p_buf->layer_specific = handle;
......@@ -258,7 +258,7 @@ static void bta_ag_sco_disc_cback(UINT16 sco_idx)
bta_ag_cb.sco.p_curr_scb->inuse_codec = BTA_AG_CODEC_NONE;
#endif
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AG_SCO_CLOSE_EVT;
p_buf->layer_specific = handle;
......@@ -747,7 +747,7 @@ static void bta_ag_sco_event(tBTA_AG_SCB *p_scb, UINT8 event)
if (p_sco->state == BTA_AG_SCO_OPEN_ST)
BTM_WriteScoData(p_sco->p_curr_scb->sco_idx, p_buf);
else
GKI_freebuf(p_buf);
osi_freebuf(p_buf);
}
else
break;
......
......@@ -30,7 +30,7 @@
#include "bta_ag_int.h"
#include "sdp_api.h"
#include "btm_api.h"
#include "gki.h"
#include "bt_common.h"
#include "utl.h"
/* Number of protocol elements in protocol element list. */
......@@ -41,7 +41,7 @@
/* size of database for service discovery */
#ifndef BTA_AG_DISC_BUF_SIZE
#define BTA_AG_DISC_BUF_SIZE GKI_MAX_BUF_SIZE
#define BTA_AG_DISC_BUF_SIZE BT_DEFAULT_BUFFER_SIZE
#endif
/* declare sdp callback functions */
......@@ -88,7 +88,7 @@ static void bta_ag_sdp_cback(UINT16 status, UINT8 idx)
event = BTA_AG_DISC_INT_RES_EVT;
}
if ((p_buf = (tBTA_AG_DISC_RESULT *) GKI_getbuf(sizeof(tBTA_AG_DISC_RESULT))) != NULL)
if ((p_buf = (tBTA_AG_DISC_RESULT *) osi_getbuf(sizeof(tBTA_AG_DISC_RESULT))) != NULL)
{
p_buf->hdr.event = event;
p_buf->hdr.layer_specific = idx;
......@@ -454,7 +454,7 @@ void bta_ag_do_disc(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
}
/* allocate buffer for sdp database */
p_scb->p_disc_db = (tSDP_DISCOVERY_DB *) GKI_getbuf(BTA_AG_DISC_BUF_SIZE);
p_scb->p_disc_db = (tSDP_DISCOVERY_DB *) osi_getbuf(BTA_AG_DISC_BUF_SIZE);
if(p_scb->p_disc_db)
{
......@@ -498,7 +498,7 @@ void bta_ag_free_db(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
if (p_scb->p_disc_db != NULL)
{
GKI_freebuf(p_scb->p_disc_db);
osi_freebuf(p_scb->p_disc_db);
p_scb->p_disc_db = NULL;
}
}
......@@ -388,7 +388,7 @@ static BOOLEAN bta_av_next_getcap(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
/* we got a stream; get its capabilities */
if (p_scb->p_cap == NULL)
{
p_scb->p_cap = (tAVDT_CFG *) GKI_getbuf(sizeof(tAVDT_CFG));
p_scb->p_cap = (tAVDT_CFG *) osi_getbuf(sizeof(tAVDT_CFG));
}
if (p_scb->p_cap == NULL)
{
......@@ -451,7 +451,7 @@ static void bta_av_proc_stream_evt(UINT8 handle, BD_ADDR bd_addr, UINT8 event, t
}
}
if (p_scb && (p_msg = (tBTA_AV_STR_MSG *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_STR_MSG) + sec_len))) != NULL)
if (p_scb && (p_msg = (tBTA_AV_STR_MSG *) osi_getbuf((UINT16) (sizeof(tBTA_AV_STR_MSG) + sec_len))) != NULL)
{
/* copy event data, bd addr, and handle to event message buffer */
......@@ -594,12 +594,12 @@ void bta_av_stream_data_cback(UINT8 handle, BT_HDR *p_pkt, UINT32 time_stamp, UI
}
if(index == BTA_AV_NUM_STRS) /* cannot find correct handler */
{
GKI_freebuf(p_pkt);
osi_freebuf(p_pkt);
return;
}
p_pkt->event = BTA_AV_MEDIA_DATA_EVT;
p_scb->seps[p_scb->sep_idx].p_app_data_cback(BTA_AV_MEDIA_DATA_EVT, (tBTA_AV_MEDIA*)p_pkt);
GKI_freebuf(p_pkt); /* a copy of packet had been delivered, we free this buffer */
osi_freebuf(p_pkt); /* a copy of packet had been delivered, we free this buffer */
}
/*******************************************************************************
......@@ -714,7 +714,7 @@ static void bta_av_a2d_sdp_cback(BOOLEAN found, tA2D_Service *p_service)
tBTA_AV_SDP_RES *p_msg;
tBTA_AV_SCB *p_scb;
if ((p_msg = (tBTA_AV_SDP_RES *) GKI_getbuf(sizeof(tBTA_AV_SDP_RES))) != NULL)
if ((p_msg = (tBTA_AV_SDP_RES *) osi_getbuf(sizeof(tBTA_AV_SDP_RES))) != NULL)
{
p_msg->hdr.event = (found) ? BTA_AV_SDP_DISC_OK_EVT : BTA_AV_SDP_DISC_FAIL_EVT;
......@@ -1009,7 +1009,7 @@ void bta_av_do_disc_a2d (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
/* allocate discovery database */
if (p_scb->p_disc_db == NULL)
{
p_scb->p_disc_db = (tSDP_DISCOVERY_DB *) GKI_getbuf(BTA_AV_DISC_BUF_SIZE);
p_scb->p_disc_db = (tSDP_DISCOVERY_DB *) osi_getbuf(BTA_AV_DISC_BUF_SIZE);
}
/* only one A2D find service is active at a time */
......@@ -2074,7 +2074,7 @@ void bta_av_str_stopped (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
p_buf = (BT_HDR *)list_front(p_scb->a2d_list);
list_remove(p_scb->a2d_list, p_buf);
GKI_freebuf(p_buf);
osi_freebuf(p_buf);
}
/* drop the audio buffers queued in L2CAP */
......@@ -2143,7 +2143,7 @@ void bta_av_reconfig (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
/* store the new configuration in control block */
if (p_scb->p_cap == NULL)
{
p_scb->p_cap = (tAVDT_CFG *) GKI_getbuf(sizeof(tAVDT_CFG));
p_scb->p_cap = (tAVDT_CFG *) osi_getbuf(sizeof(tAVDT_CFG));
}
if((p_cfg = p_scb->p_cap) == NULL)
{
......@@ -2297,7 +2297,7 @@ void bta_av_data_path (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
/* too many buffers in a2d_list, drop it. */
bta_av_co_audio_drop(p_scb->hndl);
GKI_freebuf(p_buf);
osi_freebuf(p_buf);
}
}
}
......@@ -3093,7 +3093,7 @@ void bta_av_open_at_inc (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
p_scb->coll_mask = 0;
bta_av_set_scb_sst_init (p_scb);
if ((p_buf = (tBTA_AV_API_OPEN *) GKI_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
if ((p_buf = (tBTA_AV_API_OPEN *) osi_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
{
memcpy(p_buf, &(p_scb->open_api), sizeof(tBTA_AV_API_OPEN));
bta_sys_sendmsg(p_buf);
......
......@@ -195,7 +195,7 @@ static void bta_av_avrc_sdp_cback(UINT16 status)
BT_HDR *p_msg;
UNUSED(status);
if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_msg = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_msg->event = BTA_AV_SDP_AVRC_DISC_EVT;
bta_sys_sendmsg(p_msg);
......@@ -236,7 +236,7 @@ static void bta_av_rc_ctrl_cback(UINT8 handle, UINT8 event, UINT16 result, BD_AD
if (msg_event)
{
if ((p_msg = (tBTA_AV_RC_CONN_CHG *) GKI_getbuf(sizeof(tBTA_AV_RC_CONN_CHG))) != NULL)
if ((p_msg = (tBTA_AV_RC_CONN_CHG *) osi_getbuf(sizeof(tBTA_AV_RC_CONN_CHG))) != NULL)
{
p_msg->hdr.event = msg_event;
p_msg->handle = handle;
......@@ -274,7 +274,7 @@ static void bta_av_rc_msg_cback(UINT8 handle, UINT8 label, UINT8 opcode, tAVRC_M
/* Create a copy of the message */
tBTA_AV_RC_MSG *p_buf =
(tBTA_AV_RC_MSG *)GKI_getbuf((UINT16)(sizeof(tBTA_AV_RC_MSG) + data_len));
(tBTA_AV_RC_MSG *)osi_getbuf((UINT16)(sizeof(tBTA_AV_RC_MSG) + data_len));
if (p_buf != NULL) {
p_buf->hdr.event = BTA_AV_AVRC_MSG_EVT;
p_buf->handle = handle;
......@@ -681,7 +681,7 @@ void bta_av_rc_meta_rsp(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
}
if (do_free)
GKI_freebuf (p_data->api_meta_rsp.p_pkt);
osi_freebuf (p_data->api_meta_rsp.p_pkt);
}
/*******************************************************************************
......@@ -697,7 +697,7 @@ void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
UNUSED(p_cb);
GKI_freebuf (p_data->api_meta_rsp.p_pkt);
osi_freebuf (p_data->api_meta_rsp.p_pkt);
}
/*******************************************************************************
......@@ -1608,7 +1608,7 @@ static void bta_av_acp_sig_timer_cback(timer_entry_t *p_te)
p_scb->coll_mask &= ~BTA_AV_COLL_API_CALLED;
/* BTA_AV_API_OPEN_EVT */
if ((p_buf = (tBTA_AV_API_OPEN *) GKI_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
if ((p_buf = (tBTA_AV_API_OPEN *) osi_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
{
memcpy(p_buf, &(p_scb->open_api), sizeof(tBTA_AV_API_OPEN));
bta_sys_sendmsg(p_buf);
......@@ -1943,7 +1943,7 @@ void bta_av_rc_disc(UINT8 disc)
/* allocate discovery database */
if (p_cb->p_disc_db == NULL)
{
p_cb->p_disc_db = (tSDP_DISCOVERY_DB *) GKI_getbuf(BTA_AV_DISC_BUF_SIZE);
p_cb->p_disc_db = (tSDP_DISCOVERY_DB *) osi_getbuf(BTA_AV_DISC_BUF_SIZE);
}
if (p_cb->p_disc_db)
......@@ -2004,7 +2004,7 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
while (!list_is_empty(p_scb->a2d_list)) {
p_buf = (BT_HDR*)list_front(p_scb->a2d_list);
list_remove(p_scb->a2d_list, p_buf);
GKI_freebuf(p_buf);
osi_freebuf(p_buf);
}
}
......
......@@ -31,7 +31,7 @@
#include "bta_sys.h"
#include "bta_av_api.h"
#include "bta_av_int.h"
#include "gki.h"
#include "bt_common.h"
#include <string.h>
/*****************************************************************************
......@@ -64,7 +64,7 @@ void BTA_AvEnable(tBTA_SEC sec_mask, tBTA_AV_FEAT features, tBTA_AV_CBACK *p_cba
/* register with BTA system manager */
bta_sys_register(BTA_ID_AV, &bta_av_reg);
if ((p_buf = (tBTA_AV_API_ENABLE *) GKI_getbuf(sizeof(tBTA_AV_API_ENABLE))) != NULL)
if ((p_buf = (tBTA_AV_API_ENABLE *) osi_getbuf(sizeof(tBTA_AV_API_ENABLE))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_ENABLE_EVT;
p_buf->p_cback = p_cback;
......@@ -88,7 +88,7 @@ void BTA_AvDisable(void)
BT_HDR *p_buf;
bta_sys_deregister(BTA_ID_AV);
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AV_API_DISABLE_EVT;
bta_sys_sendmsg(p_buf);
......@@ -113,7 +113,7 @@ void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id,
tBTA_AV_API_REG *p_buf;
if ((p_buf = (tBTA_AV_API_REG *) GKI_getbuf(sizeof(tBTA_AV_API_REG))) != NULL)
if ((p_buf = (tBTA_AV_API_REG *) osi_getbuf(sizeof(tBTA_AV_API_REG))) != NULL)
{
p_buf->hdr.layer_specific = chnl;
p_buf->hdr.event = BTA_AV_API_REGISTER_EVT;
......@@ -145,7 +145,7 @@ void BTA_AvDeregister(tBTA_AV_HNDL hndl)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->layer_specific = hndl;
p_buf->event = BTA_AV_API_DEREGISTER_EVT;
......@@ -169,7 +169,7 @@ void BTA_AvOpen(BD_ADDR bd_addr, tBTA_AV_HNDL handle, BOOLEAN use_rc, tBTA_SEC s
{
tBTA_AV_API_OPEN *p_buf;
if ((p_buf = (tBTA_AV_API_OPEN *) GKI_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
if ((p_buf = (tBTA_AV_API_OPEN *) osi_getbuf(sizeof(tBTA_AV_API_OPEN))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_OPEN_EVT;
p_buf->hdr.layer_specific = handle;
......@@ -195,7 +195,7 @@ void BTA_AvClose(tBTA_AV_HNDL handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AV_API_CLOSE_EVT;
p_buf->layer_specific = handle;
......@@ -216,7 +216,7 @@ void BTA_AvDisconnect(BD_ADDR bd_addr)
{
tBTA_AV_API_DISCNT *p_buf;
if ((p_buf = (tBTA_AV_API_DISCNT *) GKI_getbuf(sizeof(tBTA_AV_API_DISCNT))) != NULL)
if ((p_buf = (tBTA_AV_API_DISCNT *) osi_getbuf(sizeof(tBTA_AV_API_DISCNT))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_DISCONNECT_EVT;
bdcpy(p_buf->bd_addr, bd_addr);
......@@ -237,7 +237,7 @@ void BTA_AvStart(void)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AV_API_START_EVT;
bta_sys_sendmsg(p_buf);
......@@ -257,7 +257,7 @@ void BTA_AvEnable_Sink(int enable)
{
#if (BTA_AV_SINK_INCLUDED == TRUE)
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = BTA_AV_API_SINK_ENABLE_EVT;
p_buf->layer_specific = enable;
......@@ -283,7 +283,7 @@ void BTA_AvStop(BOOLEAN suspend)
{
tBTA_AV_API_STOP *p_buf;
if ((p_buf = (tBTA_AV_API_STOP *) GKI_getbuf(sizeof(tBTA_AV_API_STOP))) != NULL)
if ((p_buf = (tBTA_AV_API_STOP *) osi_getbuf(sizeof(tBTA_AV_API_STOP))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_STOP_EVT;
p_buf->flush = TRUE;
......@@ -310,7 +310,7 @@ void BTA_AvReconfig(tBTA_AV_HNDL hndl, BOOLEAN suspend, UINT8 sep_info_idx,
{
tBTA_AV_API_RCFG *p_buf;
if ((p_buf = (tBTA_AV_API_RCFG *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_RCFG) + num_protect))) != NULL)
if ((p_buf = (tBTA_AV_API_RCFG *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_RCFG) + num_protect))) != NULL)
{
p_buf->hdr.layer_specific = hndl;
p_buf->hdr.event = BTA_AV_API_RECONFIG_EVT;
......@@ -338,7 +338,7 @@ void BTA_AvProtectReq(tBTA_AV_HNDL hndl, UINT8 *p_data, UINT16 len)
{
tBTA_AV_API_PROTECT_REQ *p_buf;
if ((p_buf = (tBTA_AV_API_PROTECT_REQ *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_PROTECT_REQ) + len))) != NULL)
if ((p_buf = (tBTA_AV_API_PROTECT_REQ *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_PROTECT_REQ) + len))) != NULL)
{
p_buf->hdr.layer_specific = hndl;
p_buf->hdr.event = BTA_AV_API_PROTECT_REQ_EVT;
......@@ -372,7 +372,7 @@ void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, UINT8 error_code, UINT8 *p_data, UINT16
{
tBTA_AV_API_PROTECT_RSP *p_buf;
if ((p_buf = (tBTA_AV_API_PROTECT_RSP *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_PROTECT_RSP) + len))) != NULL)
if ((p_buf = (tBTA_AV_API_PROTECT_RSP *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_PROTECT_RSP) + len))) != NULL)
{
p_buf->hdr.layer_specific = hndl;
p_buf->hdr.event = BTA_AV_API_PROTECT_RSP_EVT;
......@@ -405,7 +405,7 @@ void BTA_AvRemoteCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_RC rc_id, tBTA_AV_STA
{
tBTA_AV_API_REMOTE_CMD *p_buf;
if ((p_buf = (tBTA_AV_API_REMOTE_CMD *) GKI_getbuf(sizeof(tBTA_AV_API_REMOTE_CMD))) != NULL)
if ((p_buf = (tBTA_AV_API_REMOTE_CMD *) osi_getbuf(sizeof(tBTA_AV_API_REMOTE_CMD))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_REMOTE_CMD_EVT;
p_buf->hdr.layer_specific = rc_handle;
......@@ -433,7 +433,7 @@ void BTA_AvVendorCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE cmd_code, UINT8
{
tBTA_AV_API_VENDOR *p_buf;
if ((p_buf = (tBTA_AV_API_VENDOR *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_VENDOR) + len))) != NULL)
if ((p_buf = (tBTA_AV_API_VENDOR *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_VENDOR) + len))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_VENDOR_CMD_EVT;
p_buf->hdr.layer_specific = rc_handle;
......@@ -472,7 +472,7 @@ void BTA_AvVendorRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code, UINT8
{
tBTA_AV_API_VENDOR *p_buf;
if ((p_buf = (tBTA_AV_API_VENDOR *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_VENDOR) + len))) != NULL)
if ((p_buf = (tBTA_AV_API_VENDOR *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_VENDOR) + len))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_VENDOR_RSP_EVT;
p_buf->hdr.layer_specific = rc_handle;
......@@ -512,7 +512,7 @@ void BTA_AvOpenRc(tBTA_AV_HNDL handle)
{
tBTA_AV_API_OPEN_RC *p_buf;
if ((p_buf = (tBTA_AV_API_OPEN_RC *) GKI_getbuf(sizeof(tBTA_AV_API_OPEN_RC))) != NULL)
if ((p_buf = (tBTA_AV_API_OPEN_RC *) osi_getbuf(sizeof(tBTA_AV_API_OPEN_RC))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_RC_OPEN_EVT;
p_buf->hdr.layer_specific = handle;
......@@ -533,7 +533,7 @@ void BTA_AvCloseRc(UINT8 rc_handle)
{
tBTA_AV_API_CLOSE_RC *p_buf;
if ((p_buf = (tBTA_AV_API_CLOSE_RC *) GKI_getbuf(sizeof(tBTA_AV_API_CLOSE_RC))) != NULL)
if ((p_buf = (tBTA_AV_API_CLOSE_RC *) osi_getbuf(sizeof(tBTA_AV_API_CLOSE_RC))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_RC_CLOSE_EVT;
p_buf->hdr.layer_specific = rc_handle;
......@@ -558,7 +558,7 @@ void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
{
tBTA_AV_API_META_RSP *p_buf;
if ((p_buf = (tBTA_AV_API_META_RSP *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_META_RSP)))) != NULL)
if ((p_buf = (tBTA_AV_API_META_RSP *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_META_RSP)))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_META_RSP_EVT;
p_buf->hdr.layer_specific = rc_handle;
......@@ -569,7 +569,7 @@ void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
bta_sys_sendmsg(p_buf);
} else if (p_pkt) {
GKI_freebuf(p_pkt);
osi_freebuf(p_pkt);
}
}
......@@ -591,7 +591,7 @@ void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p
{
tBTA_AV_API_META_RSP *p_buf;
if ((p_buf = (tBTA_AV_API_META_RSP *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_API_META_RSP)))) != NULL)
if ((p_buf = (tBTA_AV_API_META_RSP *) osi_getbuf((UINT16) (sizeof(tBTA_AV_API_META_RSP)))) != NULL)
{
p_buf->hdr.event = BTA_AV_API_META_RSP_EVT;
p_buf->hdr.layer_specific = rc_handle;
......
......@@ -26,7 +26,7 @@
#include <stddef.h>
#include "bt_target.h"
#include "gki.h"
#include "bt_common.h"
#include "bta_api.h"
#include "bta_av_int.h"
......
......@@ -46,7 +46,7 @@ void bta_av_ci_src_data_ready(tBTA_AV_CHNL chnl)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->layer_specific = chnl;
p_buf->event = BTA_AV_CI_SRC_DATA_READY_EVT;
......@@ -72,7 +72,7 @@ void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, UINT8 err_code, UINT8 category,
{
tBTA_AV_CI_SETCONFIG *p_buf;
if ((p_buf = (tBTA_AV_CI_SETCONFIG *) GKI_getbuf(sizeof(tBTA_AV_CI_SETCONFIG))) != NULL)
if ((p_buf = (tBTA_AV_CI_SETCONFIG *) osi_getbuf(sizeof(tBTA_AV_CI_SETCONFIG))) != NULL)
{
p_buf->hdr.layer_specific = hndl;
p_buf->hdr.event = (err_code == AVDT_SUCCESS) ?
......
......@@ -233,7 +233,7 @@ static void bta_av_timer_cback(void *p_te)
}
}
if (p_scb && (p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if (p_scb && (p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
/* send the event through the audio state machine.
* only when the audio SM is open, the main SM opens the RC connection as INT */
......@@ -380,7 +380,7 @@ static tBTA_AV_SCB * bta_av_alloc_scb(tBTA_AV_CHNL chnl)
if(bta_av_cb.p_scb[xx] == NULL)
{
/* found an empty spot */
p_ret = (tBTA_AV_SCB *)GKI_getbuf(sizeof(tBTA_AV_SCB));
p_ret = (tBTA_AV_SCB *)osi_getbuf(sizeof(tBTA_AV_SCB));
if(p_ret)
{
memset(p_ret, 0, sizeof(tBTA_AV_SCB));
......@@ -429,7 +429,7 @@ void bta_av_conn_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p
//(AVDT_CONNECT_IND_EVT == event && AVDT_ACP == p_data->hdr.err_param))
(AVDT_CONNECT_IND_EVT == event))&& */
(p_msg = (tBTA_AV_STR_MSG *) GKI_getbuf((UINT16) (sizeof(tBTA_AV_STR_MSG)))) != NULL)
(p_msg = (tBTA_AV_STR_MSG *) osi_getbuf((UINT16) (sizeof(tBTA_AV_STR_MSG)))) != NULL)
{
p_msg->hdr.event = evt;
p_msg->hdr.layer_specific = event;
......@@ -931,7 +931,7 @@ static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,UINT8 id, UINT8 app
/* note that more than one SCB (a2dp & vdp) maybe waiting for this event */
p_scb = bta_av_cb.p_scb[i];
if (p_scb && (bdcmp (peer_addr, p_scb->peer_addr) == 0) &&
(p_buf = (tBTA_AV_ROLE_RES *) GKI_getbuf(sizeof(tBTA_AV_ROLE_RES))) != NULL)
(p_buf = (tBTA_AV_ROLE_RES *) osi_getbuf(sizeof(tBTA_AV_ROLE_RES))) != NULL)
{
APPL_TRACE_DEBUG("new_role:%d, hci_status:x%x hndl: x%x", id, app_id, p_scb->hndl);
/*
......@@ -1196,7 +1196,7 @@ void bta_av_dup_audio_buf(tBTA_AV_SCB *p_scb, BT_HDR *p_buf)
if(bta_av_cb.audio_open_cnt >= 2)
{
size = GKI_get_buf_size(p_buf);
size = osi_get_buf_size(p_buf);
copy_size = BT_HDR_SIZE + p_buf->len + p_buf->offset;
/* more than one audio channel is connected */
for(i=0; i<BTA_AV_NUM_STRS; i++)
......@@ -1207,7 +1207,7 @@ void bta_av_dup_audio_buf(tBTA_AV_SCB *p_scb, BT_HDR *p_buf)
p_scbi && p_scbi->co_started ) /* scb is used and started */
{
/* enqueue the data only when the stream is started */
p_new = (BT_HDR *)GKI_getbuf(size);
p_new = (BT_HDR *)osi_getbuf(size);
if(p_new)
{
memcpy(p_new, p_buf, copy_size);
......@@ -1217,7 +1217,7 @@ void bta_av_dup_audio_buf(tBTA_AV_SCB *p_scb, BT_HDR *p_buf)
bta_av_co_audio_drop(p_scbi->hndl);
BT_HDR *p_buf = list_front(p_scbi->a2d_list);
list_remove(p_scbi->a2d_list, p_buf);
GKI_freebuf(p_buf);
osi_freebuf(p_buf);
}
}
}
......
......@@ -37,7 +37,7 @@
#include "btm_int.h"
#include "btu.h"
#include "gap_api.h" /* For GAP_BleReadPeerPrefConnParams */
#include "gki.h"
#include "bt_common.h"
#include "l2c_api.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
......@@ -274,7 +274,7 @@ void bta_dm_enable(tBTA_DM_MSG *p_data)
bta_dm_cb.is_bta_dm_active = TRUE;
/* send a message to BTA SYS */
if ((sys_enable_event = (tBTA_SYS_HW_MSG *) GKI_getbuf(sizeof(tBTA_SYS_HW_MSG))) != NULL)
if ((sys_enable_event = (tBTA_SYS_HW_MSG *) osi_getbuf(sizeof(tBTA_SYS_HW_MSG))) != NULL)
{
sys_enable_event->hdr.event = BTA_SYS_API_ENABLE_EVT;
sys_enable_event->hw_module = BTA_SYS_HW_BLUETOOTH;
......@@ -1158,7 +1158,7 @@ void bta_dm_search_start (tBTA_DM_MSG *p_data)
if ((bta_dm_search_cb.num_uuid = p_data->search.num_uuid) != 0 &&
p_data->search.p_uuid != NULL)
{
if ((bta_dm_search_cb.p_srvc_uuid = (tBT_UUID *)GKI_getbuf(len)) == NULL)
if ((bta_dm_search_cb.p_srvc_uuid = (tBT_UUID *)osi_getbuf(len)) == NULL)
{
APPL_TRACE_ERROR("%s no resources", __func__);
......@@ -1203,7 +1203,7 @@ void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
if (BTM_CancelInquiry() != BTM_CMD_STARTED)
{
bta_dm_search_cancel_notify(NULL);
p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG));
p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG));
if (p_msg != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
......@@ -1220,7 +1220,7 @@ void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
{
BTM_CancelRemoteDeviceName();
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
......@@ -1229,7 +1229,7 @@ void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
}
else {
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_INQUIRY_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
......@@ -1272,7 +1272,7 @@ void bta_dm_discover (tBTA_DM_MSG *p_data)
if ((bta_dm_search_cb.num_uuid = p_data->discover.num_uuid) != 0 &&
p_data->discover.p_uuid != NULL)
{
if ((bta_dm_search_cb.p_srvc_uuid = (tBT_UUID *)GKI_getbuf(len)) == NULL)
if ((bta_dm_search_cb.p_srvc_uuid = (tBT_UUID *)osi_getbuf(len)) == NULL)
{
p_data->discover.p_cback(BTA_DM_DISC_CMPL_EVT, NULL);
return;
......@@ -1339,7 +1339,7 @@ static void bta_dm_di_disc_callback(UINT16 result)
{
tBTA_DM_MSG * p_msg;
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DI_DISCOVER_EVT;
......@@ -1396,7 +1396,7 @@ void bta_dm_di_disc (tBTA_DM_MSG *p_data)
bdcpy(bta_dm_search_cb.peer_bdaddr, p_data->di_disc.bd_addr);
bta_dm_di_cb.p_di_db = p_data->di_disc.p_sdp_db;
if((bta_dm_search_cb.p_sdp_db = (tSDP_DISCOVERY_DB *)GKI_getbuf(BTA_DM_SDP_DB_SIZE)) != NULL)
if((bta_dm_search_cb.p_sdp_db = (tSDP_DISCOVERY_DB *)osi_getbuf(BTA_DM_SDP_DB_SIZE)) != NULL)
{
if ( SDP_DiDiscover(bta_dm_search_cb.peer_bdaddr, p_data->di_disc.p_sdp_db,
p_data->di_disc.len, bta_dm_di_disc_callback) == SDP_SUCCESS)
......@@ -1410,7 +1410,7 @@ void bta_dm_di_disc (tBTA_DM_MSG *p_data)
}
if ( result == BTA_FAILURE &&
(p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
(p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DI_DISCOVER_EVT;
......@@ -1496,7 +1496,7 @@ void bta_dm_inq_cmpl (tBTA_DM_MSG *p_data)
/* no devices, search complete */
bta_dm_search_cb.services = 0;
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
......@@ -1683,7 +1683,7 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
}
while(bta_dm_search_cb.service_index <= BTA_MAX_SERVICE_ID);
// GKI_freebuf(bta_dm_search_cb.p_sdp_db);
// osi_freebuf(bta_dm_search_cb.p_sdp_db);
// bta_dm_search_cb.p_sdp_db = NULL;
APPL_TRACE_DEBUG("%s services_found = %04x", __FUNCTION__,
bta_dm_search_cb.services_found);
......@@ -1722,7 +1722,7 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_DISCOVERY_RESULT_EVT;
p_msg->disc_result.result.disc_res.result = BTA_SUCCESS;
......@@ -1731,7 +1731,7 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
p_msg->disc_result.result.disc_res.num_uuids = num_uuids;
p_msg->disc_result.result.disc_res.p_uuid_list = NULL;
if (num_uuids > 0) {
p_msg->disc_result.result.disc_res.p_uuid_list = (UINT8*)GKI_getbuf(num_uuids*MAX_UUID_SIZE);
p_msg->disc_result.result.disc_res.p_uuid_list = (UINT8*)osi_getbuf(num_uuids*MAX_UUID_SIZE);
if (p_msg->disc_result.result.disc_res.p_uuid_list) {
memcpy(p_msg->disc_result.result.disc_res.p_uuid_list, uuid_list,
num_uuids*MAX_UUID_SIZE);
......@@ -1750,7 +1750,7 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
bta_dm_search_cb.p_sdp_db->raw_used,
bta_dm_search_cb.p_sdp_db->raw_data);
p_msg->disc_result.result.disc_res.p_raw_data = GKI_getbuf(bta_dm_search_cb.p_sdp_db->raw_used);
p_msg->disc_result.result.disc_res.p_raw_data = osi_getbuf(bta_dm_search_cb.p_sdp_db->raw_used);
if ( NULL != p_msg->disc_result.result.disc_res.p_raw_data ) {
memcpy( p_msg->disc_result.result.disc_res.p_raw_data,
bta_dm_search_cb.p_sdp_db->raw_data,
......@@ -1801,12 +1801,12 @@ void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
bta_dm_search_cb.wait_disc = FALSE;
/* not able to connect go to next device */
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
osi_freebuf(bta_dm_search_cb.p_sdp_db);
bta_dm_search_cb.p_sdp_db = NULL;
BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_DISCOVERY_RESULT_EVT;
p_msg->disc_result.result.disc_res.result = BTA_FAILURE;
......@@ -1865,7 +1865,7 @@ void bta_dm_disc_result (tBTA_DM_MSG *p_data)
#endif
bta_dm_search_cb.p_search_cback(BTA_DM_DISC_RES_EVT, &p_data->disc_result.result);
tBTA_DM_MSG *p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG));
tBTA_DM_MSG *p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG));
/* send a message to change state */
if (p_msg != NULL)
......@@ -1951,7 +1951,7 @@ void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data)
UNUSED(p_data);
if(bta_dm_search_cb.p_sdp_db)
{
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
osi_freebuf(bta_dm_search_cb.p_sdp_db);
bta_dm_search_cb.p_sdp_db = NULL;
}
......@@ -1970,10 +1970,10 @@ void bta_dm_queue_search (tBTA_DM_MSG *p_data)
{
if(bta_dm_search_cb.p_search_queue)
{
GKI_freebuf(bta_dm_search_cb.p_search_queue);
osi_freebuf(bta_dm_search_cb.p_search_queue);
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)GKI_getbuf(sizeof(tBTA_DM_API_SEARCH));
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_getbuf(sizeof(tBTA_DM_API_SEARCH));
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_SEARCH));
}
......@@ -1991,10 +1991,10 @@ void bta_dm_queue_disc (tBTA_DM_MSG *p_data)
{
if(bta_dm_search_cb.p_search_queue)
{
GKI_freebuf(bta_dm_search_cb.p_search_queue);
osi_freebuf(bta_dm_search_cb.p_search_queue);
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)GKI_getbuf(sizeof(tBTA_DM_API_DISCOVER));
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)osi_getbuf(sizeof(tBTA_DM_API_DISCOVER));
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_DISCOVER));
}
......@@ -2013,7 +2013,7 @@ void bta_dm_search_clear_queue (tBTA_DM_MSG *p_data)
UNUSED(p_data);
if(bta_dm_search_cb.p_search_queue)
{
GKI_freebuf(bta_dm_search_cb.p_search_queue);
osi_freebuf(bta_dm_search_cb.p_search_queue);
bta_dm_search_cb.p_search_queue = NULL;
}
}
......@@ -2053,7 +2053,7 @@ void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data)
UNUSED(p_data);
if(bta_dm_search_cb.p_sdp_db)
{
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
osi_freebuf(bta_dm_search_cb.p_sdp_db);
bta_dm_search_cb.p_sdp_db = NULL;
}
......@@ -2112,7 +2112,7 @@ static void bta_dm_find_services ( BD_ADDR bd_addr)
if( bta_dm_search_cb.services_to_search
& (tBTA_SERVICE_MASK)(BTA_SERVICE_ID_TO_SERVICE_MASK(bta_dm_search_cb.service_index)))
{
if((bta_dm_search_cb.p_sdp_db = (tSDP_DISCOVERY_DB *)GKI_getbuf(BTA_DM_SDP_DB_SIZE)) != NULL)
if((bta_dm_search_cb.p_sdp_db = (tSDP_DISCOVERY_DB *)osi_getbuf(BTA_DM_SDP_DB_SIZE)) != NULL)
{
APPL_TRACE_DEBUG("bta_dm_search_cb.services = %04x***********", bta_dm_search_cb.services);
/* try to search all services by search based on L2CAP UUID */
......@@ -2184,7 +2184,7 @@ static void bta_dm_find_services ( BD_ADDR bd_addr)
{
/* if discovery not successful with this device
proceed to next one */
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
osi_freebuf(bta_dm_search_cb.p_sdp_db);
bta_dm_search_cb.p_sdp_db = NULL;
bta_dm_search_cb.service_index = BTA_MAX_SERVICE_ID;
......@@ -2212,7 +2212,7 @@ static void bta_dm_find_services ( BD_ADDR bd_addr)
/* no more services to be discovered */
if(bta_dm_search_cb.service_index >= BTA_MAX_SERVICE_ID)
{
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_DISCOVERY_RESULT_EVT;
p_msg->disc_result.result.disc_res.services = bta_dm_search_cb.services_found;
......@@ -2256,7 +2256,7 @@ static void bta_dm_discover_next_device(void)
/* no devices, search complete */
bta_dm_search_cb.services = 0;
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
......@@ -2404,7 +2404,7 @@ static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
}
/* name discovery and service discovery are done for this device */
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_DISCOVERY_RESULT_EVT;
/* initialize the data structure - includes p_raw_data and raw_data_size */
......@@ -2436,7 +2436,7 @@ static void bta_dm_sdp_callback (UINT16 sdp_status)
tBTA_DM_SDP_RESULT * p_msg;
if ((p_msg = (tBTA_DM_SDP_RESULT *) GKI_getbuf(sizeof(tBTA_DM_SDP_RESULT))) != NULL)
if ((p_msg = (tBTA_DM_SDP_RESULT *) osi_getbuf(sizeof(tBTA_DM_SDP_RESULT))) != NULL)
{
p_msg->hdr.event = BTA_DM_SDP_RESULT_EVT;
p_msg->sdp_result = sdp_status;
......@@ -2516,7 +2516,7 @@ static void bta_dm_inq_cmpl_cb (void * p_result)
if (bta_dm_search_cb.cancel_pending == FALSE)
{
APPL_TRACE_DEBUG("%s", __FUNCTION__);
p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG));
p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG));
if (p_msg != NULL) {
p_msg->inq_cmpl.hdr.event = BTA_DM_INQUIRY_CMPL_EVT;
p_msg->inq_cmpl.num = ((tBTM_INQUIRY_CMPL *)p_result)->num_resp;
......@@ -2528,7 +2528,7 @@ static void bta_dm_inq_cmpl_cb (void * p_result)
bta_dm_search_cb.cancel_pending = FALSE;
bta_dm_search_cancel_notify(NULL);
p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG));
p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG));
if (p_msg != NULL) {
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
......@@ -2623,7 +2623,7 @@ static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name)
}
#endif
if ((p_msg = (tBTA_DM_REM_NAME *) GKI_getbuf(sizeof(tBTA_DM_REM_NAME))) != NULL)
if ((p_msg = (tBTA_DM_REM_NAME *) osi_getbuf(sizeof(tBTA_DM_REM_NAME))) != NULL)
{
bdcpy (p_msg->result.disc_res.bd_addr, bta_dm_search_cb.peer_bdaddr);
BCM_STRNCPY_S((char*)p_msg->result.disc_res.bd_name, sizeof(BD_NAME), (char*)p_remote_name->remote_bd_name, (BD_NAME_LEN));
......@@ -3086,7 +3086,7 @@ static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data)
{
tBTA_DM_ACL_CHANGE * p_msg;
if ((p_msg = (tBTA_DM_ACL_CHANGE *) GKI_getbuf(sizeof(tBTA_DM_ACL_CHANGE))) != NULL)
if ((p_msg = (tBTA_DM_ACL_CHANGE *) osi_getbuf(sizeof(tBTA_DM_ACL_CHANGE))) != NULL)
{
p_msg->event = p_data->event;
p_msg->is_new = FALSE;
......@@ -3148,7 +3148,7 @@ static void bta_dm_acl_change_cback(BD_ADDR p_bda, DEV_CLASS p_dc, BD_NAME p_bdn
UINT8 *features, BOOLEAN is_new)
#endif
{
tBTA_DM_ACL_CHANGE *p_msg = (tBTA_DM_ACL_CHANGE *) GKI_getbuf(sizeof(tBTA_DM_ACL_CHANGE));
tBTA_DM_ACL_CHANGE *p_msg = (tBTA_DM_ACL_CHANGE *) osi_getbuf(sizeof(tBTA_DM_ACL_CHANGE));
if (p_msg != NULL)
{
memset(p_msg, 0, sizeof(tBTA_DM_ACL_CHANGE));
......@@ -3490,7 +3490,7 @@ static void bta_dm_disable_conn_down_timer_cback(timer_entry_t *p_te)
bta_sys_hw_register( BTA_SYS_HW_BLUETOOTH, bta_dm_sys_hw_cback );
/* send a message to BTA SYS */
if ((sys_enable_event = (tBTA_SYS_HW_MSG *) GKI_getbuf(sizeof(tBTA_SYS_HW_MSG))) != NULL)
if ((sys_enable_event = (tBTA_SYS_HW_MSG *) osi_getbuf(sizeof(tBTA_SYS_HW_MSG))) != NULL)
{
sys_enable_event->hdr.event = BTA_SYS_API_DISABLE_EVT;
sys_enable_event->hw_module = BTA_SYS_HW_BLUETOOTH;
......@@ -3820,7 +3820,7 @@ static void bta_dm_set_eir (char *local_name)
#endif // BTA_EIR_CANNED_UUID_LIST
/* Allocate a buffer to hold HCI command */
BT_HDR *p_buf = (BT_HDR *)GKI_getbuf(BTM_CMD_BUF_SIZE);
BT_HDR *p_buf = (BT_HDR *)osi_getbuf(BTM_CMD_BUF_SIZE);
if (p_buf == NULL)
{
APPL_TRACE_ERROR("bta_dm_set_eir couldn't allocate buffer");
......@@ -5531,7 +5531,7 @@ static void bta_dm_gatt_disc_complete(UINT16 conn_id, tBTA_GATT_STATUS status)
bta_dm_search_cb.uuid_to_search = 0;
/* no more services to be discovered */
if ((p_msg = (tBTA_DM_MSG *) GKI_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
if ((p_msg = (tBTA_DM_MSG *) osi_getbuf(sizeof(tBTA_DM_MSG))) != NULL)
{
p_msg->hdr.event = BTA_DM_DISCOVERY_RESULT_EVT;
p_msg->disc_result.result.disc_res.result = (status == BTA_GATT_OK) ? BTA_SUCCESS :BTA_FAILURE;
......@@ -5550,7 +5550,7 @@ static void bta_dm_gatt_disc_complete(UINT16 conn_id, tBTA_GATT_STATUS status)
p_msg->disc_result.result.disc_res.device_type |= BT_DEVICE_TYPE_BLE;
if ( bta_dm_search_cb.ble_raw_used > 0 )
{
p_msg->disc_result.result.disc_res.p_raw_data = GKI_getbuf(bta_dm_search_cb.ble_raw_used);
p_msg->disc_result.result.disc_res.p_raw_data = osi_getbuf(bta_dm_search_cb.ble_raw_used);
memcpy( p_msg->disc_result.result.disc_res.p_raw_data,
bta_dm_search_cb.p_ble_rawdata,
......
This diff is collapsed.
......@@ -22,7 +22,7 @@
*
******************************************************************************/
#include "gki.h"
#include "bt_common.h"
#include "bta_sys.h"
#include "bta_api.h"
#include "bta_dm_int.h"
......@@ -48,7 +48,7 @@ void bta_dm_ci_io_req(BD_ADDR bd_addr, tBTA_IO_CAP io_cap, tBTA_OOB_DATA oob_dat
{
tBTA_DM_CI_IO_REQ *p_msg;
if ((p_msg = (tBTA_DM_CI_IO_REQ *) GKI_getbuf(sizeof(tBTA_DM_CI_IO_REQ))) != NULL)
if ((p_msg = (tBTA_DM_CI_IO_REQ *) osi_getbuf(sizeof(tBTA_DM_CI_IO_REQ))) != NULL)
{
p_msg->hdr.event = BTA_DM_CI_IO_REQ_EVT;
bdcpy(p_msg->bd_addr, bd_addr);
......@@ -74,7 +74,7 @@ void bta_dm_ci_rmt_oob(BOOLEAN accept, BD_ADDR bd_addr, BT_OCTET16 c, BT_OCTET16
{
tBTA_DM_CI_RMT_OOB *p_msg;
if ((p_msg = (tBTA_DM_CI_RMT_OOB *) GKI_getbuf(sizeof(tBTA_DM_CI_RMT_OOB))) != NULL)
if ((p_msg = (tBTA_DM_CI_RMT_OOB *) osi_getbuf(sizeof(tBTA_DM_CI_RMT_OOB))) != NULL)
{
p_msg->hdr.event = BTA_DM_CI_RMT_OOB_EVT;
bdcpy(p_msg->bd_addr, bd_addr);
......@@ -106,7 +106,7 @@ void bta_dm_sco_ci_data_ready(UINT16 event, UINT16 sco_handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
if ((p_buf = (BT_HDR *) osi_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = event;
p_buf->layer_specific = sco_handle;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment