Lines Matching defs:local
76 /* Caller must hold local->sta_mtx */
77 static int sta_info_hash_del(struct ieee80211_local *local,
80 return rhltable_remove(&local->sta_hash, &sta->hash_node,
89 struct ieee80211_local *local = sdata->local;
119 ieee80211_txq_purge(local, txqi);
124 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]);
125 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]);
126 ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]);
145 ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
153 struct ieee80211_local *local = sdata->local;
156 sta_info_free(local, sta);
159 struct rhlist_head *sta_info_hash_lookup(struct ieee80211_local *local,
162 return rhltable_lookup(&local->sta_hash, addr, sta_rht_params);
169 struct ieee80211_local *local = sdata->local;
174 for_each_sta_info(local, addr, sta, tmp) {
194 struct ieee80211_local *local = sdata->local;
199 for_each_sta_info(local, addr, sta, tmp) {
213 struct sta_info *sta_info_get_by_addrs(struct ieee80211_local *local,
219 for_each_sta_info(local, sta_addr, sta, tmp) {
230 struct ieee80211_local *local = sdata->local;
234 list_for_each_entry_rcu(sta, &local->sta_list, list,
235 lockdep_is_held(&local->sta_mtx)) {
251 * @local: pointer to the global information
259 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
294 /* Caller must hold local->sta_mtx */
295 static int sta_info_hash_add(struct ieee80211_local *local,
298 return rhltable_insert(&local->sta_hash, &sta->hash_node,
321 static int sta_prepare_rate_control(struct ieee80211_local *local,
324 if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL))
327 sta->rate_ctrl = local->rate_ctrl;
339 struct ieee80211_local *local = sdata->local;
340 struct ieee80211_hw *hw = &local->hw;
378 local->hw.max_rx_aggregation_subframes;
389 sta->local = local;
408 if (local->ops->wake_tx_queue) {
425 if (sta_prepare_rate_control(local, sta, gfp))
435 sta->airtime[i].aql_limit_low = local->aql_txq_limit_low[i];
436 sta->airtime[i].aql_limit_high = local->aql_txq_limit_high[i];
558 lockdep_assert_held(&sdata->local->sta_mtx);
559 if (ieee80211_hw_check(&sdata->local->hw, NEEDS_UNIQUE_STA_ADDR) &&
560 ieee80211_find_sta_by_ifaddr(&sdata->local->hw, sta->addr, NULL)) {
569 static int sta_info_insert_drv_state(struct ieee80211_local *local,
577 err = drv_sta_state(local, sdata, sta, state, state + 1);
587 if (!local->ops->sta_add)
601 WARN_ON(drv_sta_state(local, sdata, sta, state, state - 1));
609 struct ieee80211_local *local = sdata->local;
614 list_for_each_entry_rcu(sta, &local->sta_list, list) {
638 struct ieee80211_local *local = sta->local;
643 lockdep_assert_held(&local->sta_mtx);
657 local->num_sta++;
658 local->sta_generation++;
665 err = sta_info_hash_add(local, sta);
669 list_add_tail_rcu(&sta->list, &local->sta_list);
672 err = sta_info_insert_drv_state(local, sdata, sta);
690 sinfo->generation = local->sta_generation;
698 mutex_unlock(&local->sta_mtx);
707 sta_info_hash_del(local, sta);
710 local->num_sta--;
714 mutex_unlock(&local->sta_mtx);
722 struct ieee80211_local *local = sta->local;
727 mutex_lock(&local->sta_mtx);
731 sta_info_free(local, sta);
732 mutex_unlock(&local->sta_mtx);
796 struct ieee80211_local *local = sta->local;
818 if (ieee80211_hw_check(&local->hw, AP_LINK_PS) && !local->ops->set_tim)
856 spin_lock_bh(&local->tim_lock);
866 if (local->ops->set_tim && !WARN_ON(sta->dead)) {
867 local->tim_in_locked_section = true;
868 drv_set_tim(local, &sta->sta, indicate_tim);
869 local->tim_in_locked_section = false;
873 spin_unlock_bh(&local->tim_lock);
901 static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local,
931 ieee80211_free_txskb(&local->hw, skb);
957 local->total_ps_buffered--;
960 ieee80211_free_txskb(&local->hw, skb);
979 static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
992 sta_info_cleanup_expire_buffered_ac(local, sta, ac);
999 struct ieee80211_local *local;
1008 local = sta->local;
1011 lockdep_assert_held(&local->sta_mtx);
1027 drv_sync_rx_queues(local, sta);
1029 ret = sta_info_hash_del(local, sta);
1038 drv_tdls_cancel_channel_switch(local, sdata, &sta->sta);
1046 drv_sta_pre_rcu_remove(local, sta->sdata, sta);
1057 struct ieee80211_local *local = sta->local;
1068 lockdep_assert_held(&local->sta_mtx);
1076 ieee80211_free_sta_keys(local, sta);
1083 local->num_sta--;
1084 local->sta_generation++;
1095 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE,
1134 mutex_lock(&sdata->local->sta_mtx);
1137 mutex_unlock(&sdata->local->sta_mtx);
1148 mutex_lock(&sdata->local->sta_mtx);
1151 mutex_unlock(&sdata->local->sta_mtx);
1158 struct ieee80211_local *local = from_timer(local, t, sta_cleanup);
1163 list_for_each_entry_rcu(sta, &local->sta_list, list)
1164 if (sta_info_cleanup_expire_buffered(local, sta))
1168 if (local->quiescing)
1174 mod_timer(&local->sta_cleanup,
1178 int sta_info_init(struct ieee80211_local *local)
1182 err = rhltable_init(&local->sta_hash, &sta_rht_params);
1186 spin_lock_init(&local->tim_lock);
1187 mutex_init(&local->sta_mtx);
1188 INIT_LIST_HEAD(&local->sta_list);
1190 timer_setup(&local->sta_cleanup, sta_info_cleanup, 0);
1194 void sta_info_stop(struct ieee80211_local *local)
1196 del_timer_sync(&local->sta_cleanup);
1197 rhltable_destroy(&local->sta_hash);
1203 struct ieee80211_local *local = sdata->local;
1213 mutex_lock(&local->sta_mtx);
1214 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
1228 mutex_unlock(&local->sta_mtx);
1236 struct ieee80211_local *local = sdata->local;
1239 mutex_lock(&local->sta_mtx);
1241 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
1259 mutex_unlock(&local->sta_mtx);
1266 struct ieee80211_local *local = hw_to_local(hw);
1274 for_each_sta_info(local, addr, sta, tmp) {
1310 struct ieee80211_local *local = sdata->local;
1333 if (!ieee80211_hw_check(&local->hw, AP_LINK_PS))
1334 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta);
1340 schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i]));
1365 ieee80211_add_pending_skbs(local, &pending);
1379 local->total_ps_buffered -= buffered;
1395 struct ieee80211_local *local = sdata->local;
1415 skb = dev_alloc_skb(local->hw.extra_tx_headroom + size);
1419 skb_reserve(skb, local->hw.extra_tx_headroom);
1458 drv_allow_buffered_frames(local, sta, BIT(tid), 1,
1527 struct ieee80211_local *local = sdata->local;
1557 local->total_ps_buffered--;
1582 struct ieee80211_local *local = sdata->local;
1718 drv_allow_buffered_frames(local, sta, tids, num,
1721 ieee80211_add_pending_skbs(local, &pending);
1742 drv_release_buffered_frames(local, sta, driver_release_tids,
1825 trace_api_sta_block_awake(sta->local, pubsta, block);
1855 struct ieee80211_local *local = sta->local;
1857 trace_api_eosp(local, pubsta);
1869 trace_api_send_eosp_nullfunc(sta->local, pubsta, tid);
1887 trace_api_sta_set_buffered(sta->local, pubsta, tid, buffered);
1902 struct ieee80211_local *local = sta->sdata->local;
1906 if (sta->local->airtime_flags & AIRTIME_USE_TX)
1908 if (sta->local->airtime_flags & AIRTIME_USE_RX)
1911 spin_lock_bh(&local->active_txq_lock[ac]);
1915 spin_unlock_bh(&local->active_txq_lock[ac]);
1919 void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local,
1925 if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL))
1933 atomic_add(tx_airtime, &local->aql_total_pending_airtime);
1946 &local->aql_total_pending_airtime);
1949 wiphy_name(local->hw.wiphy), ac, tx_pending,
1951 atomic_cmpxchg(&local->aql_total_pending_airtime,
1997 int err = drv_sta_state(sta->local, sta->sdata, sta,
2111 static void sta_stats_decode_rate(struct ieee80211_local *local, u32 rate,
2137 sband = local->hw.wiphy->bands[band];
2170 sta_stats_decode_rate(sta->local, rate, rinfo);
2192 struct ieee80211_local *local = sta->local;
2217 ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
2223 ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
2228 if (local->ops->wake_tx_queue && tid < IEEE80211_NUM_TIDS) {
2229 spin_lock_bh(&local->fq.lock);
2237 spin_unlock_bh(&local->fq.lock);
2258 struct ieee80211_local *local = sdata->local;
2265 sinfo->generation = sdata->local->sta_generation;
2274 drv_sta_statistics(local, sdata, &sta->sta, sinfo);
2380 if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) ||
2381 ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) {
2516 airtime_link_metric_get(local, sta);
2523 struct ieee80211_local *local = sdata->local;
2528 ref = local->rate_ctrl;
2534 thr = drv_get_expected_throughput(local, sta);
2551 if (!sta->sdata->local->ops->wake_tx_queue)
2554 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {