550-ath9k-Add-a-define-for-the-EEPROM-eepmisc-endianness.patch 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. From 9692ab1ff30ae0abc1000d11b2f929b6e2e4cb7f Mon Sep 17 00:00:00 2001
  2. From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  3. Date: Mon, 3 Oct 2016 00:29:07 +0200
  4. Subject: [v2 PATCH 1/7] ath9k: Add a #define for the EEPROM "eepmisc" endianness
  5. bit
  6. This replaces a magic number with a named #define. Additionally it
  7. removes two "eeprom format" specific #defines for the "big endianness"
  8. bit which are the same on all eeprom formats.
  9. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  10. ---
  11. drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 3 ++-
  12. drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 1 -
  13. drivers/net/wireless/ath/ath9k/eeprom.h | 4 +++-
  14. drivers/net/wireless/ath/ath9k/eeprom_4k.c | 2 +-
  15. drivers/net/wireless/ath/ath9k/eeprom_9287.c | 2 +-
  16. drivers/net/wireless/ath/ath9k/eeprom_def.c | 2 +-
  17. 6 files changed, 8 insertions(+), 6 deletions(-)
  18. --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  19. +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
  20. @@ -3468,7 +3468,8 @@ static u32 ath9k_hw_ar9003_dump_eeprom(s
  21. AR5416_OPFLAGS_N_5G_HT20));
  22. PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags.opFlags &
  23. AR5416_OPFLAGS_N_5G_HT40));
  24. - PR_EEP("Big Endian", !!(pBase->opCapFlags.eepMisc & 0x01));
  25. + PR_EEP("Big Endian", !!(pBase->opCapFlags.eepMisc &
  26. + AR5416_EEPMISC_BIG_ENDIAN));
  27. PR_EEP("RF Silent", pBase->rfSilent);
  28. PR_EEP("BT option", pBase->blueToothOptions);
  29. PR_EEP("Device Cap", pBase->deviceCap);
  30. --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
  31. +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
  32. @@ -38,7 +38,6 @@
  33. #define AR9300_NUM_CTLS_2G 12
  34. #define AR9300_NUM_BAND_EDGES_5G 8
  35. #define AR9300_NUM_BAND_EDGES_2G 4
  36. -#define AR9300_EEPMISC_BIG_ENDIAN 0x01
  37. #define AR9300_EEPMISC_WOW 0x02
  38. #define AR9300_CUSTOMER_DATA_SIZE 20
  39. --- a/drivers/net/wireless/ath/ath9k/eeprom.h
  40. +++ b/drivers/net/wireless/ath/ath9k/eeprom.h
  41. @@ -161,6 +161,9 @@
  42. #define AR5416_EEP_TXGAIN_ORIGINAL 0
  43. #define AR5416_EEP_TXGAIN_HIGH_POWER 1
  44. +/* Endianness of EEPROM content */
  45. +#define AR5416_EEPMISC_BIG_ENDIAN 0x01
  46. +
  47. #define AR5416_EEP4K_START_LOC 64
  48. #define AR5416_EEP4K_NUM_2G_CAL_PIERS 3
  49. #define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS 3
  50. @@ -191,7 +194,6 @@
  51. #define AR9287_NUM_CTLS 12
  52. #define AR9287_NUM_BAND_EDGES 4
  53. #define AR9287_PD_GAIN_ICEPTS 1
  54. -#define AR9287_EEPMISC_BIG_ENDIAN 0x01
  55. #define AR9287_EEPMISC_WOW 0x02
  56. #define AR9287_MAX_CHAINS 2
  57. #define AR9287_ANT_16S 32
  58. --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  59. +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  60. @@ -154,7 +154,7 @@ static u32 ath9k_hw_4k_dump_eeprom(struc
  61. AR5416_OPFLAGS_N_5G_HT20));
  62. PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags &
  63. AR5416_OPFLAGS_N_5G_HT40));
  64. - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01));
  65. + PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN));
  66. PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF);
  67. PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF);
  68. PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
  69. --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  70. +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  71. @@ -150,7 +150,7 @@ static u32 ath9k_hw_ar9287_dump_eeprom(s
  72. AR5416_OPFLAGS_N_5G_HT20));
  73. PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags &
  74. AR5416_OPFLAGS_N_5G_HT40));
  75. - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01));
  76. + PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN));
  77. PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF);
  78. PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF);
  79. PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
  80. --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
  81. +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
  82. @@ -232,7 +232,7 @@ static u32 ath9k_hw_def_dump_eeprom(stru
  83. AR5416_OPFLAGS_N_5G_HT20));
  84. PR_EEP("Disable 5Ghz HT40", !!(pBase->opCapFlags &
  85. AR5416_OPFLAGS_N_5G_HT40));
  86. - PR_EEP("Big Endian", !!(pBase->eepMisc & 0x01));
  87. + PR_EEP("Big Endian", !!(pBase->eepMisc & AR5416_EEPMISC_BIG_ENDIAN));
  88. PR_EEP("Cal Bin Major Ver", (pBase->binBuildNumber >> 24) & 0xFF);
  89. PR_EEP("Cal Bin Minor Ver", (pBase->binBuildNumber >> 16) & 0xFF);
  90. PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);