From: Felix Fietkau Date: Sat, 8 Jun 2013 22:56:35 +0000 (+0200) Subject: codegen: work around firmware bug, only accept the first found tlv X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a54ab694cdad2a5b50159a27e2f79df4b4a1e8bd;p=oweals%2Fuqmi.git codegen: work around firmware bug, only accept the first found tlv --- diff --git a/data/gen-code.pl b/data/gen-code.pl index 71b738d..c903d6b 100755 --- a/data/gen-code.pl +++ b/data/gen-code.pl @@ -132,9 +132,12 @@ sub gen_tlv_parse_field($$$$) { } } -sub gen_tlv_type($$) { +sub gen_tlv_type($$$) { my $cname = shift; my $elem = shift; + my $idx = shift; + my $idx_word = "found[".int($idx / 32)."]"; + my $idx_bit = "(1 << ".($idx % 32).")"; my $type = $elem->{"format"}; my $id = $elem->{"id"}; @@ -146,6 +149,10 @@ sub gen_tlv_type($$) { print <{name}); - gen_tlv_type($cname, $field); + gen_tlv_type($cname, $field, $i++); } print <