aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_ioctl.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-26 11:53:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:19 -0400
commitddd3d2be85e3207c47f2b3c431723e6c758b4b0d (patch)
tree126bb0b470f94e82d4a7f7c0c88bac0b35c95623 /net/mac80211/ieee80211_ioctl.c
parent58d4185e36913d4fc94afa4b4daccb3c9aa01957 (diff)
[MAC80211]: make userspace-mlme a per-interface setting
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r--net/mac80211/ieee80211_ioctl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 6c8e73e0d29d..f0224c2311d2 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -105,12 +105,12 @@ static int ieee80211_ioctl_siwgenie(struct net_device *dev,
105 struct iw_point *data, char *extra) 105 struct iw_point *data, char *extra)
106{ 106{
107 struct ieee80211_sub_if_data *sdata; 107 struct ieee80211_sub_if_data *sdata;
108 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
109 108
110 if (local->user_space_mlme) 109 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
110
111 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)
111 return -EOPNOTSUPP; 112 return -EOPNOTSUPP;
112 113
113 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
114 if (sdata->type == IEEE80211_IF_TYPE_STA || 114 if (sdata->type == IEEE80211_IF_TYPE_STA ||
115 sdata->type == IEEE80211_IF_TYPE_IBSS) { 115 sdata->type == IEEE80211_IF_TYPE_IBSS) {
116 int ret = ieee80211_sta_set_extra_ie(dev, extra, data->length); 116 int ret = ieee80211_sta_set_extra_ie(dev, extra, data->length);
@@ -374,7 +374,6 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
374 struct iw_request_info *info, 374 struct iw_request_info *info,
375 struct iw_point *data, char *ssid) 375 struct iw_point *data, char *ssid)
376{ 376{
377 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
378 struct ieee80211_sub_if_data *sdata; 377 struct ieee80211_sub_if_data *sdata;
379 size_t len = data->length; 378 size_t len = data->length;
380 379
@@ -386,7 +385,7 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
386 if (sdata->type == IEEE80211_IF_TYPE_STA || 385 if (sdata->type == IEEE80211_IF_TYPE_STA ||
387 sdata->type == IEEE80211_IF_TYPE_IBSS) { 386 sdata->type == IEEE80211_IF_TYPE_IBSS) {
388 int ret; 387 int ret;
389 if (local->user_space_mlme) { 388 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
390 if (len > IEEE80211_MAX_SSID_LEN) 389 if (len > IEEE80211_MAX_SSID_LEN)
391 return -EINVAL; 390 return -EINVAL;
392 memcpy(sdata->u.sta.ssid, ssid, len); 391 memcpy(sdata->u.sta.ssid, ssid, len);
@@ -451,14 +450,13 @@ static int ieee80211_ioctl_siwap(struct net_device *dev,
451 struct iw_request_info *info, 450 struct iw_request_info *info,
452 struct sockaddr *ap_addr, char *extra) 451 struct sockaddr *ap_addr, char *extra)
453{ 452{
454 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
455 struct ieee80211_sub_if_data *sdata; 453 struct ieee80211_sub_if_data *sdata;
456 454
457 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 455 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
458 if (sdata->type == IEEE80211_IF_TYPE_STA || 456 if (sdata->type == IEEE80211_IF_TYPE_STA ||
459 sdata->type == IEEE80211_IF_TYPE_IBSS) { 457 sdata->type == IEEE80211_IF_TYPE_IBSS) {
460 int ret; 458 int ret;
461 if (local->user_space_mlme) { 459 if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) {
462 memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data, 460 memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data,
463 ETH_ALEN); 461 ETH_ALEN);
464 return 0; 462 return 0;