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