Here are a few fixes for the wireless stack: one fixes the

RTS rate, one for a debugfs file, one to return the correct
 channel to userspace, a sanity check for a userspace value
 and the remaining two are just documentation fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJUSUotAAoJEDBSmw7B7bqr2TwP/2EJiYMOXhLTM5F/sEaGP5aX
 +hN+/Za3hAuLu3GkYXnIEw8uJL0ooDpUkQLoyV7AUoqVKhgqCuMQPWbklU0Ns2Og
 qubAl9BRY1DPgMtdGa3mMMJ3GYkIC8Hbh6kTOPqYASVZWover5NRKFlp2jp1uhbf
 ypv0IfIJVO323s90TWv1ZQsTtnGxMtL9DaLwqBNKN8nSGKxe62cUZsQN+H5KGm4N
 /n7eN62XPkidFUsTmdAXHfcgEpGv82rtSpxWmSrwxDbQEj12xkP66cRTuomZJ5v1
 981OIzcxtV0ngLjfnoSGev6bvgO2TDEbvQScIsZiqfnaJuBfzPEAaghnWozox3op
 dfolKkD3LecLGcxVVGJlKddxm3K4+2q7tuwkfDcxKNx2KFqtOqM6gY8z1uXYX8MW
 Jv7669nwpKgWM0e3hsxz6WJauEsdWRVzarmimK/Ymitu0RgNmXTVbdvvFVSTenuZ
 0HLqfr7Uk0gw5gQgWfj4F0qjNxzmjhnw/pz+c1DRtYs6w6SGToCqcm5yRU6f8pLt
 SHc3LJ67xK5RnOq8+KJ8o92MfE29HH2CTzLzgghNrLnwqcYBTApuCr0OtpQb04Zf
 AgQRMq61IGXwCDiVFE1ElpRgrW4/aekUZh/JB8pGHlhrAvl+HwNYVek66MBDeMyl
 akmLeHhrCkuWstDHHz+o
 =m/XT
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-for-john-2014-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg <johannes@sipsolutions.net> says:

"Here are a few fixes for the wireless stack: one fixes the
RTS rate, one for a debugfs file, one to return the correct
channel to userspace, a sanity check for a userspace value
and the remaining two are just documentation fixes."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
John W. Linville 2014-10-27 13:38:15 -04:00
commit 99c814066e
6 changed files with 27 additions and 13 deletions

View File

@ -3458,7 +3458,7 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
rcu_read_lock(); rcu_read_lock();
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (chanctx_conf) { if (chanctx_conf) {
*chandef = chanctx_conf->def; *chandef = sdata->vif.bss_conf.chandef;
ret = 0; ret = 0;
} else if (local->open_count > 0 && } else if (local->open_count > 0 &&
local->open_count == local->monitors && local->open_count == local->monitors &&

View File

@ -448,7 +448,7 @@ static void rate_fixup_ratelist(struct ieee80211_vif *vif,
*/ */
if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) { if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) {
u32 basic_rates = vif->bss_conf.basic_rates; u32 basic_rates = vif->bss_conf.basic_rates;
s8 baserate = basic_rates ? ffs(basic_rates - 1) : 0; s8 baserate = basic_rates ? ffs(basic_rates) - 1 : 0;
rate = &sband->bitrates[rates[0].idx]; rate = &sband->bitrates[rates[0].idx];

View File

@ -62,14 +62,14 @@ minstrel_stats_open(struct inode *inode, struct file *file)
unsigned int i, tp, prob, eprob; unsigned int i, tp, prob, eprob;
char *p; char *p;
ms = kmalloc(sizeof(*ms) + 4096, GFP_KERNEL); ms = kmalloc(2048, GFP_KERNEL);
if (!ms) if (!ms)
return -ENOMEM; return -ENOMEM;
file->private_data = ms; file->private_data = ms;
p = ms->buf; p = ms->buf;
p += sprintf(p, "rate throughput ewma prob this prob " p += sprintf(p, "rate tpt eprob *prob"
"this succ/attempt success attempts\n"); " *ok(*cum) ok( cum)\n");
for (i = 0; i < mi->n_rates; i++) { for (i = 0; i < mi->n_rates; i++) {
struct minstrel_rate *mr = &mi->r[i]; struct minstrel_rate *mr = &mi->r[i];
struct minstrel_rate_stats *mrs = &mi->r[i].stats; struct minstrel_rate_stats *mrs = &mi->r[i].stats;
@ -86,8 +86,8 @@ minstrel_stats_open(struct inode *inode, struct file *file)
prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); prob = MINSTREL_TRUNC(mrs->cur_prob * 1000);
eprob = MINSTREL_TRUNC(mrs->probability * 1000); eprob = MINSTREL_TRUNC(mrs->probability * 1000);
p += sprintf(p, " %6u.%1u %6u.%1u %6u.%1u " p += sprintf(p, " %4u.%1u %3u.%1u %3u.%1u"
" %3u(%3u) %8llu %8llu\n", " %4u(%4u) %9llu(%9llu)\n",
tp / 10, tp % 10, tp / 10, tp % 10,
eprob / 10, eprob % 10, eprob / 10, eprob % 10,
prob / 10, prob % 10, prob / 10, prob % 10,
@ -102,6 +102,8 @@ minstrel_stats_open(struct inode *inode, struct file *file)
mi->sample_packets); mi->sample_packets);
ms->len = p - ms->buf; ms->len = p - ms->buf;
WARN_ON(ms->len + sizeof(*ms) > 2048);
return 0; return 0;
} }

View File

@ -63,8 +63,8 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
prob = MINSTREL_TRUNC(mr->cur_prob * 1000); prob = MINSTREL_TRUNC(mr->cur_prob * 1000);
eprob = MINSTREL_TRUNC(mr->probability * 1000); eprob = MINSTREL_TRUNC(mr->probability * 1000);
p += sprintf(p, " %6u.%1u %6u.%1u %6u.%1u " p += sprintf(p, " %4u.%1u %3u.%1u %3u.%1u "
"%3u %3u(%3u) %8llu %8llu\n", "%3u %4u(%4u) %9llu(%9llu)\n",
tp / 10, tp % 10, tp / 10, tp % 10,
eprob / 10, eprob % 10, eprob / 10, eprob % 10,
prob / 10, prob % 10, prob / 10, prob % 10,
@ -96,14 +96,15 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file)
return ret; return ret;
} }
ms = kmalloc(sizeof(*ms) + 8192, GFP_KERNEL); ms = kmalloc(8192, GFP_KERNEL);
if (!ms) if (!ms)
return -ENOMEM; return -ENOMEM;
file->private_data = ms; file->private_data = ms;
p = ms->buf; p = ms->buf;
p += sprintf(p, "type rate throughput ewma prob " p += sprintf(p, "type rate tpt eprob *prob "
"this prob retry this succ/attempt success attempts\n"); "ret *ok(*cum) ok( cum)\n");
p = minstrel_ht_stats_dump(mi, max_mcs, p); p = minstrel_ht_stats_dump(mi, max_mcs, p);
for (i = 0; i < max_mcs; i++) for (i = 0; i < max_mcs; i++)
@ -118,6 +119,8 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file)
MINSTREL_TRUNC(mi->avg_ampdu_len * 10) % 10); MINSTREL_TRUNC(mi->avg_ampdu_len * 10) % 10);
ms->len = p - ms->buf; ms->len = p - ms->buf;
WARN_ON(ms->len + sizeof(*ms) > 8192);
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
} }

View File

@ -336,6 +336,7 @@ struct ieee80211_tx_latency_stat {
* @known_smps_mode: the smps_mode the client thinks we are in. Relevant for * @known_smps_mode: the smps_mode the client thinks we are in. Relevant for
* AP only. * AP only.
* @cipher_scheme: optional cipher scheme for this station * @cipher_scheme: optional cipher scheme for this station
* @last_tdls_pkt_time: holds the time in jiffies of last TDLS pkt ACKed
*/ */
struct sta_info { struct sta_info {
/* General information, mostly static */ /* General information, mostly static */

View File

@ -5927,6 +5927,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
int err; int err;
bool need_new_beacon = false; bool need_new_beacon = false;
int len, i; int len, i;
u32 cs_count;
if (!rdev->ops->channel_switch || if (!rdev->ops->channel_switch ||
!(rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)) !(rdev->wiphy.flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH))
@ -5963,7 +5964,14 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
if (need_new_beacon && !info->attrs[NL80211_ATTR_CSA_IES]) if (need_new_beacon && !info->attrs[NL80211_ATTR_CSA_IES])
return -EINVAL; return -EINVAL;
params.count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]); /* Even though the attribute is u32, the specification says
* u8, so let's make sure we don't overflow.
*/
cs_count = nla_get_u32(info->attrs[NL80211_ATTR_CH_SWITCH_COUNT]);
if (cs_count > 255)
return -EINVAL;
params.count = cs_count;
if (!need_new_beacon) if (!need_new_beacon)
goto skip_beacons; goto skip_beacons;