Return-path: Received: from smtp.nokia.com ([192.100.122.230]:50594 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219Ab0CLLUh (ORCPT ); Fri, 12 Mar 2010 06:20:37 -0500 Subject: Re: [RFC PATCH 1/1] mac80211: Add ieee80211_probereq_failed function From: Juuso Oikarinen To: ext Johannes Berg Cc: "linux-wireless@vger.kernel.org" In-Reply-To: <1268392206.4828.6.camel@jlt3.sipsolutions.net> References: <1268135572-30722-1-git-send-email-juuso.oikarinen@nokia.com> <1268135572-30722-2-git-send-email-juuso.oikarinen@nokia.com> <1268392206.4828.6.camel@jlt3.sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Date: Fri, 12 Mar 2010 13:17:49 +0200 Message-ID: <1268392669.10120.517.camel@wimaxnb.nmp.nokia.com> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, 2010-03-12 at 12:10 +0100, ext Johannes Berg wrote: > On Tue, 2010-03-09 at 13:52 +0200, Juuso Oikarinen wrote: > > Some hardware (i.e. the wl1271) are able to monitor beacons, and send > > probe-requests to AP in case of beacon loss independently to try to recover > > the connection. In these cases, it is useless for the mac80211 to send > > further probe-requests. > > > > Add a new function for the hardware to indicate that the AP has been lost. > > This function immediately tears down the connection. > > > > Signed-off-by: Juuso Oikarinen > > --- > > include/net/mac80211.h | 12 ++++++++++++ > > net/mac80211/mlme.c | 32 ++++++++++++++++++++++++++++++++ > > 2 files changed, 44 insertions(+), 0 deletions(-) > > > > diff --git a/include/net/mac80211.h b/include/net/mac80211.h > > index 45d7d44..d9792e4 100644 > > --- a/include/net/mac80211.h > > +++ b/include/net/mac80211.h > > @@ -2370,6 +2370,18 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, > > */ > > void ieee80211_beacon_loss(struct ieee80211_vif *vif); > > > > +/** > > + * ieee80211_probereq_failed - inform hardware has lost connection with the AP > > + * > > + * @vif: &struct ieee80211_vif pointer from the add_interface callback. > > + * > > + * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and > > + * IEEE80211_CONF_PS is set, the driver needs to inform with this function > > + * whenever the hardware is not receiving beacons and the AP is not responding > > + * to probe requests with this function. > > + */ > > +void ieee80211_probereq_failed(struct ieee80211_vif *vif); > > + > > /* Rate control API */ > > > > /** > > diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c > > index 0ab284c..8f591a4 100644 > > --- a/net/mac80211/mlme.c > > +++ b/net/mac80211/mlme.c > > @@ -945,6 +945,38 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif) > > } > > EXPORT_SYMBOL(ieee80211_beacon_loss); > > > > +void ieee80211_probereq_failed(struct ieee80211_vif *vif) > > +{ > > + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); > > + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; > > + struct ieee80211_local *local = sdata->local; > > + u8 bssid[ETH_ALEN]; > > + > > + mutex_lock(&ifmgd->mtx); > > + if (!ifmgd->associated) { > > + mutex_unlock(&ifmgd->mtx); > > + return; > > + } > > + > > + memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); > > I think the actual work should be deferred to a workqueue struct item so > that you don't get into locking trouble with drivers here. You're right. I will send a v2 of this patch next week with that change. Then, I will also bundle Kalle Valo's "mac80211: add support connection monitor in hardware" patch to this set to propose a fully hardware based connection maintenance (periodic probe-req's (or keep-alives) and automatic probe-requests on beacon loss.) -Juuso > johannes > > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html