diff options
author | Thomas Huehn <thomas@net.t-labs.tu-berlin.de> | 2012-07-02 13:46:16 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-07-03 07:48:37 -0400 |
commit | e3e1a0bcb3f192fe2f95f86a74bd4e7967341e74 (patch) | |
tree | ed07b2c0a4bd814263bc1b85183ed0d1040ba274 | |
parent | cb831b537d50d21f6afb5dffbde4cf6523627461 (diff) |
mac80211: reduce IEEE80211_TX_MAX_RATES
IEEE80211_TX_MAX_RATES can be reduced from 5 to 4 as there
is no current hardware supporting a rate chain with 5 multi
rate stages (mrr), so 4 mrr stages are sufficient.
The memory that is freed within the ieee80211_tx_info struct
will be used in the upcoming Transmission Power Control (TPC)
implementation.
Suggested-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/ath/carl9170/tx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/p54/txrx.c | 6 | ||||
-rw-r--r-- | include/net/mac80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/tx.c | 3 |
4 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index aed305177af6..ede0b572cebc 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c | |||
@@ -277,11 +277,11 @@ static void carl9170_tx_release(struct kref *ref) | |||
277 | return; | 277 | return; |
278 | 278 | ||
279 | BUILD_BUG_ON( | 279 | BUILD_BUG_ON( |
280 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23); | 280 | offsetof(struct ieee80211_tx_info, status.ack_signal) != 20); |
281 | 281 | ||
282 | memset(&txinfo->status.ampdu_ack_len, 0, | 282 | memset(&txinfo->status.ack_signal, 0, |
283 | sizeof(struct ieee80211_tx_info) - | 283 | sizeof(struct ieee80211_tx_info) - |
284 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); | 284 | offsetof(struct ieee80211_tx_info, status.ack_signal)); |
285 | 285 | ||
286 | if (atomic_read(&ar->tx_total_queued)) | 286 | if (atomic_read(&ar->tx_total_queued)) |
287 | ar->tx_schedule = true; | 287 | ar->tx_schedule = true; |
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c index 82a1cac920bd..f38786e02623 100644 --- a/drivers/net/wireless/p54/txrx.c +++ b/drivers/net/wireless/p54/txrx.c | |||
@@ -422,11 +422,11 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb) | |||
422 | * Clear manually, ieee80211_tx_info_clear_status would | 422 | * Clear manually, ieee80211_tx_info_clear_status would |
423 | * clear the counts too and we need them. | 423 | * clear the counts too and we need them. |
424 | */ | 424 | */ |
425 | memset(&info->status.ampdu_ack_len, 0, | 425 | memset(&info->status.ack_signal, 0, |
426 | sizeof(struct ieee80211_tx_info) - | 426 | sizeof(struct ieee80211_tx_info) - |
427 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); | 427 | offsetof(struct ieee80211_tx_info, status.ack_signal)); |
428 | BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, | 428 | BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, |
429 | status.ampdu_ack_len) != 23); | 429 | status.ack_signal) != 20); |
430 | 430 | ||
431 | if (entry_hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_ALIGN)) | 431 | if (entry_hdr->flags & cpu_to_le16(P54_HDR_FLAG_DATA_ALIGN)) |
432 | pad = entry_data->align[0]; | 432 | pad = entry_data->align[0]; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index dc2a97af95e7..3f1b58cf9c8c 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -475,7 +475,7 @@ enum mac80211_rate_control_flags { | |||
475 | #define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 | 475 | #define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 |
476 | 476 | ||
477 | /* maximum number of rate stages */ | 477 | /* maximum number of rate stages */ |
478 | #define IEEE80211_TX_MAX_RATES 5 | 478 | #define IEEE80211_TX_MAX_RATES 4 |
479 | 479 | ||
480 | /** | 480 | /** |
481 | * struct ieee80211_tx_rate - rate selection/status | 481 | * struct ieee80211_tx_rate - rate selection/status |
@@ -563,11 +563,11 @@ struct ieee80211_tx_info { | |||
563 | } control; | 563 | } control; |
564 | struct { | 564 | struct { |
565 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; | 565 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; |
566 | u8 ampdu_ack_len; | ||
567 | int ack_signal; | 566 | int ack_signal; |
567 | u8 ampdu_ack_len; | ||
568 | u8 ampdu_len; | 568 | u8 ampdu_len; |
569 | u8 antenna; | 569 | u8 antenna; |
570 | /* 14 bytes free */ | 570 | /* 21 bytes free */ |
571 | } status; | 571 | } status; |
572 | struct { | 572 | struct { |
573 | struct ieee80211_tx_rate driver_rates[ | 573 | struct ieee80211_tx_rate driver_rates[ |
@@ -634,7 +634,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
634 | info->status.rates[i].count = 0; | 634 | info->status.rates[i].count = 0; |
635 | 635 | ||
636 | BUILD_BUG_ON( | 636 | BUILD_BUG_ON( |
637 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23); | 637 | offsetof(struct ieee80211_tx_info, status.ack_signal) != 20); |
638 | memset(&info->status.ampdu_ack_len, 0, | 638 | memset(&info->status.ampdu_ack_len, 0, |
639 | sizeof(struct ieee80211_tx_info) - | 639 | sizeof(struct ieee80211_tx_info) - |
640 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); | 640 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 364a1e7b4afa..c9d2175d15c1 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -959,8 +959,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) | |||
959 | info->control.rates[1].idx = -1; | 959 | info->control.rates[1].idx = -1; |
960 | info->control.rates[2].idx = -1; | 960 | info->control.rates[2].idx = -1; |
961 | info->control.rates[3].idx = -1; | 961 | info->control.rates[3].idx = -1; |
962 | info->control.rates[4].idx = -1; | 962 | BUILD_BUG_ON(IEEE80211_TX_MAX_RATES != 4); |
963 | BUILD_BUG_ON(IEEE80211_TX_MAX_RATES != 5); | ||
964 | info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 963 | info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
965 | } else { | 964 | } else { |
966 | hdr->frame_control &= ~morefrags; | 965 | hdr->frame_control &= ~morefrags; |