aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_hwmp.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/mesh_hwmp.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/mesh_hwmp.c')
-rw-r--r--net/mac80211/mesh_hwmp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 6b4603a90031..f0dd8742ed42 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -205,6 +205,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
205 struct sk_buff *skb) 205 struct sk_buff *skb)
206{ 206{
207 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 207 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
208 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
208 209
209 skb_set_mac_header(skb, 0); 210 skb_set_mac_header(skb, 0);
210 skb_set_network_header(skb, 0); 211 skb_set_network_header(skb, 0);
@@ -217,6 +218,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
217 info->control.vif = &sdata->vif; 218 info->control.vif = &sdata->vif;
218 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; 219 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
219 ieee80211_set_qos_hdr(sdata, skb); 220 ieee80211_set_qos_hdr(sdata, skb);
221 ieee80211_mps_set_frame_flags(sdata, NULL, hdr);
220} 222}
221 223
222/** 224/**
@@ -1080,6 +1082,10 @@ int mesh_nexthop_resolve(struct sk_buff *skb,
1080 u8 *target_addr = hdr->addr3; 1082 u8 *target_addr = hdr->addr3;
1081 int err = 0; 1083 int err = 0;
1082 1084
1085 /* Nulls are only sent to peers for PS and should be pre-addressed */
1086 if (ieee80211_is_qos_nullfunc(hdr->frame_control))
1087 return 0;
1088
1083 rcu_read_lock(); 1089 rcu_read_lock();
1084 err = mesh_nexthop_lookup(skb, sdata); 1090 err = mesh_nexthop_lookup(skb, sdata);
1085 if (!err) 1091 if (!err)
@@ -1151,6 +1157,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
1151 if (next_hop) { 1157 if (next_hop) {
1152 memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN); 1158 memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN);
1153 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); 1159 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
1160 ieee80211_mps_set_frame_flags(sdata, next_hop, hdr);
1154 err = 0; 1161 err = 0;
1155 } 1162 }
1156 1163