aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorMichael Wu <flamingice@sourmilk.net>2008-01-31 13:48:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:02 -0500
commit8cc9a73914b07b5908d8a59320f4557fc9639f2e (patch)
tree34ad48b7fa4078c04bd83a45e7cef75b0f49176a /net/mac80211/cfg.c
parent66f7ac50ed7cc5c19a62bc97e8f6e7891004a03a (diff)
mac80211: Use monitor configuration flags
Take advantage of the monitor configuration flags now provided by cfg80211. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 706418d477c2..a083cc78855e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -38,6 +38,9 @@ static int ieee80211_add_iface(struct wiphy *wiphy, char *name,
38{ 38{
39 struct ieee80211_local *local = wiphy_priv(wiphy); 39 struct ieee80211_local *local = wiphy_priv(wiphy);
40 enum ieee80211_if_types itype; 40 enum ieee80211_if_types itype;
41 struct net_device *dev;
42 struct ieee80211_sub_if_data *sdata;
43 int err;
41 44
42 if (unlikely(local->reg_state != IEEE80211_DEV_REGISTERED)) 45 if (unlikely(local->reg_state != IEEE80211_DEV_REGISTERED))
43 return -ENODEV; 46 return -ENODEV;
@@ -46,7 +49,13 @@ static int ieee80211_add_iface(struct wiphy *wiphy, char *name,
46 if (itype == IEEE80211_IF_TYPE_INVALID) 49 if (itype == IEEE80211_IF_TYPE_INVALID)
47 return -EINVAL; 50 return -EINVAL;
48 51
49 return ieee80211_if_add(local->mdev, name, NULL, itype); 52 err = ieee80211_if_add(local->mdev, name, &dev, itype);
53 if (err || itype != IEEE80211_IF_TYPE_MNTR || !flags)
54 return err;
55
56 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
57 sdata->u.mntr_flags = *flags;
58 return 0;
50} 59}
51 60
52static int ieee80211_del_iface(struct wiphy *wiphy, int ifindex) 61static int ieee80211_del_iface(struct wiphy *wiphy, int ifindex)
@@ -99,6 +108,10 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
99 ieee80211_if_reinit(dev); 108 ieee80211_if_reinit(dev);
100 ieee80211_if_set_type(dev, itype); 109 ieee80211_if_set_type(dev, itype);
101 110
111 if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR || !flags)
112 return 0;
113
114 sdata->u.mntr_flags = *flags;
102 return 0; 115 return 0;
103} 116}
104 117