According to IEEE80211s standard a mesh STA shall indicate its non-peer mesh power mode with the Power Management field in the Frame Control field and the Mesh Power Save Level field in the Mesh Capability field in Beacon and Probe Response frames. Signed-off-by: Ivan Bezyazychnyy <ivan.bezyazychnyy@xxxxxxxxx> Signed-off-by: Mike Krinkin <krinkin.m.u@xxxxxxxxx> Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx> --- net/mac80211/mesh.c | 2 ++ net/mac80211/mesh.h | 3 +++ net/mac80211/tx.c | 3 +++ 3 files changed, 8 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a7078fd..5b8c5d3 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -242,6 +242,8 @@ 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_POWER_SAVE_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..e62c53b 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_POWER_SAVE_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 500c3ce..aeb2968 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2339,6 +2339,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 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html