aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mesh.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-06 02:18:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-06 15:18:17 -0400
commite8c9bd5b8d807cfe6c923265969a523b1ba1e6c2 (patch)
treee36cab1a3b2fb25bdc84115e3472a19672045dbe /net/wireless/mesh.c
parent7c9c46c16d2d1d232f3296924162de293477f017 (diff)
cfg80211: clarify set_channel APIs
Now that we've removed all uses of the set_channel API except for the monitor channel and in libertas, clarify this. Split the libertas mesh use into a new libertas_set_mesh_channel() operation, just to keep backward compatibility, and rename the normal set_channel() to set_monitor_channel(). Also describe the desired set_monitor_channel() semantics more clearly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/mesh.c')
-rw-r--r--net/wireless/mesh.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 2e3b700eba32..b44c736bf9cf 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -179,6 +179,13 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
179{ 179{
180 struct ieee80211_channel *channel; 180 struct ieee80211_channel *channel;
181 181
182 channel = rdev_freq_to_chan(rdev, freq, channel_type);
183 if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy,
184 channel,
185 channel_type)) {
186 return -EINVAL;
187 }
188
182 /* 189 /*
183 * Workaround for libertas (only!), it puts the interface 190 * Workaround for libertas (only!), it puts the interface
184 * into mesh mode but doesn't implement join_mesh. Instead, 191 * into mesh mode but doesn't implement join_mesh. Instead,
@@ -186,27 +193,20 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
186 * you set the channel. Note that the libertas mesh isn't 193 * you set the channel. Note that the libertas mesh isn't
187 * compatible with 802.11 mesh. 194 * compatible with 802.11 mesh.
188 */ 195 */
189 if (!rdev->ops->join_mesh) { 196 if (rdev->ops->libertas_set_mesh_channel) {
190 int err; 197 if (channel_type != NL80211_CHAN_NO_HT)
198 return -EINVAL;
191 199
192 if (!netif_running(wdev->netdev)) 200 if (!netif_running(wdev->netdev))
193 return -ENETDOWN; 201 return -ENETDOWN;
194 wdev_lock(wdev); 202 return rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
195 err = cfg80211_set_freq(rdev, wdev, freq, channel_type); 203 wdev->netdev,
196 wdev_unlock(wdev); 204 channel);
197
198 return err;
199 } 205 }
200 206
201 if (wdev->mesh_id_len) 207 if (wdev->mesh_id_len)
202 return -EBUSY; 208 return -EBUSY;
203 209
204 channel = rdev_freq_to_chan(rdev, freq, channel_type);
205 if (!channel || !cfg80211_can_beacon_sec_chan(&rdev->wiphy,
206 channel,
207 channel_type)) {
208 return -EINVAL;
209 }
210 wdev->preset_chan = channel; 210 wdev->preset_chan = channel;
211 wdev->preset_chantype = channel_type; 211 wdev->preset_chantype = channel_type;
212 return 0; 212 return 0;