summaryrefslogtreecommitdiffstats
path: root/tools/csr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/csr.c')
-rw-r--r--tools/csr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/csr.c b/tools/csr.c
index 6ed0a08f..d1932cf4 100644
--- a/tools/csr.c
+++ b/tools/csr.c
@@ -401,7 +401,7 @@ char *csr_pskeytostr(uint16_t pskey)
int csr_read_varid_complex(int dd, uint16_t seqnum, uint16_t varid, uint8_t *value, uint16_t length)
{
- unsigned char cmd[] = { 0x00, 0x00, (length + 5) & 0xff, (length + 5) >> 8,
+ unsigned char cmd[] = { 0x00, 0x00, ((length / 2) + 5) & 0xff, ((length / 2) + 5) >> 8,
seqnum & 0xff, seqnum >> 8, varid & 0xff, varid >> 8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };