linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Add mesh peer AID setting API
@ 2016-06-30  9:00 Masashi Honma
  2016-06-30 10:03 ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Masashi Honma @ 2016-06-30  9:00 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, j, me, Masashi Honma

Previously, mesh peer AID is not reported to kernel when local mesh
STA is created without iw command. The mesh peer AID is needed by
mesh peer power management functionality to identify a AID in a TIM
element.

This patch creates mesh peer AID setting API.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
 include/net/cfg80211.h       | 1 +
 include/uapi/linux/nl80211.h | 5 +++++
 net/mac80211/cfg.c           | 1 +
 net/wireless/nl80211.c       | 3 +++
 4 files changed, 10 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7bbb00d..2fa5896 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -805,6 +805,7 @@ struct station_parameters {
 	u32 sta_modify_mask;
 	int listen_interval;
 	u16 aid;
+	u16 mesh_aid;
 	u8 supported_rates_len;
 	u8 plink_action;
 	u8 plink_state;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 53c8278..f8c454e 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1829,6 +1829,9 @@ enum nl80211_commands {
  *	%NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
  *	interface type.
  *
+ * @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
+ *	used to pull the stored data for mesh peer in power save state.
+ *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2213,6 +2216,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_IFTYPE_EXT_CAPA,
 
+	NL80211_ATTR_MESH_PEER_AID,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 0c12e40..08802f7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -997,6 +997,7 @@ static void sta_apply_mesh_params(struct ieee80211_local *local,
 			if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
 				changed = mesh_plink_inc_estab_count(sdata);
 			sta->mesh->plink_state = params->plink_state;
+			sta->mesh->aid = params->mesh_aid;
 
 			ieee80211_mps_sta_status_update(sta);
 			changed |= ieee80211_mps_set_sta_local_pm(sta,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c503e96..f41fb61 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4410,6 +4410,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
 			nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_STATE]);
 		if (params.plink_state >= NUM_NL80211_PLINK_STATES)
 			return -EINVAL;
+		if (info->attrs[NL80211_ATTR_MESH_PEER_AID])
+			params.mesh_aid = nla_get_u16(
+				info->attrs[NL80211_ATTR_MESH_PEER_AID]);
 		params.sta_modify_mask |= STATION_PARAM_APPLY_PLINK_STATE;
 	}
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-06 13:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30  9:00 [PATCH] cfg80211: Add mesh peer AID setting API Masashi Honma
2016-06-30 10:03 ` kbuild test robot
2016-06-30 11:11 ` Bob Copeland
2016-06-30 12:01   ` Masashi Honma
2016-07-01  1:19 ` [PATCH v2] " Masashi Honma
2016-07-06 12:42   ` Johannes Berg
2016-07-06 12:58     ` Bob Copeland
2016-07-06 13:03       ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).