All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate
@ 2013-03-04 18:27 Karl Beldan
  2013-03-04 18:27 ` [PATCH v2 2/2] mac80211: fix the check for mcs rates masking Karl Beldan
  2013-03-04 20:12 ` [PATCH v2 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Johannes Berg
  0 siblings, 2 replies; 16+ messages in thread
From: Karl Beldan @ 2013-03-04 18:27 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Karl Beldan, Karl Beldan

From: Karl Beldan <karl.beldan@rivierawaves.com>

Currently it gets it from the sdata. This uses and updates the ad-hoc
masks of the ieee80211_tx_rate_control instead of copying them.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
---
 net/mac80211/rate.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index dd88381..c1e5f25 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -435,8 +435,8 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_sta *ista = NULL;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb);
 	int i;
-	u32 mask;
-	u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN];
+	u32 *mask;
+	u8 *mcs_mask;
 
 	if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) {
 		ista = &sta->sta;
@@ -459,14 +459,13 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
 	 * default mask (allow all rates) is used to save some processing for
 	 * the common case.
 	 */
-	mask = sdata->rc_rateidx_mask[info->band];
-	memcpy(mcs_mask, sdata->rc_rateidx_mcs_mask[info->band],
-	       sizeof(mcs_mask));
-	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
+	mask = &txrc->rate_idx_mask;
+	mcs_mask = txrc->rate_idx_mcs_mask;
+	if (*mask != (1 << txrc->sband->n_bitrates) - 1) {
 		if (sta) {
 			/* Filter out rates that the STA does not support */
-			mask &= sta->sta.supp_rates[info->band];
-			for (i = 0; i < sizeof(mcs_mask); i++)
+			*mask &= sta->sta.supp_rates[info->band];
+			for (i = 0; i < sizeof(txrc->rate_idx_mcs_mask); i++)
 				mcs_mask[i] &= sta->sta.ht_cap.mcs.rx_mask[i];
 		}
 		/*
@@ -479,7 +478,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
 			if (info->control.rates[i].idx < 0)
 				break;
 			rate_idx_match_mask(&info->control.rates[i], txrc,
-					    mask, mcs_mask);
+					    *mask, mcs_mask);
 		}
 	}
 
-- 
1.7.10.GIT


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-03-16 12:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 18:27 [PATCH v2 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Karl Beldan
2013-03-04 18:27 ` [PATCH v2 2/2] mac80211: fix the check for mcs rates masking Karl Beldan
2013-03-04 20:13   ` Johannes Berg
2013-03-04 20:51     ` john
2013-03-04 20:12 ` [PATCH v2 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Johannes Berg
2013-03-04 20:45   ` john
2013-03-05 13:29     ` Felix Fietkau
2013-03-05 16:10       ` Karl Beldan
2013-03-05 18:53         ` Johannes Berg
2013-03-05 22:27           ` john
2013-03-10 22:35             ` Karl Beldan
2013-03-10 22:16       ` Karl Beldan
2013-03-10 22:27         ` Felix Fietkau
2013-03-10 23:06           ` Karl Beldan
2013-03-10 23:33             ` Felix Fietkau
2013-03-15 15:46             ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.