component/bt : remove all GKI reference

1. remove GKI(not use osi_free_and_reset)
2. modify mutex/semaphore to individual directory
3. set osi_malloc as malloc(previously use calloc)
4. change osi allocator debug osi_free
5. fix rebase of remove GKI
This commit is contained in:
Tian Hao
2017-08-17 21:13:45 +08:00
parent fc85cb683d
commit e4f63819a1
179 changed files with 2565 additions and 3599 deletions

View File

@@ -24,7 +24,6 @@
#include <stddef.h>
#include "bt_target.h"
#include "gki.h"
#include "rfcdefs.h"
#include "port_api.h"
#include "l2c_api.h"
@@ -44,7 +43,7 @@ void rfc_send_sabme (tRFC_MCB *p_mcb, UINT8 dlci)
UINT8 *p_data;
UINT8 cr = RFCOMM_CR(p_mcb->is_initiator, TRUE);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -77,7 +76,7 @@ void rfc_send_ua (tRFC_MCB *p_mcb, UINT8 dlci)
UINT8 *p_data;
UINT8 cr = RFCOMM_CR(p_mcb->is_initiator, FALSE);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -110,7 +109,7 @@ void rfc_send_dm (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN pf)
UINT8 *p_data;
UINT8 cr = RFCOMM_CR(p_mcb->is_initiator, FALSE);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -143,7 +142,7 @@ void rfc_send_disc (tRFC_MCB *p_mcb, UINT8 dlci)
UINT8 *p_data;
UINT8 cr = RFCOMM_CR(p_mcb->is_initiator, TRUE);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -234,7 +233,7 @@ void rfc_send_pn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command, UINT16 mtu, U
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -281,7 +280,7 @@ void rfc_send_fcon (tRFC_MCB *p_mcb, BOOLEAN is_command)
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -310,7 +309,7 @@ void rfc_send_fcoff (tRFC_MCB *p_mcb, BOOLEAN is_command)
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -346,7 +345,7 @@ void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
signals = p_pars->modem_signal;
break_duration = p_pars->break_signal;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -394,7 +393,7 @@ void rfc_send_rls (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command, UINT8 status
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -426,7 +425,7 @@ void rfc_send_nsc (tRFC_MCB *p_mcb)
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -460,7 +459,7 @@ void rfc_send_rpn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
BT_HDR *p_buf;
UINT8 *p_data;
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -548,7 +547,7 @@ void rfc_send_credit(tRFC_MCB *p_mcb, UINT8 dlci, UINT8 credit)
UINT8 *p_data;
UINT8 cr = RFCOMM_CR(p_mcb->is_initiator, TRUE);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (RFCOMM_CMD_POOL_ID)) == NULL) {
if ((p_buf = (BT_HDR *)osi_malloc(RFCOMM_CMD_BUF_SIZE)) == NULL) {
return;
}
@@ -701,7 +700,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
if (!p_rx_frame->ea || !length) {
RFCOMM_TRACE_ERROR ("Illegal MX Frame ea:%d len:%d", p_rx_frame->ea, length);
GKI_freebuf (p_buf);
osi_free (p_buf);
return;
}
@@ -721,7 +720,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
if (mx_len != length) {
RFCOMM_TRACE_ERROR ("Bad MX frame");
GKI_freebuf (p_buf);
osi_free (p_buf);
return;
}
@@ -749,7 +748,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
break;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_pn (p_mcb, is_command, p_rx_frame);
return;
@@ -777,7 +776,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
break;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_fcon (p_mcb, is_command);
return;
@@ -787,7 +786,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
break;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_fcoff (p_mcb, is_command);
return;
@@ -813,7 +812,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
p_rx_frame->u.msc.break_present = FALSE;
p_rx_frame->u.msc.break_duration = 0;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_msc (p_mcb, is_command, p_rx_frame);
return;
@@ -827,7 +826,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
p_rx_frame->u.nsc.cr = (*p_data & RFCOMM_CR_MASK) >> RFCOMM_SHIFT_CR;
p_rx_frame->u.nsc.type = *p_data++ >> RFCOMM_SHIFT_DLCI;
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_nsc (p_mcb, p_rx_frame);
return;
@@ -861,7 +860,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
p_rx_frame->u.rpn.xoff_char = *p_data++;
p_rx_frame->u.rpn.param_mask = (*p_data + (*(p_data + 1) << 8)) & RFCOMM_RPN_PM_MASK;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_rpn (p_mcb, is_command, p_rx_frame->u.rpn.is_request, p_rx_frame);
return;
@@ -883,13 +882,13 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
break;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
rfc_process_rls (p_mcb, is_command, p_rx_frame);
return;
}
GKI_freebuf (p_buf);
osi_free (p_buf);
if (is_command) {
rfc_send_nsc (p_mcb);