aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2010-10-02 05:31:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-05 13:35:28 -0400
commit78be49ec2a0df34de9441930fdced20311fd709f (patch)
tree0eb6da18b78abc19e58b1cfd2375c548454186a8
parent5a5b6ed6ce46be128f2a5a9e56f47193c3ac3e32 (diff)
mac80211: distinct between max rates and the number of rates the hw can report
Some drivers cannot handle multiple retry rates specified by the rc algorithm but instead use their own retry table (for example rt2800). However, if such a device registers itself with a max_rates value of 1 the rc algorithm cannot make use of the extended information the device can provide about retried rates. On the other hand, if a device registers itself with a max_rates value > 1 the rc algorithm assumes that the device can handle multi rate retries. Fix this issue by introducing another hw parameter max_report_rates that can be set to a different value then max_rates to indicate if a device is capable of reporting more rates then specified in max_rates. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h6
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/mac80211/status.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fe8b9dae4dee..47316a653ae1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1109,7 +1109,10 @@ enum ieee80211_hw_flags {
1109 * @sta_data_size: size (in bytes) of the drv_priv data area 1109 * @sta_data_size: size (in bytes) of the drv_priv data area
1110 * within &struct ieee80211_sta. 1110 * within &struct ieee80211_sta.
1111 * 1111 *
1112 * @max_rates: maximum number of alternate rate retry stages 1112 * @max_rates: maximum number of alternate rate retry stages the hw
1113 * can handle.
1114 * @max_report_rates: maximum number of alternate rate retry stages
1115 * the hw can report back.
1113 * @max_rate_tries: maximum number of tries for each stage 1116 * @max_rate_tries: maximum number of tries for each stage
1114 * 1117 *
1115 * @napi_weight: weight used for NAPI polling. You must specify an 1118 * @napi_weight: weight used for NAPI polling. You must specify an
@@ -1131,6 +1134,7 @@ struct ieee80211_hw {
1131 u16 max_listen_interval; 1134 u16 max_listen_interval;
1132 s8 max_signal; 1135 s8 max_signal;
1133 u8 max_rates; 1136 u8 max_rates;
1137 u8 max_report_rates;
1134 u8 max_rate_tries; 1138 u8 max_rate_tries;
1135}; 1139};
1136 1140
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e127fbb8424e..9c2f3f934c74 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -537,6 +537,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
537 /* set up some defaults */ 537 /* set up some defaults */
538 local->hw.queues = 1; 538 local->hw.queues = 1;
539 local->hw.max_rates = 1; 539 local->hw.max_rates = 1;
540 local->hw.max_report_rates = 0;
540 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; 541 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
541 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; 542 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
542 local->user_power_level = -1; 543 local->user_power_level = -1;
@@ -612,6 +613,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
612 WLAN_CIPHER_SUITE_AES_CMAC 613 WLAN_CIPHER_SUITE_AES_CMAC
613 }; 614 };
614 615
616 if (hw->max_report_rates == 0)
617 hw->max_report_rates = hw->max_rates;
618
615 /* 619 /*
616 * generic code guarantees at least one band, 620 * generic code guarantees at least one band,
617 * set this very early because much code assumes 621 * set this very early because much code assumes
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index dd85006c4fe8..95763e036975 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -176,7 +176,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
176 176
177 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { 177 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
178 /* the HW cannot have attempted that rate */ 178 /* the HW cannot have attempted that rate */
179 if (i >= hw->max_rates) { 179 if (i >= hw->max_report_rates) {
180 info->status.rates[i].idx = -1; 180 info->status.rates[i].idx = -1;
181 info->status.rates[i].count = 0; 181 info->status.rates[i].count = 0;
182 } else if (info->status.rates[i].idx >= 0) { 182 } else if (info->status.rates[i].idx >= 0) {