aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mlme.c
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2013-11-06 07:55:51 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:50:46 -0500
commitd2859df5e7f00469011482d850fba652517a2eab (patch)
treee43b5fe6844f412cf27fdc6aaf2d25eef90b3a81 /net/wireless/mlme.c
parent5282c3ba4c5a24b2ab45a6742f9ab01a3d90c167 (diff)
cfg80211/mac80211: DFS setup chandef for cac event
To report channel width correctly we have to send correct channel parameters from mac80211 when calling cfg80211_cac_event(). This is required in case of using channel width higher than 20MHz and we have to set correct dfs channel state after CAC (NL80211_DFS_AVAILABLE). Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Reviewed-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/mlme.c')
-rw-r--r--net/wireless/mlme.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 6a6b1c8e907d..31f541f7e4ea 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -763,12 +763,12 @@ void cfg80211_radar_event(struct wiphy *wiphy,
763EXPORT_SYMBOL(cfg80211_radar_event); 763EXPORT_SYMBOL(cfg80211_radar_event);
764 764
765void cfg80211_cac_event(struct net_device *netdev, 765void cfg80211_cac_event(struct net_device *netdev,
766 const struct cfg80211_chan_def *chandef,
766 enum nl80211_radar_event event, gfp_t gfp) 767 enum nl80211_radar_event event, gfp_t gfp)
767{ 768{
768 struct wireless_dev *wdev = netdev->ieee80211_ptr; 769 struct wireless_dev *wdev = netdev->ieee80211_ptr;
769 struct wiphy *wiphy = wdev->wiphy; 770 struct wiphy *wiphy = wdev->wiphy;
770 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 771 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
771 struct cfg80211_chan_def chandef;
772 unsigned long timeout; 772 unsigned long timeout;
773 773
774 trace_cfg80211_cac_event(netdev, event); 774 trace_cfg80211_cac_event(netdev, event);
@@ -779,14 +779,12 @@ void cfg80211_cac_event(struct net_device *netdev,
779 if (WARN_ON(!wdev->channel)) 779 if (WARN_ON(!wdev->channel))
780 return; 780 return;
781 781
782 cfg80211_chandef_create(&chandef, wdev->channel, NL80211_CHAN_NO_HT);
783
784 switch (event) { 782 switch (event) {
785 case NL80211_RADAR_CAC_FINISHED: 783 case NL80211_RADAR_CAC_FINISHED:
786 timeout = wdev->cac_start_time + 784 timeout = wdev->cac_start_time +
787 msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS); 785 msecs_to_jiffies(IEEE80211_DFS_MIN_CAC_TIME_MS);
788 WARN_ON(!time_after_eq(jiffies, timeout)); 786 WARN_ON(!time_after_eq(jiffies, timeout));
789 cfg80211_set_dfs_state(wiphy, &chandef, NL80211_DFS_AVAILABLE); 787 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE);
790 break; 788 break;
791 case NL80211_RADAR_CAC_ABORTED: 789 case NL80211_RADAR_CAC_ABORTED:
792 break; 790 break;
@@ -796,6 +794,6 @@ void cfg80211_cac_event(struct net_device *netdev,
796 } 794 }
797 wdev->cac_started = false; 795 wdev->cac_started = false;
798 796
799 nl80211_radar_notify(rdev, &chandef, event, netdev, gfp); 797 nl80211_radar_notify(rdev, chandef, event, netdev, gfp);
800} 798}
801EXPORT_SYMBOL(cfg80211_cac_event); 799EXPORT_SYMBOL(cfg80211_cac_event);