diff options
author | Christian Lamparter <chunkeey@web.de> | 2008-12-22 09:35:31 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-12 14:24:55 -0500 |
commit | d57854bb1d78ba89ffbfdfd1c3e95b52ed7478ff (patch) | |
tree | c92947608e8457129a97c6ac43dad460a9a4cab0 /net | |
parent | d3a1db1c67735063921d9186145fc86164cf9781 (diff) |
minstrel: fix warning if lowest supported rate index is not 0
This patch fixes the following WARNING (caused by rix_to_ndx): "
>WARNING: at net/mac80211/rc80211_minstrel.c:69 minstrel_rate_init+0xd2/0x33a [mac80211]()
>[...]
>Call Trace:
> warn_on_slowpath+0x51/0x75
> _format_mac_addr+0x4c/0x88
> minstrel_rate_init+0xd2/0x33a [mac80211]
> print_mac+0x16/0x1b
> schedule_hrtimeout_range+0xdc/0x107
> ieee80211_add_station+0x158/0x1bd [mac80211]
> nl80211_new_station+0x1b3/0x20b [cfg80211]
The reason is that I'm experimenting with "g" only mode on a 802.11 b/g card.
Therefore rate_lowest_index returns 4 (= 6Mbit, instead of usual 0 = 1Mbit).
Since mi->r array is initialized with zeros in minstrel_alloc_sta,
rix_to_ndx has a hard time to find the 6Mbit entry and will trigged the WARNING.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 2b3b490a6073..3824990d340b 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -395,13 +395,15 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
395 | { | 395 | { |
396 | struct minstrel_sta_info *mi = priv_sta; | 396 | struct minstrel_sta_info *mi = priv_sta; |
397 | struct minstrel_priv *mp = priv; | 397 | struct minstrel_priv *mp = priv; |
398 | struct minstrel_rate *mr_ctl; | 398 | struct ieee80211_local *local = hw_to_local(mp->hw); |
399 | struct ieee80211_rate *ctl_rate; | ||
399 | unsigned int i, n = 0; | 400 | unsigned int i, n = 0; |
400 | unsigned int t_slot = 9; /* FIXME: get real slot time */ | 401 | unsigned int t_slot = 9; /* FIXME: get real slot time */ |
401 | 402 | ||
402 | mi->lowest_rix = rate_lowest_index(sband, sta); | 403 | mi->lowest_rix = rate_lowest_index(sband, sta); |
403 | mr_ctl = &mi->r[rix_to_ndx(mi, mi->lowest_rix)]; | 404 | ctl_rate = &sband->bitrates[mi->lowest_rix]; |
404 | mi->sp_ack_dur = mr_ctl->ack_time; | 405 | mi->sp_ack_dur = ieee80211_frame_duration(local, 10, ctl_rate->bitrate, |
406 | !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1); | ||
405 | 407 | ||
406 | for (i = 0; i < sband->n_bitrates; i++) { | 408 | for (i = 0; i < sband->n_bitrates; i++) { |
407 | struct minstrel_rate *mr = &mi->r[n]; | 409 | struct minstrel_rate *mr = &mi->r[n]; |
@@ -416,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
416 | 418 | ||
417 | mr->rix = i; | 419 | mr->rix = i; |
418 | mr->bitrate = sband->bitrates[i].bitrate / 5; | 420 | mr->bitrate = sband->bitrates[i].bitrate / 5; |
419 | calc_rate_durations(mi, hw_to_local(mp->hw), mr, | 421 | calc_rate_durations(mi, local, mr, |
420 | &sband->bitrates[i]); | 422 | &sband->bitrates[i]); |
421 | 423 | ||
422 | /* calculate maximum number of retransmissions before | 424 | /* calculate maximum number of retransmissions before |