#!/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() n value='author'>author
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-10-25 17:40:35 +0100
committerJani Nikula <jani.nikula@intel.com>2016-10-28 15:24:04 +0300
commit6d9deb910c8eee8728129326dc88ec109b03b135 (patch)
tree8e50495dc6c1683b36f3cd2b74ab0984d336d23b
parente3b9e6e3a989904ae062e7a48a9431edc837ea6b (diff)
drm/i915: Rotated view does not need a fence
We do not need to set up a fence for the rotated view. Display does not need it and no one can access it. v2: Move code to __i915_vma_set_map_and_fenceable. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Fixes: 05a20d098db1 ("drm/i915: Move map-and-fenceable tracking to the VMA") Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit 07ee2bce6a516e0218dba22581803cb8f11bcf82) Signed-off-by: Jani Nikula <jani.nikula@intel.com>