diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2012-04-11 02:47:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-13 14:32:50 -0400 |
commit | 4ee73f338a528f44fd90496adfbfd9c119401850 (patch) | |
tree | 665c02d2ec013a09b252713c8f94b604f6050cc7 /net/mac80211/rc80211_minstrel.c | |
parent | f58cc809d2fe60989095c7b55fd14e1935a2f72a (diff) |
mac80211: remove hw.conf.channel usage where possible
Removes hw.conf.channel usage from the following functions:
* ieee80211_mandatory_rates
* ieee80211_sta_get_rates
* ieee80211_frame_duration
* ieee80211_rts_duration
* ieee80211_ctstoself_duration
This is in preparation for multi-channel operation.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel.c')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 13 |
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 | ||
336 | static void | 336 | static void |
337 | calc_rate_durations(struct ieee80211_local *local, struct minstrel_rate *d, | 337 | calc_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) */ |