2
0

304-ath9k-Enable-multi-channel-properly.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From: Sujith Manoharan <[email protected]>
  2. Date: Fri, 17 Oct 2014 07:40:09 +0530
  3. Subject: [PATCH] ath9k: Enable multi-channel properly
  4. In MCC mode, currently the decision to enable
  5. the multi-channel state machine is done
  6. based on the association status if one of
  7. the interfaces assigned to a context is in
  8. station mode.
  9. This allows the driver to switch to the other
  10. context before the current station is able to
  11. complete the 4-way handshake in case it is
  12. required and this causes problems.
  13. Instead, enable multi-channel mode when the
  14. station moves to the authorized state. This
  15. disallows an early switch to the other channel.
  16. Signed-off-by: Sujith Manoharan <[email protected]>
  17. ---
  18. --- a/drivers/net/wireless/ath/ath9k/ath9k.h
  19. +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
  20. @@ -362,7 +362,7 @@ enum ath_chanctx_event {
  21. ATH_CHANCTX_EVENT_BEACON_SENT,
  22. ATH_CHANCTX_EVENT_TSF_TIMER,
  23. ATH_CHANCTX_EVENT_BEACON_RECEIVED,
  24. - ATH_CHANCTX_EVENT_ASSOC,
  25. + ATH_CHANCTX_EVENT_AUTHORIZED,
  26. ATH_CHANCTX_EVENT_SWITCH,
  27. ATH_CHANCTX_EVENT_ASSIGN,
  28. ATH_CHANCTX_EVENT_UNASSIGN,
  29. --- a/drivers/net/wireless/ath/ath9k/channel.c
  30. +++ b/drivers/net/wireless/ath/ath9k/channel.c
  31. @@ -171,7 +171,7 @@ static const char *chanctx_event_string(
  32. case_rtn_string(ATH_CHANCTX_EVENT_BEACON_SENT);
  33. case_rtn_string(ATH_CHANCTX_EVENT_TSF_TIMER);
  34. case_rtn_string(ATH_CHANCTX_EVENT_BEACON_RECEIVED);
  35. - case_rtn_string(ATH_CHANCTX_EVENT_ASSOC);
  36. + case_rtn_string(ATH_CHANCTX_EVENT_AUTHORIZED);
  37. case_rtn_string(ATH_CHANCTX_EVENT_SWITCH);
  38. case_rtn_string(ATH_CHANCTX_EVENT_ASSIGN);
  39. case_rtn_string(ATH_CHANCTX_EVENT_UNASSIGN);
  40. @@ -510,7 +510,7 @@ void ath_chanctx_event(struct ath_softc
  41. ath_chanctx_setup_timer(sc, tsf_time);
  42. break;
  43. - case ATH_CHANCTX_EVENT_ASSOC:
  44. + case ATH_CHANCTX_EVENT_AUTHORIZED:
  45. if (sc->sched.state != ATH_CHANCTX_STATE_FORCE_ACTIVE ||
  46. avp->chanctx != sc->cur_chan)
  47. break;
  48. --- a/drivers/net/wireless/ath/ath9k/main.c
  49. +++ b/drivers/net/wireless/ath/ath9k/main.c
  50. @@ -1569,6 +1569,13 @@ static int ath9k_sta_state(struct ieee80
  51. "Remove station: %pM\n", sta->addr);
  52. }
  53. + if (ath9k_is_chanctx_enabled()) {
  54. + if (old_state == IEEE80211_STA_ASSOC &&
  55. + new_state == IEEE80211_STA_AUTHORIZED)
  56. + ath_chanctx_event(sc, vif,
  57. + ATH_CHANCTX_EVENT_AUTHORIZED);
  58. + }
  59. +
  60. return ret;
  61. }
  62. @@ -1761,12 +1768,6 @@ static void ath9k_bss_info_changed(struc
  63. avp->assoc = bss_conf->assoc;
  64. ath9k_calculate_summary_state(sc, avp->chanctx);
  65. -
  66. - if (ath9k_is_chanctx_enabled()) {
  67. - if (bss_conf->assoc)
  68. - ath_chanctx_event(sc, vif,
  69. - ATH_CHANCTX_EVENT_ASSOC);
  70. - }
  71. }
  72. if (changed & BSS_CHANGED_IBSS) {