Lines Matching refs:preq
403 struct ieee80211_meshpreq_ie *preq; in hwmp_recv_action_meshpath() local
425 preq = IEEE80211_MALLOC(sizeof(*preq) + in hwmp_recv_action_meshpath()
426 (ndest - 1) * sizeof(*preq->preq_targets), in hwmp_recv_action_meshpath()
429 KASSERT(preq != NULL, ("preq == NULL")); in hwmp_recv_action_meshpath()
431 preq->preq_ie = *iefrm_t++; in hwmp_recv_action_meshpath()
432 preq->preq_len = *iefrm_t++; in hwmp_recv_action_meshpath()
433 preq->preq_flags = *iefrm_t++; in hwmp_recv_action_meshpath()
434 preq->preq_hopcount = *iefrm_t++; in hwmp_recv_action_meshpath()
435 preq->preq_ttl = *iefrm_t++; in hwmp_recv_action_meshpath()
436 preq->preq_id = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
437 IEEE80211_ADDR_COPY(preq->preq_origaddr, iefrm_t); in hwmp_recv_action_meshpath()
439 preq->preq_origseq = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
441 if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { in hwmp_recv_action_meshpath()
443 preq->preq_orig_ext_addr, iefrm_t); in hwmp_recv_action_meshpath()
446 preq->preq_lifetime = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
447 preq->preq_metric = le32dec(iefrm_t); iefrm_t += 4; in hwmp_recv_action_meshpath()
448 preq->preq_tcount = *iefrm_t++; in hwmp_recv_action_meshpath()
450 for (i = 0; i < preq->preq_tcount; i++) { in hwmp_recv_action_meshpath()
451 preq->preq_targets[i].target_flags = *iefrm_t++; in hwmp_recv_action_meshpath()
453 preq->preq_targets[i].target_addr, iefrm_t); in hwmp_recv_action_meshpath()
455 preq->preq_targets[i].target_seq = in hwmp_recv_action_meshpath()
460 hwmp_recv_preq(vap, ni, wh, preq); in hwmp_recv_action_meshpath()
461 IEEE80211_FREE(preq, M_80211_MESH_PREQ); in hwmp_recv_action_meshpath()
688 #define PREQ_TFLAGS(n) preq->preq_targets[n].target_flags
689 #define PREQ_TADDR(n) preq->preq_targets[n].target_addr
690 #define PREQ_TSEQ(n) preq->preq_targets[n].target_seq
692 hwmp_add_meshpreq(uint8_t *frm, const struct ieee80211_meshpreq_ie *preq) in hwmp_add_meshpreq() argument
697 *frm++ = preq->preq_len; /* len already calculated */ in hwmp_add_meshpreq()
698 *frm++ = preq->preq_flags; in hwmp_add_meshpreq()
699 *frm++ = preq->preq_hopcount; in hwmp_add_meshpreq()
700 *frm++ = preq->preq_ttl; in hwmp_add_meshpreq()
701 ADDWORD(frm, preq->preq_id); in hwmp_add_meshpreq()
702 IEEE80211_ADDR_COPY(frm, preq->preq_origaddr); frm += 6; in hwmp_add_meshpreq()
703 ADDWORD(frm, preq->preq_origseq); in hwmp_add_meshpreq()
704 if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { in hwmp_add_meshpreq()
705 IEEE80211_ADDR_COPY(frm, preq->preq_orig_ext_addr); in hwmp_add_meshpreq()
708 ADDWORD(frm, preq->preq_lifetime); in hwmp_add_meshpreq()
709 ADDWORD(frm, preq->preq_metric); in hwmp_add_meshpreq()
710 *frm++ = preq->preq_tcount; in hwmp_add_meshpreq()
711 for (i = 0; i < preq->preq_tcount; i++) { in hwmp_add_meshpreq()
830 #define PREQ_TFLAGS(n) preq.preq_targets[n].target_flags
831 #define PREQ_TADDR(n) preq.preq_targets[n].target_addr
832 #define PREQ_TSEQ(n) preq.preq_targets[n].target_seq
839 struct ieee80211_meshpreq_ie preq; in hwmp_rootmode_cb() local
844 preq.preq_flags = 0; in hwmp_rootmode_cb()
846 preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_GATE; in hwmp_rootmode_cb()
848 preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_PP; in hwmp_rootmode_cb()
849 preq.preq_hopcount = 0; in hwmp_rootmode_cb()
850 preq.preq_ttl = ms->ms_ttl; in hwmp_rootmode_cb()
851 preq.preq_id = ++hs->hs_preqid; in hwmp_rootmode_cb()
852 IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); in hwmp_rootmode_cb()
853 preq.preq_origseq = ++hs->hs_seq; in hwmp_rootmode_cb()
854 preq.preq_lifetime = ticks_to_msecs(ieee80211_hwmp_roottimeout); in hwmp_rootmode_cb()
855 preq.preq_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_rootmode_cb()
856 preq.preq_tcount = 1; in hwmp_rootmode_cb()
863 hwmp_send_preq(vap, broadcastaddr, &preq, NULL, NULL); in hwmp_rootmode_cb()
939 #define PREQ_TFLAGS(n) preq->preq_targets[n].target_flags
940 #define PREQ_TADDR(n) preq->preq_targets[n].target_addr
941 #define PREQ_TSEQ(n) preq->preq_targets[n].target_seq
944 const struct ieee80211_frame *wh, const struct ieee80211_meshpreq_ie *preq) in hwmp_recv_preq() argument
960 if (IEEE80211_ADDR_EQ(vap->iv_myaddr, preq->preq_origaddr)) in hwmp_recv_preq()
964 "received PREQ, orig %6D, targ(0) %6D", preq->preq_origaddr, ":", in hwmp_recv_preq()
980 preq->preq_origaddr, NULL, "%s", "not accepting PREQ"); in hwmp_recv_preq()
991 if(preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AM && in hwmp_recv_preq()
995 preq->preq_origaddr, NULL, in hwmp_recv_preq()
1003 rtorig = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); in hwmp_recv_preq()
1005 rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr); in hwmp_recv_preq()
1009 preq->preq_origaddr, ":"); in hwmp_recv_preq()
1014 "adding originator %6D", preq->preq_origaddr, ":"); in hwmp_recv_preq()
1020 hrorig->hr_preqid = HWMP_SEQ_MAX(hrorig->hr_preqid, preq->preq_id); in hwmp_recv_preq()
1025 metric = preq->preq_metric + ms->ms_pmetric->mpm_metric(ni); in hwmp_recv_preq()
1026 if (HWMP_SEQ_GT(preq->preq_origseq, hrorig->hr_seq) || in hwmp_recv_preq()
1027 (HWMP_SEQ_EQ(preq->preq_origseq, hrorig->hr_seq) && in hwmp_recv_preq()
1029 hrorig->hr_seq = preq->preq_origseq; in hwmp_recv_preq()
1032 rtorig->rt_nhops = preq->preq_hopcount + 1; in hwmp_recv_preq()
1033 ieee80211_mesh_rt_update(rtorig, preq->preq_lifetime); in hwmp_recv_preq()
1042 preqid >= preq->preq_id)) { in hwmp_recv_preq()
1046 preq->preq_origaddr, ":", in hwmp_recv_preq()
1047 preq->preq_origseq, hrorig->hr_seq, in hwmp_recv_preq()
1048 preq->preq_id, preqid); in hwmp_recv_preq()
1095 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1096 IEEE80211_ADDR_COPY(prep.prep_origaddr, preq->preq_origaddr); in hwmp_recv_preq()
1097 prep.prep_origseq = preq->preq_origseq; in hwmp_recv_preq()
1100 "reply to %6D", preq->preq_origaddr, ":"); in hwmp_recv_preq()
1105 else if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE) { in hwmp_recv_preq()
1107 ieee80211_mesh_rt_find(vap, preq->preq_orig_ext_addr); in hwmp_recv_preq()
1110 preq->preq_orig_ext_addr); in hwmp_recv_preq()
1114 preq->preq_orig_ext_addr, ":"); in hwmp_recv_preq()
1119 preq->preq_origaddr); in hwmp_recv_preq()
1121 rtorig_ext->rt_ext_seq = preq->preq_origseq; in hwmp_recv_preq()
1122 ieee80211_mesh_rt_update(rtorig_ext, preq->preq_lifetime); in hwmp_recv_preq()
1131 "root mesh station @ %6D", preq->preq_origaddr, ":"); in hwmp_recv_preq()
1134 if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_GATE) { in hwmp_recv_preq()
1138 gr = ieee80211_mesh_mark_gate(vap, preq->preq_origaddr, in hwmp_recv_preq()
1148 (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) { in hwmp_recv_preq()
1155 preq->preq_origaddr); in hwmp_recv_preq()
1156 prep.prep_origseq = preq->preq_origseq; in hwmp_recv_preq()
1157 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1169 if ((preq->preq_tcount == 1) && (preq->preq_ttl > 1) && in hwmp_recv_preq()
1173 memcpy(&ppreq, preq, sizeof(ppreq)); in hwmp_recv_preq()
1193 preq->preq_origaddr, ":"); in hwmp_recv_preq()
1200 prep.prep_lifetime = preq->preq_lifetime; in hwmp_recv_preq()
1203 preq->preq_origaddr); in hwmp_recv_preq()
1218 preq->preq_origaddr, ":"); in hwmp_recv_preq()
1234 struct ieee80211_meshpreq_ie *preq, in hwmp_send_preq() argument
1257 preq->preq_ie = IEEE80211_ELEMID_MESHPREQ; in hwmp_send_preq()
1258 preq->preq_len = (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_AE ? in hwmp_send_preq()
1260 preq->preq_tcount * IEEE80211_MESHPREQ_TRGT_SZ; in hwmp_send_preq()
1261 return hwmp_send_action(vap, da, (uint8_t *)preq, preq->preq_len+2); in hwmp_send_preq()
1744 struct ieee80211_meshpreq_ie preq; in hwmp_recv_rann() local
1799 preq.preq_flags = IEEE80211_MESHPREQ_FLAGS_AM; in hwmp_recv_rann()
1800 preq.preq_hopcount = 0; in hwmp_recv_rann()
1801 preq.preq_ttl = ms->ms_ttl; in hwmp_recv_rann()
1802 preq.preq_id = 0; /* reserved */ in hwmp_recv_rann()
1803 IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); in hwmp_recv_rann()
1804 preq.preq_origseq = ++hs->hs_seq; in hwmp_recv_rann()
1805 preq.preq_lifetime = ieee80211_hwmp_roottimeout; in hwmp_recv_rann()
1806 preq.preq_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_recv_rann()
1807 preq.preq_tcount = 1; in hwmp_recv_rann()
1808 preq.preq_targets[0].target_flags = IEEE80211_MESHPREQ_TFLAGS_TO; in hwmp_recv_rann()
1810 IEEE80211_ADDR_COPY(preq.preq_targets[0].target_addr, rann->rann_addr); in hwmp_recv_rann()
1811 preq.preq_targets[0].target_seq = rann->rann_seq; in hwmp_recv_rann()
1813 hwmp_send_preq(vap, wh->i_addr2, &preq, &hr->hr_lastrootconf, in hwmp_recv_rann()
1848 #define PREQ_TFLAGS(n) preq.preq_targets[n].target_flags
1849 #define PREQ_TADDR(n) preq.preq_targets[n].target_addr
1850 #define PREQ_TSEQ(n) preq.preq_targets[n].target_seq
1859 struct ieee80211_meshpreq_ie preq; /* Optimize: storing first preq? */ in hwmp_rediscover_cb() local
1883 preq.preq_flags = 0; in hwmp_rediscover_cb()
1884 preq.preq_hopcount = 0; in hwmp_rediscover_cb()
1885 preq.preq_ttl = ms->ms_ttl; in hwmp_rediscover_cb()
1886 preq.preq_id = ++hs->hs_preqid; in hwmp_rediscover_cb()
1887 IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); in hwmp_rediscover_cb()
1888 preq.preq_origseq = hr->hr_origseq; in hwmp_rediscover_cb()
1889 preq.preq_lifetime = ticks_to_msecs(ieee80211_hwmp_pathtimeout); in hwmp_rediscover_cb()
1890 preq.preq_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_rediscover_cb()
1891 preq.preq_tcount = 1; in hwmp_rediscover_cb()
1899 hwmp_send_preq(vap, broadcastaddr, &preq, &hr->hr_lastpreq, in hwmp_rediscover_cb()
1914 struct ieee80211_meshpreq_ie preq; in hwmp_discover() local
1979 preq.preq_flags = 0; in hwmp_discover()
1980 preq.preq_hopcount = 0; in hwmp_discover()
1981 preq.preq_ttl = ms->ms_ttl; in hwmp_discover()
1982 preq.preq_id = ++hs->hs_preqid; in hwmp_discover()
1983 IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); in hwmp_discover()
1984 preq.preq_origseq = hr->hr_origseq; in hwmp_discover()
1985 preq.preq_lifetime = in hwmp_discover()
1987 preq.preq_metric = IEEE80211_MESHLMETRIC_INITIALVAL; in hwmp_discover()
1988 preq.preq_tcount = 1; in hwmp_discover()
1996 hwmp_send_preq(vap, broadcastaddr, &preq, in hwmp_discover()