aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/ieee80211_cfg.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-05 14:13:36 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-05 14:13:36 -0700
commit68762f3d8e7ea644fae1f490f9850ebf462548bd (patch)
tree81be52e9ba33fc4d8aa5f569aaab77b5a34e09ab /net/mac80211/ieee80211_cfg.c
parent4f7a307dc6e4d8bfeb56f7cf7231b08cb845687c (diff)
parent7544b0972c1fc1a0e6c54baa1f44c81019743daa (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [TG3]: Add TG3_FLAG_SUPPORT_MSI flag. [TG3]: Eliminate the TG3_FLAG_5701_REG_WRITE_BUG flag. [TG3]: Eliminate the TG3_FLAG_GOT_SERDES_FLOWCTL flag. [TG3]: Remove reset during MAC address changes. [TG3]: WoL fixes. [TG3]: Clear GPIO mask before storing. [TG3]: Improve NVRAM sizing. [TG3]: Fix TSO bugs. [MAC80211]: Add maintainers entry for mac80211. [MAC80211]: Add debugfs attributes. [MAC80211]: Add mac80211 wireless stack. [MAC80211]: Add generic include/linux/ieee80211.h [NETLINK]: Remove references to process ID [AF_IUCV]: Compile fix - adopt to skbuff changes.
Diffstat (limited to 'net/mac80211/ieee80211_cfg.c')
-rw-r--r--net/mac80211/ieee80211_cfg.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_cfg.c b/net/mac80211/ieee80211_cfg.c
new file mode 100644
index 00000000000..509096edb32
--- /dev/null
+++ b/net/mac80211/ieee80211_cfg.c
@@ -0,0 +1,66 @@
+/*
+ * mac80211 configuration hooks for cfg80211
+ *
+ * Copyright 2006 Johannes Berg <johannes@sipsolutions.net>
+ *
+ * This file is GPLv2 as found in COPYING.
+ */
+
+#include <linux/nl80211.h>
+#include <linux/rtnetlink.h>
+#include <net/cfg80211.h>
+#include "ieee80211_i.h"
+#include "ieee80211_cfg.h"
+
+static int ieee80211_add_iface(struct wiphy *wiphy, char *name,
+ unsigned int type)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ int itype;
+
+ if (unlikely(local->reg_state != IEEE80211_DEV_REGISTERED))
+ return -ENODEV;
+
+ switch (type) {
+ case NL80211_IFTYPE_UNSPECIFIED:
+ itype = IEEE80211_IF_TYPE_STA;
+ break;
+ case NL80211_IFTYPE_ADHOC:
+ itype = IEEE80211_IF_TYPE_IBSS;
+ break;
+ case NL80211_IFTYPE_STATION:
+ itype = IEEE80211_IF_TYPE_STA;
+ break;
+ case NL80211_IFTYPE_MONITOR:
+ itype = IEEE80211_IF_TYPE_MNTR;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return ieee80211_if_add(local->mdev, name, NULL, itype);
+}
+
+static int ieee80211_del_iface(struct wiphy *wiphy, int ifindex)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ struct net_device *dev;
+ char *name;
+
+ if (unlikely(local->reg_state != IEEE80211_DEV_REGISTERED))
+ return -ENODEV;
+
+ dev = dev_get_by_index(ifindex);
+ if (!dev)
+ return 0;
+
+ name = dev->name;
+ dev_put(dev);
+
+ return ieee80211_if_remove(local->mdev, name, -1);
+}
+
+struct cfg80211_ops mac80211_config_ops = {
+ .add_virtual_intf = ieee80211_add_iface,
+ .del_virtual_intf = ieee80211_del_iface,
+};