summaryrefslogtreecommitdiff
path: root/hsspi_uci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hsspi_uci.c')
-rw-r--r--hsspi_uci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hsspi_uci.c b/hsspi_uci.c
index 0738e34..0d85591 100644
--- a/hsspi_uci.c
+++ b/hsspi_uci.c
@@ -108,7 +108,8 @@ static void uci_sent(struct hsspi_layer *hlayer, struct hsspi_block *blk,
static size_t get_payload_size_from_header(const u8 *header)
{
- bool is_control_packet = (header[0] >> 7) == 0;
+ bool is_data_packet = ((header[0] >> 5) & 0x07) == 0;
+ bool is_control_packet = !is_data_packet && ((header[0] >> 7) == 0);
if (is_control_packet)
return header[UCI_CONTROL_PACKET_PAYLOAD_SIZE_LOCATION];