306-ath9k-Unify-reset-API.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. From: Sujith Manoharan <[email protected]>
  2. Date: Fri, 17 Oct 2014 07:40:11 +0530
  3. Subject: [PATCH] ath9k: Unify reset API
  4. Instead of having ath_reset_internal() and ath_reset()
  5. as two separate calls to perform a HW reset, have
  6. one function. This makes sure that the behavior will
  7. be the same at all callsites.
  8. Signed-off-by: Sujith Manoharan <[email protected]>
  9. ---
  10. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  11. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  12. @@ -540,7 +540,6 @@ static inline void ath_chanctx_check_act
  13. #endif /* CPTCFG_ATH9K_CHANNEL_CONTEXT */
  14. -int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan);
  15. void ath_startrecv(struct ath_softc *sc);
  16. bool ath_stoprecv(struct ath_softc *sc);
  17. u32 ath_calcrxfilter(struct ath_softc *sc);
  18. @@ -1069,7 +1068,7 @@ void ath9k_tasklet(unsigned long data);
  19. int ath_cabq_update(struct ath_softc *);
  20. u8 ath9k_parse_mpdudensity(u8 mpdudensity);
  21. irqreturn_t ath_isr(int irq, void *dev);
  22. -int ath_reset(struct ath_softc *sc);
  23. +int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan);
  24. void ath_cancel_work(struct ath_softc *sc);
  25. void ath_restart_work(struct ath_softc *sc);
  26. int ath9k_init_device(u16 devid, struct ath_softc *sc,
  27. --- a/drivers/net/wireless/ath/ath9k/channel.c
  28. +++ b/drivers/net/wireless/ath/ath9k/channel.c
  29. @@ -66,7 +66,7 @@ static int ath_set_channel(struct ath_so
  30. }
  31. hchan = &sc->sc_ah->channels[pos];
  32. - r = ath_reset_internal(sc, hchan);
  33. + r = ath_reset(sc, hchan);
  34. if (r)
  35. return r;
  36. --- a/drivers/net/wireless/ath/ath9k/main.c
  37. +++ b/drivers/net/wireless/ath/ath9k/main.c
  38. @@ -270,7 +270,7 @@ static bool ath_complete_reset(struct at
  39. return true;
  40. }
  41. -int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan)
  42. +static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan)
  43. {
  44. struct ath_hw *ah = sc->sc_ah;
  45. struct ath_common *common = ath9k_hw_common(ah);
  46. @@ -598,12 +598,12 @@ chip_reset:
  47. #undef SCHED_INTR
  48. }
  49. -int ath_reset(struct ath_softc *sc)
  50. +int ath_reset(struct ath_softc *sc, struct ath9k_channel *hchan)
  51. {
  52. int r;
  53. ath9k_ps_wakeup(sc);
  54. - r = ath_reset_internal(sc, NULL);
  55. + r = ath_reset_internal(sc, hchan);
  56. ath9k_ps_restore(sc);
  57. return r;
  58. @@ -623,7 +623,9 @@ void ath_reset_work(struct work_struct *
  59. {
  60. struct ath_softc *sc = container_of(work, struct ath_softc, hw_reset_work);
  61. - ath_reset(sc);
  62. + ath9k_ps_wakeup(sc);
  63. + ath_reset_internal(sc, NULL);
  64. + ath9k_ps_restore(sc);
  65. }
  66. /**********************/
  67. @@ -2044,7 +2046,7 @@ void __ath9k_flush(struct ieee80211_hw *
  68. spin_unlock_bh(&sc->sc_pcu_lock);
  69. if (!drain_txq)
  70. - ath_reset(sc);
  71. + ath_reset(sc, NULL);
  72. ath9k_ps_restore(sc);
  73. }
  74. --- a/drivers/net/wireless/ath/ath9k/tx99.c
  75. +++ b/drivers/net/wireless/ath/ath9k/tx99.c
  76. @@ -99,7 +99,7 @@ static struct sk_buff *ath9k_build_tx99_
  77. static void ath9k_tx99_deinit(struct ath_softc *sc)
  78. {
  79. - ath_reset(sc);
  80. + ath_reset(sc, NULL);
  81. ath9k_ps_wakeup(sc);
  82. ath9k_tx99_stop(sc);
  83. @@ -127,7 +127,7 @@ static int ath9k_tx99_init(struct ath_so
  84. memset(&txctl, 0, sizeof(txctl));
  85. txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO];
  86. - ath_reset(sc);
  87. + ath_reset(sc, NULL);
  88. ath9k_ps_wakeup(sc);