Lines Matching defs:local
91 /* Caller must hold local->sta_mtx */
92 static int sta_info_hash_del(struct ieee80211_local *local,
95 return rhltable_remove(&local->sta_hash, &sta->hash_node,
99 static int link_sta_info_hash_add(struct ieee80211_local *local,
102 lockdep_assert_held(&local->sta_mtx);
103 return rhltable_insert(&local->link_sta_hash,
108 static int link_sta_info_hash_del(struct ieee80211_local *local,
111 lockdep_assert_held(&local->sta_mtx);
112 return rhltable_remove(&local->link_sta_hash,
122 struct ieee80211_local *local = sdata->local;
151 ieee80211_txq_purge(local, txqi);
155 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]);
156 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]);
157 ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]);
176 ieee80211_purge_tx_queue(&local->hw, &tid_tx->pending);
184 struct ieee80211_local *local = sdata->local;
187 sta_info_free(local, sta);
190 struct rhlist_head *sta_info_hash_lookup(struct ieee80211_local *local,
193 return rhltable_lookup(&local->sta_hash, addr, sta_rht_params);
200 struct ieee80211_local *local = sdata->local;
205 for_each_sta_info(local, addr, sta, tmp) {
225 struct ieee80211_local *local = sdata->local;
230 for_each_sta_info(local, addr, sta, tmp) {
244 struct rhlist_head *link_sta_info_hash_lookup(struct ieee80211_local *local,
247 return rhltable_lookup(&local->link_sta_hash, addr,
254 struct ieee80211_local *local = sdata->local;
259 for_each_link_sta_info(local, addr, link_sta, tmp) {
281 struct ieee80211_local *local = hw_to_local(hw);
285 for_each_link_sta_info(local, addr, link_sta, tmp) {
312 struct sta_info *sta_info_get_by_addrs(struct ieee80211_local *local,
318 for_each_sta_info(local, sta_addr, sta, tmp) {
329 struct ieee80211_local *local = sdata->local;
333 list_for_each_entry_rcu(sta, &local->sta_list, list,
334 lockdep_is_held(&local->sta_mtx)) {
360 lockdep_assert_held(&sta->local->sta_mtx);
366 link_sta_info_hash_del(sta->local, link_sta);
388 * @local: pointer to the global information
396 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
443 /* Caller must hold local->sta_mtx */
444 static int sta_info_hash_add(struct ieee80211_local *local,
447 return rhltable_insert(&local->sta_hash, &sta->hash_node,
470 static int sta_prepare_rate_control(struct ieee80211_local *local,
473 if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL))
476 sta->rate_ctrl = local->rate_ctrl;
485 static int sta_info_alloc_link(struct ieee80211_local *local,
489 struct ieee80211_hw *hw = &local->hw;
532 struct ieee80211_local *local = sdata->local;
533 struct ieee80211_hw *hw = &local->hw;
543 sta->local = local;
546 if (sta_info_alloc_link(local, &sta->deflink, gfp))
583 local->hw.max_rx_aggregation_subframes;
623 if (sta_prepare_rate_control(local, sta, gfp))
633 sta->airtime[i].aql_limit_low = local->aql_txq_limit_low[i];
634 sta->airtime[i].aql_limit_high = local->aql_txq_limit_high[i];
740 lockdep_assert_held(&sdata->local->sta_mtx);
741 if (ieee80211_hw_check(&sdata->local->hw, NEEDS_UNIQUE_STA_ADDR) &&
742 ieee80211_find_sta_by_ifaddr(&sdata->local->hw, sta->addr, NULL)) {
751 static int sta_info_insert_drv_state(struct ieee80211_local *local,
759 err = drv_sta_state(local, sdata, sta, state, state + 1);
769 if (!local->ops->sta_add)
783 WARN_ON(drv_sta_state(local, sdata, sta, state, state - 1));
791 struct ieee80211_local *local = sdata->local;
796 list_for_each_entry_rcu(sta, &local->sta_list, list) {
821 struct ieee80211_local *local = sta->local;
826 lockdep_assert_held(&local->sta_mtx);
840 local->num_sta++;
841 local->sta_generation++;
848 err = sta_info_hash_add(local, sta);
853 err = link_sta_info_hash_add(local, &sta->deflink);
855 sta_info_hash_del(local, sta);
860 list_add_tail_rcu(&sta->list, &local->sta_list);
872 err = sta_info_insert_drv_state(local, sdata, sta);
890 lockdep_is_held(&local->sta_mtx));
904 sinfo->generation = local->sta_generation;
912 mutex_unlock(&local->sta_mtx);
922 link_sta_info_hash_del(local, &sta->deflink);
923 sta_info_hash_del(local, sta);
926 local->num_sta--;
930 mutex_unlock(&local->sta_mtx);
938 struct ieee80211_local *local = sta->local;
943 mutex_lock(&local->sta_mtx);
947 sta_info_free(local, sta);
948 mutex_unlock(&local->sta_mtx);
1012 struct ieee80211_local *local = sta->local;
1034 if (ieee80211_hw_check(&local->hw, AP_LINK_PS) && !local->ops->set_tim)
1072 spin_lock_bh(&local->tim_lock);
1082 if (local->ops->set_tim && !WARN_ON(sta->dead)) {
1083 local->tim_in_locked_section = true;
1084 drv_set_tim(local, &sta->sta, indicate_tim);
1085 local->tim_in_locked_section = false;
1089 spin_unlock_bh(&local->tim_lock);
1117 static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local,
1147 ieee80211_free_txskb(&local->hw, skb);
1173 local->total_ps_buffered--;
1176 ieee80211_free_txskb(&local->hw, skb);
1195 static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
1208 sta_info_cleanup_expire_buffered_ac(local, sta, ac);
1215 struct ieee80211_local *local;
1224 local = sta->local;
1227 lockdep_assert_held(&local->sta_mtx);
1243 drv_sync_rx_queues(local, sta);
1252 lockdep_is_held(&local->sta_mtx));
1254 link_sta_info_hash_del(local, link_sta);
1257 ret = sta_info_hash_del(local, sta);
1266 drv_tdls_cancel_channel_switch(local, sdata, &sta->sta);
1274 drv_sta_pre_rcu_remove(local, sta->sdata, sta);
1325 int err = drv_sta_state(sta->local, sta->sdata, sta,
1395 struct ieee80211_local *local = sta->local;
1406 lockdep_assert_held(&local->sta_mtx);
1418 if (local->ops->set_key) {
1419 if (local->ops->flush_sta)
1420 drv_flush_sta(local, sta->sdata, sta);
1422 ieee80211_flush_queues(local, sta->sdata, false);
1426 ieee80211_free_sta_keys(local, sta);
1433 local->num_sta--;
1434 local->sta_generation++;
1445 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE,
1484 mutex_lock(&sdata->local->sta_mtx);
1487 mutex_unlock(&sdata->local->sta_mtx);
1498 mutex_lock(&sdata->local->sta_mtx);
1501 mutex_unlock(&sdata->local->sta_mtx);
1508 struct ieee80211_local *local = from_timer(local, t, sta_cleanup);
1513 list_for_each_entry_rcu(sta, &local->sta_list, list)
1514 if (sta_info_cleanup_expire_buffered(local, sta))
1518 if (local->quiescing)
1524 mod_timer(&local->sta_cleanup,
1528 int sta_info_init(struct ieee80211_local *local)
1532 err = rhltable_init(&local->sta_hash, &sta_rht_params);
1536 err = rhltable_init(&local->link_sta_hash, &link_sta_rht_params);
1538 rhltable_destroy(&local->sta_hash);
1542 spin_lock_init(&local->tim_lock);
1543 mutex_init(&local->sta_mtx);
1544 INIT_LIST_HEAD(&local->sta_list);
1546 timer_setup(&local->sta_cleanup, sta_info_cleanup, 0);
1550 void sta_info_stop(struct ieee80211_local *local)
1552 del_timer_sync(&local->sta_cleanup);
1553 rhltable_destroy(&local->sta_hash);
1554 rhltable_destroy(&local->link_sta_hash);
1560 struct ieee80211_local *local = sdata->local;
1570 mutex_lock(&local->sta_mtx);
1571 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
1594 mutex_unlock(&local->sta_mtx);
1602 struct ieee80211_local *local = sdata->local;
1605 mutex_lock(&local->sta_mtx);
1607 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
1625 mutex_unlock(&local->sta_mtx);
1632 struct ieee80211_local *local = hw_to_local(hw);
1640 for_each_sta_info(local, addr, sta, tmp) {
1676 struct ieee80211_local *local = sdata->local;
1699 if (!ieee80211_hw_check(&local->hw, AP_LINK_PS))
1700 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta);
1706 schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i]));
1731 ieee80211_add_pending_skbs(local, &pending);
1745 local->total_ps_buffered -= buffered;
1761 struct ieee80211_local *local = sdata->local;
1781 skb = dev_alloc_skb(local->hw.extra_tx_headroom + size);
1785 skb_reserve(skb, local->hw.extra_tx_headroom);
1824 drv_allow_buffered_frames(local, sta, BIT(tid), 1,
1893 struct ieee80211_local *local = sdata->local;
1923 local->total_ps_buffered--;
1948 struct ieee80211_local *local = sdata->local;
2084 drv_allow_buffered_frames(local, sta, tids, num,
2087 ieee80211_add_pending_skbs(local, &pending);
2108 drv_release_buffered_frames(local, sta, driver_release_tids,
2188 trace_api_sta_block_awake(sta->local, pubsta, block);
2218 struct ieee80211_local *local = sta->local;
2220 trace_api_eosp(local, pubsta);
2232 trace_api_send_eosp_nullfunc(sta->local, pubsta, tid);
2250 trace_api_sta_set_buffered(sta->local, pubsta, tid, buffered);
2265 struct ieee80211_local *local = sta->sdata->local;
2270 if (sta->local->airtime_flags & AIRTIME_USE_TX)
2272 if (sta->local->airtime_flags & AIRTIME_USE_RX)
2275 spin_lock_bh(&local->active_txq_lock[ac]);
2283 spin_unlock_bh(&local->active_txq_lock[ac]);
2340 void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local,
2346 if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL))
2354 atomic_add(tx_airtime, &local->aql_total_pending_airtime);
2355 atomic_add(tx_airtime, &local->aql_ac_pending_airtime[ac]);
2367 atomic_sub(tx_airtime, &local->aql_total_pending_airtime);
2369 &local->aql_ac_pending_airtime[ac]);
2372 wiphy_name(local->hw.wiphy), ac, tx_pending,
2374 atomic_cmpxchg(&local->aql_ac_pending_airtime[ac],
2376 atomic_sub(tx_pending, &local->aql_total_pending_airtime);
2401 static void sta_stats_decode_rate(struct ieee80211_local *local, u32 rate,
2427 sband = local->hw.wiphy->bands[band];
2467 sta_stats_decode_rate(sta->local, rate, rinfo);
2489 struct ieee80211_local *local = sta->local;
2516 ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
2522 ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
2528 spin_lock_bh(&local->fq.lock);
2536 spin_unlock_bh(&local->fq.lock);
2557 struct ieee80211_local *local = sdata->local;
2564 sinfo->generation = sdata->local->sta_generation;
2573 drv_sta_statistics(local, sdata, &sta->sta, sinfo);
2682 if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) ||
2683 ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) {
2820 airtime_link_metric_get(local, sta);
2827 struct ieee80211_local *local = sdata->local;
2832 ref = local->rate_ctrl;
2838 thr = drv_get_expected_throughput(local, sta);
2855 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {
2880 lockdep_assert_held(&sdata->local->sta_mtx);
2894 ret = sta_info_alloc_link(sdata->local, &alloc->info, GFP_KERNEL);
2909 lockdep_assert_held(&sta->sdata->local->sta_mtx);
2923 lockdep_is_held(&sdata->local->sta_mtx));
2929 if (link_sta_info_hash_lookup(sdata->local, link_sta->addr)) {
2948 ret = drv_change_sta_links(sdata->local, sdata, &sta->sta,
2957 ret = link_sta_info_hash_add(sdata->local, link_sta);
2967 lockdep_assert_held(&sdata->local->sta_mtx);
2972 drv_change_sta_links(sdata->local, sdata, &sta->sta,
3006 return lockdep_is_held(&sta->local->sta_mtx);