Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368397
b: refs/heads/master
c: cdc89b9
h: refs/heads/master
i:
  368395: bed7ac3
v: v3
  • Loading branch information
Johannes Berg committed Mar 6, 2013
1 parent cfab1e7 commit fcc1a62
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 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: 3713b4e364effef4b170c97d54528b1cdb16aa6b
refs/heads/master: cdc89b97bf23ae3a7869804b6dc13be011ec8f4c
38 changes: 29 additions & 9 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ static inline void *nl80211hdr_put(struct sk_buff *skb, u32 portid, u32 seq,
}

static int nl80211_msg_put_channel(struct sk_buff *msg,
struct ieee80211_channel *chan)
struct ieee80211_channel *chan,
bool large)
{
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_FREQ,
chan->center_freq))
Expand All @@ -555,9 +556,22 @@ static int nl80211_msg_put_channel(struct sk_buff *msg,
if ((chan->flags & IEEE80211_CHAN_NO_IBSS) &&
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_IBSS))
goto nla_put_failure;
if ((chan->flags & IEEE80211_CHAN_RADAR) &&
nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR))
goto nla_put_failure;
if (chan->flags & IEEE80211_CHAN_RADAR) {
if (nla_put_flag(msg, NL80211_FREQUENCY_ATTR_RADAR))
goto nla_put_failure;
if (large) {
u32 time;

time = elapsed_jiffies_msecs(chan->dfs_state_entered);

if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_STATE,
chan->dfs_state))
goto nla_put_failure;
if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_DFS_TIME,
time))
goto nla_put_failure;
}
}

if (nla_put_u32(msg, NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
DBM_TO_MBM(chan->max_power)))
Expand Down Expand Up @@ -833,7 +847,8 @@ static int nl80211_put_iftypes(struct sk_buff *msg, u32 attr, u16 ifmodes)
}

static int nl80211_put_iface_combinations(struct wiphy *wiphy,
struct sk_buff *msg)
struct sk_buff *msg,
bool large)
{
struct nlattr *nl_combis;
int i, j;
Expand Down Expand Up @@ -882,6 +897,10 @@ static int nl80211_put_iface_combinations(struct wiphy *wiphy,
nla_put_u32(msg, NL80211_IFACE_COMB_MAXNUM,
c->max_interfaces))
goto nla_put_failure;
if (large &&
nla_put_u32(msg, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
c->radar_detect_widths))
goto nla_put_failure;

nla_nest_end(msg, nl_combi);
}
Expand Down Expand Up @@ -1231,7 +1250,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,

chan = &sband->channels[i];

if (nl80211_msg_put_channel(msg, chan))
if (nl80211_msg_put_channel(msg, chan,
split))
goto nla_put_failure;

nla_nest_end(msg, nl_freq);
Expand Down Expand Up @@ -1385,7 +1405,7 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
dev->wiphy.software_iftypes))
goto nla_put_failure;

if (nl80211_put_iface_combinations(&dev->wiphy, msg))
if (nl80211_put_iface_combinations(&dev->wiphy, msg, split))
goto nla_put_failure;

(*split_start)++;
Expand Down Expand Up @@ -9377,15 +9397,15 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_BEFORE);
if (!nl_freq)
goto nla_put_failure;
if (nl80211_msg_put_channel(msg, channel_before))
if (nl80211_msg_put_channel(msg, channel_before, false))
goto nla_put_failure;
nla_nest_end(msg, nl_freq);

/* After */
nl_freq = nla_nest_start(msg, NL80211_ATTR_FREQ_AFTER);
if (!nl_freq)
goto nla_put_failure;
if (nl80211_msg_put_channel(msg, channel_after))
if (nl80211_msg_put_channel(msg, channel_after, false))
goto nla_put_failure;
nla_nest_end(msg, nl_freq);

Expand Down

0 comments on commit fcc1a62

Please sign in to comment.