Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Thomas Pedersen <thomas@cozybit.com>
Cc: linux-wireless@vger.kernel.org, devel@lists.open80211s.org
Subject: Re: [PATCH v2] mac80211: dynamic short slot time for MBSSs
Date: Sun, 27 Jan 2013 00:04:23 +0100	[thread overview]
Message-ID: <1359241463.9086.4.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1359232645-10563-1-git-send-email-thomas@cozybit.com> (sfid-20130126_213837_005675_90531EEB)


> +	sband = local->hw.wiphy->bands[band];
> +	bitrates = sband->bitrates;

It might be interesting to loop once here and build a bitmap (in an
unsigned long) of rates marked ERP_G. Something like

erp_rates = 0;
for (i = 0; i < sband->n_bitrates; i++)
	if (bitrates[i].flags & ...)
		erp_rates |= BIT(i);


> +	rcu_read_lock();
> +	list_for_each_entry_rcu(sta, &local->sta_list, list) {
> +		if (sdata != sta->sdata ||
> +		    sta->plink_state != NL80211_PLINK_ESTAB)
> +			continue;
> +
> +		short_slot = false;
> +		rates = sta->sta.supp_rates[band];
> +		for_each_set_bit(i, (unsigned long *)&rates,
> +				 sizeof(rates) * BITS_PER_BYTE) {
> +			if (bitrates[i].flags & IEEE80211_RATE_ERP_G) {
> +				short_slot = true;
> +				break;
> +			}
> +		}
> +
> +		if (!short_slot)
> +			break;

Then the inner bitrate loop here becomes just

		if (!(rates & erp_rates)) {
			short_slot = false;
			break;
		}

which assumes "short_slot = true" as a precondition to going into the
sta loop.

(although that does change the overall logic to enable short slot when
NO stations are present)

johannes


  parent reply	other threads:[~2013-01-26 23:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 20:37 [PATCH v2] mac80211: dynamic short slot time for MBSSs Thomas Pedersen
2013-01-26 22:58 ` Johannes Berg
2013-01-26 23:05   ` Johannes Berg
2013-01-26 23:04 ` Johannes Berg [this message]
2013-01-26 23:36   ` Thomas Pedersen
2013-01-26 23:48     ` Johannes Berg

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=1359241463.9086.4.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=linux-wireless@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox