linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate
@ 2013-02-27 12:00 Karl Beldan
  2013-02-27 12:00 ` [PATCH 2/2] mac80211: fix the check for mcs rates masking Karl Beldan
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Beldan @ 2013-02-27 12:00 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, the behavior remains unchanged.

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

diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index dd88381..cfbd7d5 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -459,9 +459,8 @@ 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));
+	mask = txrc->rate_idx_mask;
+	memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
 	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
 		if (sta) {
 			/* Filter out rates that the STA does not support */
-- 
1.7.10.GIT


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

* [PATCH 2/2] mac80211: fix the check for mcs rates masking
  2013-02-27 12:00 [PATCH 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Karl Beldan
@ 2013-02-27 12:00 ` Karl Beldan
  2013-02-27 13:38   ` Karl Beldan
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Beldan @ 2013-02-27 12:00 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Karl Beldan, Karl Beldan

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

Currently the mcs bitrates mask rate_idx_mcs_mask is only applied when
the pre-ht bitrates mask rate_idx_mask of the same band differs from the
default mask.
Fix it by comparing the rate_idx_mcs_mask with the ht_cap.mcs.rx_mask, the
copy of the rate_idx_mcs_mask is now done if the check succeeds.
This results, when no pre-ht bitrates is disabled && an mcs idx is, to
one more memcmp, otherwise the cost remains identical.

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

diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index cfbd7d5..4c0a14d 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -460,8 +460,11 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
 	 * the common case.
 	 */
 	mask = txrc->rate_idx_mask;
-	memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
-	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
+	if (mask != (1 << txrc->sband->n_bitrates) - 1 ||
+		memcmp(txrc->sband->ht_cap.mcs.rx_mask, txrc->rate_idx_mcs_mask,
+		       sizeof(txrc->rate_idx_mcs_mask))) {
+		memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
+
 		if (sta) {
 			/* Filter out rates that the STA does not support */
 			mask &= sta->sta.supp_rates[info->band];
-- 
1.7.10.GIT


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

* Re: [PATCH 2/2] mac80211: fix the check for mcs rates masking
  2013-02-27 12:00 ` [PATCH 2/2] mac80211: fix the check for mcs rates masking Karl Beldan
@ 2013-02-27 13:38   ` Karl Beldan
  2013-03-04 15:50     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Beldan @ 2013-02-27 13:38 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Karl Beldan

On Wed, Feb 27, 2013 at 01:00:34PM +0100, Karl Beldan wrote:
> From: Karl Beldan <karl.beldan@rivierawaves.com>
> 
> Currently the mcs bitrates mask rate_idx_mcs_mask is only applied when
> the pre-ht bitrates mask rate_idx_mask of the same band differs from the
> default mask.
> Fix it by comparing the rate_idx_mcs_mask with the ht_cap.mcs.rx_mask, the
> copy of the rate_idx_mcs_mask is now done if the check succeeds.
> This results, when no pre-ht bitrates is disabled && an mcs idx is, to
> one more memcmp, otherwise the cost remains identical.
> 
> Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
> ---
>  net/mac80211/rate.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
> index cfbd7d5..4c0a14d 100644
> --- a/net/mac80211/rate.c
> +++ b/net/mac80211/rate.c
> @@ -460,8 +460,11 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
>  	 * the common case.
>  	 */
>  	mask = txrc->rate_idx_mask;
> -	memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> -	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
> +	if (mask != (1 << txrc->sband->n_bitrates) - 1 ||
> +		memcmp(txrc->sband->ht_cap.mcs.rx_mask, txrc->rate_idx_mcs_mask,
> +		       sizeof(txrc->rate_idx_mcs_mask))) {
> +		memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> +
>  		if (sta) {
> 

I don't know why I refrained myself from getting rid of the copies of
the masks altogether.

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

* Re: [PATCH 2/2] mac80211: fix the check for mcs rates masking
  2013-02-27 13:38   ` Karl Beldan
@ 2013-03-04 15:50     ` Johannes Berg
  2013-03-04 18:28       ` Karl Beldan
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2013-03-04 15:50 UTC (permalink / raw)
  To: Karl Beldan; +Cc: linux-wireless, Karl Beldan

On Wed, 2013-02-27 at 14:38 +0100, Karl Beldan wrote:

> >  	mask = txrc->rate_idx_mask;
> > -	memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> > -	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
> > +	if (mask != (1 << txrc->sband->n_bitrates) - 1 ||
> > +		memcmp(txrc->sband->ht_cap.mcs.rx_mask, txrc->rate_idx_mcs_mask,
> > +		       sizeof(txrc->rate_idx_mcs_mask))) {
> > +		memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> > +
> >  		if (sta) {
> > 
> 
> I don't know why I refrained myself from getting rid of the copies of
> the masks altogether.

Are you going to resend?

johannes


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

* Re: [PATCH 2/2] mac80211: fix the check for mcs rates masking
  2013-03-04 15:50     ` Johannes Berg
@ 2013-03-04 18:28       ` Karl Beldan
  0 siblings, 0 replies; 5+ messages in thread
From: Karl Beldan @ 2013-03-04 18:28 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Karl Beldan

On Mon, Mar 04, 2013 at 04:50:28PM +0100, Johannes Berg wrote:
> On Wed, 2013-02-27 at 14:38 +0100, Karl Beldan wrote:
> 
> > >  	mask = txrc->rate_idx_mask;
> > > -	memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> > > -	if (mask != (1 << txrc->sband->n_bitrates) - 1) {
> > > +	if (mask != (1 << txrc->sband->n_bitrates) - 1 ||
> > > +		memcmp(txrc->sband->ht_cap.mcs.rx_mask, txrc->rate_idx_mcs_mask,
> > > +		       sizeof(txrc->rate_idx_mcs_mask))) {
> > > +		memcpy(mcs_mask, txrc->rate_idx_mcs_mask, sizeof(mcs_mask));
> > > +
> > >  		if (sta) {
> > > 
> > 
> > I don't know why I refrained myself from getting rid of the copies of
> > the masks altogether.
> 
> Are you going to resend?
> 
Just did.


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

end of thread, other threads:[~2013-03-04 18:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27 12:00 [PATCH 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Karl Beldan
2013-02-27 12:00 ` [PATCH 2/2] mac80211: fix the check for mcs rates masking Karl Beldan
2013-02-27 13:38   ` Karl Beldan
2013-03-04 15:50     ` Johannes Berg
2013-03-04 18:28       ` Karl Beldan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).