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
124 sta->mesh->plink_state != NL80211_PLINK_ESTAB)
147 * @sdata: the (mesh) interface to handle
150 * mesh STA in a MBSS. Three HT protection modes are supported for now, non-HT
175 sta->mesh->plink_state != NL80211_PLINK_ESTAB)
205 sdata->u.mesh.mshcfg.ht_opmode = ht_opmode;
234 2 + sdata->u.mesh.mesh_id_len +
245 sdata->u.mesh.ie_len);
350 * __mesh_plink_deactivate - deactivate mesh peer link
352 * @sta: mesh peer link to deactivate
359 * Locking: the caller must hold sta->mesh->plink_lock
366 lockdep_assert_held(&sta->mesh->plink_lock);
368 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
370 sta->mesh->plink_state = NL80211_PLINK_BLOCKED;
380 * mesh_plink_deactivate - deactivate mesh peer link
382 * @sta: mesh peer link to deactivate
384 * All mesh paths with this peer as next hop will be flushed
391 spin_lock_bh(&sta->mesh->plink_lock);
394 if (!sdata->u.mesh.user_mpm) {
395 sta->mesh->reason = WLAN_REASON_MESH_PEER_CANCELED;
397 sta->sta.addr, sta->mesh->llid,
398 sta->mesh->plid, sta->mesh->reason);
400 spin_unlock_bh(&sta->mesh->plink_lock);
401 if (!sdata->u.mesh.user_mpm)
402 del_timer_sync(&sta->mesh->plink_timer);
427 spin_lock_bh(&sta->mesh->plink_lock);
431 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB &&
432 sta->mesh->processed_beacon)
434 sta->mesh->processed_beacon = true;
469 spin_unlock_bh(&sta->mesh->plink_lock);
517 sta->mesh->plink_state = NL80211_PLINK_LISTEN;
536 if (sdata->u.mesh.user_mpm ||
537 sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
557 * mesh_sta_info_get - return mesh sta info entry for @addr.
561 * @elems: IEs from beacon or mesh peering frame.
597 * mesh_neighbour_update - update or initialize new mesh neighbor.
601 * @elems: IEs from beacon or mesh peering frame
618 sta->mesh->connected_to_gate = elems->mesh_config->meshconf_form &
622 sta->mesh->plink_state == NL80211_PLINK_LISTEN &&
623 sdata->u.mesh.accepting_plinks &&
624 sdata->u.mesh.mshcfg.auto_open_plinks &&
636 struct mesh_sta *mesh = from_timer(mesh, t, plink_timer);
648 sta = mesh->plink_sta;
653 spin_lock_bh(&sta->mesh->plink_lock);
660 if (time_before(jiffies, sta->mesh->plink_timer.expires)) {
663 sta->sta.addr, mplstates[sta->mesh->plink_state]);
664 spin_unlock_bh(&sta->mesh->plink_lock);
669 if (sta->mesh->plink_state == NL80211_PLINK_LISTEN ||
670 sta->mesh->plink_state == NL80211_PLINK_ESTAB) {
673 sta->sta.addr, mplstates[sta->mesh->plink_state]);
674 spin_unlock_bh(&sta->mesh->plink_lock);
680 sta->sta.addr, mplstates[sta->mesh->plink_state]);
682 mshcfg = &sdata->u.mesh.mshcfg;
684 switch (sta->mesh->plink_state) {
688 if (sta->mesh->plink_retries < mshcfg->dot11MeshMaxRetries) {
692 sta->sta.addr, sta->mesh->plink_retries,
693 sta->mesh->plink_timeout);
695 sta->mesh->plink_timeout = sta->mesh->plink_timeout +
696 rand % sta->mesh->plink_timeout;
697 ++sta->mesh->plink_retries;
698 mod_plink_timer(sta, sta->mesh->plink_timeout);
708 sta->mesh->plink_state = NL80211_PLINK_HOLDING;
714 del_timer(&sta->mesh->plink_timer);
720 spin_unlock_bh(&sta->mesh->plink_lock);
723 sta->mesh->llid, sta->mesh->plid, reason);
728 sta->mesh->plink_timeout = timeout;
729 mod_timer(&sta->mesh->plink_timer, jiffies + msecs_to_jiffies(timeout));
744 if (!memcmp(&sta->mesh->llid, &llid, sizeof(llid))) {
773 spin_lock_bh(&sta->mesh->plink_lock);
774 sta->mesh->llid = mesh_get_new_llid(sdata);
775 if (sta->mesh->plink_state != NL80211_PLINK_LISTEN &&
776 sta->mesh->plink_state != NL80211_PLINK_BLOCKED) {
777 spin_unlock_bh(&sta->mesh->plink_lock);
780 sta->mesh->plink_state = NL80211_PLINK_OPN_SNT;
781 mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout);
782 spin_unlock_bh(&sta->mesh->plink_lock);
791 sta->sta.addr, sta->mesh->llid, 0, 0);
799 spin_lock_bh(&sta->mesh->plink_lock);
801 sta->mesh->plink_state = NL80211_PLINK_BLOCKED;
802 spin_unlock_bh(&sta->mesh->plink_lock);
812 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
816 sta->mesh->reason = reason;
817 sta->mesh->plink_state = NL80211_PLINK_HOLDING;
824 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
827 del_timer(&sta->mesh->plink_timer);
828 sta->mesh->plink_state = NL80211_PLINK_ESTAB;
842 * @sta: mesh neighbor
850 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
856 mplstates[sta->mesh->plink_state], mplevents[event]);
858 spin_lock_bh(&sta->mesh->plink_lock);
859 switch (sta->mesh->plink_state) {
866 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD;
867 sta->mesh->llid = mesh_get_new_llid(sdata);
889 sta->mesh->plink_state = NL80211_PLINK_OPN_RCVD;
893 sta->mesh->plink_state = NL80211_PLINK_CNF_RCVD;
954 del_timer(&sta->mesh->plink_timer);
973 spin_unlock_bh(&sta->mesh->plink_lock);
978 sta->mesh->llid, sta->mesh->plid,
979 sta->mesh->reason);
985 sta->sta.addr, sta->mesh->llid,
986 sta->mesh->plid, 0);
1045 if (sta->mesh->plink_state == NL80211_PLINK_BLOCKED)
1054 (sta->mesh->plid && sta->mesh->plid != plid))
1063 sta->mesh->llid != llid ||
1064 (sta->mesh->plid && sta->mesh->plid != plid))
1070 if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
1081 else if (sta->mesh->plid != plid)
1083 else if (ie_len == 8 && sta->mesh->llid != llid)
1118 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) {
1171 sta->mesh->plid = plid;
1184 if (!sta->mesh->plid)
1185 sta->mesh->plid = plid;
1187 sta->mesh->aid = get_unaligned_le16(PLINK_CNF_AID(mgmt));
1211 if (sdata->u.mesh.user_mpm)