aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/cfg.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2009-06-18 18:21:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:46 -0400
commit5217c571c898371c540e49671600d54346b2e123 (patch)
tree6a43660fb5669c02a0ba11f7a53404790638c7a3 /drivers/net/wireless/orinoco/cfg.c
parent721aa2f75b00399074eb443fdf16d797b4504a36 (diff)
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)
93 return wiphy_register(wiphy); 93 return wiphy_register(wiphy);
94} 94}
95 95
96const struct cfg80211_ops orinoco_cfg_ops = { 96static int orinoco_change_vif(struct wiphy *wiphy, struct net_device *dev,
97 enum nl80211_iftype type, u32 *flags,
98 struct vif_params *params)
99{
100 struct orinoco_private *priv = wiphy_priv(wiphy);
101 int err = 0;
102 unsigned long lock;
103
104 if (orinoco_lock(priv, &lock) != 0)
105 return -EBUSY;
106
107 switch (type) {
108 case NL80211_IFTYPE_ADHOC:
109 if (!priv->has_ibss && !priv->has_port3)
110 err = -EINVAL;
111 break;
112
113 case NL80211_IFTYPE_STATION:
114 break;
115
116 case NL80211_IFTYPE_MONITOR:
117 if (priv->broken_monitor && !force_monitor) {
118 printk(KERN_WARNING "%s: Monitor mode support is "
119 "buggy in this firmware, not enabling\n",
120 wiphy_name(wiphy));
121 err = -EINVAL;
122 }
123 break;
124
125 default:
126 err = -EINVAL;
127 }
97 128
129 if (!err) {
130 priv->iw_mode = type;
131 set_port_type(priv);
132 err = orinoco_commit(priv);
133 }
134
135 orinoco_unlock(priv, &lock);
136
137 return err;
138}
139
140const struct cfg80211_ops orinoco_cfg_ops = {
141 .change_virtual_intf = orinoco_change_vif,
98}; 142};