aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rc80211_minstrel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rc80211_minstrel.c')
-rw-r--r--net/mac80211/rc80211_minstrel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index b39dda523f39..79633ae06fd6 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -334,14 +334,15 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
334 334
335 335
336static void 336static void
337calc_rate_durations(struct ieee80211_local *local, struct minstrel_rate *d, 337calc_rate_durations(enum ieee80211_band band,
338 struct minstrel_rate *d,
338 struct ieee80211_rate *rate) 339 struct ieee80211_rate *rate)
339{ 340{
340 int erp = !!(rate->flags & IEEE80211_RATE_ERP_G); 341 int erp = !!(rate->flags & IEEE80211_RATE_ERP_G);
341 342
342 d->perfect_tx_time = ieee80211_frame_duration(local, 1200, 343 d->perfect_tx_time = ieee80211_frame_duration(band, 1200,
343 rate->bitrate, erp, 1); 344 rate->bitrate, erp, 1);
344 d->ack_time = ieee80211_frame_duration(local, 10, 345 d->ack_time = ieee80211_frame_duration(band, 10,
345 rate->bitrate, erp, 1); 346 rate->bitrate, erp, 1);
346} 347}
347 348
@@ -379,14 +380,14 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
379{ 380{
380 struct minstrel_sta_info *mi = priv_sta; 381 struct minstrel_sta_info *mi = priv_sta;
381 struct minstrel_priv *mp = priv; 382 struct minstrel_priv *mp = priv;
382 struct ieee80211_local *local = hw_to_local(mp->hw);
383 struct ieee80211_rate *ctl_rate; 383 struct ieee80211_rate *ctl_rate;
384 unsigned int i, n = 0; 384 unsigned int i, n = 0;
385 unsigned int t_slot = 9; /* FIXME: get real slot time */ 385 unsigned int t_slot = 9; /* FIXME: get real slot time */
386 386
387 mi->lowest_rix = rate_lowest_index(sband, sta); 387 mi->lowest_rix = rate_lowest_index(sband, sta);
388 ctl_rate = &sband->bitrates[mi->lowest_rix]; 388 ctl_rate = &sband->bitrates[mi->lowest_rix];
389 mi->sp_ack_dur = ieee80211_frame_duration(local, 10, ctl_rate->bitrate, 389 mi->sp_ack_dur = ieee80211_frame_duration(sband->band, 10,
390 ctl_rate->bitrate,
390 !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1); 391 !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1);
391 392
392 for (i = 0; i < sband->n_bitrates; i++) { 393 for (i = 0; i < sband->n_bitrates; i++) {
@@ -402,7 +403,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
402 403
403 mr->rix = i; 404 mr->rix = i;
404 mr->bitrate = sband->bitrates[i].bitrate / 5; 405 mr->bitrate = sband->bitrates[i].bitrate / 5;
405 calc_rate_durations(local, mr, &sband->bitrates[i]); 406 calc_rate_durations(sband->band, mr, &sband->bitrates[i]);
406 407
407 /* calculate maximum number of retransmissions before 408 /* calculate maximum number of retransmissions before
408 * fallback (based on maximum segment size) */ 409 * fallback (based on maximum segment size) */