Lines Matching refs:mesh
14 #include "mesh.h"
20 #define mod_plink_timer(s, t) (mod_timer(&s->mesh->plink_timer, \
61 s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold;
69 * mesh_plink_fsm_restart - restart a mesh peer link finite state machine
71 * @sta: mesh peer link to restart
73 * Locking: this function must be called holding sta->mesh->plink_lock
77 lockdep_assert_held(&sta->mesh->plink_lock);
78 sta->mesh->plink_state = NL80211_PLINK_LISTEN;
79 sta->mesh->llid = sta->mesh->plid = sta->mesh->reason = 0;
80 sta->mesh->plink_retries = 0;
86 * The standard indirectly mandates mesh STAs to turn off short slot time by
88 * can't be sneaky about it. Enable short slot time if all mesh STAs in the
125 sta->mesh->plink_state != NL80211_PLINK_ESTAB)
148 * @sdata: the (mesh) interface to handle
151 * mesh STA in a MBSS. Three HT protection modes are supported for now, non-HT
176 sta->mesh->plink_state != NL80211_PLINK_ESTAB)
206 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode;
237 2 + sdata->u.mesh.mesh_id_len +
251 sdata->u.mesh.ie_len);
358 * __mesh_plink_deactivate - deactivate mesh peer link
360 * @sta: mesh peer link to deactivate
367 * Locking: the caller must hold sta->mesh->plink_lock
374 lockdep_assert_held(&sta->mesh->plink_lock);
376 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
378 sta->mesh->plink_state = NL80211_PLINK_BLOCKED;
388 * mesh_plink_deactivate - deactivate mesh peer link
390 * @sta: mesh peer link to deactivate
392 * All mesh paths with this peer as next hop will be flushed
399 spin_lock_bh(&sta->mesh->plink_lock);
402 if (!sdata->u.mesh.user_mpm) {
403 sta->mesh->reason = WLAN_REASON_MESH_PEER_CANCELED;
405 sta->sta.addr, sta->mesh->llid,
406 sta->mesh->plid, sta->mesh->reason);
408 spin_unlock_bh(&sta->mesh->plink_lock);
409 if (!sdata->u.mesh.user_mpm)
410 del_timer_sync(&sta->mesh->plink_timer);
435 spin_lock_bh(&sta->mesh->plink_lock);
439 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB &&
440 sta->mesh->processed_beacon)
442 sta->mesh->processed_beacon = true;
484 spin_unlock_bh(&sta->mesh->plink_lock);
531 sta->mesh->plink_state = NL80211_PLINK_LISTEN;
550 if (sdata->u.mesh.user_mpm ||
551 sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
571 * mesh_sta_info_get - return mesh sta info entry for @addr.
575 * @elems: IEs from beacon or mesh peering frame.
611 * mesh_neighbour_update - update or initialize new mesh neighbor.
615 * @elems: IEs from beacon or mesh peering frame
632 sta->mesh->connected_to_gate = elems->mesh_config->meshconf_form &
636 sta->mesh->plink_state == NL80211_PLINK_LISTEN &&
637 sdata->u.mesh.accepting_plinks &&
638 sdata->u.mesh.mshcfg.auto_open_plinks &&
650 struct mesh_sta *mesh = from_timer(mesh, t, plink_timer);
662 sta = mesh->plink_sta;
667 spin_lock_bh(&sta->mesh->plink_lock);
674 if (time_before(jiffies, sta->mesh->plink_timer.expires)) {
677 sta->sta.addr, mplstates[sta->mesh->plink_state]);
678 spin_unlock_bh(&sta->mesh->plink_lock);
683 if (sta->mesh->plink_state == NL80211_PLINK_LISTEN ||
684 sta->mesh->plink_state == NL80211_PLINK_ESTAB) {
687 sta->sta.addr, mplstates[sta->mesh->plink_state]);
688 spin_unlock_bh(&sta->mesh->plink_lock);
694 sta->sta.addr, mplstates[sta->mesh->plink_state]);
696 mshcfg = &sdata->u.mesh.mshcfg;
698 switch (sta->mesh->plink_state) {
702 if (sta->mesh->plink_retries < mshcfg->dot11MeshMaxRetries) {
706 sta->sta.addr, sta->mesh->plink_retries,
707 sta->mesh->plink_timeout);
709 sta->mesh->plink_timeout = sta->mesh->plink_timeout +
710 rand % sta->mesh->plink_timeout;
711 ++sta->mesh->plink_retries;
712 mod_plink_timer(sta, sta->mesh->plink_timeout);
722 sta->mesh->plink_state = NL80211_PLINK_HOLDING;
728 del_timer(&sta->mesh->plink_timer);
734 spin_unlock_bh(&sta->mesh->plink_lock);
737 sta->mesh->llid, sta->mesh->plid, reason);
742 sta->mesh->plink_timeout = timeout;
743 mod_timer(&sta->mesh->plink_timer, jiffies + msecs_to_jiffies(timeout));
758 if (!memcmp(&sta->mesh->llid, &llid, sizeof(llid))) {
787 spin_lock_bh(&sta->mesh->plink_lock);
788 sta->mesh->llid = mesh_get_new_llid(sdata);
789 if (sta->mesh->plink_state != NL80211_PLINK_LISTEN &&
790 sta->mesh->plink_state != NL80211_PLINK_BLOCKED) {
791 spin_unlock_bh(&sta->mesh->plink_lock);
794 sta->mesh->plink_state = NL80211_PLINK_OPN_SNT;
795 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout);
796 spin_unlock_bh(&sta->mesh->plink_lock);
805 sta->sta.addr, sta->mesh->llid, 0, 0);
813 spin_lock_bh(&sta->mesh->plink_lock);
815 sta->mesh->plink_state = NL80211_PLINK_BLOCKED;
816 spin_unlock_bh(&sta->mesh->plink_lock);
826 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
830 sta->mesh->reason = reason;
831 sta->mesh->plink_state = NL80211_PLINK_HOLDING;
838 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
841 del_timer(&sta->mesh->plink_timer);
842 sta->mesh->plink_state = NL80211_PLINK_ESTAB;
856 * @sta: mesh neighbor
864 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
870 mplstates[sta->mesh->plink_state], mplevents[event]);
872 spin_lock_bh(&sta->mesh->plink_lock);
873 switch (sta->mesh->plink_state) {
880 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD;
881 sta->mesh->llid = mesh_get_new_llid(sdata);
903 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD;
907 sta->mesh->plink_state = NL80211_PLINK_CNF_RCVD;
968 del_timer(&sta->mesh->plink_timer);
987 spin_unlock_bh(&sta->mesh->plink_lock);
992 sta->mesh->llid, sta->mesh->plid,
993 sta->mesh->reason);
999 sta->sta.addr, sta->mesh->llid,
1000 sta->mesh->plid, 0);
1059 if (sta->mesh->plink_state == NL80211_PLINK_BLOCKED)
1068 (sta->mesh->plid && sta->mesh->plid != plid))
1077 sta->mesh->llid != llid ||
1078 (sta->mesh->plid && sta->mesh->plid != plid))
1084 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
1095 else if (sta->mesh->plid != plid)
1097 else if (ie_len == 8 && sta->mesh->llid != llid)
1132 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) {
1185 sta->mesh->plid = plid;
1198 if (!sta->mesh->plid)
1199 sta->mesh->plid = plid;
1201 sta->mesh->aid = get_unaligned_le16(PLINK_CNF_AID(mgmt));
1225 if (sdata->u.mesh.user_mpm)