Linux wireless drivers development
 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: [PATCHv7 2/3] mac80211: add radar detection command/event
Date: Thu, 31 Jan 2013 17:31:26 +0100	[thread overview]
Message-ID: <20130131163126.GB1387@pandem0nium> (raw)
In-Reply-To: <1359643448.8415.62.camel@jlt4.sipsolutions.net>

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

On Thu, Jan 31, 2013 at 03:44:08PM +0100, Johannes Berg wrote:
> On Tue, 2013-01-29 at 13:21 +0100, Simon Wunderlich wrote:
> 
> > +void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
> > +				    struct ieee80211_chanctx *chanctx)
> > +{
> > +	struct ieee80211_sub_if_data *sdata;
> > +	bool radar_enabled = false;
> > +
> > +	lockdep_assert_held(&local->chanctx_mtx);
> > +
> > +	rcu_read_lock();
> > +	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
> > +		if (sdata->radar_required)
> > +			radar_enabled = true;
> 
> I guess you could break here. 

yes, OK.

> Technically though I'm not sure this is
> right, since it should only iterate interfaces on this chanctx. OTOH,
> multiple channel contexts aren't (currently?) allowed anyway.

I wonder of multiple channel contexts ever make sense for the DFS case.
If they do, we would have to change this anyway to detect radars on
one channel but (maybe) not on the other ... Anyway, I would leave that
to future strategists. ;)

> 
> > +	chanctx->conf.radar_enabled = radar_enabled;
> > +	local->radar_detect_enabled = chanctx->conf.radar_enabled;
> 
> What's the reason for "local->radar_detect_enabled"?

Interaction checking with ROC and scan.
> 
> Btw, do we also make the driver responsible for turning off any
> powersave when radar detection is enabled? I guess so?
> 
> > @@ -817,6 +817,15 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
> >  
> >  	cancel_work_sync(&sdata->recalc_smps);
> >  
> > +	cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
> > +
> > +	/* only inform about abort cac if it was started before. */
> > +	if (sdata->wdev.cac_started) {
> 
> I'm not entirely sure we should use the wdev data here, OTOH it seems
> safe, so why not.
> 

If you don't mind, it's easier like that ... ;)

> > +void ieee80211_dfs_cac_timer_work(struct work_struct *work)
> > +{
> > +	struct delayed_work *delayed_work =
> > +		container_of(work, struct delayed_work, work);
> > +	struct ieee80211_sub_if_data *sdata =
> > +		container_of(delayed_work, struct ieee80211_sub_if_data,
> > +			     dfs_cac_timer_work);
> > +
> > +	rtnl_lock();
> 
> what part requires rtnl?
> 
ieee80211_vif_release_channel() calls __ieee80211_vif_release_channel()
and has ASSERT_RTNL() before parsing the AP VLAN list.

cfg80211_radar_event() probably doesn't need it ... I should remove it
from the rtnl lock, I guess?

> > +void ieee80211_radar_detected(struct ieee80211_vif *vif, gfp_t gfp)
> > +{
> > +	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> > +
> > +	trace_api_radar_detected(sdata);
> > +
> > +	/* may happen to devices which have been added but are not up */
> > +	if (!cfg80211_chandef_valid(&sdata->vif.bss_conf.chandef))
> > +		return;
> 
> Huh, what does device and up have to do with that?
> 

What I've tried:
 * configure 2 SSIDs in hostapd, start it
 * both wlan0 and wlan0-1 got created
 * only wlan0 comes up, wlan0-1 was rejected because of missing channel combinations
 * now I've injected a radar - which should be sent to wlan0 and wlan0-1
 * wlan0 could send the event, but wlan0-1 had no bss configured and therefore no chandef

I can change this comment to "may happen to devices which have currently no BSS configured",
maybe that it is not so confusing ...

> >  static bool ieee80211_can_scan(struct ieee80211_local *local,
> >  			       struct ieee80211_sub_if_data *sdata)
> >  {
> > +	if (local->radar_detect_enabled)
> > +		return false;
> 
> Oh, ok. I guess that explains the reason for radar_detect_enabled :)

Yup. :)

Cheers,
	Simon

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

  reply	other threads:[~2013-01-31 16:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 12:21 [PATCHv7 0/3] Add DFS master ability Simon Wunderlich
2013-01-29 12:21 ` [PATCHv7 1/3] nl80211/cfg80211: add radar detection command/event Simon Wunderlich
2013-01-29 13:48   ` Zefir Kurtisi
2013-01-29 14:36     ` Simon Wunderlich
2013-01-30 11:51       ` Zefir Kurtisi
2013-01-30 16:25         ` Simon Wunderlich
2013-01-31  8:52           ` Zefir Kurtisi
2013-01-31 17:54             ` Simon Wunderlich
2013-02-01 10:08               ` Zefir Kurtisi
2013-02-13 14:47                 ` Simon Wunderlich
2013-01-31 14:25   ` Johannes Berg
2013-01-31 16:13     ` Simon Wunderlich
2013-01-31 16:46       ` Johannes Berg
2013-01-31 17:44         ` Simon Wunderlich
2013-02-01  9:40           ` Zefir Kurtisi
2013-02-01  9:54           ` Johannes Berg
2013-01-29 12:21 ` [PATCHv7 2/3] mac80211: " Simon Wunderlich
2013-01-29 13:26   ` Zefir Kurtisi
2013-01-29 14:43     ` Simon Wunderlich
2013-01-31 14:44   ` Johannes Berg
2013-01-31 16:31     ` Simon Wunderlich [this message]
2013-01-31 16:48       ` Johannes Berg
2013-01-31 17:47         ` Simon Wunderlich
2013-02-01  9:57           ` Johannes Berg
2013-02-02 22:15             ` Simon Wunderlich
2013-02-04 17:32               ` Johannes Berg
2013-02-05  8:44                 ` Simon Wunderlich
2013-02-05  9:35                   ` Johannes Berg
2013-02-05 10:03                     ` Simon Wunderlich
2013-01-29 12:22 ` [PATCHv7 3/3] nl80211: allow DFS in start_ap Simon Wunderlich
2013-01-29 13:14 ` [PATCHv7 0/3] Add DFS master ability Zefir Kurtisi
2013-01-29 14:52   ` Simon Wunderlich
2013-01-31 16:50 ` Johannes Berg
2013-01-31 17:21   ` 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=20130131163126.GB1387@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