Lines Matching refs:sta
17 static struct sk_buff *mps_qos_null_get(struct sta_info *sta) in mps_qos_null_get() argument
19 struct ieee80211_sub_if_data *sdata = sta->sdata; in mps_qos_null_get()
33 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, in mps_qos_null_get()
39 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in mps_qos_null_get()
41 ieee80211_mps_set_frame_flags(sdata, sta, nullfunc); in mps_qos_null_get()
50 static void mps_qos_null_tx(struct sta_info *sta) in mps_qos_null_tx() argument
54 skb = mps_qos_null_get(sta); in mps_qos_null_tx()
58 mps_dbg(sta->sdata, "announcing peer-specific power mode to %pM\n", in mps_qos_null_tx()
59 sta->sta.addr); in mps_qos_null_tx()
62 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in mps_qos_null_tx()
68 ieee80211_tx_skb(sta->sdata, skb); in mps_qos_null_tx()
82 struct sta_info *sta; in ieee80211_mps_local_status_update() local
90 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_mps_local_status_update()
91 if (sdata != sta->sdata) in ieee80211_mps_local_status_update()
94 switch (sta->mesh->plink_state) { in ieee80211_mps_local_status_update()
101 if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) in ieee80211_mps_local_status_update()
103 else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) in ieee80211_mps_local_status_update()
150 u32 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, in ieee80211_mps_set_sta_local_pm() argument
153 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_mps_set_sta_local_pm()
155 if (sta->mesh->local_pm == pm) in ieee80211_mps_set_sta_local_pm()
159 pm, sta->sta.addr); in ieee80211_mps_set_sta_local_pm()
161 sta->mesh->local_pm = pm; in ieee80211_mps_set_sta_local_pm()
167 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_sta_local_pm()
168 mps_qos_null_tx(sta); in ieee80211_mps_set_sta_local_pm()
186 struct sta_info *sta, in ieee80211_mps_set_frame_flags() argument
194 !sta)) in ieee80211_mps_set_frame_flags()
199 sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_frame_flags()
200 pm = sta->mesh->local_pm; in ieee80211_mps_set_frame_flags()
230 void ieee80211_mps_sta_status_update(struct sta_info *sta) in ieee80211_mps_sta_status_update() argument
236 if (sta->sta_state < IEEE80211_STA_ASSOC) in ieee80211_mps_sta_status_update()
243 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in ieee80211_mps_sta_status_update()
244 sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN) in ieee80211_mps_sta_status_update()
245 pm = sta->mesh->peer_pm; in ieee80211_mps_sta_status_update()
247 pm = sta->mesh->nonpeer_pm; in ieee80211_mps_sta_status_update()
252 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) { in ieee80211_mps_sta_status_update()
253 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
254 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mps_sta_status_update()
256 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
260 if (test_sta_flag(sta, WLAN_STA_PS_STA) == do_buffer) in ieee80211_mps_sta_status_update()
264 set_sta_flag(sta, WLAN_STA_PS_STA); in ieee80211_mps_sta_status_update()
265 atomic_inc(&sta->sdata->u.mesh.ps.num_sta_ps); in ieee80211_mps_sta_status_update()
266 mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n", in ieee80211_mps_sta_status_update()
267 sta->sta.addr); in ieee80211_mps_sta_status_update()
269 ieee80211_sta_ps_deliver_wakeup(sta); in ieee80211_mps_sta_status_update()
273 static void mps_set_sta_peer_pm(struct sta_info *sta, in mps_set_sta_peer_pm() argument
298 if (sta->mesh->peer_pm == pm) in mps_set_sta_peer_pm()
301 mps_dbg(sta->sdata, "STA %pM enters mode %d\n", in mps_set_sta_peer_pm()
302 sta->sta.addr, pm); in mps_set_sta_peer_pm()
304 sta->mesh->peer_pm = pm; in mps_set_sta_peer_pm()
306 ieee80211_mps_sta_status_update(sta); in mps_set_sta_peer_pm()
309 static void mps_set_sta_nonpeer_pm(struct sta_info *sta, in mps_set_sta_nonpeer_pm() argument
319 if (sta->mesh->nonpeer_pm == pm) in mps_set_sta_nonpeer_pm()
322 mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", in mps_set_sta_nonpeer_pm()
323 sta->sta.addr, pm); in mps_set_sta_nonpeer_pm()
325 sta->mesh->nonpeer_pm = pm; in mps_set_sta_nonpeer_pm()
327 ieee80211_mps_sta_status_update(sta); in mps_set_sta_nonpeer_pm()
336 void ieee80211_mps_rx_h_sta_process(struct sta_info *sta, in ieee80211_mps_rx_h_sta_process() argument
345 mps_set_sta_peer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
349 sta, false, false); in ieee80211_mps_rx_h_sta_process()
355 mps_set_sta_nonpeer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
362 static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp) in mpsp_trigger_send() argument
364 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_trigger_send()
370 skb = mps_qos_null_get(sta); in mpsp_trigger_send()
398 rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr); in mpsp_trigger_send()
412 static void mpsp_qos_null_append(struct sta_info *sta, in mpsp_qos_null_append() argument
415 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_qos_null_append()
423 new_skb = mps_qos_null_get(sta); in mpsp_qos_null_append()
428 sta->sta.addr); in mpsp_qos_null_append()
450 static void mps_frame_deliver(struct sta_info *sta, int n_frames) in mps_frame_deliver() argument
452 struct ieee80211_local *local = sta->sdata->local; in mps_frame_deliver()
463 skb = skb_dequeue(&sta->tx_filtered[ac]); in mps_frame_deliver()
466 &sta->ps_tx_buf[ac]); in mps_frame_deliver()
476 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in mps_frame_deliver()
477 !skb_queue_empty(&sta->ps_tx_buf[ac])) in mps_frame_deliver()
483 mpsp_trigger_send(sta, false, true); in mps_frame_deliver()
488 if (test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in mps_frame_deliver()
489 mpsp_qos_null_append(sta, &frames); in mps_frame_deliver()
491 mps_dbg(sta->sdata, "sending %d frames to PS STA %pM\n", in mps_frame_deliver()
492 skb_queue_len(&frames), sta->sta.addr); in mps_frame_deliver()
524 sta_info_recalc_tim(sta); in mps_frame_deliver()
537 void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, in ieee80211_mpsp_trigger_process() argument
545 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
548 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mpsp_trigger_process()
550 test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mpsp_trigger_process()
551 !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
552 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
555 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
556 else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE) in ieee80211_mpsp_trigger_process()
557 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
559 if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
560 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
575 void ieee80211_mps_frame_release(struct sta_info *sta, in ieee80211_mps_frame_release() argument
581 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
583 sta->mesh->aid); in ieee80211_mps_frame_release()
586 mps_dbg(sta->sdata, "%pM indicates buffered frames\n", in ieee80211_mps_frame_release()
587 sta->sta.addr); in ieee80211_mps_frame_release()
590 if (test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mps_frame_release()
594 if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mps_frame_release()
596 buffer_local += skb_queue_len(&sta->ps_tx_buf[ac]) + in ieee80211_mps_frame_release()
597 skb_queue_len(&sta->tx_filtered[ac]); in ieee80211_mps_frame_release()
602 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
603 mpsp_trigger_send(sta, has_buffered, !buffer_local); in ieee80211_mps_frame_release()
605 mps_frame_deliver(sta, 1); in ieee80211_mps_frame_release()