Add API to config QoS

This commit is contained in:
Bao Hong De
2021-01-05 10:32:47 +08:00
committed by Jiang Jiang Jian
parent 0b31f6a5fc
commit 64d30fa6c4
15 changed files with 241 additions and 7 deletions

View File

@@ -1866,7 +1866,7 @@ tBTM_STATUS BTM_SetQoS (BD_ADDR bd, FLOW_SPEC *p_flow, tBTM_CMPL_CB *p_cb)
}
if ( (p = btm_bda_to_acl(bd, BT_TRANSPORT_BR_EDR)) != NULL) {
btu_start_timer (&btm_cb.devcb.qossu_timer, BTU_TTYPE_BTM_ACL, BTM_DEV_REPLY_TIMEOUT);
btu_start_timer (&btm_cb.devcb.qossu_timer, BTU_TTYPE_BTM_QOS, BTM_DEV_REPLY_TIMEOUT);
btm_cb.devcb.p_qossu_cmpl_cb = p_cb;
if (!btsnd_hcic_qos_setup (p->hci_handle, p_flow->qos_flags, p_flow->service_type,
@@ -1907,6 +1907,10 @@ void btm_qos_setup_complete (UINT8 status, UINT16 handle, FLOW_SPEC *p_flow)
memset(&qossu, 0, sizeof(tBTM_QOS_SETUP_CMPL));
qossu.status = status;
qossu.handle = handle;
tACL_CONN *p = btm_handle_to_acl(handle);
if (p != NULL) {
memcpy (qossu.rem_bda, p->remote_addr, BD_ADDR_LEN);
}
if (p_flow != NULL) {
qossu.flow.qos_flags = p_flow->qos_flags;
qossu.flow.service_type = p_flow->service_type;
@@ -1921,6 +1925,22 @@ void btm_qos_setup_complete (UINT8 status, UINT16 handle, FLOW_SPEC *p_flow)
}
}
/*******************************************************************************
**
** Function btm_qos_setup_timeout
**
** Description This function processes a timeout.
** Currently, we just report an error log
**
** Returns void
**
*******************************************************************************/
void btm_qos_setup_timeout (void *p_tle)
{
BTM_TRACE_DEBUG ("%s\n", __func__);
btm_qos_setup_complete (HCI_ERR_HOST_TIMEOUT, 0, NULL);
}
/*******************************************************************************
**

View File

@@ -1068,6 +1068,7 @@ void btm_sco_process_num_completed_pkts (UINT8 *p);
#define btm_sco_chk_pend_unpark(hci_status, hci_handle)
#endif /* BTM_SCO_INCLUDED */
void btm_qos_setup_complete (UINT8 status, UINT16 handle, FLOW_SPEC *p_flow);
void btm_qos_setup_timeout (void *p_tle);
/* Internal functions provided by btm_sco.c

View File

@@ -385,17 +385,17 @@ static void btu_general_alarm_process(void *param)
}
break;
default:;
int i = 0;
BOOLEAN handled = FALSE;
for (; !handled && i < BTU_MAX_REG_TIMER; i++) {
case BTU_TTYPE_BTM_QOS:
btm_qos_setup_timeout(p_tle);
break;
default:
for (int i = 0; i < BTU_MAX_REG_TIMER; i++) {
if (btu_cb.timer_reg[i].timer_cb == NULL) {
continue;
}
if (btu_cb.timer_reg[i].p_tle == p_tle) {
btu_cb.timer_reg[i].timer_cb(p_tle);
handled = TRUE;
break;
}
}
break;

View File

@@ -765,6 +765,7 @@ typedef struct {
FLOW_SPEC flow;
UINT16 handle;
UINT8 status;
BD_ADDR rem_bda;
} tBTM_QOS_SETUP_CMPL;

View File

@@ -164,6 +164,9 @@ typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
#define BTU_TTYPE_UCD_TO 108
#define BTU_TTYPE_BLE_SCAN 109
/* BTU internal timer for QOS */
#define BTU_TTYPE_BTM_QOS 110
/* BTU Task Signal */
typedef enum {
SIG_BTU_START_UP = 0,