diff options
Diffstat (limited to 'net/wireless/chan.c')
-rw-r--r-- | net/wireless/chan.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 434c56b92c3c..d355f67d0cdd 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c | |||
@@ -82,7 +82,6 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, | |||
82 | int freq, enum nl80211_channel_type chantype) | 82 | int freq, enum nl80211_channel_type chantype) |
83 | { | 83 | { |
84 | struct ieee80211_channel *chan; | 84 | struct ieee80211_channel *chan; |
85 | int err; | ||
86 | 85 | ||
87 | if (!rdev->ops->set_monitor_channel) | 86 | if (!rdev->ops->set_monitor_channel) |
88 | return -EOPNOTSUPP; | 87 | return -EOPNOTSUPP; |
@@ -93,25 +92,17 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, | |||
93 | if (!chan) | 92 | if (!chan) |
94 | return -EINVAL; | 93 | return -EINVAL; |
95 | 94 | ||
96 | err = rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype); | 95 | return rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype); |
97 | if (!err) { | ||
98 | rdev->monitor_channel = chan; | ||
99 | rdev->monitor_channel_type = chantype; | ||
100 | } | ||
101 | |||
102 | return err; | ||
103 | } | 96 | } |
104 | 97 | ||
105 | void | 98 | void |
106 | cfg80211_get_chan_state(struct cfg80211_registered_device *rdev, | 99 | cfg80211_get_chan_state(struct wireless_dev *wdev, |
107 | struct wireless_dev *wdev, | ||
108 | struct ieee80211_channel **chan, | 100 | struct ieee80211_channel **chan, |
109 | enum cfg80211_chan_mode *chanmode) | 101 | enum cfg80211_chan_mode *chanmode) |
110 | { | 102 | { |
111 | *chan = NULL; | 103 | *chan = NULL; |
112 | *chanmode = CHAN_MODE_UNDEFINED; | 104 | *chanmode = CHAN_MODE_UNDEFINED; |
113 | 105 | ||
114 | ASSERT_RDEV_LOCK(rdev); | ||
115 | ASSERT_WDEV_LOCK(wdev); | 106 | ASSERT_WDEV_LOCK(wdev); |
116 | 107 | ||
117 | if (!netif_running(wdev->netdev)) | 108 | if (!netif_running(wdev->netdev)) |
@@ -136,9 +127,16 @@ cfg80211_get_chan_state(struct cfg80211_registered_device *rdev, | |||
136 | break; | 127 | break; |
137 | case NL80211_IFTYPE_AP: | 128 | case NL80211_IFTYPE_AP: |
138 | case NL80211_IFTYPE_P2P_GO: | 129 | case NL80211_IFTYPE_P2P_GO: |
130 | if (wdev->beacon_interval) { | ||
131 | *chan = wdev->channel; | ||
132 | *chanmode = CHAN_MODE_SHARED; | ||
133 | } | ||
134 | return; | ||
139 | case NL80211_IFTYPE_MESH_POINT: | 135 | case NL80211_IFTYPE_MESH_POINT: |
140 | *chan = wdev->channel; | 136 | if (wdev->mesh_id_len) { |
141 | *chanmode = CHAN_MODE_SHARED; | 137 | *chan = wdev->channel; |
138 | *chanmode = CHAN_MODE_SHARED; | ||
139 | } | ||
142 | return; | 140 | return; |
143 | case NL80211_IFTYPE_MONITOR: | 141 | case NL80211_IFTYPE_MONITOR: |
144 | case NL80211_IFTYPE_AP_VLAN: | 142 | case NL80211_IFTYPE_AP_VLAN: |