bluetooth:fix h5 ack to controller timeout

h5 ack which send to controller always timeout, which causing
controller would send repend hci data until host send back h5 ack.

Signed-off-by: chengkai <chengkai@xiaomi.com>
This commit is contained in:
chengkai 2023-11-22 21:49:22 +08:00 committed by Xiang Xiao
parent c55fcb59b8
commit f0b7f48adf
1 changed files with 3 additions and 8 deletions

View File

@ -73,7 +73,6 @@
#define H5_SET_TYPE(hdr, type) ((hdr)[1] |= (type))
#define H5_SET_LEN(hdr, len) (((hdr)[1] |= ((len)&0x0f) << 4), ((hdr)[2] |= (len) >> 4))
#define H5_ACK_TIMEOUT MSEC2TICK(250) /* 250ms */
#define H5_RTX_TIMEOUT MSEC2TICK(150) /* 150ms */
union bt_hdr_u
@ -466,11 +465,7 @@ h5_recv_handle(FAR struct uart_bth5_s *dev)
if (H5_HDR_RELIABLE(hdr))
{
dev->txack = (dev->txack + 1) & 0x07;
if (work_available(&dev->ackworker))
{
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev,
H5_ACK_TIMEOUT);
}
h5_ack_work(dev);
}
dev->rxack = H5_HDR_ACK(hdr);
@ -563,7 +558,7 @@ h5_rx_header(FAR struct uart_bth5_s *dev, uint8_t c)
if (H5_HDR_RELIABLE(hdr) && H5_HDR_SEQ(hdr) != dev->txack)
{
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev, 0);
h5_ack_work(dev);
h5_rx_reset(dev);
return -EINVAL;
}
@ -1114,7 +1109,7 @@ uart_bth5_write(FAR struct file *filep, FAR const char *buffer,
if (h5_unack_size(&dev->unackpool) > dev->txwin)
{
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev, 0);
h5_ack_work(dev);
if (filep->f_oflags & O_NONBLOCK)
{
ret = -EAGAIN;