316-ath9k-Remove-some-defined-constants-to-decrease-verb.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. From: Benjamin Berg <[email protected]>
  2. Date: Mon, 4 Jul 2016 14:37:24 +0200
  3. Subject: [PATCH] ath9k: Remove some #defined constants to decrease
  4. verbosity
  5. The removed ATH9K_SLOT_TIME_X constants simply map the value in microseconds
  6. to the same integer. These constants were not used consistently, so fix the
  7. inconsistency issue by replacing all occurances with the integer equivalent.
  8. Signed-off-by: Benjamin Berg <[email protected]>
  9. ---
  10. --- a/drivers/net/wireless/ath/ath9k/beacon.c
  11. +++ b/drivers/net/wireless/ath/ath9k/beacon.c
  12. @@ -50,7 +50,7 @@ static void ath9k_beaconq_config(struct
  13. txq = sc->tx.txq_map[IEEE80211_AC_BE];
  14. ath9k_hw_get_txq_props(ah, txq->axq_qnum, &qi_be);
  15. qi.tqi_aifs = qi_be.tqi_aifs;
  16. - if (ah->slottime == ATH9K_SLOT_TIME_20)
  17. + if (ah->slottime == 20)
  18. qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
  19. else
  20. qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
  21. --- a/drivers/net/wireless/ath/ath9k/dynack.c
  22. +++ b/drivers/net/wireless/ath/ath9k/dynack.c
  23. @@ -280,7 +280,7 @@ EXPORT_SYMBOL(ath_dynack_sample_ack_ts);
  24. void ath_dynack_node_init(struct ath_hw *ah, struct ath_node *an)
  25. {
  26. /* ackto = slottime + sifs + air delay */
  27. - u32 ackto = ATH9K_SLOT_TIME_9 + 16 + 64;
  28. + u32 ackto = 9 + 16 + 64;
  29. struct ath_dynack *da = &ah->dynack;
  30. an->ackto = ackto;
  31. @@ -315,7 +315,7 @@ EXPORT_SYMBOL(ath_dynack_node_deinit);
  32. void ath_dynack_reset(struct ath_hw *ah)
  33. {
  34. /* ackto = slottime + sifs + air delay */
  35. - u32 ackto = ATH9K_SLOT_TIME_9 + 16 + 64;
  36. + u32 ackto = 9 + 16 + 64;
  37. struct ath_dynack *da = &ah->dynack;
  38. da->lto = jiffies;
  39. --- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
  40. +++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
  41. @@ -45,7 +45,7 @@ void ath9k_htc_beaconq_config(struct ath
  42. * Long slot time : 2x cwmin
  43. * Short slot time : 4x cwmin
  44. */
  45. - if (ah->slottime == ATH9K_SLOT_TIME_20)
  46. + if (ah->slottime == 20)
  47. qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
  48. else
  49. qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
  50. --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
  51. +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
  52. @@ -678,7 +678,7 @@ static int ath9k_init_priv(struct ath9k_
  53. for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++)
  54. priv->beacon.bslot[i] = NULL;
  55. - priv->beacon.slottime = ATH9K_SLOT_TIME_9;
  56. + priv->beacon.slottime = 9;
  57. ath9k_cmn_init_channels_rates(common);
  58. ath9k_cmn_init_crypto(ah);
  59. --- a/drivers/net/wireless/ath/ath9k/hw.c
  60. +++ b/drivers/net/wireless/ath/ath9k/hw.c
  61. @@ -454,7 +454,7 @@ static void ath9k_hw_init_defaults(struc
  62. if (AR_SREV_9100(ah))
  63. ah->sta_id1_defaults |= AR_STA_ID1_AR9100_BA_FIX;
  64. - ah->slottime = ATH9K_SLOT_TIME_9;
  65. + ah->slottime = 9;
  66. ah->globaltxtimeout = (u32) -1;
  67. ah->power_mode = ATH9K_PM_UNDEFINED;
  68. ah->htc_reset_init = true;
  69. --- a/drivers/net/wireless/ath/ath9k/init.c
  70. +++ b/drivers/net/wireless/ath/ath9k/init.c
  71. @@ -372,7 +372,7 @@ static void ath9k_init_misc(struct ath_s
  72. common->last_rssi = ATH_RSSI_DUMMY_MARKER;
  73. memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
  74. - sc->beacon.slottime = ATH9K_SLOT_TIME_9;
  75. + sc->beacon.slottime = 9;
  76. for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
  77. sc->beacon.bslot[i] = NULL;
  78. --- a/drivers/net/wireless/ath/ath9k/mac.h
  79. +++ b/drivers/net/wireless/ath/ath9k/mac.h
  80. @@ -65,10 +65,6 @@
  81. #define INIT_SSH_RETRY 32
  82. #define INIT_SLG_RETRY 32
  83. -#define ATH9K_SLOT_TIME_6 6
  84. -#define ATH9K_SLOT_TIME_9 9
  85. -#define ATH9K_SLOT_TIME_20 20
  86. -
  87. #define ATH9K_TXERR_XRETRY 0x01
  88. #define ATH9K_TXERR_FILT 0x02
  89. #define ATH9K_TXERR_FIFO 0x04
  90. --- a/drivers/net/wireless/ath/ath9k/main.c
  91. +++ b/drivers/net/wireless/ath/ath9k/main.c
  92. @@ -926,7 +926,7 @@ static void ath9k_vif_iter(struct ath9k_
  93. }
  94. if (!vif->bss_conf.use_short_slot)
  95. - iter_data->slottime = ATH9K_SLOT_TIME_20;
  96. + iter_data->slottime = 20;
  97. switch (vif->type) {
  98. case NL80211_IFTYPE_AP:
  99. @@ -999,7 +999,7 @@ void ath9k_calculate_iter_data(struct at
  100. */
  101. memset(iter_data, 0, sizeof(*iter_data));
  102. eth_broadcast_addr(iter_data->mask);
  103. - iter_data->slottime = ATH9K_SLOT_TIME_9;
  104. + iter_data->slottime = 9;
  105. list_for_each_entry(avp, &ctx->vifs, list)
  106. ath9k_vif_iter(iter_data, avp->vif->addr, avp->vif);
  107. @@ -1061,7 +1061,7 @@ static void ath9k_set_offchannel_state(s
  108. ah->opmode = vif->type;
  109. ah->imask &= ~ATH9K_INT_SWBA;
  110. ah->imask &= ~ATH9K_INT_TSFOOR;
  111. - ah->slottime = ATH9K_SLOT_TIME_9;
  112. + ah->slottime = 9;
  113. ath_hw_setbssidmask(common);
  114. ath9k_hw_setopmode(ah);
  115. @@ -1788,6 +1788,7 @@ static void ath9k_bss_info_changed(struc
  116. slottime = 9;
  117. else
  118. slottime = 20;
  119. +
  120. if (vif->type == NL80211_IFTYPE_AP) {
  121. /*
  122. * Defer update, so that connected stations can adjust