Lines Matching refs:sta

16 static struct sk_buff *mps_qos_null_get(struct sta_info *sta)  in mps_qos_null_get()  argument
18 struct ieee80211_sub_if_data *sdata = sta->sdata; in mps_qos_null_get()
32 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, in mps_qos_null_get()
38 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in mps_qos_null_get()
40 ieee80211_mps_set_frame_flags(sdata, sta, nullfunc); in mps_qos_null_get()
48 static void mps_qos_null_tx(struct sta_info *sta) in mps_qos_null_tx() argument
52 skb = mps_qos_null_get(sta); in mps_qos_null_tx()
56 mps_dbg(sta->sdata, "announcing peer-specific power mode to %pM\n", in mps_qos_null_tx()
57 sta->sta.addr); in mps_qos_null_tx()
60 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in mps_qos_null_tx()
66 ieee80211_tx_skb(sta->sdata, skb); in mps_qos_null_tx()
80 struct sta_info *sta; in ieee80211_mps_local_status_update() local
88 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_mps_local_status_update()
89 if (sdata != sta->sdata) in ieee80211_mps_local_status_update()
92 switch (sta->mesh->plink_state) { in ieee80211_mps_local_status_update()
99 if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) in ieee80211_mps_local_status_update()
101 else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) in ieee80211_mps_local_status_update()
148 u32 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, in ieee80211_mps_set_sta_local_pm() argument
151 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_mps_set_sta_local_pm()
153 if (sta->mesh->local_pm == pm) in ieee80211_mps_set_sta_local_pm()
157 pm, sta->sta.addr); in ieee80211_mps_set_sta_local_pm()
159 sta->mesh->local_pm = pm; in ieee80211_mps_set_sta_local_pm()
165 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_sta_local_pm()
166 mps_qos_null_tx(sta); in ieee80211_mps_set_sta_local_pm()
184 struct sta_info *sta, in ieee80211_mps_set_frame_flags() argument
192 !sta)) in ieee80211_mps_set_frame_flags()
197 sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_frame_flags()
198 pm = sta->mesh->local_pm; in ieee80211_mps_set_frame_flags()
228 void ieee80211_mps_sta_status_update(struct sta_info *sta) in ieee80211_mps_sta_status_update() argument
234 if (sta->sta_state < IEEE80211_STA_ASSOC) in ieee80211_mps_sta_status_update()
241 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in ieee80211_mps_sta_status_update()
242 sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN) in ieee80211_mps_sta_status_update()
243 pm = sta->mesh->peer_pm; in ieee80211_mps_sta_status_update()
245 pm = sta->mesh->nonpeer_pm; in ieee80211_mps_sta_status_update()
250 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) { in ieee80211_mps_sta_status_update()
251 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
252 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mps_sta_status_update()
254 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
258 if (test_sta_flag(sta, WLAN_STA_PS_STA) == do_buffer) in ieee80211_mps_sta_status_update()
262 set_sta_flag(sta, WLAN_STA_PS_STA); in ieee80211_mps_sta_status_update()
263 atomic_inc(&sta->sdata->u.mesh.ps.num_sta_ps); in ieee80211_mps_sta_status_update()
264 mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n", in ieee80211_mps_sta_status_update()
265 sta->sta.addr); in ieee80211_mps_sta_status_update()
267 ieee80211_sta_ps_deliver_wakeup(sta); in ieee80211_mps_sta_status_update()
271 static void mps_set_sta_peer_pm(struct sta_info *sta, in mps_set_sta_peer_pm() argument
296 if (sta->mesh->peer_pm == pm) in mps_set_sta_peer_pm()
299 mps_dbg(sta->sdata, "STA %pM enters mode %d\n", in mps_set_sta_peer_pm()
300 sta->sta.addr, pm); in mps_set_sta_peer_pm()
302 sta->mesh->peer_pm = pm; in mps_set_sta_peer_pm()
304 ieee80211_mps_sta_status_update(sta); in mps_set_sta_peer_pm()
307 static void mps_set_sta_nonpeer_pm(struct sta_info *sta, in mps_set_sta_nonpeer_pm() argument
317 if (sta->mesh->nonpeer_pm == pm) in mps_set_sta_nonpeer_pm()
320 mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", in mps_set_sta_nonpeer_pm()
321 sta->sta.addr, pm); in mps_set_sta_nonpeer_pm()
323 sta->mesh->nonpeer_pm = pm; in mps_set_sta_nonpeer_pm()
325 ieee80211_mps_sta_status_update(sta); in mps_set_sta_nonpeer_pm()
334 void ieee80211_mps_rx_h_sta_process(struct sta_info *sta, in ieee80211_mps_rx_h_sta_process() argument
343 mps_set_sta_peer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
347 sta, false, false); in ieee80211_mps_rx_h_sta_process()
353 mps_set_sta_nonpeer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
360 static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp) in mpsp_trigger_send() argument
362 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_trigger_send()
368 skb = mps_qos_null_get(sta); in mpsp_trigger_send()
396 rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr); in mpsp_trigger_send()
408 static void mpsp_qos_null_append(struct sta_info *sta, in mpsp_qos_null_append() argument
411 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_qos_null_append()
419 new_skb = mps_qos_null_get(sta); in mpsp_qos_null_append()
424 sta->sta.addr); in mpsp_qos_null_append()
446 static void mps_frame_deliver(struct sta_info *sta, int n_frames) in mps_frame_deliver() argument
448 struct ieee80211_local *local = sta->sdata->local; in mps_frame_deliver()
459 skb = skb_dequeue(&sta->tx_filtered[ac]); in mps_frame_deliver()
462 &sta->ps_tx_buf[ac]); in mps_frame_deliver()
472 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in mps_frame_deliver()
473 !skb_queue_empty(&sta->ps_tx_buf[ac])) in mps_frame_deliver()
479 mpsp_trigger_send(sta, false, true); in mps_frame_deliver()
484 if (test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in mps_frame_deliver()
485 mpsp_qos_null_append(sta, &frames); in mps_frame_deliver()
487 mps_dbg(sta->sdata, "sending %d frames to PS STA %pM\n", in mps_frame_deliver()
488 skb_queue_len(&frames), sta->sta.addr); in mps_frame_deliver()
520 sta_info_recalc_tim(sta); in mps_frame_deliver()
533 void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, in ieee80211_mpsp_trigger_process() argument
541 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
544 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mpsp_trigger_process()
546 test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mpsp_trigger_process()
547 !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
548 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
551 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
552 else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE) in ieee80211_mpsp_trigger_process()
553 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
555 if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
556 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
571 void ieee80211_mps_frame_release(struct sta_info *sta, in ieee80211_mps_frame_release() argument
577 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
579 sta->mesh->aid); in ieee80211_mps_frame_release()
582 mps_dbg(sta->sdata, "%pM indicates buffered frames\n", in ieee80211_mps_frame_release()
583 sta->sta.addr); in ieee80211_mps_frame_release()
586 if (test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mps_frame_release()
590 if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mps_frame_release()
592 buffer_local += skb_queue_len(&sta->ps_tx_buf[ac]) + in ieee80211_mps_frame_release()
593 skb_queue_len(&sta->tx_filtered[ac]); in ieee80211_mps_frame_release()
598 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
599 mpsp_trigger_send(sta, has_buffered, !buffer_local); in ieee80211_mps_frame_release()
601 mps_frame_deliver(sta, 1); in ieee80211_mps_frame_release()