# SPDX-License-Identifier: MIT import logging, struct from .core import FWFile log = logging.getLogger("asahi_firmware.asmedia") MAGIC = b"2214A_RCFG" def extract_asmedia(kernel): try: off = kernel.index(MAGIC) except ValueError: raise Exception("Could not find ASMedia firmware") size = struct.unpack("