551-ath9k-indicate-that-the-AR9003-EEPROM-template-value.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From e88ab4a2649d0fbf675193fb2c176f65375bdd2d Mon Sep 17 00:00:00 2001
  2. From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  3. Date: Mon, 3 Oct 2016 00:29:08 +0200
  4. Subject: [v2 PATCH 2/7] ath9k: indicate that the AR9003 EEPROM template values
  5. are little endian
  6. The eepMisc field was not set explicitly. The default value of 0 means
  7. that the values in the EEPROM (template) should be interpreted as little
  8. endian. However, this is not clear until comparing the AR9003 code with
  9. the other EEPROM formats.
  10. To make the code easier to understand we explicitly state that the values
  11. are little endian - there are no functional changes with this patch.
  12. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  13. ---
  14. drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 +++++-----
  15. drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 3 +++
  16. 2 files changed, 8 insertions(+), 5 deletions(-)
  17. --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  18. +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  19. @@ -53,7 +53,7 @@ static const struct ar9300_eeprom ar9300
  20. .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
  21. .opCapFlags = {
  22. .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
  23. - .eepMisc = 0,
  24. + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN,
  25. },
  26. .rfSilent = 0,
  27. .blueToothOptions = 0,
  28. @@ -631,7 +631,7 @@ static const struct ar9300_eeprom ar9300
  29. .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
  30. .opCapFlags = {
  31. .opFlags = AR5416_OPFLAGS_11A,
  32. - .eepMisc = 0,
  33. + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN,
  34. },
  35. .rfSilent = 0,
  36. .blueToothOptions = 0,
  37. @@ -1210,7 +1210,7 @@ static const struct ar9300_eeprom ar9300
  38. .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
  39. .opCapFlags = {
  40. .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
  41. - .eepMisc = 0,
  42. + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN,
  43. },
  44. .rfSilent = 0,
  45. .blueToothOptions = 0,
  46. @@ -1789,7 +1789,7 @@ static const struct ar9300_eeprom ar9300
  47. .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */
  48. .opCapFlags = {
  49. .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
  50. - .eepMisc = 0,
  51. + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN,
  52. },
  53. .rfSilent = 0,
  54. .blueToothOptions = 0,
  55. @@ -2367,7 +2367,7 @@ static const struct ar9300_eeprom ar9300
  56. .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */
  57. .opCapFlags = {
  58. .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A,
  59. - .eepMisc = 0,
  60. + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN,
  61. },
  62. .rfSilent = 0,
  63. .blueToothOptions = 0,
  64. --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
  65. +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
  66. @@ -69,6 +69,9 @@
  67. #define AR9300_BASE_ADDR 0x3ff
  68. #define AR9300_BASE_ADDR_512 0x1ff
  69. +/* AR5416_EEPMISC_BIG_ENDIAN not set indicates little endian */
  70. +#define AR9300_EEPMISC_LITTLE_ENDIAN 0
  71. +
  72. #define AR9300_OTP_BASE \
  73. ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
  74. #define AR9300_OTP_STATUS \