From: Rostislav Lisovy <lisovy@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Sojka <sojkam1@fel.cvut.cz>,
s.sander@nordsys.de, jan-niklas.meier@volkswagen.de,
burak.simsek@volkswagen.de,
Emmanuel Thierry <emmanuel.thierry@yogoko.fr>,
laszlo.virag@commsignia.com,
Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz>
Subject: Re: [PATCH 1/4] mac80211: OCB mode + join and leave handling
Date: Thu, 16 Oct 2014 19:20:05 +0200 [thread overview]
Message-ID: <1413480005.16330.15.camel@umadbro> (raw)
In-Reply-To: <1413477188.15416.10.camel@umadbro>
On Thu, 2014-10-16 at 18:33 +0200, Rostislav Lisovy wrote:
> > > + mutex_lock(&sdata->local->mtx);
> > > + ieee80211_vif_release_channel(sdata);
> > > + mutex_unlock(&sdata->local->mtx);
> > > +
> > > + skb_queue_purge(&sdata->skb_queue);
> > > +
> > > + del_timer_sync(&sdata->u.ocb.housekeeping_timer);
> >
> > That might call the timer - is it safe if that happens here? Looks like
> > maybe the housekeeping would still get triggered or so.
>
> You are right. I hope the following is a reasonable solution (in form of
> a patch to my previous patch; comment stolen from some prehistoric
> version of mesh.c):
>
> @@ -127,6 +127,9 @@ void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata)
> struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
> struct sta_info *sta;
>
> + if (!netif_running(sdata->dev))
> + return;
> +
> sdata_lock(sdata);
>
> spin_lock_bh(&ifocb->incomplete_lock);
> @@ -229,6 +232,13 @@ int ieee80211_ocb_leave(struct ieee80211_sub_if_data *sdata)
> skb_queue_purge(&sdata->skb_queue);
>
> del_timer_sync(&sdata->u.ocb.housekeeping_timer);
> + /*
> + * If the timer fired while we waited for it, it will have
> + * requeued the work. Now the work will be running again
> + * but will not rearm the timer again because it checks
> + * whether the interface is running, which, at this point,
> + * it no longer is.
> + */
>
> return 0;
> }
Now I realized it is not that easy (and I confused "interface running"
and being "connected to the network"). There seems not to be a solid
indication that we are no longer "connected" to the network.
I think a field
enum {
IEEE80211_OCB_STOPPED,
IEEE80211_OCB_JOINED,
} state;
in struct ieee80211_if_ocb seems to be appropriate.
Best regards;
Rostislav
next prev parent reply other threads:[~2014-10-16 17:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 14:30 [PATCH 0/4] 802.11p OCB mode Rostislav Lisovy
2014-09-11 14:30 ` [PATCH 1/4] mac80211: OCB mode + join and leave handling Rostislav Lisovy
2014-10-09 8:23 ` Johannes Berg
2014-10-16 16:33 ` Rostislav Lisovy
2014-10-16 17:20 ` Rostislav Lisovy [this message]
2014-10-20 9:41 ` Johannes Berg
2014-10-20 9:40 ` Johannes Berg
2014-09-11 14:30 ` [PATCH 2/4] mac80211: Use different EDCA config for OCB Rostislav Lisovy
2014-09-11 14:30 ` [PATCH 3/4] cfg80211: Join and Leave handling for OCB mode Rostislav Lisovy
2014-10-09 8:26 ` Johannes Berg
2014-09-11 14:30 ` [PATCH 4/4] nl80211: " Rostislav Lisovy
2014-10-09 8:31 ` Johannes Berg
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=1413480005.16330.15.camel@umadbro \
--to=lisovy@gmail.com \
--cc=burak.simsek@volkswagen.de \
--cc=emmanuel.thierry@yogoko.fr \
--cc=jan-niklas.meier@volkswagen.de \
--cc=johannes@sipsolutions.net \
--cc=laszlo.virag@commsignia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rostislav.lisovy@fel.cvut.cz \
--cc=s.sander@nordsys.de \
--cc=sojkam1@fel.cvut.cz \
/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