// SPDX-License-Identifier: ISC /* Initialize Owl Emulation Devices * * Copyright (C) 2016 Christian Lamparter <chunkeey@gmail.com> * Copyright (C) 2016 Martin Blumenstingl <martin.blumenstingl@googlemail.com> * * Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) * need to be able to initialize the PCIe wifi device. Normally, this is done * during the early stages as a pci quirk. * However, this isn't possible for devices which have the init code for the * Atheros chip stored on UBI Volume on NAND. Hence, this module can be used to * initialize the chip when the user-space is ready to extract the init code.
*/ #include <linux/module.h> #include <linux/completion.h> #include <linux/etherdevice.h> #include <linux/firmware.h> #include <linux/pci.h> #include <linux/delay.h> #include <linux/platform_device.h> #include <linux/nvmem-consumer.h> #include <linux/workqueue.h>
/* also note that we are doing *u16 operations on the file */ if (cal_len > 4096 || cal_len < 0x200 || (cal_len & 1) == 1) {
dev_err(&pdev->dev, "eeprom has an invalid size.\n"); return -EINVAL;
}
if (*cal_data != AR5416_EEPROM_MAGIC) { if (*cal_data != swab16(AR5416_EEPROM_MAGIC)) {
dev_err(&pdev->dev, "invalid calibration data\n"); return -EINVAL;
}
dev_dbg(&pdev->dev, "calibration data needs swapping\n");
swap_needed = true;
}
pci_lock_rescan_remove();
pci_stop_and_remove_bus_device(pdev); /* the device should come back with the proper * ProductId. But we have to initiate a rescan.
*/
pci_rescan_bus(bus);
pci_unlock_rescan_remove();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.