diff mbox

mac80211: add new IEEE80211_VIF_GET_NOA_UPDATE flag

Message ID 1445931520-14509-1-git-send-email-janusz.dziedzic@tieto.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show

Commit Message

Janusz.Dziedzic@tieto.com Oct. 27, 2015, 7:38 a.m. UTC
Add new VIF flag, that will allow get NOA update
notification when driver will request this, even
this is not pure P2P vif (eg. STA vif).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 include/net/mac80211.h | 4 ++++
 net/mac80211/mlme.c    | 6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Comments

Janusz.Dziedzic@tieto.com Nov. 5, 2015, 1:48 p.m. UTC | #1
Any comments? :)

On 27 October 2015 at 08:38, Janusz Dziedzic <janusz.dziedzic@tieto.com> wrote:
> Add new VIF flag, that will allow get NOA update
> notification when driver will request this, even
> this is not pure P2P vif (eg. STA vif).
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> ---
>  include/net/mac80211.h | 4 ++++
>  net/mac80211/mlme.c    | 6 ++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 4ec6fed..1173c63 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1325,11 +1325,15 @@ struct ieee80211_channel_switch {
>   *     interface. This flag should be set during interface addition,
>   *     but may be set/cleared as late as authentication to an AP. It is
>   *     only valid for managed/station mode interfaces.
> + * @IEEE80211_VIF_GET_NOA_UPDATE: request to handle NOA attributes
> + *     and send P2P_PS notification to the driver if NOA changed, even
> + *     this is not pure P2P vif.
>   */
>  enum ieee80211_vif_flags {
>         IEEE80211_VIF_BEACON_FILTER             = BIT(0),
>         IEEE80211_VIF_SUPPORTS_CQM_RSSI         = BIT(1),
>         IEEE80211_VIF_SUPPORTS_UAPSD            = BIT(2),
> +       IEEE80211_VIF_GET_NOA_UPDATE            = BIT(3),
>  };
>
>  /**
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 56ef9a8..5bafd1e 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1941,7 +1941,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
>
>         sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE;
>
> -       if (sdata->vif.p2p) {
> +       if (sdata->vif.p2p ||
> +           sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {
>                 const struct cfg80211_bss_ies *ies;
>
>                 rcu_read_lock();
> @@ -3461,7 +3462,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
>                 }
>         }
>
> -       if (sdata->vif.p2p) {
> +       if (sdata->vif.p2p ||
> +           sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {
>                 struct ieee80211_p2p_noa_attr noa = {};
>                 int ret;
>
> --
> 1.9.1
>
--
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
Johannes Berg Nov. 5, 2015, 1:56 p.m. UTC | #2
On Thu, 2015-11-05 at 14:48 +0100, Janusz Dziedzic wrote:
> Any comments? :)
> 

Looks OK - I'm not merging for -next right now since we're in the merge
window.

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
Johannes Berg Nov. 26, 2015, 5:08 p.m. UTC | #3
On Tue, 2015-10-27 at 08:38 +0100, Janusz Dziedzic wrote:
> Add new VIF flag, that will allow get NOA update
> notification when driver will request this, even
> this is not pure P2P vif (eg. STA vif).

Applied.

I'll note that people here seem to want to do a similar thing, so
thanks :)

Also, perhaps we should have a common way to advertise this kind of
capability in the association request of this station, so that the
(mobile?) APs implementing it can know? I think we'd discussed using an
Intel-specific vendor IE for this, but making the specification thereof
public so others could do it as well, but I'm sure we're open for other
suggestions. Any interest?

We're also going to be working on nl80211 extensions to actually let
the driver know if the client is P2P (or NoA capable) or not.

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
diff mbox

Patch

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4ec6fed..1173c63 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1325,11 +1325,15 @@  struct ieee80211_channel_switch {
  *	interface. This flag should be set during interface addition,
  *	but may be set/cleared as late as authentication to an AP. It is
  *	only valid for managed/station mode interfaces.
+ * @IEEE80211_VIF_GET_NOA_UPDATE: request to handle NOA attributes
+ *	and send P2P_PS notification to the driver if NOA changed, even
+ *	this is not pure P2P vif.
  */
 enum ieee80211_vif_flags {
 	IEEE80211_VIF_BEACON_FILTER		= BIT(0),
 	IEEE80211_VIF_SUPPORTS_CQM_RSSI		= BIT(1),
 	IEEE80211_VIF_SUPPORTS_UAPSD		= BIT(2),
+	IEEE80211_VIF_GET_NOA_UPDATE		= BIT(3),
 };
 
 /**
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 56ef9a8..5bafd1e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1941,7 +1941,8 @@  static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
 
 	sdata->u.mgd.flags |= IEEE80211_STA_RESET_SIGNAL_AVE;
 
-	if (sdata->vif.p2p) {
+	if (sdata->vif.p2p ||
+	    sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {
 		const struct cfg80211_bss_ies *ies;
 
 		rcu_read_lock();
@@ -3461,7 +3462,8 @@  static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
 		}
 	}
 
-	if (sdata->vif.p2p) {
+	if (sdata->vif.p2p ||
+	    sdata->vif.driver_flags & IEEE80211_VIF_GET_NOA_UPDATE) {
 		struct ieee80211_p2p_noa_attr noa = {};
 		int ret;