All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Andrei Otcheretianski <andrei.otcheretianski@intel.com>,
	Franky Lin <franky.lin@broadcom.com>
Subject: Re: [PATCH v2] cfg80211: add start / stop NAN commands
Date: Thu, 24 Mar 2016 19:30:14 +0100	[thread overview]
Message-ID: <56F43236.7010704@broadcom.com> (raw)
In-Reply-To: <1458832375-25546-1-git-send-email-emmanuel.grumbach@intel.com>



On 24-3-2016 16:12, Emmanuel Grumbach wrote:
> This allows user space to start/stop NAN interface.
> A NAN interface is like P2P device in a few aspects: it
> doesn't have a netdev associated to it.
> Add the new interface type and prevent operations that
> can't be executed on NAN interface like scan.
> Define several attributes that may be configured by user space
> when starting NAN functionality (master preference and dual
> band operation)
> 
> Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> ---
> v2: allow master preference 1 and 255 as required by the certification
> ---
>  include/net/cfg80211.h       | 21 +++++++++-
>  include/uapi/linux/nl80211.h | 44 ++++++++++++++++++++
>  net/mac80211/cfg.c           |  2 +
>  net/mac80211/chan.c          |  3 ++
>  net/mac80211/iface.c         |  4 ++
>  net/mac80211/offchannel.c    |  1 +
>  net/mac80211/rx.c            |  3 ++
>  net/mac80211/util.c          |  1 +
>  net/wireless/chan.c          |  2 +
>  net/wireless/core.c          | 34 ++++++++++++++++
>  net/wireless/core.h          |  3 ++
>  net/wireless/mlme.c          |  1 +
>  net/wireless/nl80211.c       | 96 ++++++++++++++++++++++++++++++++++++++++++--
>  net/wireless/rdev-ops.h      | 20 +++++++++
>  net/wireless/trace.h         | 27 +++++++++++++
>  net/wireless/util.c          |  6 ++-
>  16 files changed, 261 insertions(+), 7 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 9e1b24c..cb5ab88 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -2228,6 +2228,19 @@ struct cfg80211_qos_map {
>  };
>  
>  /**
> + * struct cfg80211_nan_conf - nan configuration
> + *
> + * This struct defines nan configuration parameters
> + *
> + * @master_pref: master preference (2 -254)

This seems to contradict the change log above...

> + * @dual: dual band operation mode
> + */
> +struct cfg80211_nan_conf {
> +	u8 master_pref;
> +	enum nl80211_nan_dual_band_conf dual;
> +};
> +
> +/**
>   * struct cfg80211_ops - backend description for wireless configuration
>   *
>   * This struct is registered by fullmac card drivers and/or wireless stacks
> @@ -2500,6 +2513,8 @@ struct cfg80211_qos_map {
>   *	and returning to the base channel for communication with the AP.
>   * @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
>   *	peers must be on the base channel when the call completes.
> + * @start_nan: Start the NAN interface.
> + * @stop_nan: Stop the NAN interface.
>   */
>  struct cfg80211_ops {
>  	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
> @@ -2765,6 +2780,9 @@ struct cfg80211_ops {
>  	void	(*tdls_cancel_channel_switch)(struct wiphy *wiphy,
>  					      struct net_device *dev,
>  					      const u8 *addr);
> +	int	(*start_nan)(struct wiphy *wiphy, struct wireless_dev *wdev,
> +			     struct cfg80211_nan_conf *conf);
> +	void	(*stop_nan)(struct wiphy *wiphy, struct wireless_dev *wdev);
>  };
>  
>  /*
> @@ -3486,6 +3504,7 @@ struct cfg80211_cached_keys;
>   *	beacons, 0 when not valid
>   * @address: The address for this device, valid only if @netdev is %NULL
>   * @p2p_started: true if this is a P2P Device that has been started
> + * @nan_started: true if this is a NAN interface that has been started
>   * @cac_started: true if DFS channel availability check has been started
>   * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
>   * @cac_time_ms: CAC time in ms
> @@ -3517,7 +3536,7 @@ struct wireless_dev {
>  
>  	struct mutex mtx;
>  
> -	bool use_4addr, p2p_started;
> +	bool use_4addr, p2p_started, nan_started;
>  
>  	u8 address[ETH_ALEN] __aligned(sizeof(u16));
>  
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 5a30a75..e5a7cfb 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -824,6 +824,16 @@
>   *	not running. The driver indicates the status of the scan through
>   *	cfg80211_scan_done().
>   *
> + * @NL80211_CMD_START_NAN: Start NAN operation, identified by its
> + *	%NL80211_ATTR_WDEV interface. This interface must have been previously
> + *	created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the
> + *	NAN interface will create or join a cluster. This command must have a
> + *	valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
> + *	%NL80211_ATTR_NAN_DUAL attributes.
> + *	After this command NAN functions can be added.
> + * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
> + *	its %NL80211_ATTR_WDEV interface.
> + *
>   * @NL80211_CMD_MAX: highest used command number
>   * @__NL80211_CMD_AFTER_LAST: internal use
>   */
> @@ -1012,6 +1022,9 @@ enum nl80211_commands {
>  
>  	NL80211_CMD_ABORT_SCAN,
>  
> +	NL80211_CMD_START_NAN,
> +	NL80211_CMD_STOP_NAN,
> +
>  	/* add new commands above here */
>  
>  	/* used to define NL80211_CMD_MAX below */
> @@ -1796,6 +1809,12 @@ enum nl80211_commands {
>   *	connecting to a PCP, and in %NL80211_CMD_START_AP to start
>   *	a PCP instead of AP. Relevant for DMG networks only.
>   *
> + * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
> + *	&NL80211_CMD_START_NAN. Its type is u8 and it can't be 0, 1 or 255.

... and this as well.

Regards,
Arend

  reply	other threads:[~2016-03-24 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 15:12 [PATCH v2] cfg80211: add start / stop NAN commands Emmanuel Grumbach
2016-03-24 18:30 ` Arend Van Spriel [this message]
2016-03-24 18:49   ` Grumbach, Emmanuel

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=56F43236.7010704@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=andrei.otcheretianski@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=franky.lin@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.