summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/orinoco/cfg.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 23:21:32 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:46 -0400
commit5217c571c898371c540e49671600d54346b2e123 (patch)
tree6a43660fb5669c02a0ba11f7a53404790638c7a3 /drivers/net/wireless/orinoco/cfg.c
parent721aa2f75b00399074eb443fdf16d797b4504a36 (diff)
downloadlinux-5217c571c898371c540e49671600d54346b2e123.tar.gz
orinoco: convert mode setting to cfg80211
Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/cfg.c')
-rw-r--r--drivers/net/wireless/orinoco/cfg.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
index 9a616ddac091..9e59d90b32e4 100644
--- a/drivers/net/wireless/orinoco/cfg.c
+++ b/drivers/net/wireless/orinoco/cfg.c
@@ -93,6 +93,50 @@ int orinoco_wiphy_register(struct wiphy *wiphy)
return wiphy_register(wiphy);
}
-const struct cfg80211_ops orinoco_cfg_ops = {
+static int orinoco_change_vif(struct wiphy *wiphy, struct net_device *dev,
+ enum nl80211_iftype type, u32 *flags,
+ struct vif_params *params)
+{
+ struct orinoco_private *priv = wiphy_priv(wiphy);
+ int err = 0;
+ unsigned long lock;
+
+ if (orinoco_lock(priv, &lock) != 0)
+ return -EBUSY;
+
+ switch (type) {
+ case NL80211_IFTYPE_ADHOC:
+ if (!priv->has_ibss && !priv->has_port3)
+ err = -EINVAL;
+ break;
+
+ case NL80211_IFTYPE_STATION:
+ break;
+
+ case NL80211_IFTYPE_MONITOR:
+ if (priv->broken_monitor && !force_monitor) {
+ printk(KERN_WARNING "%s: Monitor mode support is "
+ "buggy in this firmware, not enabling\n",
+ wiphy_name(wiphy));
+ err = -EINVAL;
+ }
+ break;
+
+ default:
+ err = -EINVAL;
+ }
+ if (!err) {
+ priv->iw_mode = type;
+ set_port_type(priv);
+ err = orinoco_commit(priv);
+ }
+
+ orinoco_unlock(priv, &lock);
+
+ return err;
+}
+
+const struct cfg80211_ops orinoco_cfg_ops = {
+ .change_virtual_intf = orinoco_change_vif,
};