Return-path: Received: from mail-lb0-f174.google.com ([209.85.217.174]:42744 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840Ab3HAGHK (ORCPT ); Thu, 1 Aug 2013 02:07:10 -0400 Received: by mail-lb0-f174.google.com with SMTP id w20so1207820lbh.5 for ; Wed, 31 Jul 2013 23:07:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1374826090-17322-1-git-send-email-johannes@sipsolutions.net> Date: Thu, 1 Aug 2013 09:07:08 +0300 Message-ID: (sfid-20130801_080720_421772_A076238E) Subject: Re: [PATCH] mac80211: implement critical protocol protection From: Emmanuel Grumbach To: Arik Nemtsov Cc: Emmanuel Grumbach , linux-wireless , Johannes Berg Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: >> This new API add in cfg80211 wasn't implemented in mac80211. >> Advertise the capabilities based on the device's >> implementation (possibly NULL) of crit_prot mac80211 ops. >> >> This callback will be called by cfg80211 when hinted by >> userspace that a critical protocol is happening, e.g. it can >> be EAPOL, DHCP. >> >> Signed-off-by: Emmanuel Grumbach >> Signed-off-by: Johannes Berg > [...] >> +static int ieee80211_crit_proto_start(struct wiphy *wiphy, >> + struct wireless_dev *wdev, >> + enum nl80211_crit_proto_id protocol, >> + u16 duration) >> +{ >> + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); >> + struct ieee80211_local *local = wiphy_priv(wiphy); >> + int ret; >> + >> + ret = drv_crit_proto(local, sdata, protocol, true); >> + if (!ret) >> + return ret; > > Shouldn't this be "if (ret)" ? You're obviously right... > > Also maybe the low-level driver should get the duration and indicate > completion on its own? (similar to what Eliad suggested). > Seems to me very similar to ROC, and would probably be implemented as > such for some drivers. > yeah - that could make it. I'll be unavailable in the coming 2 weeks though.