linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>,
	linux-wireless@vger.kernel.org, victorg@ti.com,
	linville@tuxdriver.com, kgiori@qca.qualcomm.com,
	zefir.kurtisi@neratec.com, adrian@freebsd.org, j@w1.fi,
	coelho@ti.com, igalc@ti.com, nbd@nbd.name,
	mathias.kretschmer@fokus.fraunhofer.de,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: Re: [PATCHv6 0/6] Add DFS master ability
Date: Thu, 17 Jan 2013 15:21:26 +0100	[thread overview]
Message-ID: <20130117142125.GF19552@pandem0nium> (raw)
In-Reply-To: <1358378574.15012.62.camel@jlt4.sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 5298 bytes --]

Johannes, 

as always, thanks for the detailed review!

On Thu, Jan 17, 2013 at 12:22:54AM +0100, Johannes Berg wrote:
> On Tue, 2013-01-08 at 14:04 +0100, Simon Wunderlich wrote:
> 
> > Any comment/review/etc are very much appreciated!
> 
> I'm still confused about what the desired behaviour should be.
> 
> >From what we discussed the following are valid use cases:
> 
>  1) do CAC on all channels, select one that is usable later
>  2) do CAC with one NIC, use it with another NIC (hot standby)
> 
> We can address 2) by storing the "channel is clear" evaluation in the
> channel struct -- although then it'll only work with the same driver
> etc. This can be resolved later anyway.
> 
> Case 1) certainly implies that we need something like "channel
> considered usable until ..." timer. You don't have that at all. Instead,
> you seem to consider it clear until an AP interface is started & stopped
> on that channel, or otherwise forever. That seems wrong.
> 
> So I think that in the channel struct/globally we really only need the
> "channel_usable_until" value, which is X seconds (? I don't know what
> the reg rules say) after the radar detection completed.

As stated before: "available until ..." time is not neccessary as far
as I know. Also the channel must stay available when AP stops operation,
I'll change that.

> Actually with your current patch 2) cannot be implemented at all because
> the initial CAC never really finishes?

Yeah, for this case it is flawed - one could start radar detection on
different channels one after another in short time, and we would just
set "cac_started" and the timeout - which eventually might mark all channels
available without checking for the required time on it. That seems wrong.

> 
> I think the operations here should be like this:
> 
>  * start radar detection
>    - cfg80211: store radar detect chandef in wdev struct to use it in
>                cfg80211_get_chan_state()
>    - mac80211: configure chanctx, call driver
>    - driver: start radar detection

OK.

>  * radar detection finished:
>    - driver: call mac80211 with result (radar detected or not)
>    - mac80211: free up channel context (probably needs workqueue!)
>                pass result to cfg80211
>    - cfg80211: clear wdev radar detect chandef
>                if OK to use: store availability in channel struct
>                send result to userspace

Right now we only have the event for radar detect (i.e. detection
failed).

We could add a timer to mark the channel available after the CAC time,
if no radar has been detected in this time. Don't know if mac80211 or
cfg80211 would be the best place for this, but I think the driver is not
- this timer must be shared over various drivers after all.

>  * start AP:
>    - cfg80211: check channel availability
>    - cfg80211/mac80211/driver? - enable radar detection while operating

mac80211 can instruct the driver to use radar detection while operating.
E.g. pass it in sdata->vis.bss_conf ?


>  * AP channel switch:
>    - if due to radar, mark channel as not clear
OK - in AP case, we would have got the radar event anyway so the channel
would already be marked "not clear". In IBSS however, that is possible
(another station may have asked us to switch channel because of radar).
>    - if not due to radar, mark channel as clear until X seconds in the
>      future
Timeout not needed.

>  * stop AP:
>    - cfg80211: mark channel as clear until X seconds in the future,
>                unless it was marked not clear by a radar detect event
Timeout not needed, just keep it clear.
>  * radar detected event:
>    - cfg80211: mark channel as not clear

OK
> 
> 
> Note how I'm also letting the drivers determine the duration of the
> radar check. Maybe the duration should be passed to the driver, or maybe
> not, but I think for full-MAC chips it would be more likely that they
> get an event for both cases from the device, not just the timeout you
> have in software ...

Hm, I don't know. CAC times are subject to regulation changes. In ETSI
it's one minute, for weather channels (5600-5650 MHz) 10 minutes (but we
better don't support them anyway as they require incredible radar 
detection rates).

> Actually, now that I think about it, I have my doubts about the mac80211
> "start_radar_detect()" API. It seems that it really just starts the
> detection, and has no way to stop it etc. So maybe that timer should be
> in *mac80211* (for the current drivers), and should also be called after
> adding a chanctx when starting the AP vif. Or maybe it should actually
> be tied to "add_chanctx()" (or "config()" for backward compat) -- when a
> channel requiring radar detection is configured, detection should be
> enabled?

The radar detect command was originally planned to just start the detection,
yes. Userspace should just "try" to use the channel after CAC time - if the
channel should be used earlier, start_ap or whatever will just fail. So yes,
it just starts the radar detection, stopping it didn't seem neccesary yet.

If we change the concept to explicitly handle the end of CAC in the kernel,
the timer approach is imho the best.

Cheers,
	Simon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2013-01-17 14:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 13:04 [PATCHv6 0/6] Add DFS master ability Simon Wunderlich
2013-01-08 13:04 ` [PATCHv6 1/6] nl80211: check if channel can be used in join_ibss Simon Wunderlich
2013-01-16 22:35   ` Johannes Berg
2013-01-17 13:27     ` Simon Wunderlich
2013-01-08 13:04 ` [PATCHv6 2/6] cfg80211: check radar interface combinations Simon Wunderlich
2013-01-16 22:42   ` Johannes Berg
2013-01-16 22:44     ` Johannes Berg
2013-01-17 13:28       ` Simon Wunderlich
2013-01-30 16:34   ` Luciano Coelho
2013-01-30 16:56     ` Simon Wunderlich
2013-01-30 17:20       ` Luciano Coelho
2013-01-08 13:04 ` [PATCHv6 3/6] nl80211/cfg80211: add radar detection command/event Simon Wunderlich
2013-01-16 22:51   ` Johannes Berg
2013-01-17 13:40     ` Simon Wunderlich
2013-01-18 21:54       ` Johannes Berg
2013-01-21 10:44         ` Zefir Kurtisi
2013-01-23 12:49           ` Simon Wunderlich
2013-01-24 12:56             ` Zefir Kurtisi
2013-01-08 13:04 ` [PATCHv6 4/6] mac80211: " Simon Wunderlich
2013-01-16 22:59   ` Johannes Berg
2013-01-17 13:52     ` Simon Wunderlich
2013-01-18 22:00       ` Johannes Berg
2013-01-23 12:42         ` Simon Wunderlich
2013-01-08 13:04 ` [PATCHv6 5/6] mac80211: check radar interaction with scan and roc Simon Wunderlich
2013-01-16 23:00   ` Johannes Berg
2013-01-17 13:53     ` Simon Wunderlich
2013-01-08 13:04 ` [PATCHv6 6/6] nl80211: allow DFS in start_ap Simon Wunderlich
2013-01-16 23:22 ` [PATCHv6 0/6] Add DFS master ability Johannes Berg
2013-01-17 14:21   ` Simon Wunderlich [this message]
2013-01-18 22:08     ` Johannes Berg
2013-01-21 10:46       ` Zefir Kurtisi
2013-01-23 12:52         ` Simon Wunderlich
2013-01-24 12:19           ` Zefir Kurtisi
2013-01-23 12:57       ` Simon Wunderlich

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=20130117142125.GF19552@pandem0nium \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=adrian@freebsd.org \
    --cc=coelho@ti.com \
    --cc=igalc@ti.com \
    --cc=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --cc=kgiori@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mathias.kretschmer@fokus.fraunhofer.de \
    --cc=nbd@nbd.name \
    --cc=siwu@hrz.tu-chemnitz.de \
    --cc=victorg@ti.com \
    --cc=zefir.kurtisi@neratec.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;
as well as URLs for NNTP newsgroup(s).