314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. From: Sachin Kulkarni <Sachin.Kulkarni@imgtec.com>
  2. Date: Tue, 12 Jan 2016 14:30:19 +0530
  3. Subject: [PATCH] mac80211: Requeue work after scan complete for all VIF
  4. types.
  5. During a sw scan ieee80211_iface_work ignores work items for all vifs.
  6. However after the scan complete work is requeued only for STA, ADHOC
  7. and MESH iftypes.
  8. This occasionally results in event processing getting delayed/not
  9. processed for iftype AP when it coexists with a STA. This can result
  10. in data halt and eventually disconnection on the AP interface.
  11. Signed-off-by: Sachin Kulkarni <Sachin.Kulkarni@imgtec.com>
  12. Cc: linux-wireless@vger.kernel.org
  13. Cc: johannes@sipsolutions.net
  14. ---
  15. --- a/net/mac80211/ibss.c
  16. +++ b/net/mac80211/ibss.c
  17. @@ -1731,7 +1731,6 @@ void ieee80211_ibss_notify_scan_complete
  18. if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
  19. continue;
  20. sdata->u.ibss.last_scan_completed = jiffies;
  21. - ieee80211_queue_work(&local->hw, &sdata->work);
  22. }
  23. mutex_unlock(&local->iflist_mtx);
  24. }
  25. --- a/net/mac80211/mesh.c
  26. +++ b/net/mac80211/mesh.c
  27. @@ -1369,17 +1369,6 @@ out:
  28. sdata_unlock(sdata);
  29. }
  30. -void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local)
  31. -{
  32. - struct ieee80211_sub_if_data *sdata;
  33. -
  34. - rcu_read_lock();
  35. - list_for_each_entry_rcu(sdata, &local->interfaces, list)
  36. - if (ieee80211_vif_is_mesh(&sdata->vif) &&
  37. - ieee80211_sdata_running(sdata))
  38. - ieee80211_queue_work(&local->hw, &sdata->work);
  39. - rcu_read_unlock();
  40. -}
  41. void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
  42. {
  43. --- a/net/mac80211/mesh.h
  44. +++ b/net/mac80211/mesh.h
  45. @@ -362,14 +362,10 @@ static inline bool mesh_path_sel_is_hwmp
  46. return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP;
  47. }
  48. -void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local);
  49. -
  50. void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
  51. void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata);
  52. void ieee80211s_stop(void);
  53. #else
  54. -static inline void
  55. -ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) {}
  56. static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
  57. { return false; }
  58. static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
  59. --- a/net/mac80211/mlme.c
  60. +++ b/net/mac80211/mlme.c
  61. @@ -3978,8 +3978,6 @@ static void ieee80211_restart_sta_timer(
  62. if (!ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR))
  63. ieee80211_queue_work(&sdata->local->hw,
  64. &sdata->u.mgd.monitor_work);
  65. - /* and do all the other regular work too */
  66. - ieee80211_queue_work(&sdata->local->hw, &sdata->work);
  67. }
  68. }
  69. --- a/net/mac80211/scan.c
  70. +++ b/net/mac80211/scan.c
  71. @@ -314,6 +314,7 @@ static void __ieee80211_scan_completed(s
  72. bool was_scanning = local->scanning;
  73. struct cfg80211_scan_request *scan_req;
  74. struct ieee80211_sub_if_data *scan_sdata;
  75. + struct ieee80211_sub_if_data *sdata;
  76. lockdep_assert_held(&local->mtx);
  77. @@ -373,7 +374,15 @@ static void __ieee80211_scan_completed(s
  78. ieee80211_mlme_notify_scan_completed(local);
  79. ieee80211_ibss_notify_scan_completed(local);
  80. - ieee80211_mesh_notify_scan_completed(local);
  81. +
  82. + /* Requeue all the work that might have been ignored while
  83. + * the scan was in progress
  84. + */
  85. + list_for_each_entry_rcu(sdata, &local->interfaces, list) {
  86. + if (ieee80211_sdata_running(sdata))
  87. + ieee80211_queue_work(&sdata->local->hw, &sdata->work);
  88. + }
  89. +
  90. if (was_scanning)
  91. ieee80211_start_next_roc(local);
  92. }