Lines Matching refs:sta
19 static struct sk_buff *mps_qos_null_get(struct sta_info *sta) in mps_qos_null_get() argument
21 struct ieee80211_sub_if_data *sdata = sta->sdata; in mps_qos_null_get()
35 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, in mps_qos_null_get()
41 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in mps_qos_null_get()
43 ieee80211_mps_set_frame_flags(sdata, sta, nullfunc); in mps_qos_null_get()
52 static void mps_qos_null_tx(struct sta_info *sta) in mps_qos_null_tx() argument
56 skb = mps_qos_null_get(sta); in mps_qos_null_tx()
60 mps_dbg(sta->sdata, "announcing peer-specific power mode to %pM\n", in mps_qos_null_tx()
61 sta->sta.addr); in mps_qos_null_tx()
64 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in mps_qos_null_tx()
70 ieee80211_tx_skb(sta->sdata, skb); in mps_qos_null_tx()
84 struct sta_info *sta; in ieee80211_mps_local_status_update() local
92 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_mps_local_status_update()
93 if (sdata != sta->sdata) in ieee80211_mps_local_status_update()
96 switch (sta->mesh->plink_state) { in ieee80211_mps_local_status_update()
103 if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) in ieee80211_mps_local_status_update()
105 else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) in ieee80211_mps_local_status_update()
152 u64 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, in ieee80211_mps_set_sta_local_pm() argument
155 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_mps_set_sta_local_pm()
157 if (sta->mesh->local_pm == pm) in ieee80211_mps_set_sta_local_pm()
161 pm, sta->sta.addr); in ieee80211_mps_set_sta_local_pm()
163 sta->mesh->local_pm = pm; in ieee80211_mps_set_sta_local_pm()
169 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_sta_local_pm()
170 mps_qos_null_tx(sta); in ieee80211_mps_set_sta_local_pm()
188 struct sta_info *sta, in ieee80211_mps_set_frame_flags() argument
196 !sta)) in ieee80211_mps_set_frame_flags()
201 sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_frame_flags()
202 pm = sta->mesh->local_pm; in ieee80211_mps_set_frame_flags()
232 void ieee80211_mps_sta_status_update(struct sta_info *sta) in ieee80211_mps_sta_status_update() argument
238 if (sta->sta_state < IEEE80211_STA_ASSOC) in ieee80211_mps_sta_status_update()
245 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in ieee80211_mps_sta_status_update()
246 sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN) in ieee80211_mps_sta_status_update()
247 pm = sta->mesh->peer_pm; in ieee80211_mps_sta_status_update()
249 pm = sta->mesh->nonpeer_pm; in ieee80211_mps_sta_status_update()
254 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) { in ieee80211_mps_sta_status_update()
255 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
256 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mps_sta_status_update()
258 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
262 if (test_sta_flag(sta, WLAN_STA_PS_STA) == do_buffer) in ieee80211_mps_sta_status_update()
266 set_sta_flag(sta, WLAN_STA_PS_STA); in ieee80211_mps_sta_status_update()
267 atomic_inc(&sta->sdata->u.mesh.ps.num_sta_ps); in ieee80211_mps_sta_status_update()
268 mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n", in ieee80211_mps_sta_status_update()
269 sta->sta.addr); in ieee80211_mps_sta_status_update()
271 ieee80211_sta_ps_deliver_wakeup(sta); in ieee80211_mps_sta_status_update()
275 static void mps_set_sta_peer_pm(struct sta_info *sta, in mps_set_sta_peer_pm() argument
300 if (sta->mesh->peer_pm == pm) in mps_set_sta_peer_pm()
303 mps_dbg(sta->sdata, "STA %pM enters mode %d\n", in mps_set_sta_peer_pm()
304 sta->sta.addr, pm); in mps_set_sta_peer_pm()
306 sta->mesh->peer_pm = pm; in mps_set_sta_peer_pm()
308 ieee80211_mps_sta_status_update(sta); in mps_set_sta_peer_pm()
311 static void mps_set_sta_nonpeer_pm(struct sta_info *sta, in mps_set_sta_nonpeer_pm() argument
321 if (sta->mesh->nonpeer_pm == pm) in mps_set_sta_nonpeer_pm()
324 mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", in mps_set_sta_nonpeer_pm()
325 sta->sta.addr, pm); in mps_set_sta_nonpeer_pm()
327 sta->mesh->nonpeer_pm = pm; in mps_set_sta_nonpeer_pm()
329 ieee80211_mps_sta_status_update(sta); in mps_set_sta_nonpeer_pm()
338 void ieee80211_mps_rx_h_sta_process(struct sta_info *sta, in ieee80211_mps_rx_h_sta_process() argument
347 mps_set_sta_peer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
351 sta, false, false); in ieee80211_mps_rx_h_sta_process()
357 mps_set_sta_nonpeer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
364 static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp) in mpsp_trigger_send() argument
366 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_trigger_send()
372 skb = mps_qos_null_get(sta); in mpsp_trigger_send()
400 rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr); in mpsp_trigger_send()
414 static void mpsp_qos_null_append(struct sta_info *sta, in mpsp_qos_null_append() argument
417 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_qos_null_append()
425 new_skb = mps_qos_null_get(sta); in mpsp_qos_null_append()
430 sta->sta.addr); in mpsp_qos_null_append()
452 static void mps_frame_deliver(struct sta_info *sta, int n_frames) in mps_frame_deliver() argument
454 struct ieee80211_local *local = sta->sdata->local; in mps_frame_deliver()
465 skb = skb_dequeue(&sta->tx_filtered[ac]); in mps_frame_deliver()
468 &sta->ps_tx_buf[ac]); in mps_frame_deliver()
478 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in mps_frame_deliver()
479 !skb_queue_empty(&sta->ps_tx_buf[ac])) in mps_frame_deliver()
485 mpsp_trigger_send(sta, false, true); in mps_frame_deliver()
490 if (test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in mps_frame_deliver()
491 mpsp_qos_null_append(sta, &frames); in mps_frame_deliver()
493 mps_dbg(sta->sdata, "sending %d frames to PS STA %pM\n", in mps_frame_deliver()
494 skb_queue_len(&frames), sta->sta.addr); in mps_frame_deliver()
526 sta_info_recalc_tim(sta); in mps_frame_deliver()
539 void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, in ieee80211_mpsp_trigger_process() argument
547 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
550 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mpsp_trigger_process()
552 test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mpsp_trigger_process()
553 !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
554 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
557 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
558 else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE) in ieee80211_mpsp_trigger_process()
559 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
561 if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
562 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
577 void ieee80211_mps_frame_release(struct sta_info *sta, in ieee80211_mps_frame_release() argument
583 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
585 sta->mesh->aid); in ieee80211_mps_frame_release()
588 mps_dbg(sta->sdata, "%pM indicates buffered frames\n", in ieee80211_mps_frame_release()
589 sta->sta.addr); in ieee80211_mps_frame_release()
592 if (test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mps_frame_release()
596 if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mps_frame_release()
598 buffer_local += skb_queue_len(&sta->ps_tx_buf[ac]) + in ieee80211_mps_frame_release()
599 skb_queue_len(&sta->tx_filtered[ac]); in ieee80211_mps_frame_release()
604 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
605 mpsp_trigger_send(sta, has_buffered, !buffer_local); in ieee80211_mps_frame_release()
607 mps_frame_deliver(sta, 1); in ieee80211_mps_frame_release()