diff options
author | Mattias Nissler <mattias.nissler@gmx.de> | 2007-12-20 07:50:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:59:17 -0500 |
commit | 1abbe498e4b5e4f2000dfc30a0fa25be9553530e (patch) | |
tree | 8f899d2f623b2316f874fd8ae4b84838ad4e8b40 /net/mac80211/ieee80211_sta.c | |
parent | 98f0b0a3a412eade153c7cf00c6b863600980d89 (diff) |
mac80211: clean up rate selection
Move some code out of rc80211_simple since it's probably needed for all rate
selection algorithms, and fix iwlwifi accordingly. While at it, clean up the
rate_control_get_rate() interface.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_sta.c')
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 3c552fed2af5..3978ad606b5c 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -2463,9 +2463,8 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2463 | struct sk_buff *skb; | 2463 | struct sk_buff *skb; |
2464 | struct ieee80211_mgmt *mgmt; | 2464 | struct ieee80211_mgmt *mgmt; |
2465 | struct ieee80211_tx_control control; | 2465 | struct ieee80211_tx_control control; |
2466 | struct ieee80211_rate *rate; | ||
2467 | struct ieee80211_hw_mode *mode; | 2466 | struct ieee80211_hw_mode *mode; |
2468 | struct rate_control_extra extra; | 2467 | struct rate_selection ratesel; |
2469 | u8 *pos; | 2468 | u8 *pos; |
2470 | struct ieee80211_sub_if_data *sdata; | 2469 | struct ieee80211_sub_if_data *sdata; |
2471 | 2470 | ||
@@ -2550,18 +2549,16 @@ static int ieee80211_sta_join_ibss(struct net_device *dev, | |||
2550 | } | 2549 | } |
2551 | 2550 | ||
2552 | memset(&control, 0, sizeof(control)); | 2551 | memset(&control, 0, sizeof(control)); |
2553 | memset(&extra, 0, sizeof(extra)); | 2552 | rate_control_get_rate(dev, local->oper_hw_mode, skb, &ratesel); |
2554 | extra.mode = local->oper_hw_mode; | 2553 | if (!ratesel.rate) { |
2555 | rate = rate_control_get_rate(local, dev, skb, &extra); | ||
2556 | if (!rate) { | ||
2557 | printk(KERN_DEBUG "%s: Failed to determine TX rate " | 2554 | printk(KERN_DEBUG "%s: Failed to determine TX rate " |
2558 | "for IBSS beacon\n", dev->name); | 2555 | "for IBSS beacon\n", dev->name); |
2559 | break; | 2556 | break; |
2560 | } | 2557 | } |
2561 | control.tx_rate = | 2558 | control.tx_rate = |
2562 | ((sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE) && | 2559 | ((sdata->flags & IEEE80211_SDATA_SHORT_PREAMBLE) && |
2563 | (rate->flags & IEEE80211_RATE_PREAMBLE2)) ? | 2560 | (ratesel.rate->flags & IEEE80211_RATE_PREAMBLE2)) ? |
2564 | rate->val2 : rate->val; | 2561 | ratesel.rate->val2 : ratesel.rate->val; |
2565 | control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; | 2562 | control.antenna_sel_tx = local->hw.conf.antenna_sel_tx; |
2566 | control.power_level = local->hw.conf.power_level; | 2563 | control.power_level = local->hw.conf.power_level; |
2567 | control.flags |= IEEE80211_TXCTL_NO_ACK; | 2564 | control.flags |= IEEE80211_TXCTL_NO_ACK; |