Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159358
b: refs/heads/master
c: 7e2ce64
h: refs/heads/master
v: v3
  • Loading branch information
Holger Schurig authored and John W. Linville committed Aug 4, 2009
1 parent 040929f commit 6d0e8a5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91b092d73435489d7336f94e927d96224b26c9a8
refs/heads/master: 7e2ce646fc0acc99837f73d39528493e146d1dcc
41 changes: 41 additions & 0 deletions trunk/drivers/net/wireless/orinoco/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,48 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev,
return err;
}

static int orinoco_set_channel(struct wiphy *wiphy,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
struct orinoco_private *priv = wiphy_priv(wiphy);
int err = 0;
unsigned long flags;
int channel;

if (!chan)
return -EINVAL;

if (channel_type != NL80211_CHAN_NO_HT)
return -EINVAL;

if (chan->band != IEEE80211_BAND_2GHZ)
return -EINVAL;

channel = ieee80211_freq_to_dsss_chan(chan->center_freq);

if ((channel < 1) || (channel > NUM_CHANNELS) ||
!(priv->channel_mask & (1 << (channel-1))))
return -EINVAL;

if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;

priv->channel = channel;
if (priv->iw_mode == NL80211_IFTYPE_MONITOR) {
/* Fast channel change - no commit if successful */
hermes_t *hw = &priv->hw;
err = hermes_docmd_wait(hw, HERMES_CMD_TEST |
HERMES_TEST_SET_CHANNEL,
channel, NULL);
}
orinoco_unlock(priv, &flags);

return err;
}

const struct cfg80211_ops orinoco_cfg_ops = {
.change_virtual_intf = orinoco_change_vif,
.set_channel = orinoco_set_channel,
.scan = orinoco_scan,
};

0 comments on commit 6d0e8a5

Please sign in to comment.