Lines Matching refs:sta
18 static struct sk_buff *mps_qos_null_get(struct sta_info *sta) in mps_qos_null_get() argument
20 struct ieee80211_sub_if_data *sdata = sta->sdata; in mps_qos_null_get()
34 ieee80211_fill_mesh_addresses(nullfunc, &fc, sta->sta.addr, in mps_qos_null_get()
40 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in mps_qos_null_get()
42 ieee80211_mps_set_frame_flags(sdata, sta, nullfunc); in mps_qos_null_get()
51 static void mps_qos_null_tx(struct sta_info *sta) in mps_qos_null_tx() argument
55 skb = mps_qos_null_get(sta); in mps_qos_null_tx()
59 mps_dbg(sta->sdata, "announcing peer-specific power mode to %pM\n", in mps_qos_null_tx()
60 sta->sta.addr); in mps_qos_null_tx()
63 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in mps_qos_null_tx()
69 ieee80211_tx_skb(sta->sdata, skb); in mps_qos_null_tx()
83 struct sta_info *sta; in ieee80211_mps_local_status_update() local
91 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_mps_local_status_update()
92 if (sdata != sta->sdata) in ieee80211_mps_local_status_update()
95 switch (sta->mesh->plink_state) { in ieee80211_mps_local_status_update()
102 if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) in ieee80211_mps_local_status_update()
104 else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) in ieee80211_mps_local_status_update()
151 u32 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, in ieee80211_mps_set_sta_local_pm() argument
154 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_mps_set_sta_local_pm()
156 if (sta->mesh->local_pm == pm) in ieee80211_mps_set_sta_local_pm()
160 pm, sta->sta.addr); in ieee80211_mps_set_sta_local_pm()
162 sta->mesh->local_pm = pm; in ieee80211_mps_set_sta_local_pm()
168 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_sta_local_pm()
169 mps_qos_null_tx(sta); in ieee80211_mps_set_sta_local_pm()
187 struct sta_info *sta, in ieee80211_mps_set_frame_flags() argument
195 !sta)) in ieee80211_mps_set_frame_flags()
200 sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_set_frame_flags()
201 pm = sta->mesh->local_pm; in ieee80211_mps_set_frame_flags()
231 void ieee80211_mps_sta_status_update(struct sta_info *sta) in ieee80211_mps_sta_status_update() argument
237 if (sta->sta_state < IEEE80211_STA_ASSOC) in ieee80211_mps_sta_status_update()
244 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in ieee80211_mps_sta_status_update()
245 sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN) in ieee80211_mps_sta_status_update()
246 pm = sta->mesh->peer_pm; in ieee80211_mps_sta_status_update()
248 pm = sta->mesh->nonpeer_pm; in ieee80211_mps_sta_status_update()
253 if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) { in ieee80211_mps_sta_status_update()
254 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
255 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mps_sta_status_update()
257 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mps_sta_status_update()
261 if (test_sta_flag(sta, WLAN_STA_PS_STA) == do_buffer) in ieee80211_mps_sta_status_update()
265 set_sta_flag(sta, WLAN_STA_PS_STA); in ieee80211_mps_sta_status_update()
266 atomic_inc(&sta->sdata->u.mesh.ps.num_sta_ps); in ieee80211_mps_sta_status_update()
267 mps_dbg(sta->sdata, "start PS buffering frames towards %pM\n", in ieee80211_mps_sta_status_update()
268 sta->sta.addr); in ieee80211_mps_sta_status_update()
270 ieee80211_sta_ps_deliver_wakeup(sta); in ieee80211_mps_sta_status_update()
274 static void mps_set_sta_peer_pm(struct sta_info *sta, in mps_set_sta_peer_pm() argument
299 if (sta->mesh->peer_pm == pm) in mps_set_sta_peer_pm()
302 mps_dbg(sta->sdata, "STA %pM enters mode %d\n", in mps_set_sta_peer_pm()
303 sta->sta.addr, pm); in mps_set_sta_peer_pm()
305 sta->mesh->peer_pm = pm; in mps_set_sta_peer_pm()
307 ieee80211_mps_sta_status_update(sta); in mps_set_sta_peer_pm()
310 static void mps_set_sta_nonpeer_pm(struct sta_info *sta, in mps_set_sta_nonpeer_pm() argument
320 if (sta->mesh->nonpeer_pm == pm) in mps_set_sta_nonpeer_pm()
323 mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", in mps_set_sta_nonpeer_pm()
324 sta->sta.addr, pm); in mps_set_sta_nonpeer_pm()
326 sta->mesh->nonpeer_pm = pm; in mps_set_sta_nonpeer_pm()
328 ieee80211_mps_sta_status_update(sta); in mps_set_sta_nonpeer_pm()
337 void ieee80211_mps_rx_h_sta_process(struct sta_info *sta, in ieee80211_mps_rx_h_sta_process() argument
346 mps_set_sta_peer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
350 sta, false, false); in ieee80211_mps_rx_h_sta_process()
356 mps_set_sta_nonpeer_pm(sta, hdr); in ieee80211_mps_rx_h_sta_process()
363 static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp) in mpsp_trigger_send() argument
365 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_trigger_send()
371 skb = mps_qos_null_get(sta); in mpsp_trigger_send()
399 rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr); in mpsp_trigger_send()
413 static void mpsp_qos_null_append(struct sta_info *sta, in mpsp_qos_null_append() argument
416 struct ieee80211_sub_if_data *sdata = sta->sdata; in mpsp_qos_null_append()
424 new_skb = mps_qos_null_get(sta); in mpsp_qos_null_append()
429 sta->sta.addr); in mpsp_qos_null_append()
451 static void mps_frame_deliver(struct sta_info *sta, int n_frames) in mps_frame_deliver() argument
453 struct ieee80211_local *local = sta->sdata->local; in mps_frame_deliver()
464 skb = skb_dequeue(&sta->tx_filtered[ac]); in mps_frame_deliver()
467 &sta->ps_tx_buf[ac]); in mps_frame_deliver()
477 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in mps_frame_deliver()
478 !skb_queue_empty(&sta->ps_tx_buf[ac])) in mps_frame_deliver()
484 mpsp_trigger_send(sta, false, true); in mps_frame_deliver()
489 if (test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in mps_frame_deliver()
490 mpsp_qos_null_append(sta, &frames); in mps_frame_deliver()
492 mps_dbg(sta->sdata, "sending %d frames to PS STA %pM\n", in mps_frame_deliver()
493 skb_queue_len(&frames), sta->sta.addr); in mps_frame_deliver()
525 sta_info_recalc_tim(sta); in mps_frame_deliver()
538 void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, in ieee80211_mpsp_trigger_process() argument
546 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
549 clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); in ieee80211_mpsp_trigger_process()
551 test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mpsp_trigger_process()
552 !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
553 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
556 clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
557 else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE) in ieee80211_mpsp_trigger_process()
558 set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); in ieee80211_mpsp_trigger_process()
560 if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mpsp_trigger_process()
561 mps_frame_deliver(sta, -1); in ieee80211_mpsp_trigger_process()
576 void ieee80211_mps_frame_release(struct sta_info *sta, in ieee80211_mps_frame_release() argument
582 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
584 sta->mesh->aid); in ieee80211_mps_frame_release()
587 mps_dbg(sta->sdata, "%pM indicates buffered frames\n", in ieee80211_mps_frame_release()
588 sta->sta.addr); in ieee80211_mps_frame_release()
591 if (test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_mps_frame_release()
595 if (!test_sta_flag(sta, WLAN_STA_MPSP_OWNER)) in ieee80211_mps_frame_release()
597 buffer_local += skb_queue_len(&sta->ps_tx_buf[ac]) + in ieee80211_mps_frame_release()
598 skb_queue_len(&sta->tx_filtered[ac]); in ieee80211_mps_frame_release()
603 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in ieee80211_mps_frame_release()
604 mpsp_trigger_send(sta, has_buffered, !buffer_local); in ieee80211_mps_frame_release()
606 mps_frame_deliver(sta, 1); in ieee80211_mps_frame_release()