#!/usr/bin/env python # -*- coding: utf-8 -*- # # update-oui.py -- update netsniff-ng oui.conf from official IEEE OUI list # # Copyright (C) 2013 Tobias Klauser # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. import os import sys import re import getopt try: from urllib2 import urlopen # Python 2.x except ImportError: from urllib.request import urlopen # Python 3.x DEFAULT_OUPUT_FILE = "oui.conf" DEFAULT_OUI_URL = "http://standards.ieee.org/develop/regauth/oui/oui.txt" OUI_PATTERN = re.compile(b"^\s*([a-fA-F0-9]{2})-([a-fA-F0-9]{2})-([a-fA-F0-9]{2})\s+\(hex\)\s+(.*)$") def usage(): print("""usage: {0} [OPTION...] available options: -f force overwrite of existing file -o set output file (default: {1}) -u set URL to fetch OUI list from (default: {2}) -h show this help and exit""".format(os.path.basename(sys.argv[0]), DEFAULT_OUPUT_FILE, DEFAULT_OUI_URL)) def main(): try: opts, args = getopt.getopt(sys.argv[1:], "fo:u:h") except getopt.GetoptError as err: print(str(err)) usage() sys.exit(-1) overwrite = False output_file = DEFAULT_OUPUT_FILE oui_url = DEFAULT_OUI_URL for o, a in opts: if o == '-f': overwrite = True elif o == '-o': output_file = a elif o == '-u': oui_url = a elif o == '-h': usage() sys.exit(0) else: assert False, "unhandled option" if not overwrite and os.path.exists(output_file): print("Error: output file {} already exists".format(output_file)) sys.exit(-1) print("Updating OUI information in {} from {}... ".format(output_file, oui_url)) fh_url = urlopen(oui_url) ouis = [] for line in fh_url: m = OUI_PATTERN.match(line) if m: oui = "0x{}{}{}".format(m.group(1), m.group(2), m.group(3)) vendor = m.group(4).rstrip() ouis.append((oui, vendor)) fh_file = open(output_file, 'w') for oui, vendor in sorted(ouis): fh_file.write("{}, {}\n".format(oui, vendor)) fh_url.close() fh_file.close() print("{} OUIs written to {}".format(len(ouis), output_file)) if __name__ == '__main__': main() ='10' name='q' value=''/>
path: root/sound/soc
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2016-09-19 21:30:28 +0200
committerMark Brown <broonie@kernel.org>2016-09-20 18:55:35 +0100
commitbfcf928d7604692668a7c33b783d05b8e3459d09 (patch)
tree43f14d6b3bb4976500d9b93b1f290a92af6f96bc /sound/soc
parent35ddb15757cd1c817e424c6252d2f11f268cfebf (diff)
ASoC: fsl_ssi: use flat regmap cache
Same as commit ce492b3b8f99cf9d2f807ec22d8805c996a09503 Subject: drm/fsl-dcu: use flat regmap cache Using flat regmap cache instead of RB-tree to avoid the following lockdep warning on driver load: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2871 lockdep_trace_alloc+0x104/0x128 DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) The RB-tree regmap cache needs to allocate new space on first writes. However, allocations in an atomic context (e.g. when a spinlock is held) are not allowed. The function regmap_write calls map->lock, which acquires a spinlock in the fast_io case. Since the driver uses MMIO, the regmap bus of type regmap_mmio is being used which has fast_io set to true. Signed-off-by: Marek Vasut <marex@denx.de> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')