mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
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:
@@ -23,7 +23,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "bt_target.h"
|
||||
#include "gki.h"
|
||||
|
||||
#include "btm_api.h"
|
||||
#include "btm_int.h"
|
||||
@@ -165,12 +164,13 @@ tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator)
|
||||
p_mcb = &rfc_cb.port.rfc_mcb[j];
|
||||
if (rfc_cb.port.rfc_mcb[j].state == RFC_MX_STATE_IDLE) {
|
||||
/* New multiplexer control block */
|
||||
fixed_queue_free(p_mcb->cmd_q, NULL);
|
||||
memset (p_mcb, 0, sizeof (tRFC_MCB));
|
||||
memcpy (p_mcb->bd_addr, bd_addr, BD_ADDR_LEN);
|
||||
RFCOMM_TRACE_DEBUG("rfc_alloc_multiplexer_channel:is_initiator:%d, create new p_mcb:%p, index:%d",
|
||||
is_initiator, &rfc_cb.port.rfc_mcb[j], j);
|
||||
|
||||
GKI_init_q(&p_mcb->cmd_q);
|
||||
p_mcb->cmd_q = fixed_queue_new(SIZE_MAX);
|
||||
|
||||
p_mcb->is_initiator = is_initiator;
|
||||
|
||||
@@ -194,13 +194,11 @@ tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator)
|
||||
*******************************************************************************/
|
||||
void rfc_release_multiplexer_channel (tRFC_MCB *p_mcb)
|
||||
{
|
||||
void *p_buf;
|
||||
|
||||
rfc_timer_stop (p_mcb);
|
||||
|
||||
while ((p_buf = GKI_dequeue(&p_mcb->cmd_q)) != NULL) {
|
||||
GKI_freebuf(p_buf);
|
||||
}
|
||||
|
||||
fixed_queue_free(p_mcb->cmd_q, osi_free);
|
||||
|
||||
memset (p_mcb, 0, sizeof (tRFC_MCB));
|
||||
p_mcb->state = RFC_MX_STATE_IDLE;
|
||||
@@ -457,12 +455,17 @@ void rfc_check_send_cmd(tRFC_MCB *p_mcb, BT_HDR *p_buf)
|
||||
|
||||
/* if passed a buffer queue it */
|
||||
if (p_buf != NULL) {
|
||||
GKI_enqueue(&p_mcb->cmd_q, p_buf);
|
||||
if (p_mcb->cmd_q == NULL) {
|
||||
RFCOMM_TRACE_ERROR("%s: empty queue: p_mcb = %p p_mcb->lcid = %u cached p_mcb = %p",
|
||||
__func__, p_mcb, p_mcb->lcid,
|
||||
rfc_find_lcid_mcb(p_mcb->lcid));
|
||||
}
|
||||
fixed_queue_enqueue(p_mcb->cmd_q, p_buf);
|
||||
}
|
||||
|
||||
/* handle queue if L2CAP not congested */
|
||||
while (p_mcb->l2cap_congested == FALSE) {
|
||||
if ((p = (BT_HDR *) GKI_dequeue(&p_mcb->cmd_q)) == NULL) {
|
||||
if ((p = (BT_HDR *)fixed_queue_try_dequeue(p_mcb->cmd_q)) == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user