• Home
  • Raw
  • Download

Lines Matching refs:sta

59 				 struct sta_info *sta)  in rssi_threshold_check()  argument
63 (sta && in rssi_threshold_check()
64 (s8)-ewma_signal_read(&sta->rx_stats_avg.signal) > in rssi_threshold_check()
75 static inline void mesh_plink_fsm_restart(struct sta_info *sta) in mesh_plink_fsm_restart() argument
77 lockdep_assert_held(&sta->mesh->plink_lock); in mesh_plink_fsm_restart()
78 sta->mesh->plink_state = NL80211_PLINK_LISTEN; in mesh_plink_fsm_restart()
79 sta->mesh->llid = sta->mesh->plid = sta->mesh->reason = 0; in mesh_plink_fsm_restart()
80 sta->mesh->plink_retries = 0; in mesh_plink_fsm_restart()
97 struct sta_info *sta; in mesh_set_short_slot_time() local
122 list_for_each_entry_rcu(sta, &local->sta_list, list) { in mesh_set_short_slot_time()
123 if (sdata != sta->sdata || in mesh_set_short_slot_time()
124 sta->mesh->plink_state != NL80211_PLINK_ESTAB) in mesh_set_short_slot_time()
128 if (erp_rates & sta->sta.supp_rates[sband->band]) in mesh_set_short_slot_time()
158 struct sta_info *sta; in mesh_set_ht_prot_mode() local
172 list_for_each_entry_rcu(sta, &local->sta_list, list) { in mesh_set_ht_prot_mode()
173 if (sdata != sta->sdata || in mesh_set_ht_prot_mode()
174 sta->mesh->plink_state != NL80211_PLINK_ESTAB) in mesh_set_ht_prot_mode()
177 if (sta->sta.bandwidth > IEEE80211_STA_RX_BW_20) in mesh_set_ht_prot_mode()
180 if (!sta->sta.ht_cap.ht_supported) { in mesh_set_ht_prot_mode()
182 sta->sta.addr); in mesh_set_ht_prot_mode()
187 mpl_dbg(sdata, "HT20 sta (%pM) is present\n", sta->sta.addr); in mesh_set_ht_prot_mode()
210 struct sta_info *sta, in mesh_plink_frame_tx() argument
270 put_unaligned_le16(sta->sta.aid, pos); in mesh_plink_frame_tx()
353 static u32 __mesh_plink_deactivate(struct sta_info *sta) in __mesh_plink_deactivate() argument
355 struct ieee80211_sub_if_data *sdata = sta->sdata; in __mesh_plink_deactivate()
358 lockdep_assert_held(&sta->mesh->plink_lock); in __mesh_plink_deactivate()
360 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in __mesh_plink_deactivate()
362 sta->mesh->plink_state = NL80211_PLINK_BLOCKED; in __mesh_plink_deactivate()
364 ieee80211_mps_sta_status_update(sta); in __mesh_plink_deactivate()
365 changed |= ieee80211_mps_set_sta_local_pm(sta, in __mesh_plink_deactivate()
378 u32 mesh_plink_deactivate(struct sta_info *sta) in mesh_plink_deactivate() argument
380 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_deactivate()
383 spin_lock_bh(&sta->mesh->plink_lock); in mesh_plink_deactivate()
384 changed = __mesh_plink_deactivate(sta); in mesh_plink_deactivate()
387 sta->mesh->reason = WLAN_REASON_MESH_PEER_CANCELED; in mesh_plink_deactivate()
388 mesh_plink_frame_tx(sdata, sta, WLAN_SP_MESH_PEERING_CLOSE, in mesh_plink_deactivate()
389 sta->sta.addr, sta->mesh->llid, in mesh_plink_deactivate()
390 sta->mesh->plid, sta->mesh->reason); in mesh_plink_deactivate()
392 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_deactivate()
394 del_timer_sync(&sta->mesh->plink_timer); in mesh_plink_deactivate()
395 mesh_path_flush_by_nexthop(sta); in mesh_plink_deactivate()
404 struct sta_info *sta, in mesh_sta_info_init() argument
410 enum ieee80211_sta_rx_bandwidth bw = sta->sta.bandwidth; in mesh_sta_info_init()
419 spin_lock_bh(&sta->mesh->plink_lock); in mesh_sta_info_init()
420 sta->rx_stats.last_rx = jiffies; in mesh_sta_info_init()
423 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB && in mesh_sta_info_init()
424 sta->mesh->processed_beacon) in mesh_sta_info_init()
426 sta->mesh->processed_beacon = true; in mesh_sta_info_init()
428 if (sta->sta.supp_rates[sband->band] != rates) in mesh_sta_info_init()
430 sta->sta.supp_rates[sband->band] = rates; in mesh_sta_info_init()
433 elems->ht_cap_elem, sta)) in mesh_sta_info_init()
437 elems->vht_cap_elem, sta); in mesh_sta_info_init()
439 if (bw != sta->sta.bandwidth) in mesh_sta_info_init()
446 if (sta->sta.bandwidth != IEEE80211_STA_RX_BW_20) in mesh_sta_info_init()
448 sta->sta.bandwidth = IEEE80211_STA_RX_BW_20; in mesh_sta_info_init()
452 rate_control_rate_init(sta); in mesh_sta_info_init()
454 rate_control_rate_update(local, sband, sta, changed); in mesh_sta_info_init()
456 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_sta_info_init()
461 struct sta_info *sta; in mesh_allocate_aid() local
474 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) in mesh_allocate_aid()
475 __set_bit(sta->sta.aid, aid_map); in mesh_allocate_aid()
490 struct sta_info *sta; in __mesh_sta_info_alloc() local
500 sta = sta_info_alloc(sdata, hw_addr, GFP_KERNEL); in __mesh_sta_info_alloc()
501 if (!sta) in __mesh_sta_info_alloc()
504 sta->mesh->plink_state = NL80211_PLINK_LISTEN; in __mesh_sta_info_alloc()
505 sta->sta.wme = true; in __mesh_sta_info_alloc()
506 sta->sta.aid = aid; in __mesh_sta_info_alloc()
508 sta_info_pre_move_state(sta, IEEE80211_STA_AUTH); in __mesh_sta_info_alloc()
509 sta_info_pre_move_state(sta, IEEE80211_STA_ASSOC); in __mesh_sta_info_alloc()
510 sta_info_pre_move_state(sta, IEEE80211_STA_AUTHORIZED); in __mesh_sta_info_alloc()
512 return sta; in __mesh_sta_info_alloc()
519 struct sta_info *sta = NULL; in mesh_sta_info_alloc() local
531 sta = __mesh_sta_info_alloc(sdata, addr); in mesh_sta_info_alloc()
533 return sta; in mesh_sta_info_alloc()
550 struct sta_info *sta = NULL; in mesh_sta_info_get() local
553 sta = sta_info_get(sdata, addr); in mesh_sta_info_get()
554 if (sta) { in mesh_sta_info_get()
555 mesh_sta_info_init(sdata, sta, elems, false); in mesh_sta_info_get()
559 sta = mesh_sta_info_alloc(sdata, addr, elems); in mesh_sta_info_get()
560 if (!sta) { in mesh_sta_info_get()
565 mesh_sta_info_init(sdata, sta, elems, true); in mesh_sta_info_get()
567 if (sta_info_insert_rcu(sta)) in mesh_sta_info_get()
571 return sta; in mesh_sta_info_get()
587 struct sta_info *sta; in mesh_neighbour_update() local
590 sta = mesh_sta_info_get(sdata, hw_addr, elems); in mesh_neighbour_update()
591 if (!sta) in mesh_neighbour_update()
595 sta->mesh->plink_state == NL80211_PLINK_LISTEN && in mesh_neighbour_update()
598 rssi_threshold_check(sdata, sta)) in mesh_neighbour_update()
599 changed = mesh_plink_open(sta); in mesh_neighbour_update()
601 ieee80211_mps_frame_release(sta, elems); in mesh_neighbour_update()
609 struct sta_info *sta; in mesh_plink_timer() local
620 sta = (struct sta_info *) data; in mesh_plink_timer()
622 if (sta->sdata->local->quiescing) in mesh_plink_timer()
625 spin_lock_bh(&sta->mesh->plink_lock); in mesh_plink_timer()
632 if (time_before(jiffies, sta->mesh->plink_timer.expires)) { in mesh_plink_timer()
633 mpl_dbg(sta->sdata, in mesh_plink_timer()
635 sta->sta.addr, mplstates[sta->mesh->plink_state]); in mesh_plink_timer()
636 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_timer()
641 if (sta->mesh->plink_state == NL80211_PLINK_LISTEN || in mesh_plink_timer()
642 sta->mesh->plink_state == NL80211_PLINK_ESTAB) { in mesh_plink_timer()
643 mpl_dbg(sta->sdata, in mesh_plink_timer()
645 sta->sta.addr, mplstates[sta->mesh->plink_state]); in mesh_plink_timer()
646 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_timer()
650 mpl_dbg(sta->sdata, in mesh_plink_timer()
652 sta->sta.addr, mplstates[sta->mesh->plink_state]); in mesh_plink_timer()
653 sdata = sta->sdata; in mesh_plink_timer()
656 switch (sta->mesh->plink_state) { in mesh_plink_timer()
660 if (sta->mesh->plink_retries < mshcfg->dot11MeshMaxRetries) { in mesh_plink_timer()
662 mpl_dbg(sta->sdata, in mesh_plink_timer()
664 sta->sta.addr, sta->mesh->plink_retries, in mesh_plink_timer()
665 sta->mesh->plink_timeout); in mesh_plink_timer()
667 sta->mesh->plink_timeout = sta->mesh->plink_timeout + in mesh_plink_timer()
668 rand % sta->mesh->plink_timeout; in mesh_plink_timer()
669 ++sta->mesh->plink_retries; in mesh_plink_timer()
670 mod_plink_timer(sta, sta->mesh->plink_timeout); in mesh_plink_timer()
680 sta->mesh->plink_state = NL80211_PLINK_HOLDING; in mesh_plink_timer()
681 mod_plink_timer(sta, mshcfg->dot11MeshHoldingTimeout); in mesh_plink_timer()
686 del_timer(&sta->mesh->plink_timer); in mesh_plink_timer()
687 mesh_plink_fsm_restart(sta); in mesh_plink_timer()
692 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_timer()
694 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, in mesh_plink_timer()
695 sta->mesh->llid, sta->mesh->plid, reason); in mesh_plink_timer()
698 static inline void mesh_plink_timer_set(struct sta_info *sta, u32 timeout) in mesh_plink_timer_set() argument
700 sta->mesh->plink_timer.expires = jiffies + msecs_to_jiffies(timeout); in mesh_plink_timer_set()
701 sta->mesh->plink_timer.data = (unsigned long) sta; in mesh_plink_timer_set()
702 sta->mesh->plink_timer.function = mesh_plink_timer; in mesh_plink_timer_set()
703 sta->mesh->plink_timeout = timeout; in mesh_plink_timer_set()
704 add_timer(&sta->mesh->plink_timer); in mesh_plink_timer_set()
712 struct sta_info *sta; in llid_in_use() local
715 list_for_each_entry_rcu(sta, &local->sta_list, list) { in llid_in_use()
716 if (sdata != sta->sdata) in llid_in_use()
719 if (!memcmp(&sta->mesh->llid, &llid, sizeof(llid))) { in llid_in_use()
740 u32 mesh_plink_open(struct sta_info *sta) in mesh_plink_open() argument
742 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_plink_open()
745 if (!test_sta_flag(sta, WLAN_STA_AUTH)) in mesh_plink_open()
748 spin_lock_bh(&sta->mesh->plink_lock); in mesh_plink_open()
749 sta->mesh->llid = mesh_get_new_llid(sdata); in mesh_plink_open()
750 if (sta->mesh->plink_state != NL80211_PLINK_LISTEN && in mesh_plink_open()
751 sta->mesh->plink_state != NL80211_PLINK_BLOCKED) { in mesh_plink_open()
752 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_open()
755 sta->mesh->plink_state = NL80211_PLINK_OPN_SNT; in mesh_plink_open()
756 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout); in mesh_plink_open()
757 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_open()
760 sta->sta.addr); in mesh_plink_open()
765 mesh_plink_frame_tx(sdata, sta, WLAN_SP_MESH_PEERING_OPEN, in mesh_plink_open()
766 sta->sta.addr, sta->mesh->llid, 0, 0); in mesh_plink_open()
770 u32 mesh_plink_block(struct sta_info *sta) in mesh_plink_block() argument
774 spin_lock_bh(&sta->mesh->plink_lock); in mesh_plink_block()
775 changed = __mesh_plink_deactivate(sta); in mesh_plink_block()
776 sta->mesh->plink_state = NL80211_PLINK_BLOCKED; in mesh_plink_block()
777 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_block()
778 mesh_path_flush_by_nexthop(sta); in mesh_plink_block()
784 struct sta_info *sta, in mesh_plink_close() argument
791 sta->mesh->reason = reason; in mesh_plink_close()
792 sta->mesh->plink_state = NL80211_PLINK_HOLDING; in mesh_plink_close()
793 mod_plink_timer(sta, mshcfg->dot11MeshHoldingTimeout); in mesh_plink_close()
797 struct sta_info *sta) in mesh_plink_establish() argument
802 del_timer(&sta->mesh->plink_timer); in mesh_plink_establish()
803 sta->mesh->plink_state = NL80211_PLINK_ESTAB; in mesh_plink_establish()
807 mpl_dbg(sdata, "Mesh plink with %pM ESTABLISHED\n", sta->sta.addr); in mesh_plink_establish()
808 ieee80211_mps_sta_status_update(sta); in mesh_plink_establish()
809 changed |= ieee80211_mps_set_sta_local_pm(sta, mshcfg->power_mode); in mesh_plink_establish()
823 struct sta_info *sta, enum plink_event event) in mesh_plink_fsm() argument
830 mpl_dbg(sdata, "peer %pM in state %s got event %s\n", sta->sta.addr, in mesh_plink_fsm()
831 mplstates[sta->mesh->plink_state], mplevents[event]); in mesh_plink_fsm()
833 spin_lock_bh(&sta->mesh->plink_lock); in mesh_plink_fsm()
834 switch (sta->mesh->plink_state) { in mesh_plink_fsm()
838 mesh_plink_fsm_restart(sta); in mesh_plink_fsm()
841 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD; in mesh_plink_fsm()
842 sta->mesh->llid = mesh_get_new_llid(sdata); in mesh_plink_fsm()
843 mesh_plink_timer_set(sta, in mesh_plink_fsm()
859 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
864 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD; in mesh_plink_fsm()
868 sta->mesh->plink_state = NL80211_PLINK_CNF_RCVD; in mesh_plink_fsm()
869 mod_plink_timer(sta, mshcfg->dot11MeshConfirmTimeout); in mesh_plink_fsm()
880 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
887 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
898 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
902 changed |= mesh_plink_establish(sdata, sta); in mesh_plink_fsm()
912 changed |= __mesh_plink_deactivate(sta); in mesh_plink_fsm()
915 mesh_plink_close(sdata, sta, event); in mesh_plink_fsm()
929 del_timer(&sta->mesh->plink_timer); in mesh_plink_fsm()
930 mesh_plink_fsm_restart(sta); in mesh_plink_fsm()
948 spin_unlock_bh(&sta->mesh->plink_lock); in mesh_plink_fsm()
950 mesh_path_flush_by_nexthop(sta); in mesh_plink_fsm()
952 mesh_plink_frame_tx(sdata, sta, action, sta->sta.addr, in mesh_plink_fsm()
953 sta->mesh->llid, sta->mesh->plid, in mesh_plink_fsm()
954 sta->mesh->reason); in mesh_plink_fsm()
958 mesh_plink_frame_tx(sdata, sta, in mesh_plink_fsm()
960 sta->sta.addr, sta->mesh->llid, in mesh_plink_fsm()
961 sta->mesh->plid, 0); in mesh_plink_fsm()
983 struct sta_info *sta, in mesh_plink_get_event() argument
996 if (!matches_local && !sta) { in mesh_plink_get_event()
1001 if (!sta) { in mesh_plink_get_event()
1016 if (!test_sta_flag(sta, WLAN_STA_AUTH)) { in mesh_plink_get_event()
1020 if (sta->mesh->plink_state == NL80211_PLINK_BLOCKED) in mesh_plink_get_event()
1029 (sta->mesh->plid && sta->mesh->plid != plid)) in mesh_plink_get_event()
1038 sta->mesh->llid != llid || in mesh_plink_get_event()
1039 (sta->mesh->plid && sta->mesh->plid != plid)) in mesh_plink_get_event()
1045 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) in mesh_plink_get_event()
1056 else if (sta->mesh->plid != plid) in mesh_plink_get_event()
1058 else if (ie_len == 8 && sta->mesh->llid != llid) in mesh_plink_get_event()
1078 struct sta_info *sta; in mesh_process_plink_frame() local
1125 sta = sta_info_get(sdata, mgmt->sa); in mesh_process_plink_frame()
1128 !rssi_threshold_check(sdata, sta)) { in mesh_process_plink_frame()
1135 event = mesh_plink_get_event(sdata, sta, elems, ftype, llid, plid); in mesh_process_plink_frame()
1140 sta = mesh_sta_info_get(sdata, mgmt->sa, elems); in mesh_process_plink_frame()
1141 if (!sta) { in mesh_process_plink_frame()
1145 sta->mesh->plid = plid; in mesh_process_plink_frame()
1146 } else if (!sta && event == OPN_RJCT) { in mesh_process_plink_frame()
1151 } else if (!sta || event == PLINK_UNDEFINED) { in mesh_process_plink_frame()
1158 if (!sta->mesh->plid) in mesh_process_plink_frame()
1159 sta->mesh->plid = plid; in mesh_process_plink_frame()
1161 sta->mesh->aid = get_unaligned_le16(PLINK_CNF_AID(mgmt)); in mesh_process_plink_frame()
1164 changed |= mesh_plink_fsm(sdata, sta, event); in mesh_process_plink_frame()