diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-08-06 10:18:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-07 09:49:04 -0400 |
commit | 0fc980392e5a06cff34ca7acaac5790bb59528d1 (patch) | |
tree | 2f1d0dd3b710b8c2a556dbf7ca7cee8c1c9f0675 /drivers/net/wireless | |
parent | 8dbc1722a78343eb80f0ce1a3ef1965a9774ad5b (diff) |
rt2x00: Block all unsupported modes
It was possible for unsupported operating modes
to be accepted by the add_interface callback function.
This patch will block those modes until proper support
has been implemented for them.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 54 |
1 files changed, 37 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index bd422fd6a894..d06507388635 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -203,23 +203,43 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
203 | !test_bit(DEVICE_STARTED, &rt2x00dev->flags)) | 203 | !test_bit(DEVICE_STARTED, &rt2x00dev->flags)) |
204 | return -ENODEV; | 204 | return -ENODEV; |
205 | 205 | ||
206 | /* | 206 | switch (conf->type) { |
207 | * We don't support mixed combinations of sta and ap virtual | 207 | case IEEE80211_IF_TYPE_AP: |
208 | * interfaces. We can only add this interface when the rival | 208 | /* |
209 | * interface count is 0. | 209 | * We don't support mixed combinations of |
210 | */ | 210 | * sta and ap interfaces. |
211 | if ((conf->type == IEEE80211_IF_TYPE_AP && rt2x00dev->intf_sta_count) || | 211 | */ |
212 | (conf->type != IEEE80211_IF_TYPE_AP && rt2x00dev->intf_ap_count)) | 212 | if (rt2x00dev->intf_sta_count) |
213 | return -ENOBUFS; | 213 | return -ENOBUFS; |
214 | 214 | ||
215 | /* | 215 | /* |
216 | * Check if we exceeded the maximum amount of supported interfaces. | 216 | * Check if we exceeded the maximum amount |
217 | */ | 217 | * of supported interfaces. |
218 | if ((conf->type == IEEE80211_IF_TYPE_AP && | 218 | */ |
219 | rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf) || | 219 | if (rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf) |
220 | (conf->type != IEEE80211_IF_TYPE_AP && | 220 | return -ENOBUFS; |
221 | rt2x00dev->intf_sta_count >= rt2x00dev->ops->max_sta_intf)) | 221 | |
222 | return -ENOBUFS; | 222 | break; |
223 | case IEEE80211_IF_TYPE_STA: | ||
224 | case IEEE80211_IF_TYPE_IBSS: | ||
225 | /* | ||
226 | * We don't support mixed combinations of | ||
227 | * sta and ap interfaces. | ||
228 | */ | ||
229 | if (rt2x00dev->intf_ap_count) | ||
230 | return -ENOBUFS; | ||
231 | |||
232 | /* | ||
233 | * Check if we exceeded the maximum amount | ||
234 | * of supported interfaces. | ||
235 | */ | ||
236 | if (rt2x00dev->intf_sta_count >= rt2x00dev->ops->max_sta_intf) | ||
237 | return -ENOBUFS; | ||
238 | |||
239 | break; | ||
240 | default: | ||
241 | return -EINVAL; | ||
242 | } | ||
223 | 243 | ||
224 | /* | 244 | /* |
225 | * Loop through all beacon queues to find a free | 245 | * Loop through all beacon queues to find a free |