Lines Matching full:local
65 /* Caller must hold local->sta_mtx */
66 static int sta_info_hash_del(struct ieee80211_local *local, in sta_info_hash_del() argument
71 s = rcu_dereference_protected(local->sta_hash[STA_HASH(sta->sta.addr)], in sta_info_hash_del()
72 lockdep_is_held(&local->sta_mtx)); in sta_info_hash_del()
76 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], in sta_info_hash_del()
84 lockdep_is_held(&local->sta_mtx)); in sta_info_hash_del()
97 struct ieee80211_local *local = sdata->local; in sta_info_get() local
100 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], in sta_info_get()
101 lockdep_is_held(&local->sta_mtx)); in sta_info_get()
107 lockdep_is_held(&local->sta_mtx)); in sta_info_get()
116 struct ieee80211_local *local = sdata->local; in sta_info_get_rx() local
119 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], in sta_info_get_rx()
120 lockdep_is_held(&local->sta_mtx)); in sta_info_get_rx()
126 lockdep_is_held(&local->sta_mtx)); in sta_info_get_rx()
138 struct ieee80211_local *local = sdata->local; in sta_info_get_bss() local
141 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], in sta_info_get_bss()
142 lockdep_is_held(&local->sta_mtx)); in sta_info_get_bss()
150 lockdep_is_held(&local->sta_mtx)); in sta_info_get_bss()
162 struct ieee80211_local *local = sdata->local; in sta_info_get_bss_rx() local
165 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], in sta_info_get_bss_rx()
166 lockdep_is_held(&local->sta_mtx)); in sta_info_get_bss_rx()
173 lockdep_is_held(&local->sta_mtx)); in sta_info_get_bss_rx()
181 struct ieee80211_local *local = sdata->local; in sta_info_get_by_idx() local
185 list_for_each_entry_rcu(sta, &local->sta_list, list) { in sta_info_get_by_idx()
201 * @local: pointer to the global information
209 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) in sta_info_free() argument
217 wiphy_debug(local->hw.wiphy, "Destroyed STA %pM\n", sta->sta.addr); in sta_info_free()
223 /* Caller must hold local->sta_mtx */
224 static void sta_info_hash_add(struct ieee80211_local *local, in sta_info_hash_add() argument
227 lockdep_assert_held(&local->sta_mtx); in sta_info_hash_add()
228 sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; in sta_info_hash_add()
229 rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta); in sta_info_hash_add()
261 static int sta_prepare_rate_control(struct ieee80211_local *local, in sta_prepare_rate_control() argument
264 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) in sta_prepare_rate_control()
267 sta->rate_ctrl = rate_control_get(local->rate_ctrl); in sta_prepare_rate_control()
281 struct ieee80211_local *local = sdata->local; in sta_info_alloc() local
286 sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); in sta_info_alloc()
296 sta->local = local; in sta_info_alloc()
304 if (sta_prepare_rate_control(local, sta, gfp)) { in sta_info_alloc()
326 wiphy_debug(local->hw.wiphy, "Allocated STA %pM\n", sta->sta.addr); in sta_info_alloc()
363 struct ieee80211_local *local = sta->local; in sta_info_insert_finish() local
369 lockdep_assert_held(&local->sta_mtx); in sta_info_insert_finish()
390 err = drv_sta_add(local, sdata, &sta->sta); in sta_info_insert_finish()
402 local->num_sta++; in sta_info_insert_finish()
403 local->sta_generation++; in sta_info_insert_finish()
407 sta_info_hash_add(local, sta); in sta_info_insert_finish()
409 list_add(&sta->list, &local->sta_list); in sta_info_insert_finish()
422 sinfo.generation = local->sta_generation; in sta_info_insert_finish()
427 wiphy_debug(local->hw.wiphy, "Inserted %sSTA %pM\n", in sta_info_insert_finish()
433 mutex_unlock(&local->sta_mtx); in sta_info_insert_finish()
440 mutex_unlock(&local->sta_mtx); in sta_info_insert_finish()
447 struct ieee80211_local *local = sta->local; in sta_info_insert_rcu() local
458 mutex_lock(&local->sta_mtx); in sta_info_insert_rcu()
467 sta_info_free(local, sta); in sta_info_insert_rcu()
480 /* Caller must hold sta->local->sta_mtx */
483 struct ieee80211_local *local = sta->local; in sta_info_reinsert() local
488 mutex_unlock(&local->sta_mtx); in sta_info_reinsert()
537 struct ieee80211_local *local = sta->local; in sta_info_recalc_tim() local
548 if (local->hw.flags & IEEE80211_HW_AP_LINK_PS) in sta_info_recalc_tim()
581 spin_lock_irqsave(&local->tim_lock, flags); in sta_info_recalc_tim()
588 if (local->ops->set_tim) { in sta_info_recalc_tim()
589 local->tim_in_locked_section = true; in sta_info_recalc_tim()
590 drv_set_tim(local, &sta->sta, indicate_tim); in sta_info_recalc_tim()
591 local->tim_in_locked_section = false; in sta_info_recalc_tim()
594 spin_unlock_irqrestore(&local->tim_lock, flags); in sta_info_recalc_tim()
617 static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, in sta_info_cleanup_expire_buffered_ac() argument
673 local->total_ps_buffered--; in sta_info_cleanup_expire_buffered_ac()
697 static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local, in sta_info_cleanup_expire_buffered() argument
709 sta_info_cleanup_expire_buffered_ac(local, sta, ac); in sta_info_cleanup_expire_buffered()
716 struct ieee80211_local *local; in __sta_info_destroy() local
726 local = sta->local; in __sta_info_destroy()
738 ret = sta_info_hash_del(local, sta); in __sta_info_destroy()
744 mutex_lock(&local->key_mtx); in __sta_info_destroy()
746 __ieee80211_key_free(key_mtx_dereference(local, sta->gtk[i])); in __sta_info_destroy()
748 __ieee80211_key_free(key_mtx_dereference(local, sta->ptk)); in __sta_info_destroy()
749 mutex_unlock(&local->key_mtx); in __sta_info_destroy()
764 local->num_sta--; in __sta_info_destroy()
765 local->sta_generation++; in __sta_info_destroy()
778 drv_sta_remove(local, sdata, &sta->sta); in __sta_info_destroy()
791 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); in __sta_info_destroy()
802 wiphy_debug(local->hw.wiphy, "Removed STA %pM\n", sta->sta.addr); in __sta_info_destroy()
836 wiphy_debug(local->hw.wiphy, "TX A-MPDU purging %d " in __sta_info_destroy()
847 sta_info_free(local, sta); in __sta_info_destroy()
857 mutex_lock(&sdata->local->sta_mtx); in sta_info_destroy_addr()
860 mutex_unlock(&sdata->local->sta_mtx); in sta_info_destroy_addr()
871 mutex_lock(&sdata->local->sta_mtx); in sta_info_destroy_addr_bss()
874 mutex_unlock(&sdata->local->sta_mtx); in sta_info_destroy_addr_bss()
881 struct ieee80211_local *local = (struct ieee80211_local *) data; in sta_info_cleanup() local
886 list_for_each_entry_rcu(sta, &local->sta_list, list) in sta_info_cleanup()
887 if (sta_info_cleanup_expire_buffered(local, sta)) in sta_info_cleanup()
891 if (local->quiescing) in sta_info_cleanup()
897 mod_timer(&local->sta_cleanup, in sta_info_cleanup()
901 void sta_info_init(struct ieee80211_local *local) in sta_info_init() argument
903 spin_lock_init(&local->tim_lock); in sta_info_init()
904 mutex_init(&local->sta_mtx); in sta_info_init()
905 INIT_LIST_HEAD(&local->sta_list); in sta_info_init()
907 setup_timer(&local->sta_cleanup, sta_info_cleanup, in sta_info_init()
908 (unsigned long)local); in sta_info_init()
911 void sta_info_stop(struct ieee80211_local *local) in sta_info_stop() argument
913 del_timer(&local->sta_cleanup); in sta_info_stop()
914 sta_info_flush(local, NULL); in sta_info_stop()
922 * @local: local interface data
925 int sta_info_flush(struct ieee80211_local *local, in sta_info_flush() argument
933 mutex_lock(&local->sta_mtx); in sta_info_flush()
934 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in sta_info_flush()
938 mutex_unlock(&local->sta_mtx); in sta_info_flush()
946 struct ieee80211_local *local = sdata->local; in ieee80211_sta_expire() local
949 mutex_lock(&local->sta_mtx); in ieee80211_sta_expire()
951 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in ieee80211_sta_expire()
964 mutex_unlock(&local->sta_mtx); in ieee80211_sta_expire()
1021 struct ieee80211_local *local = sdata->local; in ieee80211_sta_ps_deliver_wakeup() local
1030 if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) in ieee80211_sta_ps_deliver_wakeup()
1031 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); in ieee80211_sta_ps_deliver_wakeup()
1049 ieee80211_add_pending_skbs_fn(local, &pending, clear_sta_ps_flags, sta); in ieee80211_sta_ps_deliver_wakeup()
1051 local->total_ps_buffered -= buffered; in ieee80211_sta_ps_deliver_wakeup()
1066 struct ieee80211_local *local = sdata->local; in ieee80211_send_null_response() local
1085 skb = dev_alloc_skb(local->hw.extra_tx_headroom + size); in ieee80211_send_null_response()
1089 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_send_null_response()
1120 drv_allow_buffered_frames(local, sta, BIT(tid), 1, reason, false); in ieee80211_send_null_response()
1131 struct ieee80211_local *local = sdata->local; in ieee80211_sta_ps_deliver_response() local
1167 local->total_ps_buffered--; in ieee80211_sta_ps_deliver_response()
1276 drv_allow_buffered_frames(local, sta, tids, num, in ieee80211_sta_ps_deliver_response()
1279 ieee80211_add_pending_skbs(local, &pending); in ieee80211_sta_ps_deliver_response()
1293 drv_release_buffered_frames(local, sta, driver_release_tids, in ieee80211_sta_ps_deliver_response()
1362 trace_api_sta_block_awake(sta->local, pubsta, block); in ieee80211_sta_block_awake()
1374 struct ieee80211_local *local = sta->local; in ieee80211_sta_eosp_irqsafe() local
1378 trace_api_eosp(local, pubsta); in ieee80211_sta_eosp_irqsafe()
1391 skb_queue_tail(&local->skb_queue, skb); in ieee80211_sta_eosp_irqsafe()
1392 tasklet_schedule(&local->tasklet); in ieee80211_sta_eosp_irqsafe()