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