"""
# A small script to dump the contents of a brcm80211 initvals section
#
-# Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>
+# Copyright (C) 2010 Michael Buesch <m@bues.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
print "brcm80211 initvals section dumper"
print "Prints a .initvals assembly section to stdout."
print ""
- print "Copyright (C) 2010 Michael Buesch <mb@bu3sch.de>"
+ print "Copyright (C) 2010 Michael Buesch <m@bues.ch>"
print "Licensed under the GNU/GPL version 2"
print ""
print "Usage: brcm80211-ivaldump FILE"
if size == 4:
print "\tmmio32\t0x%08X, 0x%04X" % (value, addr)
elif size == 2:
- print "\tmmio16\t0x%08X, 0x%04X" % (value, addr)
+ if value & 0xFFFF0000:
+ print "The input file is malformed (invalid value for 16bit field)"
+ sys.exit(1)
+ print "\tmmio16\t0x%04X, 0x%04X" % (value, addr)
else:
print "The input file is malformed (invalid size field: 0x%04X)" % size
sys.exit(1)