Lines Matching refs:sta

21 static struct sk_buff *mps_qos_null_get(struct sta_info *sta)  in mps_qos_null_get()  argument
23 struct ieee80211_sub_if_data *sdata = sta->sdata; in mps_qos_null_get()
37 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, in mps_qos_null_get()
43 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in mps_qos_null_get()
45 ieee80211_mps_set_frame_flags(sdata, sta, nullfunc); in mps_qos_null_get()
54 static void mps_qos_null_tx(struct sta_info *sta) in mps_qos_null_tx() argument
58 skb = mps_qos_null_get(sta); in mps_qos_null_tx()
62 mps_dbg(sta->sdata, "announcing peer-specific power mode to %pM\n", in mps_qos_null_tx()
63 sta->sta.addr); in mps_qos_null_tx()
66 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in mps_qos_null_tx()
72 ieee80211_tx_skb(sta->sdata, skb); in mps_qos_null_tx()
88 struct sta_info *sta; in ieee80211_mps_local_status_update() local
96 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_mps_local_status_update()
97 if (sdata != sta->sdata) in ieee80211_mps_local_status_update()
100 switch (sta->mesh->plink_state) { in ieee80211_mps_local_status_update()
107 if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) in ieee80211_mps_local_status_update()
109 else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) in ieee80211_mps_local_status_update()
156 u64 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, in ieee80211_mps_set_sta_local_pm() argument
159 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_mps_set_sta_local_pm()
161 if (sta->mesh->local_pm == pm) in ieee80211_mps_set_sta_local_pm()
165 pm, sta->sta.addr); in ieee80211_mps_set_sta_local_pm()
167 sta->mesh->local_pm = pm; in ieee80211_mps_set_sta_local_pm()
173 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_sta_local_pm()
174 mps_qos_null_tx(sta); in ieee80211_mps_set_sta_local_pm()
192 struct sta_info *sta, in ieee80211_mps_set_frame_flags() argument
200 !sta)) in ieee80211_mps_set_frame_flags()
205 sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_frame_flags()
206 pm = sta->mesh->local_pm; in ieee80211_mps_set_frame_flags()
236 void ieee80211_mps_sta_status_update(struct sta_info *sta) in ieee80211_mps_sta_status_update() argument
242 if (sta->sta_state < IEEE80211_STA_ASSOC) in ieee80211_mps_sta_status_update()
249 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in ieee80211_mps_sta_status_update()
250 sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN) in ieee80211_mps_sta_status_update()
251 pm = sta->mesh->peer_pm; in ieee80211_mps_sta_status_update()
253 pm = sta->mesh->nonpeer_pm; in ieee80211_mps_sta_status_update()
258 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) { in ieee80211_mps_sta_status_update()
259 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
260 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mps_sta_status_update()
262 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
266 if (test_sta_flag(sta, WLAN_STA_PS_STA) == do_buffer) in ieee80211_mps_sta_status_update()
270 set_sta_flag(sta, WLAN_STA_PS_STA); in ieee80211_mps_sta_status_update()
271 atomic_inc(&sta->sdata->u.mesh.ps.num_sta_ps); in ieee80211_mps_sta_status_update()
272 mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n", in ieee80211_mps_sta_status_update()
273 sta->sta.addr); in ieee80211_mps_sta_status_update()
275 ieee80211_sta_ps_deliver_wakeup(sta); in ieee80211_mps_sta_status_update()
279 static void mps_set_sta_peer_pm(struct sta_info *sta, in mps_set_sta_peer_pm() argument
304 if (sta->mesh->peer_pm == pm) in mps_set_sta_peer_pm()
307 mps_dbg(sta->sdata, "STA %pM enters mode %d\n", in mps_set_sta_peer_pm()
308 sta->sta.addr, pm); in mps_set_sta_peer_pm()
310 sta->mesh->peer_pm = pm; in mps_set_sta_peer_pm()
312 ieee80211_mps_sta_status_update(sta); in mps_set_sta_peer_pm()
315 static void mps_set_sta_nonpeer_pm(struct sta_info *sta, in mps_set_sta_nonpeer_pm() argument
325 if (sta->mesh->nonpeer_pm == pm) in mps_set_sta_nonpeer_pm()
328 mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", in mps_set_sta_nonpeer_pm()
329 sta->sta.addr, pm); in mps_set_sta_nonpeer_pm()
331 sta->mesh->nonpeer_pm = pm; in mps_set_sta_nonpeer_pm()
333 ieee80211_mps_sta_status_update(sta); in mps_set_sta_nonpeer_pm()
342 void ieee80211_mps_rx_h_sta_process(struct sta_info *sta, in ieee80211_mps_rx_h_sta_process() argument
351 mps_set_sta_peer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
355 sta, false, false); in ieee80211_mps_rx_h_sta_process()
361 mps_set_sta_nonpeer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
368 static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp) in mpsp_trigger_send() argument
370 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_trigger_send()
376 skb = mps_qos_null_get(sta); in mpsp_trigger_send()
404 rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr); in mpsp_trigger_send()
418 static void mpsp_qos_null_append(struct sta_info *sta, in mpsp_qos_null_append() argument
421 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_qos_null_append()
429 new_skb = mps_qos_null_get(sta); in mpsp_qos_null_append()
434 sta->sta.addr); in mpsp_qos_null_append()
456 static void mps_frame_deliver(struct sta_info *sta, int n_frames) in mps_frame_deliver() argument
458 struct ieee80211_local *local = sta->sdata->local; in mps_frame_deliver()
469 skb = skb_dequeue(&sta->tx_filtered[ac]); in mps_frame_deliver()
472 &sta->ps_tx_buf[ac]); in mps_frame_deliver()
482 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in mps_frame_deliver()
483 !skb_queue_empty(&sta->ps_tx_buf[ac])) in mps_frame_deliver()
489 mpsp_trigger_send(sta, false, true); in mps_frame_deliver()
494 if (test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in mps_frame_deliver()
495 mpsp_qos_null_append(sta, &frames); in mps_frame_deliver()
497 mps_dbg(sta->sdata, "sending %d frames to PS STA %pM\n", in mps_frame_deliver()
498 skb_queue_len(&frames), sta->sta.addr); in mps_frame_deliver()
530 sta_info_recalc_tim(sta); in mps_frame_deliver()
543 void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, in ieee80211_mpsp_trigger_process() argument
551 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
554 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mpsp_trigger_process()
556 test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mpsp_trigger_process()
557 !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
558 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
561 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
562 else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE) in ieee80211_mpsp_trigger_process()
563 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
565 if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
566 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
581 void ieee80211_mps_frame_release(struct sta_info *sta, in ieee80211_mps_frame_release() argument
587 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
589 sta->mesh->aid); in ieee80211_mps_frame_release()
592 mps_dbg(sta->sdata, "%pM indicates buffered frames\n", in ieee80211_mps_frame_release()
593 sta->sta.addr); in ieee80211_mps_frame_release()
596 if (test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mps_frame_release()
600 if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mps_frame_release()
602 buffer_local += skb_queue_len(&sta->ps_tx_buf[ac]) + in ieee80211_mps_frame_release()
603 skb_queue_len(&sta->tx_filtered[ac]); in ieee80211_mps_frame_release()
608 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
609 mpsp_trigger_send(sta, has_buffered, !buffer_local); in ieee80211_mps_frame_release()
611 mps_frame_deliver(sta, 1); in ieee80211_mps_frame_release()