board-descriptor: allow 0xffff as end tag
with latest nmhw21 boards 0xffff have been introduced as a new end tag (with or without intention). Tag 65535 is now handled the same way as Tag 0 (aka end-tag). BugzId: 55411 Signed-off-by: Patrick Zysset <patrick.zysset@netmodule.com>
This commit is contained in:
parent
adb53649bc
commit
18bf58e094
|
|
@ -155,10 +155,10 @@ class _BdRaw:
|
||||||
j = 0
|
j = 0
|
||||||
self.tlvs = []
|
self.tlvs = []
|
||||||
while i < self.buffer_len + 8:
|
while i < self.buffer_len + 8:
|
||||||
# Zero means end of bd
|
# Zero or 0xffff means end of bd
|
||||||
tag = self._get_hw(data[i:i + 2])
|
tag = self._get_hw(data[i:i + 2])
|
||||||
i += 2
|
i += 2
|
||||||
if tag == 0:
|
if tag == 0 or tag == 0xffff:
|
||||||
i -= 2
|
i -= 2
|
||||||
break
|
break
|
||||||
length = self._get_hw(data[i:i + 2])
|
length = self._get_hw(data[i:i + 2])
|
||||||
|
|
@ -175,7 +175,7 @@ class _BdRaw:
|
||||||
|
|
||||||
data_length = self._read_binary(data)
|
data_length = self._read_binary(data)
|
||||||
|
|
||||||
if self.checksum != 0:
|
if self.checksum != 0 and self.checksum != 0xffff:
|
||||||
self._verify_checksum(data[8:data_length], self.checksum)
|
self._verify_checksum(data[8:data_length], self.checksum)
|
||||||
else:
|
else:
|
||||||
self.is_writable = True
|
self.is_writable = True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue