From: Johannes Berg <johannes@sipsolutions.net>
To: Luciano Coelho <coelho@ti.com>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com
Subject: Re: [PATCH 2/3] mac80211: add support for HW scheduled scan
Date: Mon, 09 May 2011 10:22:21 +0200 [thread overview]
Message-ID: <1304929342.3475.8.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1304600420-24227-3-git-send-email-coelho@ti.com>
On Thu, 2011-05-05 at 16:00 +0300, Luciano Coelho wrote:
> +TRACE_EVENT(drv_sched_scan_start,
> + TP_PROTO(struct ieee80211_local *local,
> + struct ieee80211_sub_if_data *sdata,
> + struct cfg80211_sched_scan_request *req),
Since you're not tracing "req" (right now), could you please use
DECLARE_EVENT_CLASS() and define a common class for this and some others
that only have local and sdata?
> +TRACE_EVENT(api_sched_scan_results,
> + TP_PROTO(struct ieee80211_local *local),
and use the local_only_evt class here, cf. drv_start() for example.
> +TRACE_EVENT(api_sched_scan_stopped,
> + TP_PROTO(struct ieee80211_local *local),
ditto.
Also -- no API tracers for results/stopped?
> diff --git a/net/mac80211/main.c b/net/mac80211/main.c
> index 6187766..9a20671 100644
> --- a/net/mac80211/main.c
> +++ b/net/mac80211/main.c
> @@ -47,7 +47,7 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
> if (atomic_read(&local->iff_allmultis))
> new_flags |= FIF_ALLMULTI;
>
> - if (local->monitors || local->scanning)
> + if (local->monitors || local->scanning || local->sched_scanning)
> new_flags |= FIF_BCN_PRBRESP_PROMISC;
Hmm, that seems like an implementation detail of the driver in this
case. I'd rather not do this here, other drivers might not have a
special filter they need for scheduled scans.
> @@ -358,7 +358,8 @@ static void ieee80211_restart_work(struct work_struct *work)
> flush_workqueue(local->workqueue);
>
> mutex_lock(&local->mtx);
> - WARN(test_bit(SCAN_HW_SCANNING, &local->scanning),
> + WARN(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
> + local->sched_scanning,
> "%s called with hardware scan in progress\n", __func__);
> mutex_unlock(&local->mtx);
Good catch, I should've thought of that in the remain-on-channel stuff,
would've saved me some debugging :)
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 599fa90..1158164 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -408,7 +408,8 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx)
> return RX_CONTINUE;
>
> if (test_bit(SCAN_HW_SCANNING, &local->scanning) ||
> - test_bit(SCAN_SW_SCANNING, &local->scanning))
> + test_bit(SCAN_SW_SCANNING, &local->scanning) ||
> + local->sched_scanning)
> return ieee80211_scan_rx(rx->sdata, skb);
I'm still not convinced that this is right.
> @@ -2801,7 +2802,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
> local->dot11ReceivedFragmentCount++;
>
> if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) ||
> - test_bit(SCAN_SW_SCANNING, &local->scanning)))
> + test_bit(SCAN_SW_SCANNING, &local->scanning) ||
> + local->sched_scanning))
> status->rx_flags |= IEEE80211_RX_IN_SCAN;
Nor this I guess, though we don't use this much of course.
> + ret = drv_sched_scan_start(local, sdata, req,
> + &local->sched_scan_ies);
> + if (!ret)
> + local->sched_scanning = true;
> +out:
> + mutex_unlock(&sdata->local->mtx);
> +
> + return ret;
> +
> +out_free:
> + while (i > 0)
> + kfree(local->sched_scan_ies.ie[--i]);
> + goto out;
Not freeing it when the driver callback fails?
Seems like you should reorder:
ret = drv...();
if (ret == 0) {
... = true;
goto out;
}
out_free:
...
out:
...
johannes
next prev parent reply other threads:[~2011-05-09 8:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 13:00 [PATCH 0/3] cfg80211/mac80211: implementation of scheduled scan Luciano Coelho
2011-05-05 13:00 ` [PATCH 1/3] cfg80211/nl80211: add support for scheduled scans Luciano Coelho
2011-05-09 8:12 ` Johannes Berg
2011-05-09 8:17 ` Luciano Coelho
2011-05-09 8:23 ` Johannes Berg
2011-05-09 8:25 ` Luciano Coelho
2011-05-09 9:50 ` Eliad Peller
2011-05-09 13:59 ` Luciano Coelho
2011-05-05 13:00 ` [PATCH 2/3] mac80211: add support for HW scheduled scan Luciano Coelho
2011-05-09 8:22 ` Johannes Berg [this message]
2011-05-09 8:22 ` Johannes Berg
2011-05-09 13:38 ` Luciano Coelho
2011-05-05 13:00 ` [PATCH 3/3] cfg80211/nl80211: add interval attribute for scheduled scans Luciano Coelho
2011-05-05 14:43 ` Ben Greear
2011-05-05 14:51 ` Johannes Berg
2011-05-05 14:50 ` Ben Greear
2011-05-05 14:58 ` Johannes Berg
2011-05-05 14:59 ` Johannes Berg
2011-05-05 15:48 ` Luciano Coelho
2011-05-05 15:51 ` Luciano Coelho
2011-05-05 16:13 ` Johannes Berg
2011-05-05 16:22 ` Ben Greear
2011-05-05 16:29 ` Luciano Coelho
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=1304929342.3475.8.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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.