Lines Matching refs:sdata

91 	msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout)
93 msecs_to_jiffies(sdata->u.mesh.mshcfg.dot11MeshHWMPconfirmationInterval)
110 struct ieee80211_sub_if_data *sdata) in mesh_path_sel_frame_tx() argument
112 struct ieee80211_local *local = sdata->local; in mesh_path_sel_frame_tx()
131 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
133 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
140 mhwmp_dbg(sdata, "sending PREQ to %pM\n", target); in mesh_path_sel_frame_tx()
146 mhwmp_dbg(sdata, "sending PREP to %pM\n", orig_addr); in mesh_path_sel_frame_tx()
152 mhwmp_dbg(sdata, "sending RANN from %pM\n", orig_addr); in mesh_path_sel_frame_tx()
198 ieee80211_tx_skb(sdata, skb); in mesh_path_sel_frame_tx()
205 static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata, in prepare_frame_for_deferred_tx() argument
219 info->control.vif = &sdata->vif; in prepare_frame_for_deferred_tx()
221 ieee80211_set_qos_hdr(sdata, skb); in prepare_frame_for_deferred_tx()
222 ieee80211_mps_set_frame_flags(sdata, NULL, hdr); in prepare_frame_for_deferred_tx()
239 int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, in mesh_path_error_tx() argument
243 struct ieee80211_local *local = sdata->local; in mesh_path_error_tx()
245 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_error_tx()
255 sdata->encrypt_headroom + in mesh_path_error_tx()
261 skb_reserve(skb, local->tx_headroom + sdata->encrypt_headroom); in mesh_path_error_tx()
268 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
270 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
299 prepare_frame_for_deferred_tx(sdata, skb); in mesh_path_error_tx()
372 static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, in hwmp_route_info_get() argument
376 struct ieee80211_local *local = sdata->local; in hwmp_route_info_get()
387 sta = sta_info_get(sdata, mgmt->sa); in hwmp_route_info_get()
424 if (ether_addr_equal(orig_addr, sdata->vif.addr)) { in hwmp_route_info_get()
431 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_route_info_get()
446 mpath = mesh_path_add(sdata, orig_addr); in hwmp_route_info_get()
478 mpath = mesh_path_lookup(sdata, ta); in hwmp_route_info_get()
486 mpath = mesh_path_add(sdata, ta); in hwmp_route_info_get()
511 static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_preq_frame_process() argument
515 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_preq_frame_process()
536 mhwmp_dbg(sdata, "received PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
538 if (ether_addr_equal(target_addr, sdata->vif.addr)) { in hwmp_preq_frame_process()
539 mhwmp_dbg(sdata, "PREQ is for us\n"); in hwmp_preq_frame_process()
544 net_traversal_jiffies(sdata)) || in hwmp_preq_frame_process()
553 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_preq_frame_process()
557 target_addr = sdata->vif.addr; in hwmp_preq_frame_process()
568 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_preq_frame_process()
592 mhwmp_dbg(sdata, "replying to the PREQ\n"); in hwmp_preq_frame_process()
596 lifetime, metric, 0, sdata); in hwmp_preq_frame_process()
612 mhwmp_dbg(sdata, "forwarding the PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
628 metric, preq_id, sdata); in hwmp_preq_frame_process()
646 static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_prep_frame_process() argument
650 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_prep_frame_process()
657 mhwmp_dbg(sdata, "received PREP from %pM\n", in hwmp_prep_frame_process()
661 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_prep_frame_process()
670 sdata->u.mesh.mshstats.dropped_frames_ttl++; in hwmp_prep_frame_process()
675 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_prep_frame_process()
696 ttl, lifetime, metric, 0, sdata); in hwmp_prep_frame_process()
699 sdata->u.mesh.mshstats.fwded_unicast++; in hwmp_prep_frame_process()
700 sdata->u.mesh.mshstats.fwded_frames++; in hwmp_prep_frame_process()
705 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_prep_frame_process()
708 static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_perr_frame_process() argument
712 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_perr_frame_process()
731 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_perr_frame_process()
746 mesh_path_error_tx(sdata, ttl, target_addr, in hwmp_perr_frame_process()
756 static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_rann_frame_process() argument
760 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_rann_frame_process()
761 struct ieee80211_local *local = sdata->local; in hwmp_rann_frame_process()
780 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_rann_frame_process()
783 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
788 sta = sta_info_get(sdata, mgmt->sa); in hwmp_rann_frame_process()
796 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_rann_frame_process()
798 mpath = mesh_path_add(sdata, orig_addr); in hwmp_rann_frame_process()
801 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_rann_frame_process()
814 root_path_confirmation_jiffies(sdata)) || in hwmp_rann_frame_process()
817 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
845 metric + metric_txsta, 0, sdata); in hwmp_rann_frame_process()
852 void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_path_sel_frame() argument
865 sta = sta_info_get(sdata, mgmt->sa); in mesh_rx_path_sel_frame()
880 last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
883 hwmp_preq_frame_process(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
890 last_hop_metric = hwmp_route_info_get(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
893 hwmp_prep_frame_process(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
900 hwmp_perr_frame_process(sdata, mgmt, elems.perr); in mesh_rx_path_sel_frame()
903 hwmp_rann_frame_process(sdata, mgmt, elems.rann); in mesh_rx_path_sel_frame()
917 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_queue_preq() local
918 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_queue_preq()
923 mhwmp_dbg(sdata, "could not allocate PREQ node\n"); in mesh_queue_preq()
932 mhwmp_dbg(sdata, "PREQ node queue full\n"); in mesh_queue_preq()
954 if (time_after(jiffies, ifmsh->last_preq + min_preq_int_jiff(sdata))) in mesh_queue_preq()
955 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
961 ifmsh->last_preq = jiffies - min_preq_int_jiff(sdata) - 1; in mesh_queue_preq()
962 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
965 min_preq_int_jiff(sdata)); in mesh_queue_preq()
973 void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata) in mesh_path_start_discovery() argument
975 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_start_discovery()
985 min_preq_int_jiff(sdata))) { in mesh_path_start_discovery()
997 mpath = mesh_path_lookup(sdata, preq_node->dst); in mesh_path_start_discovery()
1011 mpath->discovery_timeout = disc_timeout_jiff(sdata); in mesh_path_start_discovery()
1023 net_traversal_jiffies(sdata)) || in mesh_path_start_discovery()
1026 sdata->u.mesh.last_sn_update = jiffies; in mesh_path_start_discovery()
1028 lifetime = default_lifetime(sdata); in mesh_path_start_discovery()
1029 ttl = sdata->u.mesh.mshcfg.element_ttl; in mesh_path_start_discovery()
1031 sdata->u.mesh.mshstats.dropped_frames_ttl++; in mesh_path_start_discovery()
1043 mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn, in mesh_path_start_discovery()
1045 ttl, lifetime, 0, ifmsh->preq_id++, sdata); in mesh_path_start_discovery()
1065 int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_resolve() argument
1080 err = mesh_nexthop_lookup(sdata, skb); in mesh_nexthop_resolve()
1085 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_resolve()
1087 mpath = mesh_path_add(sdata, target_addr); in mesh_nexthop_resolve()
1089 mesh_path_discard_frame(sdata, skb); in mesh_nexthop_resolve()
1102 ieee80211_set_qos_hdr(sdata, skb); in mesh_nexthop_resolve()
1106 mesh_path_discard_frame(sdata, skb_to_free); in mesh_nexthop_resolve()
1123 int mesh_nexthop_lookup(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_lookup() argument
1133 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_lookup()
1140 msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && in mesh_nexthop_lookup()
1141 ether_addr_equal(sdata->vif.addr, hdr->addr4) && in mesh_nexthop_lookup()
1149 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); in mesh_nexthop_lookup()
1150 ieee80211_mps_set_frame_flags(sdata, next_hop, hdr); in mesh_nexthop_lookup()
1162 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_path_timer() local
1165 if (sdata->local->quiescing) in mesh_path_timer()
1173 } else if (mpath->discovery_retries < max_preq_retries(sdata)) { in mesh_path_timer()
1183 if (!mpath->is_gate && mesh_gate_num(sdata) > 0) { in mesh_path_timer()
1186 mhwmp_dbg(sdata, "no gate was reachable\n"); in mesh_path_timer()
1192 void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) in mesh_path_tx_root_frame() argument
1194 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_tx_root_frame()
1203 mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1206 interval, 0, 0, sdata); in mesh_path_tx_root_frame()
1214 mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1218 0, ifmsh->preq_id++, sdata); in mesh_path_tx_root_frame()
1221 mhwmp_dbg(sdata, "Proactive mechanism not supported\n"); in mesh_path_tx_root_frame()