iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: "Alvin Šipraga" <alvin@pqrs.dk>, iwd@lists.linux.dev
Cc: "Alvin Šipraga" <alsi@bang-olufsen.dk>
Subject: Re: [RFC PATCH] scan: retry scan based on scan done events per wiphy, not wdev
Date: Thu, 17 Nov 2022 11:49:02 -0600	[thread overview]
Message-ID: <eead8130-e13b-e1eb-6453-e27b1d293c31@gmail.com> (raw)
In-Reply-To: <20221117172901.2459224-1-alvin@pqrs.dk>

Hi Alvin,

On 11/17/22 11:29, Alvin Šipraga wrote:
> From: Alvin Šipraga <alsi@bang-olufsen.dk>
> 
> ---
>   src/scan.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 46 insertions(+), 1 deletion(-)
> 
> diff --git a/src/scan.c b/src/scan.c
> index 5548914a12de..c3763ee41173 100644
> --- a/src/scan.c
> +++ b/src/scan.c

<snip>

> @@ -231,6 +247,7 @@ static void scan_request_triggered(struct l_genl_msg *msg, void *userdata)
>   	if (err < 0) {
>   		/* Scan in progress, assume another scan is running */
>   		if (err == -EBUSY) {
> +			l_debug("XXX busy");

This might need a nicer message

>   			sc->state = SCAN_STATE_PASSIVE;
>   			return;
>   		}
> @@ -2044,6 +2061,29 @@ static void scan_parse_result_frequencies(struct l_genl_msg *msg,
>   	}
>   }
>   
> +static void scan_retry_pending(uint32_t wiphy_id)
> +{
> +	struct scan_context *sc = l_queue_find(scan_contexts,
> +					       scan_context_match_retry,
> +					       &wiphy_id);
> +	struct scan_request *sr;
> +
> +	l_debug("");
> +
> +	if (!sc)
> +		return;
> +
> +	sr = l_queue_peek_head(sc->requests);
> +
> +	if (L_WARN_ON(!sr))
> +		return;

Also you could simplify out the need for this L_WARN_ON by using 
l_queue_get_entries() style for loop on the scan_context(s) instead of using 
l_queue_find.  But that's just me nitpicking.

> +
> +	l_debug("XXX retry pending request");
> +
> +	sc->state = SCAN_STATE_NOT_RUNNING;
> +	start_next_scan_request(&sr->work);
> +}
> +

Otherwise this looks fine to me.  Does it work?

Regards,
-Denis

  reply	other threads:[~2022-11-17 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 17:29 [RFC PATCH] scan: retry scan based on scan done events per wiphy, not wdev Alvin Šipraga
2022-11-17 17:49 ` Denis Kenzior [this message]
2022-11-17 18:29   ` Alvin Šipraga

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=eead8130-e13b-e1eb-6453-e27b1d293c31@gmail.com \
    --to=denkenz@gmail.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=alvin@pqrs.dk \
    --cc=iwd@lists.linux.dev \
    /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).