Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313993
b: refs/heads/master
c: 3d9e6e1
h: refs/heads/master
i:
  313991: 347677c
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 5, 2012
1 parent bd1ffbb commit 1f5c937
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a2ac260bb89dc34bd31d694e885164a3b78c4d9
refs/heads/master: 3d9e6e12077d2611749ba3145bc4934aae461425
70 changes: 35 additions & 35 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,41 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
return ret;
}

static int ieee80211_set_channel(struct wiphy *wiphy,
struct net_device *netdev,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata = NULL;

if (netdev)
sdata = IEEE80211_DEV_TO_SUB_IF(netdev);

switch (ieee80211_get_channel_mode(local, NULL)) {
case CHAN_MODE_HOPPING:
return -EBUSY;
case CHAN_MODE_FIXED:
if (local->oper_channel != chan)
return -EBUSY;
if (!sdata && local->_oper_channel_type == channel_type)
return 0;
break;
case CHAN_MODE_UNDEFINED:
break;
}

if (!ieee80211_set_channel_type(local, sdata, channel_type))
return -EBUSY;

local->oper_channel = chan;

/* auto-detects changes */
ieee80211_hw_config(local, 0);

return 0;
}

static int ieee80211_set_probe_resp(struct ieee80211_sub_if_data *sdata,
const u8 *resp, size_t resp_len)
{
Expand Down Expand Up @@ -1677,41 +1712,6 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
return 0;
}

static int ieee80211_set_channel(struct wiphy *wiphy,
struct net_device *netdev,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata = NULL;

if (netdev)
sdata = IEEE80211_DEV_TO_SUB_IF(netdev);

switch (ieee80211_get_channel_mode(local, NULL)) {
case CHAN_MODE_HOPPING:
return -EBUSY;
case CHAN_MODE_FIXED:
if (local->oper_channel != chan)
return -EBUSY;
if (!sdata && local->_oper_channel_type == channel_type)
return 0;
break;
case CHAN_MODE_UNDEFINED:
break;
}

if (!ieee80211_set_channel_type(local, sdata, channel_type))
return -EBUSY;

local->oper_channel = chan;

/* auto-detects changes */
ieee80211_hw_config(local, 0);

return 0;
}

#ifdef CONFIG_PM
static int ieee80211_suspend(struct wiphy *wiphy,
struct cfg80211_wowlan *wowlan)
Expand Down

0 comments on commit 1f5c937

Please sign in to comment.