* [RFC 3/7] mac80211: mesh non-peer power mode indication in beacons
@ 2011-10-21 8:37 Ivan Bezyazychnyy
2011-10-21 10:03 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Bezyazychnyy @ 2011-10-21 8:37 UTC (permalink / raw)
To: linux-wireless
inidicate local mesh sta non-peer power mode in beacons
Signed-off-by: Ivan Bezyazychnyy <ivan.bezyazychnyy@gmail.com>
---
net/mac80211/mesh.c | 3 +++
net/mac80211/mesh.h | 3 +++
net/mac80211/tx.c | 3 +++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index a7078fd..c16a203 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -242,6 +242,9 @@ mesh_add_meshconf_ie(struct sk_buff *skb, struct
ieee80211_sub_if_data *sdata)
/* Mesh capability */
ifmsh->accepting_plinks = mesh_plink_availables(sdata);
*pos = MESHCONF_CAPAB_FORWARDING;
+ if (sdata->u.mesh.mshcfg.power_mode == NL80211_MESH_POWER_DEEP_SLEEP) {
+ *pos |= MESHCONF_CAPAB_PS_LEVEL;
+ }
*pos++ |= ifmsh->accepting_plinks ?
MESHCONF_CAPAB_ACCEPT_PLINKS : 0x00;
*pos++ = 0x00;
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 6842453..188cc86 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -188,6 +188,9 @@ struct mesh_rmc {
/* Maximum number of paths per interface */
#define MESH_MAX_MPATHS 1024
+/* capability power save flag mask */
+#define MESHCONF_CAPAB_PS_LEVEL 0x80
+
/* Public interfaces */
/* Various */
int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8f2bc51..b1b1234 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2344,6 +2344,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct
ieee80211_hw *hw,
memset(mgmt, 0, 24 + sizeof(mgmt->u.beacon));
mgmt->frame_control =
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
+ if (sdata->u.mesh.mshcfg.power_mode != NL80211_MESH_POWER_ACTIVE) {
+ mgmt->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
+ }
memset(mgmt->da, 0xff, ETH_ALEN);
memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-21 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 8:37 [RFC 3/7] mac80211: mesh non-peer power mode indication in beacons Ivan Bezyazychnyy
2011-10-21 10: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