netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 08/10] mac80211: Support on-channel scan option.
Date: Thu, 12 Apr 2012 05:45:56 +0200	[thread overview]
Message-ID: <1334202356.3788.7.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1334166738-28243-9-git-send-email-greearb@candelatech.com> (sfid-20120411_195349_401873_95D8A0F4)

On Wed, 2012-04-11 at 10:52 -0700, greearb@candelatech.com wrote:

>  static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
>  				  struct cfg80211_scan_request *req)
> @@ -438,10 +461,43 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
>  	local->scan_req = req;
>  	local->scan_sdata = sdata;
>  
> -	if (local->ops->hw_scan)
> +	if (local->ops->hw_scan) {
>  		__set_bit(SCAN_HW_SCANNING, &local->scanning);
> -	else
> -		__set_bit(SCAN_SW_SCANNING, &local->scanning);
> +	} else {
> +		/* If we are scanning only on the current channel, then
> +		 * we do not need to stop normal activities
> +		 */
> +		if ((req->n_channels == 1) &&
> +		    (req->channels[0]->center_freq ==
> +		     local->hw.conf.channel->center_freq)) {

how about "else if {", then the indentation isn't so deep and you can
have much nicer code in the entire block :)

> +			unsigned long next_delay;

please add a blank line after variable declarations.

> +		}
> +		else {

please read the coding style documentation

> @@ -672,6 +704,12 @@ void ieee80211_scan_work(struct work_struct *work)
>  
>  	sdata = local->scan_sdata;
>  
> +	/* When scanning on-channel, the first-callback means completeed. */

typo "completed"

> +	if (test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning)) {
> +		aborted = test_and_clear_bit(SCAN_ABORTED, &local->scanning);
> +		goto out_complete;
> +	}

how does the onchannel bit get cleared?

Shouldn't you be calling pre/post scan hooks?


I'm a bit divided over this. On the one hand, it seems like a mildly
useful optimisation, on the other though it adds a bunch of complexity
for multi-channel we've been thinking about... Not that we want to
support multi-channel with SW scan anyway, but still.

johannes

  reply	other threads:[~2012-04-12  3:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 17:52 [PATCH 00/10] Wireless patches for wireless-testing greearb
2012-04-11 17:52 ` [PATCH 01/10] cfg80211: Add framework to support ethtool stats greearb
2012-04-11 17:52 ` [PATCH 02/10] mac80211: Support getting sta_info stats via ethtool greearb
2012-04-11 17:52 ` [PATCH 03/10] mac80211: Framework to get wifi-driver " greearb
2012-04-11 17:52 ` [PATCH 04/10] ath9k: Support ethtool getstats api greearb
2012-04-11 17:52 ` [PATCH 07/10] ath9k: Add tx-failed counter greearb
     [not found] ` <1334166738-28243-1-git-send-email-greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
2012-04-11 17:52   ` [PATCH 05/10] mac80211: Add more ethtools stats: survey, rates, etc greearb-my8/4N5VtI7c+919tysfdA
     [not found]     ` <1334166738-28243-6-git-send-email-greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
2012-04-11 18:01       ` Ben Greear
2012-04-12  3:46       ` Johannes Berg
     [not found]         ` <1334202406.3788.8.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2012-04-12 14:50           ` Ben Greear
2012-04-12 15:23         ` Ben Greear
2012-04-11 17:52   ` [PATCH 06/10] mac80211: Add sta_state to ethtool stats greearb-my8/4N5VtI7c+919tysfdA
2012-04-12  3:49     ` Johannes Berg
2012-04-12 14:48       ` Ben Greear
2012-04-11 17:52   ` [PATCH 08/10] mac80211: Support on-channel scan option greearb-my8/4N5VtI7c+919tysfdA
2012-04-12  3:45     ` Johannes Berg [this message]
2012-04-12 15:03       ` Ben Greear
2012-04-11 17:52   ` [PATCH 09/10] ath9k: Add more recv stats greearb-my8/4N5VtI7c+919tysfdA
2012-04-12  3:39   ` [PATCH 00/10] Wireless patches for wireless-testing Johannes Berg
2012-04-11 17:52 ` [PATCH 10/10] ath9k: Gather and report IRQ sync_cause errors greearb

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=1334202356.3788.7.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).