diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2009-07-28 10:34:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-04 16:43:26 -0400 |
commit | 7e2ce646fc0acc99837f73d39528493e146d1dcc (patch) | |
tree | 5b37768fe98d60c8b22601f0d3eea9ab5c45ac7f /drivers/net/wireless/orinoco | |
parent | 91b092d73435489d7336f94e927d96224b26c9a8 (diff) |
orinoco: enable cfg80211 "set_channel" operation
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r-- | drivers/net/wireless/orinoco/cfg.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c index 1a87d3a0967c..27f2d3342645 100644 --- a/drivers/net/wireless/orinoco/cfg.c +++ b/drivers/net/wireless/orinoco/cfg.c | |||
@@ -156,7 +156,48 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev, | |||
156 | return err; | 156 | return err; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int orinoco_set_channel(struct wiphy *wiphy, | ||
160 | struct ieee80211_channel *chan, | ||
161 | enum nl80211_channel_type channel_type) | ||
162 | { | ||
163 | struct orinoco_private *priv = wiphy_priv(wiphy); | ||
164 | int err = 0; | ||
165 | unsigned long flags; | ||
166 | int channel; | ||
167 | |||
168 | if (!chan) | ||
169 | return -EINVAL; | ||
170 | |||
171 | if (channel_type != NL80211_CHAN_NO_HT) | ||
172 | return -EINVAL; | ||
173 | |||
174 | if (chan->band != IEEE80211_BAND_2GHZ) | ||
175 | return -EINVAL; | ||
176 | |||
177 | channel = ieee80211_freq_to_dsss_chan(chan->center_freq); | ||
178 | |||
179 | if ((channel < 1) || (channel > NUM_CHANNELS) || | ||
180 | !(priv->channel_mask & (1 << (channel-1)))) | ||
181 | return -EINVAL; | ||
182 | |||
183 | if (orinoco_lock(priv, &flags) != 0) | ||
184 | return -EBUSY; | ||
185 | |||
186 | priv->channel = channel; | ||
187 | if (priv->iw_mode == NL80211_IFTYPE_MONITOR) { | ||
188 | /* Fast channel change - no commit if successful */ | ||
189 | hermes_t *hw = &priv->hw; | ||
190 | err = hermes_docmd_wait(hw, HERMES_CMD_TEST | | ||
191 | HERMES_TEST_SET_CHANNEL, | ||
192 | channel, NULL); | ||
193 | } | ||
194 | orinoco_unlock(priv, &flags); | ||
195 | |||
196 | return err; | ||
197 | } | ||
198 | |||
159 | const struct cfg80211_ops orinoco_cfg_ops = { | 199 | const struct cfg80211_ops orinoco_cfg_ops = { |
160 | .change_virtual_intf = orinoco_change_vif, | 200 | .change_virtual_intf = orinoco_change_vif, |
201 | .set_channel = orinoco_set_channel, | ||
161 | .scan = orinoco_scan, | 202 | .scan = orinoco_scan, |
162 | }; | 203 | }; |