bluetooth: check work_available with retxworker

retxworker would delay when there are many tx hci data

Signed-off-by: chengkai <chengkai@xiaomi.com>
This commit is contained in:
chengkai
2024-03-22 18:11:50 +08:00
committed by Xiang Xiao
parent 946dad5ff0
commit af843eb798

View File

@@ -750,8 +750,12 @@ static int bt_slip_send(FAR struct bt_driver_s *dev,
frame->type = type;
frame->pktlen = len;
memcpy(frame->data, data, len);
work_queue(HPWORK, &priv->retxworker, bt_slip_retx_work,
priv, BT_SLIP_RTX_TIMEOUT);
if (work_available(&priv->retxworker))
{
work_queue(HPWORK, &priv->retxworker, bt_slip_retx_work,
priv, BT_SLIP_RTX_TIMEOUT);
}
end:
nxmutex_unlock(&priv->sliplock);