From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
Johannes Berg <johannes@sipsolutions.net>,
Felix Fietkau <nbd@nbd.name>,
linux-wireless <linux-wireless@vger.kernel.org>,
ryder.lee@mediatek.com, evelyn.tsai@mediatek.com,
owen.peng@mediatek.com
Subject: Re: [PATCH mac80211-next] cfg80211: schedule offchan_cac_abort_wk in cfg80211_radar_event
Date: Tue, 16 Nov 2021 15:33:35 +0100 [thread overview]
Message-ID: <YZPBP1SK7IqI2iyC@lore-desk> (raw)
In-Reply-To: <CAFED-jn1Nuyx-CMvQE3ue+thZATf+7VUSEhPA0m1ccpc=S=sEQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 8840 bytes --]
On Nov 16, Janusz Dziedzic wrote:
> wt., 16 lis 2021 o 15:14 Lorenzo Bianconi
> <lorenzo.bianconi@redhat.com> napisał(a):
> >
> > > wt., 16 lis 2021 o 12:46 Lorenzo Bianconi <lorenzo@kernel.org> napisał(a):
> > > >
> > > > If necessary schedule offchan_cac_abort_wk work in cfg80211_radar_event
> > > > routine adding offchan parameter to cfg80211_radar_event signature.
> > > > Rename cfg80211_radar_event in __cfg80211_radar_event and introduce
> > > > the two following inline helpers:
> > > > - cfg80211_radar_event
> > > > - cfg80211_offchan_radar_event
> > > > Doing so the drv will not need to run cfg80211_offchan_cac_abort() after
> > > > radar detection on the offchannel chain.
> > > >
> > > > Tested-by: Owen Peng <owen.peng@mediatek.com>
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > ---
> > > > include/net/cfg80211.h | 24 +++++++++++++++++++++---
> > > > net/wireless/mlme.c | 16 ++++++++++------
> > > > net/wireless/trace.h | 11 +++++++----
> > > > 3 files changed, 38 insertions(+), 13 deletions(-)
> > > >
> > >
> > > BTW, if we don't have user for this yet, maybe we should change name
> > > offchannel -> background.
> > > In ETSI spec
> > > https://www.etsi.org/deliver/etsi_en/301800_301899/301893/02.01.01_60/en_301893v020101p.pdf
> > > we have off-channel CAC defined little bit different:
> > >
> > > "Off-Channel CAC is performed by a number of non-continuous checks
> > > spread over a period in time. This period, which is required to
> > > determine the presence of radar signals, is defined as the Off-Channel
> > > CAC Time."
> > >
> > > And:
> > > "Minimum Off-Channel CAC Time 6 minutes (see note 2) Maximum
> > > Off-Channel CAC Time 4 hours (see note 2)"
> > >
> > > So, your implementation simple run "background CAC" - use one (or
> > > more) chain for that.
> > >
> > > BR
> > > Janusz
> >
> > Hi Janusz,
> >
> > I have just posted a patch [0] in order to allow continuous radar monitoring
> > through the off-channel chain. I guess it is what you are referring to, right?
> >
> I mean all patches you send before:
>
> [PATCH v2 mac80211-next 0/6] add offchannel radar chain support
>
> I know this is only name, but ETSI spec define offchannel CAC different.
> If there is no user for this yet, then we still could change it, don't
> mix it and be aligned with etsi spec.
ok, please take a look to the patch I linked since AFAIK applying that patch
we are supposed to be aligned to the ETSI spec (and so no need to change
the name).
Regards,
Lorenzo
>
> BR
> Janusz
>
> > Regards,
> > Lorenzo
> >
> > [0] "cfg80211: allow continuous radar monitoring on offchannel chain"
> > https://lore.kernel.org/linux-wireless/d46217310a49b14ff0e9c002f0a6e0547d70fd2c.1637071350.git.lorenzo@kernel.org/T/#u
> >
> > >
> > >
> > >
> > > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > > > index 362da9f6bf39..a887086cb103 100644
> > > > --- a/include/net/cfg80211.h
> > > > +++ b/include/net/cfg80211.h
> > > > @@ -7605,15 +7605,33 @@ void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer,
> > > > void cfg80211_cqm_beacon_loss_notify(struct net_device *dev, gfp_t gfp);
> > > >
> > > > /**
> > > > - * cfg80211_radar_event - radar detection event
> > > > + * __cfg80211_radar_event - radar detection event
> > > > * @wiphy: the wiphy
> > > > * @chandef: chandef for the current channel
> > > > + * @offchan: the radar has been detected on the offchannel chain
> > > > * @gfp: context flags
> > > > *
> > > > * This function is called when a radar is detected on the current chanenl.
> > > > */
> > > > -void cfg80211_radar_event(struct wiphy *wiphy,
> > > > - struct cfg80211_chan_def *chandef, gfp_t gfp);
> > > > +void __cfg80211_radar_event(struct wiphy *wiphy,
> > > > + struct cfg80211_chan_def *chandef,
> > > > + bool offchan, gfp_t gfp);
> > > > +
> > > > +static inline void
> > > > +cfg80211_radar_event(struct wiphy *wiphy,
> > > > + struct cfg80211_chan_def *chandef,
> > > > + gfp_t gfp)
> > > > +{
> > > > + __cfg80211_radar_event(wiphy, chandef, false, gfp);
> > > > +}
> > > > +
> > > > +static inline void
> > > > +cfg80211_offchan_radar_event(struct wiphy *wiphy,
> > > > + struct cfg80211_chan_def *chandef,
> > > > + gfp_t gfp)
> > > > +{
> > > > + __cfg80211_radar_event(wiphy, chandef, true, gfp);
> > > > +}
> > > >
> > > > /**
> > > > * cfg80211_sta_opmode_change_notify - STA's ht/vht operation mode change event
> > > > diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> > > > index ac2e5e732d94..450be1ec70b8 100644
> > > > --- a/net/wireless/mlme.c
> > > > +++ b/net/wireless/mlme.c
> > > > @@ -905,13 +905,13 @@ void cfg80211_dfs_channels_update_work(struct work_struct *work)
> > > > }
> > > >
> > > >
> > > > -void cfg80211_radar_event(struct wiphy *wiphy,
> > > > - struct cfg80211_chan_def *chandef,
> > > > - gfp_t gfp)
> > > > +void __cfg80211_radar_event(struct wiphy *wiphy,
> > > > + struct cfg80211_chan_def *chandef,
> > > > + bool offchan, gfp_t gfp)
> > > > {
> > > > struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
> > > >
> > > > - trace_cfg80211_radar_event(wiphy, chandef);
> > > > + trace_cfg80211_radar_event(wiphy, chandef, offchan);
> > > >
> > > > /* only set the chandef supplied channel to unavailable, in
> > > > * case the radar is detected on only one of multiple channels
> > > > @@ -919,6 +919,9 @@ void cfg80211_radar_event(struct wiphy *wiphy,
> > > > */
> > > > cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);
> > > >
> > > > + if (offchan)
> > > > + queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
> > > > +
> > > > cfg80211_sched_dfs_chan_update(rdev);
> > > >
> > > > nl80211_radar_notify(rdev, chandef, NL80211_RADAR_DETECTED, NULL, gfp);
> > > > @@ -926,7 +929,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
> > > > memcpy(&rdev->radar_chandef, chandef, sizeof(struct cfg80211_chan_def));
> > > > queue_work(cfg80211_wq, &rdev->propagate_radar_detect_wk);
> > > > }
> > > > -EXPORT_SYMBOL(cfg80211_radar_event);
> > > > +EXPORT_SYMBOL(__cfg80211_radar_event);
> > > >
> > > > void cfg80211_cac_event(struct net_device *netdev,
> > > > const struct cfg80211_chan_def *chandef,
> > > > @@ -998,7 +1001,8 @@ __cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
> > > > rdev->offchan_radar_wdev = NULL;
> > > > break;
> > > > case NL80211_RADAR_CAC_ABORTED:
> > > > - cancel_delayed_work(&rdev->offchan_cac_done_wk);
> > > > + if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))
> > > > + return;
> > > > wdev = rdev->offchan_radar_wdev;
> > > > rdev->offchan_radar_wdev = NULL;
> > > > break;
> > > > diff --git a/net/wireless/trace.h b/net/wireless/trace.h
> > > > index 0b27eaa14a18..e854d52db1a6 100644
> > > > --- a/net/wireless/trace.h
> > > > +++ b/net/wireless/trace.h
> > > > @@ -3053,18 +3053,21 @@ TRACE_EVENT(cfg80211_ch_switch_started_notify,
> > > > );
> > > >
> > > > TRACE_EVENT(cfg80211_radar_event,
> > > > - TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
> > > > - TP_ARGS(wiphy, chandef),
> > > > + TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
> > > > + bool offchan),
> > > > + TP_ARGS(wiphy, chandef, offchan),
> > > > TP_STRUCT__entry(
> > > > WIPHY_ENTRY
> > > > CHAN_DEF_ENTRY
> > > > + __field(bool, offchan)
> > > > ),
> > > > TP_fast_assign(
> > > > WIPHY_ASSIGN;
> > > > CHAN_DEF_ASSIGN(chandef);
> > > > + __entry->offchan = offchan;
> > > > ),
> > > > - TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
> > > > - WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
> > > > + TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", offchan %d",
> > > > + WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->offchan)
> > > > );
> > > >
> > > > TRACE_EVENT(cfg80211_cac_event,
> > > > --
> > > > 2.31.1
> > > >
> > >
> > >
> > > --
> > > Janusz Dziedzic
> > >
>
>
>
> --
> Janusz Dziedzic
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2021-11-16 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 11:41 [PATCH mac80211-next] cfg80211: schedule offchan_cac_abort_wk in cfg80211_radar_event Lorenzo Bianconi
2021-11-16 13:58 ` Janusz Dziedzic
2021-11-16 14:14 ` Lorenzo Bianconi
2021-11-16 14:23 ` Janusz Dziedzic
2021-11-16 14:33 ` Lorenzo Bianconi [this message]
2021-11-16 15:28 ` Janusz Dziedzic
2021-11-16 16:03 ` Lorenzo Bianconi
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=YZPBP1SK7IqI2iyC@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=evelyn.tsai@mediatek.com \
--cc=janusz.dziedzic@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=owen.peng@mediatek.com \
--cc=ryder.lee@mediatek.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