All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Ashok Nagarajan <ashok@cozybit.com>
Cc: linux-wireless@vger.kernel.org, javier@cozybit.com,
	thomas@cozybit.com, devel@lists.open80211s.org,
	linville@tuxdriver.com
Subject: Re: [[PATCH v2 3/4] mac80211: Modify sta_get_rates to give basic rates
Date: Mon, 02 Apr 2012 12:37:46 +0200	[thread overview]
Message-ID: <1333363066.3498.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1333225930-320-3-git-send-email-ashok@cozybit.com> (sfid-20120331_223256_081687_5E78117C)

On Sat, 2012-03-31 at 13:32 -0700, Ashok Nagarajan wrote:

> @@ -1127,15 +1127,25 @@ u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
>  		     elems->ext_supp_rates_len; i++) {
>  		u8 rate = 0;
>  		int own_rate;
> +		bool is_basic;
>  		if (i < elems->supp_rates_len)
>  			rate = elems->supp_rates[i];
>  		else if (elems->ext_supp_rates)
>  			rate = elems->ext_supp_rates
>  				[i - elems->supp_rates_len];
>  		own_rate = 5 * (rate & 0x7f);
> -		for (j = 0; j < num_rates; j++)
> -			if (bitrates[j].bitrate == own_rate)
> +		is_basic = !!(rate & 0x80);
> +
> +		if (is_basic && (rate & 0x7f) == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
> +			continue;
> +
> +		for (j = 0; j < num_rates; j++) {
> +			if (bitrates[j].bitrate == own_rate) {
>  				supp_rates |= BIT(j);
> +				if (basic_rates && is_basic)
> +					*basic_rates |= BIT(j);
> +			}
> +		}

Seems it'd be worth skipping the entire logic if basic_rates is NULL?

johannes


  reply	other threads:[~2012-04-02 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 20:32 [[PATCH v2 1/4] mac80211: Use mandatory rates as basic rates when starting mesh Ashok Nagarajan
2012-03-31 20:32 ` [[PATCH v2 2/4] mac80211: Indicate basic rates when adding rate IEs Ashok Nagarajan
2012-03-31 20:32 ` [[PATCH v2 3/4] mac80211: Modify sta_get_rates to give basic rates Ashok Nagarajan
2012-04-02 10:37   ` Johannes Berg [this message]
2012-04-02 10:41     ` Johannes Berg
2012-03-31 20:32 ` [[PATCH v2 4/4] mac80211: Check basic rates when peering Ashok Nagarajan
2012-04-03  2:30   ` Ashok Nagarajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333363066.3498.2.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ashok@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=thomas@cozybit.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.