cfg80211: pass a channel definition struct
Instead of passing a channel pointer and channel type to all functions and driver methods, pass a new channel definition struct. Right now, this struct contains just the control channel and channel type, but for VHT this will change. Also, add a small inline cfg80211_get_chandef_type() so that drivers don't need to use the _type field of the new structure all the time, which will change. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -161,24 +161,23 @@ static int orinoco_scan(struct wiphy *wiphy,
|
||||
}
|
||||
|
||||
static int orinoco_set_monitor_channel(struct wiphy *wiphy,
|
||||
struct ieee80211_channel *chan,
|
||||
enum nl80211_channel_type channel_type)
|
||||
struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
struct orinoco_private *priv = wiphy_priv(wiphy);
|
||||
int err = 0;
|
||||
unsigned long flags;
|
||||
int channel;
|
||||
|
||||
if (!chan)
|
||||
if (!chandef->chan)
|
||||
return -EINVAL;
|
||||
|
||||
if (channel_type != NL80211_CHAN_NO_HT)
|
||||
if (cfg80211_get_chandef_type(chandef) != NL80211_CHAN_NO_HT)
|
||||
return -EINVAL;
|
||||
|
||||
if (chan->band != IEEE80211_BAND_2GHZ)
|
||||
if (chandef->chan->band != IEEE80211_BAND_2GHZ)
|
||||
return -EINVAL;
|
||||
|
||||
channel = ieee80211_freq_to_dsss_chan(chan->center_freq);
|
||||
channel = ieee80211_freq_to_dsss_chan(chandef->chan->center_freq);
|
||||
|
||||
if ((channel < 1) || (channel > NUM_CHANNELS) ||
|
||||
!(priv->channel_mask & (1 << (channel - 1))))
|
||||
|
Reference in New Issue
Block a user