aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c54
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