Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65dc1a5d authored by Felix Fietkau's avatar Felix Fietkau Committed by Kalle Valo
Browse files

ath9k_hw: ignore eeprom magic mismatch on flash based devices



Many AR913x based devices (maybe others too) do not have a valid EEPROM
magic in their calibration data partition.

Fixes: 6fa658fd ("ath9k: Simplify and fix eeprom endianness swapping")
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Acked-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent e0045bf8
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -150,18 +150,18 @@ int ath9k_hw_nvram_swap_data(struct ath_hw *ah, bool *swap_needed, int size)
		return -EIO;
	}

	if (magic == AR5416_EEPROM_MAGIC) {
	*swap_needed = false;
	} else if (swab16(magic) == AR5416_EEPROM_MAGIC) {
	if (swab16(magic) == AR5416_EEPROM_MAGIC) {
		if (ah->ah_flags & AH_NO_EEP_SWAP) {
			ath_info(common,
				 "Ignoring endianness difference in EEPROM magic bytes.\n");

			*swap_needed = false;
		} else {
			*swap_needed = true;
		}
	} else {
	} else if (magic != AR5416_EEPROM_MAGIC) {
		if (ath9k_hw_use_flash(ah))
			return 0;

		ath_err(common,
			"Invalid EEPROM Magic (0x%04x).\n", magic);
		return -EINVAL;