Lines Matching refs:sdata
91 msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout)
93 msecs_to_jiffies(sdata->u.mesh.mshcfg.dot11MeshHWMPconfirmationInterval)
111 struct ieee80211_sub_if_data *sdata) in mesh_path_sel_frame_tx() argument
113 struct ieee80211_local *local = sdata->local; in mesh_path_sel_frame_tx()
132 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
134 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
141 mhwmp_dbg(sdata, "sending PREQ to %pM\n", target); in mesh_path_sel_frame_tx()
147 mhwmp_dbg(sdata, "sending PREP to %pM\n", orig_addr); in mesh_path_sel_frame_tx()
153 mhwmp_dbg(sdata, "sending RANN from %pM\n", orig_addr); in mesh_path_sel_frame_tx()
200 ieee80211_tx_skb(sdata, skb); in mesh_path_sel_frame_tx()
207 static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata, in prepare_frame_for_deferred_tx() argument
221 info->control.vif = &sdata->vif; in prepare_frame_for_deferred_tx()
223 ieee80211_set_qos_hdr(sdata, skb); in prepare_frame_for_deferred_tx()
224 ieee80211_mps_set_frame_flags(sdata, NULL, hdr); in prepare_frame_for_deferred_tx()
241 int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, in mesh_path_error_tx() argument
245 struct ieee80211_local *local = sdata->local; in mesh_path_error_tx()
247 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_error_tx()
270 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
272 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
301 prepare_frame_for_deferred_tx(sdata, skb); in mesh_path_error_tx()
374 static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, in hwmp_route_info_get() argument
378 struct ieee80211_local *local = sdata->local; in hwmp_route_info_get()
389 sta = sta_info_get(sdata, mgmt->sa); in hwmp_route_info_get()
426 if (ether_addr_equal(orig_addr, sdata->vif.addr)) { in hwmp_route_info_get()
433 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_route_info_get()
448 mpath = mesh_path_add(sdata, orig_addr); in hwmp_route_info_get()
480 mpath = mesh_path_lookup(sdata, ta); in hwmp_route_info_get()
488 mpath = mesh_path_add(sdata, ta); in hwmp_route_info_get()
513 static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_preq_frame_process() argument
517 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_preq_frame_process()
538 mhwmp_dbg(sdata, "received PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
540 if (ether_addr_equal(target_addr, sdata->vif.addr)) { in hwmp_preq_frame_process()
541 mhwmp_dbg(sdata, "PREQ is for us\n"); in hwmp_preq_frame_process()
546 net_traversal_jiffies(sdata)) || in hwmp_preq_frame_process()
554 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_preq_frame_process()
558 target_addr = sdata->vif.addr; in hwmp_preq_frame_process()
569 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_preq_frame_process()
593 mhwmp_dbg(sdata, "replying to the PREQ\n"); in hwmp_preq_frame_process()
598 0, sdata); in hwmp_preq_frame_process()
614 mhwmp_dbg(sdata, "forwarding the PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
632 sdata); in hwmp_preq_frame_process()
650 static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_prep_frame_process() argument
654 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_prep_frame_process()
661 mhwmp_dbg(sdata, "received PREP from %pM\n", in hwmp_prep_frame_process()
665 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_prep_frame_process()
674 sdata->u.mesh.mshstats.dropped_frames_ttl++; in hwmp_prep_frame_process()
679 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_prep_frame_process()
702 0, sdata); in hwmp_prep_frame_process()
705 sdata->u.mesh.mshstats.fwded_unicast++; in hwmp_prep_frame_process()
706 sdata->u.mesh.mshstats.fwded_frames++; in hwmp_prep_frame_process()
711 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_prep_frame_process()
714 static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_perr_frame_process() argument
718 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_perr_frame_process()
737 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_perr_frame_process()
752 mesh_path_error_tx(sdata, ttl, target_addr, in hwmp_perr_frame_process()
763 static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_rann_frame_process() argument
767 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_rann_frame_process()
768 struct ieee80211_local *local = sdata->local; in hwmp_rann_frame_process()
787 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_rann_frame_process()
790 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
795 sta = sta_info_get(sdata, mgmt->sa); in hwmp_rann_frame_process()
803 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_rann_frame_process()
805 mpath = mesh_path_add(sdata, orig_addr); in hwmp_rann_frame_process()
808 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_rann_frame_process()
821 root_path_confirmation_jiffies(sdata)) || in hwmp_rann_frame_process()
824 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
854 0, sdata); in hwmp_rann_frame_process()
861 void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_path_sel_frame() argument
874 sta = sta_info_get(sdata, mgmt->sa); in mesh_rx_path_sel_frame()
889 last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
892 hwmp_preq_frame_process(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
899 last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
902 hwmp_prep_frame_process(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
909 hwmp_perr_frame_process(sdata, mgmt, elems.perr); in mesh_rx_path_sel_frame()
912 hwmp_rann_frame_process(sdata, mgmt, elems.rann); in mesh_rx_path_sel_frame()
926 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_queue_preq() local
927 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_queue_preq()
932 mhwmp_dbg(sdata, "could not allocate PREQ node\n"); in mesh_queue_preq()
941 mhwmp_dbg(sdata, "PREQ node queue full\n"); in mesh_queue_preq()
963 if (time_after(jiffies, ifmsh->last_preq + min_preq_int_jiff(sdata))) in mesh_queue_preq()
964 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
970 ifmsh->last_preq = jiffies - min_preq_int_jiff(sdata) - 1; in mesh_queue_preq()
971 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
974 min_preq_int_jiff(sdata)); in mesh_queue_preq()
982 void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata) in mesh_path_start_discovery() argument
984 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_start_discovery()
994 min_preq_int_jiff(sdata))) { in mesh_path_start_discovery()
1006 mpath = mesh_path_lookup(sdata, preq_node->dst); in mesh_path_start_discovery()
1020 mpath->discovery_timeout = disc_timeout_jiff(sdata); in mesh_path_start_discovery()
1032 net_traversal_jiffies(sdata)) || in mesh_path_start_discovery()
1035 sdata->u.mesh.last_sn_update = jiffies; in mesh_path_start_discovery()
1037 lifetime = default_lifetime(sdata); in mesh_path_start_discovery()
1038 ttl = sdata->u.mesh.mshcfg.element_ttl; in mesh_path_start_discovery()
1040 sdata->u.mesh.mshstats.dropped_frames_ttl++; in mesh_path_start_discovery()
1052 mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, in mesh_path_start_discovery()
1056 cpu_to_le32(ifmsh->preq_id++), sdata); in mesh_path_start_discovery()
1076 int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_resolve() argument
1091 err = mesh_nexthop_lookup(sdata, skb); in mesh_nexthop_resolve()
1096 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_resolve()
1098 mpath = mesh_path_add(sdata, target_addr); in mesh_nexthop_resolve()
1100 mesh_path_discard_frame(sdata, skb); in mesh_nexthop_resolve()
1113 ieee80211_set_qos_hdr(sdata, skb); in mesh_nexthop_resolve()
1117 mesh_path_discard_frame(sdata, skb_to_free); in mesh_nexthop_resolve()
1134 int mesh_nexthop_lookup(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_lookup() argument
1144 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_lookup()
1151 msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && in mesh_nexthop_lookup()
1152 ether_addr_equal(sdata->vif.addr, hdr->addr4) && in mesh_nexthop_lookup()
1160 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); in mesh_nexthop_lookup()
1161 ieee80211_mps_set_frame_flags(sdata, next_hop, hdr); in mesh_nexthop_lookup()
1173 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_path_timer() local
1176 if (sdata->local->quiescing) in mesh_path_timer()
1184 } else if (mpath->discovery_retries < max_preq_retries(sdata)) { in mesh_path_timer()
1194 if (!mpath->is_gate && mesh_gate_num(sdata) > 0) { in mesh_path_timer()
1197 mhwmp_dbg(sdata, "no gate was reachable\n"); in mesh_path_timer()
1203 void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) in mesh_path_tx_root_frame() argument
1205 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_tx_root_frame()
1214 mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1218 cpu_to_le32(interval), 0, 0, sdata); in mesh_path_tx_root_frame()
1226 mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1231 0, cpu_to_le32(ifmsh->preq_id++), sdata); in mesh_path_tx_root_frame()
1234 mhwmp_dbg(sdata, "Proactive mechanism not supported\n"); in mesh_path_tx_root_frame()