git: 21b6420f67cf - stable/14 - ath_hal/ar9300: allow JUPITER cards to read eeprom

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 01 Apr 2024 23:47:28 UTC
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=21b6420f67cff32e69452a7e3822af37659eb4b8

commit 21b6420f67cff32e69452a7e3822af37659eb4b8
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-03-12 21:22:36 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-04-01 23:46:10 +0000

    ath_hal/ar9300: allow JUPITER cards to read eeprom
    
    In ar9300_eeprom_read_word() also allow JUPITER cards read the eeprom
    instead of returning an error.  While this will not help all the
    9462, 9485, 9565 OEM cards to work, it will make debugging of the
    next steps a lot easier.
    
    While here fix a typo in the error message if we do not get CAL.
    
    PR:             255337
    Tested by:      John Nielsen (john jnielsen net)
    Reviewed by:    adrian
    
    (cherry picked from commit f254aad33dfb5ce18b6b97b7d036b420310e9ed5)
---
 sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
index 0251222c50b4..073428c8fa71 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
@@ -225,7 +225,7 @@ ar9300_eeprom_restore_something(struct ath_hal *ah, ar9300_eeprom_t *mptr,
 HAL_BOOL
 ar9300_eeprom_read_word(struct ath_hal *ah, u_int off, u_int16_t *data)
 {
-    if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah))
+    if (AR_SREV_OSPREY(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_JUPITER(ah))
     {
         (void) OS_REG_READ(ah, AR9300_EEPROM_OFFSET + (off << AR9300_EEPROM_S));
         if (!ath_hal_wait(ah,
@@ -4319,7 +4319,7 @@ ar9300_eeprom_restore_internal(struct ath_hal *ah, ar9300_eeprom_t *mptr,
     }
 #endif
     if (nptr < 0) {
-        ath_hal_printf(ah, "%s[%d] No vaid CAL, calling default template\n",
+        ath_hal_printf(ah, "%s[%d] No valid CAL, calling default template\n",
             __func__, __LINE__);
         nptr = ar9300_eeprom_restore_something(ah, mptr, mdata_size);
     }