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 4/6] mac80211: add radar detection command/event
Date: Thu, 17 Jan 2013 14:52:28 +0100 [thread overview]
Message-ID: <20130117135228.GD19552@pandem0nium> (raw)
In-Reply-To: <1358377171.15012.45.camel@jlt4.sipsolutions.net>
[-- Attachment #1: Type: text/plain, Size: 4512 bytes --]
On Wed, Jan 16, 2013 at 11:59:31PM +0100, Johannes Berg wrote:
> On Tue, 2013-01-08 at 14:04 +0100, Simon Wunderlich wrote:
>
> > +static int ieee80211_start_radar_detection(struct wiphy *wiphy,
> > + struct net_device *dev,
> > + struct cfg80211_chan_def *chandef)
> > +{
> > + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> > + struct ieee80211_local *local = sdata->local;
> > + int res;
> > +
> > + if (!local->ops->start_radar_detection)
> > + return -EOPNOTSUPP;
> > +
> > + /* whatever, but channel contexts should not complain about that one */
> > + sdata->smps_mode = IEEE80211_SMPS_OFF;
> > + sdata->needed_rx_chains = local->rx_chains;
> > +
> > + if (ieee80211_vif_use_channel(sdata, chandef,
> > + IEEE80211_CHANCTX_SHARED))
> > + return -EBUSY;
>
> Should probably return whatever error vif_use_channel() returned?
>
OK
> > + res = drv_start_radar_detection(local, sdata, chandef);
>
> If the vif is assigned the channel, why also pass it to the
> start_radar_detection command? That seems pointless, they can't be
> different?
>
In the initial phase, __nl80211_set_channel() should not be able to set
the channel (no CAC yet), and will fail for IBSS (to be implemented later)
generally, at least as it's implemented now.
But what we can do is set the channel from mac80211 and call the driver
function without the channel argument, as it'll be pointless in this case.
Is this what you mean?
> > +++ b/net/mac80211/iface.c
> > @@ -826,6 +826,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
> > u.vlan.list)
> > dev_close(vlan->dev);
> > WARN_ON(!list_empty(&sdata->u.ap.vlans));
> > +
> > + /* reset DFS channel availability check */
> > + if (local->_oper_channel)
> > + local->_oper_channel->cac_started = false;
>
> That doesn't really belong here, does it? Seems like it should be in
> cfg80211. Actually, should it be there at all?
Actually, no, you are right. After stopping an AP and no radar is detected,
the channel should go from "operational" back to "available" state. Quoting
from ETSI EN 3001-893 v1.7.1
4.7.1.3/Master Devices/
c) Once the RLAN has started operations on an Available Channel, then that channel becomes an Operating Channel. During normal operation, the master device shall monitor all Operating Channels (In-Service Monitoring) to ensure that there is no radar operating within these channel(s). If no radar was detected on an Operating Channel but the RLAN stops operating on that channel, then the channel becomes an Available Channel.
I'll change that.
>
> If we allow using the channel for some amount of time after doing the
> CAC, even if we haven't been on the channel continuously, then we should
> also allow using the channel after stopping the AP for that much time.
>
> IOW -- deactivating should cause the timeout to start running.
As stated in a mail earlier from this patchset, a timeout ist not neccessary.
I'd skip this patch entirely.
>
> Actually that raises another question: If we have "external" radar
> detection, say by a different NIC, then shouldn't we still ask the
> driver to start radar detection when using the channel? Or is that
> implicit, does the driver have to check?
That is a good question, I didn't consider that. In the "simple process"
we first start radar detection and start the ap on the same channel.
For external CAC that won't work, of course. What about mac80211 checking
the channel in start_ap(), and if the channel requires DFS, pass some flag
to the driver that radar detection should be enabled?
>
> It seems the driver API needs a lot more documentation :-)
Agreed, but I guess we still need to discuss some corner cases to get the
neccesary input for documentation. ;)
>
>
> > +++ b/net/mac80211/trace.h
> > @@ -45,6 +45,35 @@
> > __entry->center_freq1, __entry->center_freq2, \
> > __entry->rx_chains_static, __entry->rx_chains_dynamic
> >
> > +#define CHAN_DEF_ENTRY __field(enum ieee80211_band, band) \
>
> I'll apply my "mac80211: split out chandef tracing macros" patch
> instead.
OK.
>
>
> Also: once the CAC is completed, shouldn't the channel context be freed
> up in mac80211, or something like that?
Currently we don't handle the event "CAC finished" explicitly - we only have
the cac_started/timeout fields. More on that later ...
Cheers,
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-01-17 13:52 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 [this message]
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
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=20130117135228.GD19552@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).