1
0

553-ath9k-replace-eeprom_param-EEP_MINOR_REV-with-get_ee.patch 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. From 9f247f908d5166e16e1cc6a50b0901e0f6733410 Mon Sep 17 00:00:00 2001
  2. From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  3. Date: Mon, 3 Oct 2016 00:29:10 +0200
  4. Subject: [v2 PATCH 4/7] ath9k: replace eeprom_param EEP_MINOR_REV with
  5. get_eeprom_rev
  6. get_eeprom(ah, EEP_MINOR_REV) and get_eeprom_rev(ah) are both doing the
  7. same thing: returning the EEPROM revision (12 lowest bits). Make the
  8. code consistent by using get_eeprom_rev(ah) everywhere.
  9. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  10. ---
  11. drivers/net/wireless/ath/ath9k/ar5008_phy.c | 2 +-
  12. drivers/net/wireless/ath/ath9k/ar9002_hw.c | 6 ++----
  13. drivers/net/wireless/ath/ath9k/eeprom.h | 1 -
  14. drivers/net/wireless/ath/ath9k/eeprom_4k.c | 5 -----
  15. drivers/net/wireless/ath/ath9k/eeprom_9287.c | 6 +-----
  16. drivers/net/wireless/ath/ath9k/eeprom_def.c | 2 --
  17. 6 files changed, 4 insertions(+), 18 deletions(-)
  18. --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  19. +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
  20. @@ -524,7 +524,7 @@ static bool ar5008_hw_set_rf_regs(struct
  21. return true;
  22. /* Setup rf parameters */
  23. - eepMinorRev = ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV);
  24. + eepMinorRev = ah->eep_ops->get_eeprom_rev(ah);
  25. for (i = 0; i < ah->iniBank6.ia_rows; i++)
  26. ah->analogBank6Data[i] = INI_RA(&ah->iniBank6, i, modesIndex);
  27. --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
  28. +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
  29. @@ -108,8 +108,7 @@ static void ar9280_20_hw_init_rxgain_ini
  30. {
  31. u32 rxgain_type;
  32. - if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
  33. - AR5416_EEP_MINOR_VER_17) {
  34. + if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_17) {
  35. rxgain_type = ah->eep_ops->get_eeprom(ah, EEP_RXGAIN_TYPE);
  36. if (rxgain_type == AR5416_EEP_RXGAIN_13DB_BACKOFF)
  37. @@ -129,8 +128,7 @@ static void ar9280_20_hw_init_rxgain_ini
  38. static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type)
  39. {
  40. - if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
  41. - AR5416_EEP_MINOR_VER_19) {
  42. + if (ah->eep_ops->get_eeprom_rev(ah) >= AR5416_EEP_MINOR_VER_19) {
  43. if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
  44. INIT_INI_ARRAY(&ah->iniModesTxGain,
  45. ar9280Modes_high_power_tx_gain_9280_2);
  46. --- a/drivers/net/wireless/ath/ath9k/eeprom.h
  47. +++ b/drivers/net/wireless/ath/ath9k/eeprom.h
  48. @@ -230,7 +230,6 @@ enum eeprom_param {
  49. EEP_DB_5,
  50. EEP_OB_2,
  51. EEP_DB_2,
  52. - EEP_MINOR_REV,
  53. EEP_TX_MASK,
  54. EEP_RX_MASK,
  55. EEP_FSTCLK_5G,
  56. --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  57. +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
  58. @@ -254,9 +254,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct
  59. struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
  60. struct modal_eep_4k_header *pModal = &eep->modalHeader;
  61. struct base_eep_header_4k *pBase = &eep->baseEepHeader;
  62. - u16 ver_minor;
  63. -
  64. - ver_minor = pBase->version & AR5416_EEP_VER_MINOR_MASK;
  65. switch (param) {
  66. case EEP_NFTHRESH_2:
  67. @@ -279,8 +276,6 @@ static u32 ath9k_hw_4k_get_eeprom(struct
  68. return pModal->ob_0;
  69. case EEP_DB_2:
  70. return pModal->db1_1;
  71. - case EEP_MINOR_REV:
  72. - return ver_minor;
  73. case EEP_TX_MASK:
  74. return pBase->txMask;
  75. case EEP_RX_MASK:
  76. --- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  77. +++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
  78. @@ -250,9 +250,7 @@ static u32 ath9k_hw_ar9287_get_eeprom(st
  79. struct ar9287_eeprom *eep = &ah->eeprom.map9287;
  80. struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
  81. struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
  82. - u16 ver_minor;
  83. -
  84. - ver_minor = pBase->version & AR9287_EEP_VER_MINOR_MASK;
  85. + u16 ver_minor = ath9k_hw_ar9287_get_eeprom_rev(ah);
  86. switch (param) {
  87. case EEP_NFTHRESH_2:
  88. @@ -271,8 +269,6 @@ static u32 ath9k_hw_ar9287_get_eeprom(st
  89. return pBase->opCapFlags;
  90. case EEP_RF_SILENT:
  91. return pBase->rfSilent;
  92. - case EEP_MINOR_REV:
  93. - return ver_minor;
  94. case EEP_TX_MASK:
  95. return pBase->txMask;
  96. case EEP_RX_MASK:
  97. --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
  98. +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
  99. @@ -380,8 +380,6 @@ static u32 ath9k_hw_def_get_eeprom(struc
  100. return pModal[1].ob;
  101. case EEP_DB_2:
  102. return pModal[1].db;
  103. - case EEP_MINOR_REV:
  104. - return AR5416_VER_MASK;
  105. case EEP_TX_MASK:
  106. return pBase->txMask;
  107. case EEP_RX_MASK: