Lines Matching refs:sdata

41 	struct ieee80211_sub_if_data *sdata =  in ieee80211_mesh_housekeeping_timer()  local
42 from_timer(sdata, t, u.mesh.housekeeping_timer); in ieee80211_mesh_housekeeping_timer()
43 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_housekeeping_timer()
44 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping_timer()
48 wiphy_work_queue(local->hw.wiphy, &sdata->work); in ieee80211_mesh_housekeeping_timer()
62 bool mesh_matches_local(struct ieee80211_sub_if_data *sdata, in mesh_matches_local() argument
65 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_matches_local()
90 sband = ieee80211_get_sband(sdata); in mesh_matches_local()
94 ieee80211_sta_get_rates(sdata, ie, sband->band, in mesh_matches_local()
97 if (sdata->vif.bss_conf.basic_rates != basic_rates) in mesh_matches_local()
100 cfg80211_chandef_create(&sta_chan_def, sdata->vif.bss_conf.chanreq.oper.chan, in mesh_matches_local()
107 ieee80211_chandef_vht_oper(&sdata->local->hw, vht_cap_info, in mesh_matches_local()
110 ieee80211_chandef_he_6ghz_oper(sdata->local, ie->he_operation, in mesh_matches_local()
114 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chanreq.oper, in mesh_matches_local()
141 u64 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) in mesh_accept_plinks_update() argument
152 free_plinks = mesh_plink_availables(sdata); in mesh_accept_plinks_update()
154 if (free_plinks != sdata->u.mesh.accepting_plinks) { in mesh_accept_plinks_update()
155 sdata->u.mesh.accepting_plinks = free_plinks; in mesh_accept_plinks_update()
169 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_sta_cleanup() local
173 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_sta_cleanup()
176 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) in mesh_rmc_init() argument
180 sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); in mesh_rmc_init()
181 if (!sdata->u.mesh.rmc) in mesh_rmc_init()
183 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; in mesh_rmc_init()
185 INIT_HLIST_HEAD(&sdata->u.mesh.rmc->bucket[i]); in mesh_rmc_init()
189 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata) in mesh_rmc_free() argument
191 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_free()
196 if (!sdata->u.mesh.rmc) in mesh_rmc_free()
207 sdata->u.mesh.rmc = NULL; in mesh_rmc_free()
223 int mesh_rmc_check(struct ieee80211_sub_if_data *sdata, in mesh_rmc_check() argument
226 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_check()
261 int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_meshconf_ie() argument
264 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshconf_ie()
310 int mesh_add_meshid_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_meshid_ie() argument
312 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshid_ie()
327 static int mesh_add_awake_window_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_awake_window_ie() argument
330 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_awake_window_ie()
350 int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata, in mesh_add_vendor_ies() argument
353 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_vendor_ies()
374 int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_rsn_ie() argument
376 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_rsn_ie()
397 static int mesh_add_ds_params_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ds_params_ie() argument
408 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ds_params_ie()
424 int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_cap_ie() argument
430 sband = ieee80211_get_sband(sdata); in mesh_add_ht_cap_ie()
439 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_cap_ie()
440 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_cap_ie()
441 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_cap_ie()
453 int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_oper_ie() argument
456 struct ieee80211_local *local = sdata->local; in mesh_add_ht_oper_ie()
464 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ht_oper_ie()
480 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_oper_ie()
481 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_oper_ie()
482 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_oper_ie()
489 ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chanreq.oper, in mesh_add_ht_oper_ie()
490 sdata->vif.bss_conf.ht_operation_mode, in mesh_add_ht_oper_ie()
496 int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_cap_ie() argument
502 sband = ieee80211_get_sband(sdata); in mesh_add_vht_cap_ie()
511 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_cap_ie()
512 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_cap_ie()
513 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_cap_ie()
525 int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_oper_ie() argument
528 struct ieee80211_local *local = sdata->local; in mesh_add_vht_oper_ie()
536 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_vht_oper_ie()
552 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_oper_ie()
553 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_oper_ie()
554 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_oper_ie()
562 &sdata->vif.bss_conf.chanreq.oper); in mesh_add_vht_oper_ie()
567 int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_cap_ie() argument
572 sband = ieee80211_get_sband(sdata); in mesh_add_he_cap_ie()
576 if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_cap_ie()
577 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_cap_ie()
578 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_cap_ie()
581 return ieee80211_put_he_cap(skb, sdata, sband, NULL); in mesh_add_he_cap_ie()
584 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_oper_ie() argument
592 sband = ieee80211_get_sband(sdata); in mesh_add_he_oper_ie()
598 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_oper_ie()
599 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_oper_ie()
600 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_oper_ie()
604 if (sdata->vif.bss_conf.chanreq.oper.chan->band == NL80211_BAND_6GHZ) in mesh_add_he_oper_ie()
611 ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chanreq.oper); in mesh_add_he_oper_ie()
616 int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_6ghz_cap_ie() argument
622 sband = ieee80211_get_sband(sdata); in mesh_add_he_6ghz_cap_ie()
632 ieee80211_put_he_6ghz_cap(skb, sdata, sdata->deflink.smps_mode); in mesh_add_he_6ghz_cap_ie()
636 int mesh_add_eht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_eht_cap_ie() argument
641 sband = ieee80211_get_sband(sdata); in mesh_add_eht_cap_ie()
645 if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_cap_ie()
646 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_cap_ie()
647 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_cap_ie()
650 return ieee80211_put_eht_cap(skb, sdata, sband, NULL); in mesh_add_eht_cap_ie()
653 int mesh_add_eht_oper_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_eht_oper_ie() argument
660 sband = ieee80211_get_sband(sdata); in mesh_add_eht_oper_ie()
666 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_oper_ie()
667 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_oper_ie()
668 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_oper_ie()
678 ieee80211_ie_build_eht_oper(pos, &sdata->vif.bss_conf.chanreq.oper, eht_cap); in mesh_add_eht_oper_ie()
685 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_timer() local
686 from_timer(sdata, t, u.mesh.mesh_path_timer); in ieee80211_mesh_path_timer()
688 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_timer()
693 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_root_timer() local
694 from_timer(sdata, t, u.mesh.mesh_path_root_timer); in ieee80211_mesh_path_root_timer()
695 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_path_root_timer()
699 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_root_timer()
714 ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_update_bss_params() argument
721 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_update_bss_params()
726 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in ieee80211_mesh_update_bss_params()
727 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in ieee80211_mesh_update_bss_params()
728 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in ieee80211_mesh_update_bss_params()
731 sdata->vif.bss_conf.he_support = true; in ieee80211_mesh_update_bss_params()
739 sdata->vif.bss_conf.he_oper.params = in ieee80211_mesh_update_bss_params()
742 sdata->vif.bss_conf.eht_support = in ieee80211_mesh_update_bss_params()
746 bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_xmit_fast() argument
749 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_xmit_fast()
789 if (!ether_addr_equal(skb->data + ETH_ALEN, sdata->vif.addr)) in ieee80211_mesh_xmit_fast()
791 entry = mesh_fast_tx_get(sdata, &key); in ieee80211_mesh_xmit_fast()
815 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb)); in ieee80211_mesh_xmit_fast()
828 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_mesh_xmit_fast()
830 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_mesh_xmit_fast()
835 __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx, in ieee80211_mesh_xmit_fast()
836 entry->mpath->dst, sdata->vif.addr); in ieee80211_mesh_xmit_fast()
884 unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, in ieee80211_new_mesh_header() argument
893 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_new_mesh_header()
895 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_new_mesh_header()
911 static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_housekeeping() argument
913 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping()
917 ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); in ieee80211_mesh_housekeeping()
918 mesh_path_expire(sdata); in ieee80211_mesh_housekeeping()
920 changed = mesh_accept_plinks_update(sdata); in ieee80211_mesh_housekeeping()
921 ieee80211_mbss_info_change_notify(sdata, changed); in ieee80211_mesh_housekeeping()
923 mesh_fast_tx_gc(sdata); in ieee80211_mesh_housekeeping()
930 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rootpath() argument
932 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rootpath()
935 mesh_path_tx_root_frame(sdata); in ieee80211_mesh_rootpath()
957 struct ieee80211_sub_if_data *sdata; in ieee80211_mesh_build_beacon() local
961 sdata = container_of(ifmsh, struct ieee80211_sub_if_data, u.mesh); in ieee80211_mesh_build_beacon()
963 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_build_beacon()
965 ieee80211_chandef_rate_flags(&sdata->vif.bss_conf.chanreq.oper); in ieee80211_mesh_build_beacon()
967 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata); in ieee80211_mesh_build_beacon()
968 ie_len_eht_cap = ieee80211_ie_len_eht_cap(sdata); in ieee80211_mesh_build_beacon()
1015 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1016 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1017 ieee80211_mps_set_frame_flags(sdata, NULL, (void *) mgmt); in ieee80211_mesh_build_beacon()
1019 cpu_to_le16(sdata->vif.bss_conf.beacon_int); in ieee80211_mesh_build_beacon()
1021 sdata->u.mesh.security ? WLAN_CAPABILITY_PRIVACY : 0); in ieee80211_mesh_build_beacon()
1093 sdata->vif.bss_conf.basic_rates, in ieee80211_mesh_build_beacon()
1095 mesh_add_ds_params_ie(sdata, skb)) in ieee80211_mesh_build_beacon()
1106 sdata->vif.bss_conf.basic_rates, in ieee80211_mesh_build_beacon()
1108 mesh_add_rsn_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1109 mesh_add_ht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1110 mesh_add_ht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1111 mesh_add_meshid_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1112 mesh_add_meshconf_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1113 mesh_add_awake_window_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1114 mesh_add_vht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1115 mesh_add_vht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1116 mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) || in ieee80211_mesh_build_beacon()
1117 mesh_add_he_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1118 mesh_add_he_6ghz_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1119 mesh_add_eht_cap_ie(sdata, skb, ie_len_eht_cap) || in ieee80211_mesh_build_beacon()
1120 mesh_add_eht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1121 mesh_add_vendor_ies(sdata, skb)) in ieee80211_mesh_build_beacon()
1126 ieee80211_mesh_update_bss_params(sdata, bcn->tail, bcn->tail_len); in ieee80211_mesh_build_beacon()
1140 ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rebuild_beacon() argument
1145 old_bcn = sdata_dereference(sdata->u.mesh.beacon, sdata); in ieee80211_mesh_rebuild_beacon()
1146 ret = ieee80211_mesh_build_beacon(&sdata->u.mesh); in ieee80211_mesh_rebuild_beacon()
1156 void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata, in ieee80211_mbss_info_change_notify() argument
1159 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mbss_info_change_notify()
1170 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mbss_info_change_notify()
1173 int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_start_mesh() argument
1175 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_start_mesh()
1176 struct ieee80211_local *local = sdata->local; in ieee80211_start_mesh()
1195 wiphy_work_queue(local->hw.wiphy, &sdata->work); in ieee80211_start_mesh()
1196 sdata->vif.bss_conf.ht_operation_mode = in ieee80211_start_mesh()
1198 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_start_mesh()
1200 changed |= ieee80211_mps_local_status_update(sdata); in ieee80211_start_mesh()
1203 ieee80211_stop_mesh(sdata); in ieee80211_start_mesh()
1207 ieee80211_recalc_dtim(local, sdata); in ieee80211_start_mesh()
1208 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in ieee80211_start_mesh()
1210 netif_carrier_on(sdata->dev); in ieee80211_start_mesh()
1214 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_stop_mesh() argument
1216 struct ieee80211_local *local = sdata->local; in ieee80211_stop_mesh()
1217 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_stop_mesh()
1220 netif_carrier_off(sdata->dev); in ieee80211_stop_mesh()
1223 sta_info_flush(sdata, -1); in ieee80211_stop_mesh()
1224 ieee80211_free_keys(sdata, true); in ieee80211_stop_mesh()
1225 mesh_path_flush_by_iface(sdata); in ieee80211_stop_mesh()
1229 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_stop_mesh()
1230 sdata->beacon_rate_set = false; in ieee80211_stop_mesh()
1231 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); in ieee80211_stop_mesh()
1232 ieee80211_link_info_change_notify(sdata, &sdata->deflink, in ieee80211_stop_mesh()
1236 bcn = sdata_dereference(ifmsh->beacon, sdata); in ieee80211_stop_mesh()
1244 del_timer_sync(&sdata->u.mesh.housekeeping_timer); in ieee80211_stop_mesh()
1245 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer); in ieee80211_stop_mesh()
1246 del_timer_sync(&sdata->u.mesh.mesh_path_timer); in ieee80211_stop_mesh()
1257 static void ieee80211_mesh_csa_mark_radar(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_csa_mark_radar() argument
1264 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1265 &sdata->vif.bss_conf.chanreq.oper, in ieee80211_mesh_csa_mark_radar()
1268 cfg80211_radar_event(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1269 &sdata->vif.bss_conf.chanreq.oper, in ieee80211_mesh_csa_mark_radar()
1274 ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_process_chnswitch() argument
1279 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_process_chnswitch()
1285 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_process_chnswitch()
1287 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_process_chnswitch()
1291 switch (sdata->vif.bss_conf.chanreq.oper.width) { in ieee80211_mesh_process_chnswitch()
1313 err = ieee80211_parse_ch_switch_ie(sdata, elems, sband->band, in ieee80211_mesh_process_chnswitch()
1315 sdata->vif.addr, false, in ieee80211_mesh_process_chnswitch()
1326 ieee80211_mesh_csa_mark_radar(sdata); in ieee80211_mesh_process_chnswitch()
1331 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, &params.chandef, in ieee80211_mesh_process_chnswitch()
1333 !cfg80211_reg_can_beacon(sdata->local->hw.wiphy, &params.chandef, in ieee80211_mesh_process_chnswitch()
1335 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1337 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1345 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_process_chnswitch()
1351 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1353 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1364 &sdata->vif.bss_conf.chanreq.oper)) { in ieee80211_mesh_process_chnswitch()
1365 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1370 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1387 if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, in ieee80211_mesh_process_chnswitch()
1395 ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_probe_req() argument
1398 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_probe_req()
1399 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_probe_req()
1420 if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) && in ieee80211_mesh_rx_probe_req()
1449 ieee80211_tx_skb(sdata, presp); in ieee80211_mesh_rx_probe_req()
1456 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_bcn_presp() argument
1462 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_bcn_presp()
1463 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_bcn_presp()
1472 !ether_addr_equal(mgmt->da, sdata->vif.addr)) in ieee80211_mesh_rx_bcn_presp()
1487 (elems->rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) || in ieee80211_mesh_rx_bcn_presp()
1488 (!elems->rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) in ieee80211_mesh_rx_bcn_presp()
1501 if (mesh_matches_local(sdata, elems)) { in ieee80211_mesh_rx_bcn_presp()
1502 mpl_dbg(sdata, "rssi_threshold=%d,rx_status->signal=%d\n", in ieee80211_mesh_rx_bcn_presp()
1503 sdata->u.mesh.mshcfg.rssi_threshold, rx_status->signal); in ieee80211_mesh_rx_bcn_presp()
1504 if (!sdata->u.mesh.user_mpm || in ieee80211_mesh_rx_bcn_presp()
1505 sdata->u.mesh.mshcfg.rssi_threshold == 0 || in ieee80211_mesh_rx_bcn_presp()
1506 sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal) in ieee80211_mesh_rx_bcn_presp()
1507 mesh_neighbour_update(sdata, mgmt->sa, elems, in ieee80211_mesh_rx_bcn_presp()
1511 !sdata->vif.bss_conf.csa_active) in ieee80211_mesh_rx_bcn_presp()
1512 ieee80211_mesh_process_chnswitch(sdata, elems, true); in ieee80211_mesh_rx_bcn_presp()
1516 ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len, in ieee80211_mesh_rx_bcn_presp()
1522 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata, u64 *changed) in ieee80211_mesh_finish_csa() argument
1524 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_finish_csa()
1533 tmp_csa_settings = sdata_dereference(ifmsh->csa, sdata); in ieee80211_mesh_finish_csa()
1537 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_finish_csa()
1543 mcsa_dbg(sdata, "complete switching to center freq %d MHz", in ieee80211_mesh_finish_csa()
1544 sdata->vif.bss_conf.chanreq.oper.chan->center_freq); in ieee80211_mesh_finish_csa()
1548 int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_csa_beacon() argument
1552 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_csa_beacon()
1556 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_csa_beacon()
1568 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_csa_beacon()
1580 static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_fwd_csa_frame() argument
1586 struct ieee80211_local *local = sdata->local; in mesh_fwd_csa_frame()
1600 memcpy(mgmt_fwd->sa, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1601 memcpy(mgmt_fwd->bssid, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1603 ieee80211_tx_skb(sdata, skb); in mesh_fwd_csa_frame()
1607 static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_csa_frame() argument
1610 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_rx_csa_frame()
1628 if (!mesh_matches_local(sdata, elems)) in mesh_rx_csa_frame()
1641 if (!sdata->vif.bss_conf.csa_active && in mesh_rx_csa_frame()
1642 !ieee80211_mesh_process_chnswitch(sdata, elems, false)) { in mesh_rx_csa_frame()
1643 mcsa_dbg(sdata, "Failed to process CSA action frame"); in mesh_rx_csa_frame()
1649 if (mesh_fwd_csa_frame(sdata, mgmt, len, elems) < 0) in mesh_rx_csa_frame()
1650 mcsa_dbg(sdata, "Failed to forward the CSA frame"); in mesh_rx_csa_frame()
1656 static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_mgmt_action() argument
1667 mesh_rx_plink_frame(sdata, mgmt, len, rx_status); in ieee80211_mesh_rx_mgmt_action()
1673 mesh_rx_path_sel_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1676 mesh_rx_csa_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1681 void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_queued_mgmt() argument
1688 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_rx_queued_mgmt()
1691 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_rx_queued_mgmt()
1701 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->len, in ieee80211_mesh_rx_queued_mgmt()
1705 ieee80211_mesh_rx_probe_req(sdata, mgmt, skb->len); in ieee80211_mesh_rx_queued_mgmt()
1708 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status); in ieee80211_mesh_rx_queued_mgmt()
1713 static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata) in mesh_bss_info_changed() argument
1715 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_bss_info_changed()
1725 if (sdata->vif.bss_conf.enable_beacon && in mesh_bss_info_changed()
1730 if (ieee80211_mesh_rebuild_beacon(sdata)) in mesh_bss_info_changed()
1733 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in mesh_bss_info_changed()
1736 void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_work() argument
1738 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_work()
1740 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_work()
1743 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_work()
1749 mesh_path_start_discovery(sdata); in ieee80211_mesh_work()
1752 ieee80211_mesh_housekeeping(sdata); in ieee80211_mesh_work()
1755 ieee80211_mesh_rootpath(sdata); in ieee80211_mesh_work()
1758 mesh_sync_adjust_tsf(sdata); in ieee80211_mesh_work()
1761 mesh_bss_info_changed(sdata); in ieee80211_mesh_work()
1765 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_init_sdata() argument
1767 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_init_sdata()
1775 mesh_rmc_init(sdata); in ieee80211_mesh_init_sdata()
1784 mesh_pathtbl_init(sdata); in ieee80211_mesh_init_sdata()
1795 sdata->vif.bss_conf.bssid = zero_addr; in ieee80211_mesh_init_sdata()
1798 void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_teardown_sdata() argument
1800 mesh_rmc_free(sdata); in ieee80211_mesh_teardown_sdata()
1801 mesh_pathtbl_unregister(sdata); in ieee80211_mesh_teardown_sdata()