aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorMarco Porsch <marco@cozybit.com>2013-01-30 12:14:08 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-04 12:57:47 -0500
commit3f52b7e328c526fa7a592af9bf5772c591ed38a4 (patch)
tree1bcf93b87c99c3be6c9020a41b28114130f4c251 /net/mac80211/sta_info.c
parent0532d4f154b87da6361ab90d12f35142d5119dc1 (diff)
mac80211: mesh power save basics
Add routines to - maintain a PS mode for each peer and a non-peer PS mode - indicate own PS mode in transmitted frames - track neighbor STAs power modes - buffer frames when neighbors are in PS mode - add TIM and Awake Window IE to beacons - release frames in Mesh Peer Service Periods Add local_pm to sta_info to represent the link-specific power mode at this station towards the remote station. When a peer link is established, use the default power mode stored in mesh config. Update the PS status if the peering status of a neighbor changes. Maintain a mesh power mode for non-peer mesh STAs. Set the non-peer power mode to active mode during peering. Authenticated mesh peering is currently not working when either node is configured to be in power save mode. Indicate the current power mode in transmitted frames. Use QoS Nulls to indicate mesh power mode transitions. For performance reasons, calls to the function setting the frame flags are placed in HWMP routing routines, as there the STA pointer is already available. Add peer_pm to sta_info to represent the peer's link-specific power mode towards the local station. Add nonpeer_pm to represent the peer's power mode towards all non-peer stations. Track power modes based on received frames. Add the ps_data structure to ieee80211_if_mesh (for TIM map, PS neighbor counter and group-addressed frame buffer). Set WLAN_STA_PS flag for STA in PS mode to use the unicast frame buffering routines in the tx path. Update num_sta_ps to buffer and release group-addressed frames after DTIM beacons. Announce the awake window duration in beacons if in light or deep sleep mode towards any peer or non-peer. Create a TIM IE similarly to AP mode and add it to mesh beacons. Parse received Awake Window IEs and check TIM IEs for buffered frames. Release frames towards peers in mesh Peer Service Periods. Use the corresponding trigger frames and monitor the MPSP status. Append a QoS Null as trigger frame if neccessary to properly end the MPSP. Currently, in HT channels MPSPs behave imperfectly and show large delay spikes and frame losses. Signed-off-by: Marco Porsch <marco@cozybit.com> Signed-off-by: Ivan Bezyazychnyy <ivan.bezyazychnyy@gmail.com> Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 227233c3ff7f..47a0f0601768 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -120,6 +120,8 @@ static void cleanup_single_sta(struct sta_info *sta)
120 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || 120 if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
121 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 121 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
122 ps = &sdata->bss->ps; 122 ps = &sdata->bss->ps;
123 else if (ieee80211_vif_is_mesh(&sdata->vif))
124 ps = &sdata->u.mesh.ps;
123 else 125 else
124 return; 126 return;
125 127
@@ -587,6 +589,12 @@ void sta_info_recalc_tim(struct sta_info *sta)
587 589
588 ps = &sta->sdata->bss->ps; 590 ps = &sta->sdata->bss->ps;
589 id = sta->sta.aid; 591 id = sta->sta.aid;
592#ifdef CONFIG_MAC80211_MESH
593 } else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) {
594 ps = &sta->sdata->u.mesh.ps;
595 /* TIM map only for PLID <= IEEE80211_MAX_AID */
596 id = le16_to_cpu(sta->plid) % IEEE80211_MAX_AID;
597#endif
590 } else { 598 } else {
591 return; 599 return;
592 } 600 }
@@ -745,8 +753,9 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
745 bool have_buffered = false; 753 bool have_buffered = false;
746 int ac; 754 int ac;
747 755
748 /* This is only necessary for stations on BSS interfaces */ 756 /* This is only necessary for stations on BSS/MBSS interfaces */
749 if (!sta->sdata->bss) 757 if (!sta->sdata->bss &&
758 !ieee80211_vif_is_mesh(&sta->sdata->vif))
750 return false; 759 return false;
751 760
752 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) 761 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
@@ -934,6 +943,11 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
934 if (time_after(jiffies, sta->last_rx + exp_time)) { 943 if (time_after(jiffies, sta->last_rx + exp_time)) {
935 sta_dbg(sta->sdata, "expiring inactive STA %pM\n", 944 sta_dbg(sta->sdata, "expiring inactive STA %pM\n",
936 sta->sta.addr); 945 sta->sta.addr);
946
947 if (ieee80211_vif_is_mesh(&sdata->vif) &&
948 test_sta_flag(sta, WLAN_STA_PS_STA))
949 atomic_dec(&sdata->u.mesh.ps.num_sta_ps);
950
937 WARN_ON(__sta_info_destroy(sta)); 951 WARN_ON(__sta_info_destroy(sta));
938 } 952 }
939 } 953 }
@@ -992,6 +1006,8 @@ static void clear_sta_ps_flags(void *_sta)
992 if (sdata->vif.type == NL80211_IFTYPE_AP || 1006 if (sdata->vif.type == NL80211_IFTYPE_AP ||
993 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 1007 sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
994 ps = &sdata->bss->ps; 1008 ps = &sdata->bss->ps;
1009 else if (ieee80211_vif_is_mesh(&sdata->vif))
1010 ps = &sdata->u.mesh.ps;
995 else 1011 else
996 return; 1012 return;
997 1013