Skip to content

Commit bb27f05

Browse files
Jordan Yatesdleach02
Jordan Yates
authored andcommitted
bluetooth: hci: spi: 0xFF is a valid payload length
A payload size of 0xFF is valid and should not be a reason to keep looping for more headers. The complete reqiurement is now: ``` header_slave[STATUS_HEADER_READY] == READY_NOW && header_slave[STATUS_HEADER_TOREAD] > 0 ``` This fixes events being dropped when the payload size is 255. Signed-off-by: Jordan Yates <[email protected]>
1 parent 408babb commit bb27f05

File tree

1 file changed

+2
-3
lines changed
  • drivers/bluetooth/hci

1 file changed

+2
-3
lines changed

drivers/bluetooth/hci/spi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ static int bt_spi_get_header(uint8_t op, uint16_t *size)
166166
break;
167167
}
168168
if (reading) {
169-
/* When reading, keep looping if read buffer is not valid */
170-
loop_cond = ((header_slave[STATUS_HEADER_TOREAD] == 0U) ||
171-
(header_slave[STATUS_HEADER_TOREAD] == 0xFF));
169+
/* When reading, keep looping if there is not yet any data */
170+
loop_cond = header_slave[STATUS_HEADER_TOREAD] == 0U;
172171
} else {
173172
/* When writing, keep looping if all bytes are zero */
174173
loop_cond = ((header_slave[1] | header_slave[2] | header_slave[3] |

0 commit comments

Comments
 (0)