Lines Matching full:ni

620 mesh_vdetach_peers(void *arg, struct ieee80211_node *ni)  in mesh_vdetach_peers()  argument
622 struct ieee80211com *ic = ni->ni_ic; in mesh_vdetach_peers()
625 if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED) { in mesh_vdetach_peers()
626 args[0] = ni->ni_mlpid; in mesh_vdetach_peers()
627 args[1] = ni->ni_mllid; in mesh_vdetach_peers()
629 ieee80211_send_action(ni, in mesh_vdetach_peers()
634 callout_drain(&ni->ni_mltimer); in mesh_vdetach_peers()
637 (void *)(uintptr_t) ieee80211_mac_hash(ic, ni->ni_macaddr)); in mesh_vdetach_peers()
695 struct ieee80211_node *ni; in mesh_newstate() local
707 ni = vap->iv_bss; /* NB: no reference held */ in mesh_newstate()
809 ieee80211_node_set_chan(ni, in mesh_newstate()
811 ieee80211_htchanflags(ni->ni_chan))); in mesh_newstate()
820 ether_sprintf(ni->ni_meshid)); in mesh_newstate()
821 ieee80211_print_essid(ni->ni_meshid, in mesh_newstate()
822 ni->ni_meshidlen); in mesh_newstate()
832 ieee80211_node_authorize(ni); in mesh_newstate()
898 mesh_linkchange(struct ieee80211_node *ni, enum ieee80211_mesh_mlstate state) in mesh_linkchange() argument
900 struct ieee80211vap *vap = ni->ni_vap; in mesh_linkchange()
913 ni, "peer link: %s -> %s", in mesh_linkchange()
914 meshlinkstates[ni->ni_mlstate], meshlinkstates[state]); in mesh_linkchange()
918 ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { in mesh_linkchange()
922 } else if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED && in mesh_linkchange()
928 ni->ni_mlstate = state; in mesh_linkchange()
931 ms->ms_ppath->mpp_peerdown(ni); in mesh_linkchange()
934 ieee80211_mesh_discover(vap, ni->ni_macaddr, NULL); in mesh_linkchange()
946 mesh_checkid(void *arg, struct ieee80211_node *ni) in mesh_checkid() argument
950 if (*r == ni->ni_mllid) in mesh_checkid()
1038 struct ieee80211_node *ni; in mesh_transmit_to_gate() local
1042 ni = ieee80211_mesh_find_txnode(vap, rt_gate->rt_dest); in mesh_transmit_to_gate()
1043 if (ni == NULL) { in mesh_transmit_to_gate()
1055 (void) ieee80211_vap_pkt_send_dest(vap, m, ni); in mesh_transmit_to_gate()
1152 struct ieee80211_node *ni; in mesh_forward() local
1200 ni = ieee80211_ref_node(vap->iv_bss); in mesh_forward()
1203 ni = ieee80211_mesh_find_txnode(vap, whcopy->i_addr3); in mesh_forward()
1204 if (ni == NULL) { in mesh_forward()
1219 IEEE80211_ADDR_COPY(whcopy->i_addr1, ni->ni_macaddr); in mesh_forward()
1229 mcopy->m_pkthdr.rcvif = (void *) ni; in mesh_forward()
1527 mesh_input(struct ieee80211_node *ni, struct mbuf *m, in mesh_input() argument
1532 struct ieee80211vap *vap = ni->ni_vap; in mesh_input()
1533 struct ieee80211com *ic = ni->ni_ic; in mesh_input()
1543 KASSERT(ni != NULL, ("null node")); in mesh_input()
1544 ni->ni_inact = ni->ni_inact_reload; in mesh_input()
1554 ni->ni_macaddr, NULL, in mesh_input()
1569 ni->ni_macaddr, NULL, "wrong version %x", wh->i_fc[0]); in mesh_input()
1577 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); in mesh_input()
1578 ni->ni_noise = nf; in mesh_input()
1585 if (! ieee80211_check_rxseq(ni, wh, wh->i_addr1, rxs)) in mesh_input()
1606 if (ni == vap->iv_bss) in mesh_input()
1608 if (ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { in mesh_input()
1610 ni->ni_macaddr, NULL, in mesh_input()
1612 ni->ni_mlstate); in mesh_input()
1640 m = ieee80211_defrag(ni, m, hdrspace, 0); in mesh_input()
1669 ni->ni_macaddr, NULL, in mesh_input()
1680 ni->ni_macaddr, NULL, in mesh_input()
1702 ni->ni_macaddr, NULL, in mesh_input()
1759 ni->ni_macaddr, "data", "%s", "decap error"); in mesh_input()
1761 IEEE80211_NODE_STAT(ni, rx_decap); in mesh_input()
1765 m = ieee80211_decap_amsdu(ni, m); in mesh_input()
1769 ieee80211_deliver_data(vap, ni, m); in mesh_input()
1773 IEEE80211_NODE_STAT(ni, rx_mgmt); in mesh_input()
1782 ni->ni_macaddr, "mgt", "too short: len %u", in mesh_input()
1802 vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf); in mesh_input()
1806 IEEE80211_NODE_STAT(ni, rx_ctrl); in mesh_input()
1828 mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, in mesh_recv_mgmt() argument
1831 struct ieee80211vap *vap = ni->ni_vap; in mesh_recv_mgmt()
1833 struct ieee80211com *ic = ni->ni_ic; in mesh_recv_mgmt()
1857 if (ieee80211_parse_beacon(ni, m0, rxchan, &scan) != 0) in mesh_recv_mgmt()
1864 IEEE80211_NODE_STAT(ni, rx_beacons); in mesh_recv_mgmt()
1866 IEEE80211_NODE_STAT(ni, rx_proberesp); in mesh_recv_mgmt()
1924 if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { in mesh_recv_mgmt()
1928 ni = ieee80211_add_neighbor(vap, wh, &scan); in mesh_recv_mgmt()
1933 if (ni != vap->iv_bss && in mesh_recv_mgmt()
1935 switch (ni->ni_mlstate) { in mesh_recv_mgmt()
1941 if (ni->ni_mlhcnt >= ieee80211_mesh_maxholding) in mesh_recv_mgmt()
1944 ni->ni_mlpid = mesh_generateid(vap); in mesh_recv_mgmt()
1945 if (ni->ni_mlpid == 0) in mesh_recv_mgmt()
1947 mesh_linkchange(ni, IEEE80211_NODE_MESH_OPENSNT); in mesh_recv_mgmt()
1948 args[0] = ni->ni_mlpid; in mesh_recv_mgmt()
1949 ieee80211_send_action(ni, in mesh_recv_mgmt()
1952 ni->ni_mlrcnt = 0; in mesh_recv_mgmt()
1953 mesh_peer_timeout_setup(ni); in mesh_recv_mgmt()
2047 if (ni == vap->iv_bss) { in mesh_recv_mgmt()
2062 if (ieee80211_parse_action(ni, m0) == 0) in mesh_recv_mgmt()
2063 (void)ic->ic_recv_action(ni, wh, frm, efrm); in mesh_recv_mgmt()
2090 mesh_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype) in mesh_recv_ctl() argument
2095 ieee80211_recv_bar(ni, m); in mesh_recv_ctl()
2104 mesh_parse_meshpeering_action(struct ieee80211_node *ni, in mesh_parse_meshpeering_action() argument
2109 struct ieee80211vap *vap = ni->ni_vap; in mesh_parse_meshpeering_action()
2198 switch (ni->ni_mlstate) { in mesh_parse_meshpeering_action()
2207 args[0] = ni->ni_mlpid; in mesh_parse_meshpeering_action()
2208 args[1] = ni->ni_mllid; in mesh_parse_meshpeering_action()
2218 ieee80211_send_action(ni, in mesh_parse_meshpeering_action()
2222 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_parse_meshpeering_action()
2223 mesh_peer_timeout_setup(ni); in mesh_parse_meshpeering_action()
2233 mesh_recv_action_meshpeering_open(struct ieee80211_node *ni, in mesh_recv_action_meshpeering_open() argument
2237 struct ieee80211vap *vap = ni->ni_vap; in mesh_recv_action_meshpeering_open()
2244 meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2, efrm, &ie, in mesh_recv_action_meshpeering_open()
2251 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, in mesh_recv_action_meshpeering_open()
2254 switch (ni->ni_mlstate) { in mesh_recv_action_meshpeering_open()
2261 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2269 mesh_linkchange(ni, IEEE80211_NODE_MESH_OPENRCV); in mesh_recv_action_meshpeering_open()
2270 ni->ni_mllid = meshpeer->peer_llinkid; in mesh_recv_action_meshpeering_open()
2271 ni->ni_mlpid = mesh_generateid(vap); in mesh_recv_action_meshpeering_open()
2272 if (ni->ni_mlpid == 0) in mesh_recv_action_meshpeering_open()
2274 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2276 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2280 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2281 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2282 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2286 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_open()
2290 if (ni->ni_mllid != meshpeer->peer_llinkid) { in mesh_recv_action_meshpeering_open()
2291 args[0] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2292 args[1] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2294 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2298 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_recv_action_meshpeering_open()
2299 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_open()
2303 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2304 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2305 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2311 ni->ni_mllid = meshpeer->peer_llinkid; in mesh_recv_action_meshpeering_open()
2312 mesh_linkchange(ni, IEEE80211_NODE_MESH_OPENRCV); in mesh_recv_action_meshpeering_open()
2313 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2314 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2315 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2322 if (ni->ni_mlpid != meshpeer->peer_linkid || in mesh_recv_action_meshpeering_open()
2323 ni->ni_mllid != meshpeer->peer_llinkid) { in mesh_recv_action_meshpeering_open()
2324 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2325 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2327 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2331 mesh_linkchange(ni, in mesh_recv_action_meshpeering_open()
2333 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_open()
2336 mesh_linkchange(ni, IEEE80211_NODE_MESH_ESTABLISHED); in mesh_recv_action_meshpeering_open()
2337 ni->ni_mllid = meshpeer->peer_llinkid; in mesh_recv_action_meshpeering_open()
2338 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2339 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2340 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2344 mesh_peer_timeout_stop(ni); in mesh_recv_action_meshpeering_open()
2347 if (ni->ni_mllid != meshpeer->peer_llinkid) { in mesh_recv_action_meshpeering_open()
2348 args[0] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2349 args[1] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2351 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2355 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_recv_action_meshpeering_open()
2356 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_open()
2359 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2360 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_open()
2361 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2367 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_open()
2371 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_open()
2381 mesh_recv_action_meshpeering_confirm(struct ieee80211_node *ni, in mesh_recv_action_meshpeering_confirm() argument
2385 struct ieee80211vap *vap = ni->ni_vap; in mesh_recv_action_meshpeering_confirm()
2391 meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2+2, efrm, &ie, in mesh_recv_action_meshpeering_confirm()
2397 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, in mesh_recv_action_meshpeering_confirm()
2401 switch (ni->ni_mlstate) { in mesh_recv_action_meshpeering_confirm()
2403 mesh_linkchange(ni, IEEE80211_NODE_MESH_ESTABLISHED); in mesh_recv_action_meshpeering_confirm()
2404 mesh_peer_timeout_stop(ni); in mesh_recv_action_meshpeering_confirm()
2407 mesh_linkchange(ni, IEEE80211_NODE_MESH_CONFIRMRCV); in mesh_recv_action_meshpeering_confirm()
2408 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_confirm()
2411 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_confirm()
2415 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_confirm()
2421 if (ni->ni_mllid != meshpeer->peer_llinkid) { in mesh_recv_action_meshpeering_confirm()
2422 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_confirm()
2423 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_confirm()
2425 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_confirm()
2429 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_recv_action_meshpeering_confirm()
2430 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_confirm()
2437 ni->ni_mlstate); in mesh_recv_action_meshpeering_confirm()
2445 mesh_recv_action_meshpeering_close(struct ieee80211_node *ni, in mesh_recv_action_meshpeering_close() argument
2454 meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2, efrm, &ie, in mesh_recv_action_meshpeering_close()
2466 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, in mesh_recv_action_meshpeering_close()
2467 ni, "%s", "recv PEER CLOSE"); in mesh_recv_action_meshpeering_close()
2469 switch (ni->ni_mlstate) { in mesh_recv_action_meshpeering_close()
2477 args[0] = ni->ni_mlpid; in mesh_recv_action_meshpeering_close()
2478 args[1] = ni->ni_mllid; in mesh_recv_action_meshpeering_close()
2480 ieee80211_send_action(ni, in mesh_recv_action_meshpeering_close()
2484 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_recv_action_meshpeering_close()
2485 mesh_peer_timeout_setup(ni); in mesh_recv_action_meshpeering_close()
2488 mesh_linkchange(ni, IEEE80211_NODE_MESH_IDLE); in mesh_recv_action_meshpeering_close()
2489 mesh_peer_timeout_stop(ni); in mesh_recv_action_meshpeering_close()
2499 mesh_recv_action_meshlmetric(struct ieee80211_node *ni, in mesh_recv_action_meshlmetric() argument
2510 lm_rep.lm_metric = mesh_airtime_calc(ni); in mesh_recv_action_meshlmetric()
2511 ieee80211_send_action(ni, in mesh_recv_action_meshlmetric()
2525 mesh_parse_meshgate_action(struct ieee80211_node *ni, in mesh_parse_meshgate_action() argument
2529 struct ieee80211vap *vap = ni->ni_vap; in mesh_parse_meshgate_action()
2558 mesh_recv_action_meshgate(struct ieee80211_node *ni, in mesh_recv_action_meshgate() argument
2562 struct ieee80211vap *vap = ni->ni_vap; in mesh_recv_action_meshgate()
2571 if (mesh_parse_meshgate_action(ni, wh, &ie, frm+2, efrm) != 0) { in mesh_recv_action_meshgate()
2573 ni->ni_macaddr, NULL, "%s", in mesh_recv_action_meshgate()
2582 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ni->ni_macaddr, in mesh_recv_action_meshgate()
2594 ni->ni_macaddr, NULL, in mesh_recv_action_meshgate()
2646 mesh_send_action(struct ieee80211_node *ni, in mesh_send_action() argument
2651 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action()
2652 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action()
2656 KASSERT(ni != NULL, ("null node")); in mesh_send_action()
2659 IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT, ni, in mesh_send_action()
2662 ieee80211_free_node(ni); in mesh_send_action()
2669 ieee80211_free_node(ni); in mesh_send_action()
2674 ieee80211_send_setup(ni, m, in mesh_send_action()
2681 params.ibp_rate0 = ni->ni_txparms->mgmtrate; in mesh_send_action()
2685 params.ibp_try0 = ni->ni_txparms->maxretry; in mesh_send_action()
2686 params.ibp_power = ni->ni_txpower; in mesh_send_action()
2688 IEEE80211_NODE_STAT(ni, tx_mgmt); in mesh_send_action()
2690 ret = ieee80211_raw_output(vap, ni, m, &params); in mesh_send_action()
2709 mesh_send_action_meshpeering_open(struct ieee80211_node *ni, in mesh_send_action_meshpeering_open() argument
2712 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action_meshpeering_open()
2713 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action_meshpeering_open()
2719 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, in mesh_send_action_meshpeering_open()
2724 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in mesh_send_action_meshpeering_open()
2725 ieee80211_ref_node(ni); in mesh_send_action_meshpeering_open()
2751 ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan)); in mesh_send_action_meshpeering_open()
2760 return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); in mesh_send_action_meshpeering_open()
2763 ieee80211_free_node(ni); in mesh_send_action_meshpeering_open()
2769 mesh_send_action_meshpeering_confirm(struct ieee80211_node *ni, in mesh_send_action_meshpeering_confirm() argument
2772 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action_meshpeering_confirm()
2773 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action_meshpeering_confirm()
2779 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, in mesh_send_action_meshpeering_confirm()
2785 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in mesh_send_action_meshpeering_confirm()
2786 ieee80211_ref_node(ni); in mesh_send_action_meshpeering_confirm()
2816 ADDSHORT(frm, ieee80211_getcapinfo(vap, ni->ni_chan)); in mesh_send_action_meshpeering_confirm()
2828 return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); in mesh_send_action_meshpeering_confirm()
2831 ieee80211_free_node(ni); in mesh_send_action_meshpeering_confirm()
2837 mesh_send_action_meshpeering_close(struct ieee80211_node *ni, in mesh_send_action_meshpeering_close() argument
2840 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action_meshpeering_close()
2841 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action_meshpeering_close()
2846 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, in mesh_send_action_meshpeering_close()
2852 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in mesh_send_action_meshpeering_close()
2853 ieee80211_ref_node(ni); in mesh_send_action_meshpeering_close()
2877 return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); in mesh_send_action_meshpeering_close()
2880 ieee80211_free_node(ni); in mesh_send_action_meshpeering_close()
2886 mesh_send_action_meshlmetric(struct ieee80211_node *ni, in mesh_send_action_meshlmetric() argument
2889 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action_meshlmetric()
2890 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action_meshlmetric()
2897 ni, "%s", "send LINK METRIC REQUEST action"); in mesh_send_action_meshlmetric()
2900 ni, "send LINK METRIC REPLY action: metric 0x%x", in mesh_send_action_meshlmetric()
2905 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in mesh_send_action_meshlmetric()
2906 ieee80211_ref_node(ni); in mesh_send_action_meshlmetric()
2925 return mesh_send_action(ni, vap->iv_myaddr, ni->ni_macaddr, m); in mesh_send_action_meshlmetric()
2928 ieee80211_free_node(ni); in mesh_send_action_meshlmetric()
2934 mesh_send_action_meshgate(struct ieee80211_node *ni, in mesh_send_action_meshgate() argument
2937 struct ieee80211vap *vap = ni->ni_vap; in mesh_send_action_meshgate()
2938 struct ieee80211com *ic = ni->ni_ic; in mesh_send_action_meshgate()
2945 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in mesh_send_action_meshgate()
2946 ieee80211_ref_node(ni); in mesh_send_action_meshgate()
2964 return mesh_send_action(ni, vap->iv_myaddr, broadcastaddr, m); in mesh_send_action_meshgate()
2967 ieee80211_free_node(ni); in mesh_send_action_meshgate()
2973 mesh_peer_timeout_setup(struct ieee80211_node *ni) in mesh_peer_timeout_setup() argument
2975 switch (ni->ni_mlstate) { in mesh_peer_timeout_setup()
2977 ni->ni_mltval = ieee80211_mesh_holdingtimeout; in mesh_peer_timeout_setup()
2980 ni->ni_mltval = ieee80211_mesh_confirmtimeout; in mesh_peer_timeout_setup()
2983 ni->ni_mltval = 0; in mesh_peer_timeout_setup()
2986 ni->ni_mltval = ieee80211_mesh_retrytimeout; in mesh_peer_timeout_setup()
2989 if (ni->ni_mltval) in mesh_peer_timeout_setup()
2990 callout_reset(&ni->ni_mltimer, ni->ni_mltval, in mesh_peer_timeout_setup()
2991 mesh_peer_timeout_cb, ni); in mesh_peer_timeout_setup()
2998 mesh_peer_timeout_backoff(struct ieee80211_node *ni) in mesh_peer_timeout_backoff() argument
3003 ni->ni_mltval += r % ni->ni_mltval; in mesh_peer_timeout_backoff()
3004 callout_reset(&ni->ni_mltimer, ni->ni_mltval, mesh_peer_timeout_cb, in mesh_peer_timeout_backoff()
3005 ni); in mesh_peer_timeout_backoff()
3009 mesh_peer_timeout_stop(struct ieee80211_node *ni) in mesh_peer_timeout_stop() argument
3011 callout_drain(&ni->ni_mltimer); in mesh_peer_timeout_stop()
3017 struct ieee80211_node *ni = (struct ieee80211_node *)arg; in mesh_peer_backoff_cb() local
3020 ni->ni_mlhcnt = 0; in mesh_peer_backoff_cb()
3029 struct ieee80211_node *ni = (struct ieee80211_node *)arg; in mesh_peer_timeout_cb() local
3032 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_MESH, in mesh_peer_timeout_cb()
3033 ni, "mesh link timeout, state %d, retry counter %d", in mesh_peer_timeout_cb()
3034 ni->ni_mlstate, ni->ni_mlrcnt); in mesh_peer_timeout_cb()
3036 switch (ni->ni_mlstate) { in mesh_peer_timeout_cb()
3042 if (ni->ni_mlrcnt == ieee80211_mesh_maxretries) { in mesh_peer_timeout_cb()
3043 args[0] = ni->ni_mlpid; in mesh_peer_timeout_cb()
3045 ieee80211_send_action(ni, in mesh_peer_timeout_cb()
3048 ni->ni_mlrcnt = 0; in mesh_peer_timeout_cb()
3049 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_peer_timeout_cb()
3050 mesh_peer_timeout_setup(ni); in mesh_peer_timeout_cb()
3052 args[0] = ni->ni_mlpid; in mesh_peer_timeout_cb()
3053 ieee80211_send_action(ni, in mesh_peer_timeout_cb()
3056 ni->ni_mlrcnt++; in mesh_peer_timeout_cb()
3057 mesh_peer_timeout_backoff(ni); in mesh_peer_timeout_cb()
3061 args[0] = ni->ni_mlpid; in mesh_peer_timeout_cb()
3063 ieee80211_send_action(ni, in mesh_peer_timeout_cb()
3066 mesh_linkchange(ni, IEEE80211_NODE_MESH_HOLDING); in mesh_peer_timeout_cb()
3067 mesh_peer_timeout_setup(ni); in mesh_peer_timeout_cb()
3070 ni->ni_mlhcnt++; in mesh_peer_timeout_cb()
3071 if (ni->ni_mlhcnt >= ieee80211_mesh_maxholding) in mesh_peer_timeout_cb()
3072 callout_reset(&ni->ni_mlhtimer, in mesh_peer_timeout_cb()
3074 mesh_peer_backoff_cb, ni); in mesh_peer_timeout_cb()
3075 mesh_linkchange(ni, IEEE80211_NODE_MESH_IDLE); in mesh_peer_timeout_cb()
3290 mesh_airtime_calc(struct ieee80211_node *ni) in mesh_airtime_calc() argument
3294 struct ieee80211com *ic = ni->ni_ic; in mesh_airtime_calc()
3295 struct ifnet *ifp = ni->ni_vap->iv_ifp; in mesh_airtime_calc()
3301 rate = ni->ni_txrate; in mesh_airtime_calc()
3354 ieee80211_mesh_node_init(struct ieee80211vap *vap, struct ieee80211_node *ni) in ieee80211_mesh_node_init() argument
3356 ni->ni_flags |= IEEE80211_NODE_QOS; in ieee80211_mesh_node_init()
3357 callout_init(&ni->ni_mltimer, 1); in ieee80211_mesh_node_init()
3358 callout_init(&ni->ni_mlhtimer, 1); in ieee80211_mesh_node_init()
3365 ieee80211_mesh_node_cleanup(struct ieee80211_node *ni) in ieee80211_mesh_node_cleanup() argument
3367 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_mesh_node_cleanup()
3370 callout_drain(&ni->ni_mltimer); in ieee80211_mesh_node_cleanup()
3371 callout_drain(&ni->ni_mlhtimer); in ieee80211_mesh_node_cleanup()
3374 ms->ms_ppath->mpp_peerdown(ni); in ieee80211_mesh_node_cleanup()
3378 ieee80211_parse_meshid(struct ieee80211_node *ni, const uint8_t *ie) in ieee80211_parse_meshid() argument
3380 ni->ni_meshidlen = ie[1]; in ieee80211_parse_meshid()
3381 memcpy(ni->ni_meshid, ie + 2, ie[1]); in ieee80211_parse_meshid()
3388 ieee80211_mesh_init_neighbor(struct ieee80211_node *ni, in ieee80211_mesh_init_neighbor() argument
3392 ieee80211_parse_meshid(ni, sp->meshid); in ieee80211_mesh_init_neighbor()