All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guy Eilam <guy@wizery.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 3/4] nl80211: Pass probe response data to drivers
Date: Sat, 22 Oct 2011 15:11:51 +0200	[thread overview]
Message-ID: <1319289112-21896-3-git-send-email-guy@wizery.com> (raw)
In-Reply-To: <1319289112-21896-1-git-send-email-guy@wizery.com>

Allow usermode to pass probe-response data. This data can be used as a
template probe-response offloading.

Signed-off-by: Guy Eilam <guy@wizery.com>
---
 include/linux/nl80211.h |    4 ++++
 include/net/cfg80211.h  |    4 ++++
 net/wireless/nl80211.c  |   11 +++++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a436f74..6369631 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1114,6 +1114,8 @@ enum nl80211_commands {
  *	In addition this attribute holds a bitmap of the supported protocols
  *	for offloading using &enum nl80211_probe_resp_offload_support_attr.
  *
+ * @NL80211_ATTR_PROBE_RESP: Probe Response template data
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1344,6 +1346,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT,
 
+	NL80211_ATTR_PROBE_RESP,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b5ddd62..eb8b8c5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -737,6 +737,8 @@ struct mpath_info {
  * @ap_isolate: do not forward packets between connected stations
  * @ht_opmode: HT Operation mode
  * 	(u16 = opmode, -1 = do not change)
+ * @probe_resp_len: length of probe response template (@probe_resp)
+ * @probe_resp: probe response template (AP mode only)
  */
 struct bss_parameters {
 	int use_cts_prot;
@@ -746,6 +748,8 @@ struct bss_parameters {
 	u8 basic_rates_len;
 	int ap_isolate;
 	int ht_opmode;
+	int probe_resp_len;
+	u8 *probe_resp;
 };
 
 /*
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ad90ec4..aadca02 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -197,6 +197,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_TDLS_OPERATION] = { .type = NLA_U8 },
 	[NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG },
 	[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
+	[NL80211_ATTR_PROBE_RESP] = { .type = NLA_BINARY,
+				      .len = IEEE80211_MAX_DATA_LEN },
 };
 
 /* policy for the key attributes */
@@ -2978,6 +2980,15 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
 	if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE])
 		params.ht_opmode =
 			nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]);
+	if (info->attrs[NL80211_ATTR_PROBE_RESP]) {
+		if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP)
+			return -EOPNOTSUPP;
+
+		params.probe_resp =
+			nla_data(info->attrs[NL80211_ATTR_PROBE_RESP]);
+		params.probe_resp_len =
+			nla_len(info->attrs[NL80211_ATTR_PROBE_RESP]);
+	}
 
 	if (!rdev->ops->change_bss)
 		return -EOPNOTSUPP;
-- 
1.7.4.1


  parent reply	other threads:[~2011-10-22 13:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22 13:11 [PATCH 1/4] nl80211: Add probe response offload attribute Guy Eilam
2011-10-22 13:11 ` [PATCH 2/4] mac80211: Get the probe response offloading support from the driver Guy Eilam
2011-10-22 13:11 ` Guy Eilam [this message]
2011-10-22 13:11 ` [PATCH 4/4] mac80211: Save probe response data for BSS Guy Eilam
2011-10-22 13:34 ` [PATCH 1/4] nl80211: Add probe response offload attribute Johannes Berg
2011-10-22 13:36   ` Johannes Berg
2011-10-22 17:26     ` Guy Eilam
2011-10-22 17:39       ` Johannes Berg
2011-10-22 17:42         ` Guy Eilam
2011-10-22 17:44           ` 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=1319289112-21896-3-git-send-email-guy@wizery.com \
    --to=guy@wizery.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.