Lines Matching refs:sdata

88 	msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout)
90 msecs_to_jiffies(sdata->u.mesh.mshcfg.dot11MeshHWMPconfirmationInterval)
107 struct ieee80211_sub_if_data *sdata) in mesh_path_sel_frame_tx() argument
109 struct ieee80211_local *local = sdata->local; in mesh_path_sel_frame_tx()
128 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
130 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_sel_frame_tx()
137 mhwmp_dbg(sdata, "sending PREQ to %pM\n", target); in mesh_path_sel_frame_tx()
143 mhwmp_dbg(sdata, "sending PREP to %pM\n", orig_addr); in mesh_path_sel_frame_tx()
149 mhwmp_dbg(sdata, "sending RANN from %pM\n", orig_addr); in mesh_path_sel_frame_tx()
195 ieee80211_tx_skb(sdata, skb); in mesh_path_sel_frame_tx()
202 static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata, in prepare_frame_for_deferred_tx() argument
216 info->control.vif = &sdata->vif; in prepare_frame_for_deferred_tx()
218 ieee80211_set_qos_hdr(sdata, skb); in prepare_frame_for_deferred_tx()
219 ieee80211_mps_set_frame_flags(sdata, NULL, hdr); in prepare_frame_for_deferred_tx()
236 int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, in mesh_path_error_tx() argument
240 struct ieee80211_local *local = sdata->local; in mesh_path_error_tx()
242 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_error_tx()
252 sdata->encrypt_headroom + in mesh_path_error_tx()
258 skb_reserve(skb, local->tx_headroom + sdata->encrypt_headroom); in mesh_path_error_tx()
265 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
267 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in mesh_path_error_tx()
291 prepare_frame_for_deferred_tx(sdata, skb); in mesh_path_error_tx()
365 static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, in hwmp_route_info_get() argument
369 struct ieee80211_local *local = sdata->local; in hwmp_route_info_get()
380 sta = sta_info_get(sdata, mgmt->sa); in hwmp_route_info_get()
417 if (ether_addr_equal(orig_addr, sdata->vif.addr)) { in hwmp_route_info_get()
424 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_route_info_get()
459 mpath = mesh_path_add(sdata, orig_addr); in hwmp_route_info_get()
491 mpath = mesh_path_lookup(sdata, ta); in hwmp_route_info_get()
499 mpath = mesh_path_add(sdata, ta); in hwmp_route_info_get()
524 static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_preq_frame_process() argument
528 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_preq_frame_process()
548 mhwmp_dbg(sdata, "received PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
550 if (ether_addr_equal(target_addr, sdata->vif.addr)) { in hwmp_preq_frame_process()
551 mhwmp_dbg(sdata, "PREQ is for us\n"); in hwmp_preq_frame_process()
556 net_traversal_jiffies(sdata)) || in hwmp_preq_frame_process()
565 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_preq_frame_process()
569 target_addr = sdata->vif.addr; in hwmp_preq_frame_process()
580 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_preq_frame_process()
602 mhwmp_dbg(sdata, "replying to the PREQ\n"); in hwmp_preq_frame_process()
607 sdata); in hwmp_preq_frame_process()
623 mhwmp_dbg(sdata, "forwarding the PREQ from %pM\n", orig_addr); in hwmp_preq_frame_process()
638 orig_metric, preq_id, sdata); in hwmp_preq_frame_process()
656 static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_prep_frame_process() argument
660 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_prep_frame_process()
667 mhwmp_dbg(sdata, "received PREP from %pM\n", in hwmp_prep_frame_process()
671 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_prep_frame_process()
680 sdata->u.mesh.mshstats.dropped_frames_ttl++; in hwmp_prep_frame_process()
685 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_prep_frame_process()
706 ttl, lifetime, metric, 0, sdata); in hwmp_prep_frame_process()
709 sdata->u.mesh.mshstats.fwded_unicast++; in hwmp_prep_frame_process()
710 sdata->u.mesh.mshstats.fwded_frames++; in hwmp_prep_frame_process()
715 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_prep_frame_process()
718 static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_perr_frame_process() argument
722 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_perr_frame_process()
741 mpath = mesh_path_lookup(sdata, target_addr); in hwmp_perr_frame_process()
759 mesh_path_error_tx(sdata, ttl, target_addr, in hwmp_perr_frame_process()
769 static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, in hwmp_rann_frame_process() argument
773 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in hwmp_rann_frame_process()
774 struct ieee80211_local *local = sdata->local; in hwmp_rann_frame_process()
793 if (ether_addr_equal(orig_addr, sdata->vif.addr)) in hwmp_rann_frame_process()
796 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
801 sta = sta_info_get(sdata, mgmt->sa); in hwmp_rann_frame_process()
809 mpath = mesh_path_lookup(sdata, orig_addr); in hwmp_rann_frame_process()
811 mpath = mesh_path_add(sdata, orig_addr); in hwmp_rann_frame_process()
814 sdata->u.mesh.mshstats.dropped_frames_no_route++; in hwmp_rann_frame_process()
827 root_path_confirmation_jiffies(sdata)) || in hwmp_rann_frame_process()
830 mhwmp_dbg(sdata, in hwmp_rann_frame_process()
858 metric + metric_txsta, 0, sdata); in hwmp_rann_frame_process()
865 void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_path_sel_frame() argument
878 sta = sta_info_get(sdata, mgmt->sa); in mesh_rx_path_sel_frame()
893 path_metric = hwmp_route_info_get(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
896 hwmp_preq_frame_process(sdata, mgmt, elems.preq, in mesh_rx_path_sel_frame()
903 path_metric = hwmp_route_info_get(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
906 hwmp_prep_frame_process(sdata, mgmt, elems.prep, in mesh_rx_path_sel_frame()
913 hwmp_perr_frame_process(sdata, mgmt, elems.perr); in mesh_rx_path_sel_frame()
916 hwmp_rann_frame_process(sdata, mgmt, elems.rann); in mesh_rx_path_sel_frame()
930 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_queue_preq() local
931 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_queue_preq()
936 mhwmp_dbg(sdata, "could not allocate PREQ node\n"); in mesh_queue_preq()
945 mhwmp_dbg(sdata, "PREQ node queue full\n"); in mesh_queue_preq()
967 if (time_after(jiffies, ifmsh->last_preq + min_preq_int_jiff(sdata))) in mesh_queue_preq()
968 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
974 ifmsh->last_preq = jiffies - min_preq_int_jiff(sdata) - 1; in mesh_queue_preq()
975 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in mesh_queue_preq()
978 min_preq_int_jiff(sdata)); in mesh_queue_preq()
986 void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata) in mesh_path_start_discovery() argument
988 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_start_discovery()
998 min_preq_int_jiff(sdata))) { in mesh_path_start_discovery()
1010 mpath = mesh_path_lookup(sdata, preq_node->dst); in mesh_path_start_discovery()
1024 mpath->discovery_timeout = disc_timeout_jiff(sdata); in mesh_path_start_discovery()
1036 net_traversal_jiffies(sdata)) || in mesh_path_start_discovery()
1039 sdata->u.mesh.last_sn_update = jiffies; in mesh_path_start_discovery()
1041 lifetime = default_lifetime(sdata); in mesh_path_start_discovery()
1042 ttl = sdata->u.mesh.mshcfg.element_ttl; in mesh_path_start_discovery()
1044 sdata->u.mesh.mshstats.dropped_frames_ttl++; in mesh_path_start_discovery()
1056 mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn, in mesh_path_start_discovery()
1058 ttl, lifetime, 0, ifmsh->preq_id++, sdata); in mesh_path_start_discovery()
1078 int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_resolve() argument
1093 err = mesh_nexthop_lookup(sdata, skb); in mesh_nexthop_resolve()
1098 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_resolve()
1100 mpath = mesh_path_add(sdata, target_addr); in mesh_nexthop_resolve()
1102 mesh_path_discard_frame(sdata, skb); in mesh_nexthop_resolve()
1115 ieee80211_set_qos_hdr(sdata, skb); in mesh_nexthop_resolve()
1119 mesh_path_discard_frame(sdata, skb_to_free); in mesh_nexthop_resolve()
1136 int mesh_nexthop_lookup(struct ieee80211_sub_if_data *sdata, in mesh_nexthop_lookup() argument
1146 mpath = mesh_path_lookup(sdata, target_addr); in mesh_nexthop_lookup()
1153 msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && in mesh_nexthop_lookup()
1154 ether_addr_equal(sdata->vif.addr, hdr->addr4) && in mesh_nexthop_lookup()
1162 memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); in mesh_nexthop_lookup()
1163 ieee80211_mps_set_frame_flags(sdata, next_hop, hdr); in mesh_nexthop_lookup()
1175 struct ieee80211_sub_if_data *sdata = mpath->sdata; in mesh_path_timer() local
1178 if (sdata->local->quiescing) in mesh_path_timer()
1186 } else if (mpath->discovery_retries < max_preq_retries(sdata)) { in mesh_path_timer()
1198 if (!mpath->is_gate && mesh_gate_num(sdata) > 0) { in mesh_path_timer()
1201 mhwmp_dbg(sdata, "no gate was reachable\n"); in mesh_path_timer()
1207 void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) in mesh_path_tx_root_frame() argument
1209 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_path_tx_root_frame()
1218 mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1221 interval, 0, 0, sdata); in mesh_path_tx_root_frame()
1229 mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr, in mesh_path_tx_root_frame()
1233 0, ifmsh->preq_id++, sdata); in mesh_path_tx_root_frame()
1236 mhwmp_dbg(sdata, "Proactive mechanism not supported\n"); in mesh_path_tx_root_frame()