Skip to content

Commit f0b7f48

Browse files
chengkai15xiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent c55fcb5 commit f0b7f48

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/serial/uart_bth5.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
#define H5_SET_TYPE(hdr, type) ((hdr)[1] |= (type))
7474
#define H5_SET_LEN(hdr, len) (((hdr)[1] |= ((len)&0x0f) << 4), ((hdr)[2] |= (len) >> 4))
7575

76-
#define H5_ACK_TIMEOUT MSEC2TICK(250) /* 250ms */
7776
#define H5_RTX_TIMEOUT MSEC2TICK(150) /* 150ms */
7877

7978
union bt_hdr_u
@@ -466,11 +465,7 @@ h5_recv_handle(FAR struct uart_bth5_s *dev)
466465
if (H5_HDR_RELIABLE(hdr))
467466
{
468467
dev->txack = (dev->txack + 1) & 0x07;
469-
if (work_available(&dev->ackworker))
470-
{
471-
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev,
472-
H5_ACK_TIMEOUT);
473-
}
468+
h5_ack_work(dev);
474469
}
475470

476471
dev->rxack = H5_HDR_ACK(hdr);
@@ -563,7 +558,7 @@ h5_rx_header(FAR struct uart_bth5_s *dev, uint8_t c)
563558

564559
if (H5_HDR_RELIABLE(hdr) && H5_HDR_SEQ(hdr) != dev->txack)
565560
{
566-
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev, 0);
561+
h5_ack_work(dev);
567562
h5_rx_reset(dev);
568563
return -EINVAL;
569564
}
@@ -1114,7 +1109,7 @@ uart_bth5_write(FAR struct file *filep, FAR const char *buffer,
11141109

11151110
if (h5_unack_size(&dev->unackpool) > dev->txwin)
11161111
{
1117-
work_queue(HPWORK, &dev->ackworker, h5_ack_work, dev, 0);
1112+
h5_ack_work(dev);
11181113
if (filep->f_oflags & O_NONBLOCK)
11191114
{
11201115
ret = -EAGAIN;

0 commit comments

Comments
 (0)