2
0

323-ath9k-Fix-HW-scan-abort.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From: Sujith Manoharan <[email protected]>
  2. Date: Fri, 17 Oct 2014 07:40:28 +0530
  3. Subject: [PATCH] ath9k: Fix HW scan abort
  4. Instead of using ATH_CHANCTX_EVENT_ASSIGN to abort
  5. a HW scan when a new interface becomes active, use the
  6. mgd_prepare_tx() callback. This allows us to make
  7. sure that the GO's channel becomes operational by
  8. using flush_work().
  9. Signed-off-by: Sujith Manoharan <[email protected]>
  10. ---
  11. --- a/drivers/net/wireless/ath/ath9k/channel.c
  12. +++ b/drivers/net/wireless/ath/ath9k/channel.c
  13. @@ -743,22 +743,6 @@ void ath_chanctx_event(struct ath_softc
  14. ieee80211_queue_work(sc->hw, &sc->chanctx_work);
  15. break;
  16. case ATH_CHANCTX_EVENT_ASSIGN:
  17. - /*
  18. - * When adding a new channel context, check if a scan
  19. - * is in progress and abort it since the addition of
  20. - * a new channel context is usually followed by VIF
  21. - * assignment, in which case we have to start multi-channel
  22. - * operation.
  23. - */
  24. - if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
  25. - ath_dbg(common, CHAN_CTX,
  26. - "Aborting HW scan to add new context\n");
  27. -
  28. - spin_unlock_bh(&sc->chan_lock);
  29. - del_timer_sync(&sc->offchannel.timer);
  30. - ath_scan_complete(sc, true);
  31. - spin_lock_bh(&sc->chan_lock);
  32. - }
  33. break;
  34. case ATH_CHANCTX_EVENT_CHANGE:
  35. break;
  36. --- a/drivers/net/wireless/ath/ath9k/main.c
  37. +++ b/drivers/net/wireless/ath/ath9k/main.c
  38. @@ -2365,7 +2365,6 @@ static int ath9k_add_chanctx(struct ieee
  39. conf->def.chan->center_freq);
  40. ath_chanctx_set_channel(sc, ctx, &conf->def);
  41. - ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_ASSIGN);
  42. mutex_unlock(&sc->mutex);
  43. return 0;
  44. @@ -2496,6 +2495,19 @@ static void ath9k_mgd_prepare_tx(struct
  45. if (!changed)
  46. goto out;
  47. + if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
  48. + ath_dbg(common, CHAN_CTX,
  49. + "%s: Aborting HW scan\n", __func__);
  50. +
  51. + mutex_unlock(&sc->mutex);
  52. +
  53. + del_timer_sync(&sc->offchannel.timer);
  54. + ath_scan_complete(sc, true);
  55. + flush_work(&sc->chanctx_work);
  56. +
  57. + mutex_lock(&sc->mutex);
  58. + }
  59. +
  60. go_ctx = ath_is_go_chanctx_present(sc);
  61. if (go_ctx) {