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()
60 bool mesh_matches_local(struct ieee80211_sub_if_data *sdata, in mesh_matches_local() argument
63 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_matches_local()
88 sband = ieee80211_get_sband(sdata); in mesh_matches_local()
92 ieee80211_sta_get_rates(sdata, ie, sband->band, in mesh_matches_local()
95 if (sdata->vif.bss_conf.basic_rates != basic_rates) in mesh_matches_local()
98 cfg80211_chandef_create(&sta_chan_def, sdata->vif.bss_conf.chandef.chan, in mesh_matches_local()
105 ieee80211_chandef_vht_oper(&sdata->local->hw, vht_cap_info, in mesh_matches_local()
108 ieee80211_chandef_he_6ghz_oper(sdata, ie->he_operation, ie->eht_operation, in mesh_matches_local()
111 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chandef, in mesh_matches_local()
136 u64 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) in mesh_accept_plinks_update() argument
147 free_plinks = mesh_plink_availables(sdata); in mesh_accept_plinks_update()
149 if (free_plinks != sdata->u.mesh.accepting_plinks) { in mesh_accept_plinks_update()
150 sdata->u.mesh.accepting_plinks = free_plinks; in mesh_accept_plinks_update()
164 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_sta_cleanup() local
168 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_sta_cleanup()
171 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) in mesh_rmc_init() argument
175 sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); in mesh_rmc_init()
176 if (!sdata->u.mesh.rmc) in mesh_rmc_init()
178 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; in mesh_rmc_init()
180 INIT_HLIST_HEAD(&sdata->u.mesh.rmc->bucket[i]); in mesh_rmc_init()
184 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata) in mesh_rmc_free() argument
186 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_free()
191 if (!sdata->u.mesh.rmc) in mesh_rmc_free()
202 sdata->u.mesh.rmc = NULL; in mesh_rmc_free()
218 int mesh_rmc_check(struct ieee80211_sub_if_data *sdata, in mesh_rmc_check() argument
221 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_check()
256 int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_meshconf_ie() argument
259 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshconf_ie()
305 int mesh_add_meshid_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_meshid_ie() argument
307 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshid_ie()
322 static int mesh_add_awake_window_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_awake_window_ie() argument
325 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_awake_window_ie()
345 int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata, in mesh_add_vendor_ies() argument
348 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_vendor_ies()
369 int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_rsn_ie() argument
371 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_rsn_ie()
392 static int mesh_add_ds_params_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ds_params_ie() argument
403 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ds_params_ie()
419 int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_cap_ie() argument
425 sband = ieee80211_get_sband(sdata); in mesh_add_ht_cap_ie()
434 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_cap_ie()
435 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_cap_ie()
436 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_cap_ie()
448 int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_oper_ie() argument
451 struct ieee80211_local *local = sdata->local; in mesh_add_ht_oper_ie()
459 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ht_oper_ie()
475 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_oper_ie()
476 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_oper_ie()
477 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_oper_ie()
484 ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chandef, in mesh_add_ht_oper_ie()
485 sdata->vif.bss_conf.ht_operation_mode, in mesh_add_ht_oper_ie()
491 int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_cap_ie() argument
497 sband = ieee80211_get_sband(sdata); in mesh_add_vht_cap_ie()
506 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_cap_ie()
507 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_cap_ie()
508 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_cap_ie()
520 int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_oper_ie() argument
523 struct ieee80211_local *local = sdata->local; in mesh_add_vht_oper_ie()
531 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_vht_oper_ie()
547 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_oper_ie()
548 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_oper_ie()
549 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_oper_ie()
557 &sdata->vif.bss_conf.chandef); in mesh_add_vht_oper_ie()
562 int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_cap_ie() argument
569 sband = ieee80211_get_sband(sdata); in mesh_add_he_cap_ie()
576 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_cap_ie()
577 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_cap_ie()
578 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_cap_ie()
590 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_oper_ie() argument
598 sband = ieee80211_get_sband(sdata); in mesh_add_he_oper_ie()
604 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_oper_ie()
605 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_oper_ie()
606 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_oper_ie()
610 if (sdata->vif.bss_conf.chandef.chan->band == NL80211_BAND_6GHZ) in mesh_add_he_oper_ie()
617 ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chandef); in mesh_add_he_oper_ie()
622 int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_6ghz_cap_ie() argument
628 sband = ieee80211_get_sband(sdata); in mesh_add_he_6ghz_cap_ie()
638 ieee80211_ie_build_he_6ghz_cap(sdata, sdata->deflink.smps_mode, skb); in mesh_add_he_6ghz_cap_ie()
642 int mesh_add_eht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_eht_cap_ie() argument
650 sband = ieee80211_get_sband(sdata); in mesh_add_eht_cap_ie()
657 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_cap_ie()
658 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_cap_ie()
659 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_cap_ie()
671 int mesh_add_eht_oper_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_eht_oper_ie() argument
678 sband = ieee80211_get_sband(sdata); in mesh_add_eht_oper_ie()
684 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_oper_ie()
685 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_oper_ie()
686 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_oper_ie()
696 ieee80211_ie_build_eht_oper(pos, &sdata->vif.bss_conf.chandef, eht_cap); in mesh_add_eht_oper_ie()
703 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_timer() local
704 from_timer(sdata, t, u.mesh.mesh_path_timer); in ieee80211_mesh_path_timer()
706 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_timer()
711 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_root_timer() local
712 from_timer(sdata, t, u.mesh.mesh_path_root_timer); in ieee80211_mesh_path_root_timer()
713 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_path_root_timer()
717 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_root_timer()
732 ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_update_bss_params() argument
739 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_update_bss_params()
744 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in ieee80211_mesh_update_bss_params()
745 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in ieee80211_mesh_update_bss_params()
746 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in ieee80211_mesh_update_bss_params()
749 sdata->vif.bss_conf.he_support = true; in ieee80211_mesh_update_bss_params()
757 sdata->vif.bss_conf.he_oper.params = in ieee80211_mesh_update_bss_params()
760 sdata->vif.bss_conf.eht_support = in ieee80211_mesh_update_bss_params()
764 bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_xmit_fast() argument
767 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_xmit_fast()
803 entry = mesh_fast_tx_get(sdata, skb->data); in ieee80211_mesh_xmit_fast()
827 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb)); in ieee80211_mesh_xmit_fast()
840 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_mesh_xmit_fast()
842 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_mesh_xmit_fast()
847 __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx, in ieee80211_mesh_xmit_fast()
848 entry->mpath->dst, sdata->vif.addr); in ieee80211_mesh_xmit_fast()
896 unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, in ieee80211_new_mesh_header() argument
905 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_new_mesh_header()
907 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_new_mesh_header()
923 static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_housekeeping() argument
925 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping()
929 ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); in ieee80211_mesh_housekeeping()
930 mesh_path_expire(sdata); in ieee80211_mesh_housekeeping()
932 changed = mesh_accept_plinks_update(sdata); in ieee80211_mesh_housekeeping()
933 ieee80211_mbss_info_change_notify(sdata, changed); in ieee80211_mesh_housekeeping()
935 mesh_fast_tx_gc(sdata); in ieee80211_mesh_housekeeping()
942 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rootpath() argument
944 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rootpath()
947 mesh_path_tx_root_frame(sdata); in ieee80211_mesh_rootpath()
970 struct ieee80211_sub_if_data *sdata; in ieee80211_mesh_build_beacon() local
973 sdata = container_of(ifmsh, struct ieee80211_sub_if_data, u.mesh); in ieee80211_mesh_build_beacon()
975 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in ieee80211_mesh_build_beacon()
979 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata, in ieee80211_mesh_build_beacon()
981 ie_len_eht_cap = ieee80211_ie_len_eht_cap(sdata, in ieee80211_mesh_build_beacon()
1029 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1030 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1031 ieee80211_mps_set_frame_flags(sdata, NULL, (void *) mgmt); in ieee80211_mesh_build_beacon()
1033 cpu_to_le16(sdata->vif.bss_conf.beacon_int); in ieee80211_mesh_build_beacon()
1035 sdata->u.mesh.security ? WLAN_CAPABILITY_PRIVACY : 0); in ieee80211_mesh_build_beacon()
1106 if (ieee80211_add_srates_ie(sdata, skb, true, band) || in ieee80211_mesh_build_beacon()
1107 mesh_add_ds_params_ie(sdata, skb)) in ieee80211_mesh_build_beacon()
1117 if (ieee80211_add_ext_srates_ie(sdata, skb, true, band) || in ieee80211_mesh_build_beacon()
1118 mesh_add_rsn_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1119 mesh_add_ht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1120 mesh_add_ht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1121 mesh_add_meshid_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1122 mesh_add_meshconf_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1123 mesh_add_awake_window_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1124 mesh_add_vht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1125 mesh_add_vht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1126 mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) || in ieee80211_mesh_build_beacon()
1127 mesh_add_he_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1128 mesh_add_he_6ghz_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1129 mesh_add_eht_cap_ie(sdata, skb, ie_len_eht_cap) || in ieee80211_mesh_build_beacon()
1130 mesh_add_eht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1131 mesh_add_vendor_ies(sdata, skb)) in ieee80211_mesh_build_beacon()
1136 ieee80211_mesh_update_bss_params(sdata, bcn->tail, bcn->tail_len); in ieee80211_mesh_build_beacon()
1150 ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rebuild_beacon() argument
1155 old_bcn = sdata_dereference(sdata->u.mesh.beacon, sdata); in ieee80211_mesh_rebuild_beacon()
1156 ret = ieee80211_mesh_build_beacon(&sdata->u.mesh); in ieee80211_mesh_rebuild_beacon()
1166 void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata, in ieee80211_mbss_info_change_notify() argument
1169 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mbss_info_change_notify()
1180 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mbss_info_change_notify()
1183 int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_start_mesh() argument
1185 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_start_mesh()
1186 struct ieee80211_local *local = sdata->local; in ieee80211_start_mesh()
1205 wiphy_work_queue(local->hw.wiphy, &sdata->work); in ieee80211_start_mesh()
1206 sdata->vif.bss_conf.ht_operation_mode = in ieee80211_start_mesh()
1208 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_start_mesh()
1210 changed |= ieee80211_mps_local_status_update(sdata); in ieee80211_start_mesh()
1213 ieee80211_stop_mesh(sdata); in ieee80211_start_mesh()
1217 ieee80211_recalc_dtim(local, sdata); in ieee80211_start_mesh()
1218 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in ieee80211_start_mesh()
1220 netif_carrier_on(sdata->dev); in ieee80211_start_mesh()
1224 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_stop_mesh() argument
1226 struct ieee80211_local *local = sdata->local; in ieee80211_stop_mesh()
1227 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_stop_mesh()
1230 netif_carrier_off(sdata->dev); in ieee80211_stop_mesh()
1233 sta_info_flush(sdata); in ieee80211_stop_mesh()
1234 ieee80211_free_keys(sdata, true); in ieee80211_stop_mesh()
1235 mesh_path_flush_by_iface(sdata); in ieee80211_stop_mesh()
1239 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_stop_mesh()
1240 sdata->beacon_rate_set = false; in ieee80211_stop_mesh()
1241 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); in ieee80211_stop_mesh()
1242 ieee80211_link_info_change_notify(sdata, &sdata->deflink, in ieee80211_stop_mesh()
1246 bcn = sdata_dereference(ifmsh->beacon, sdata); in ieee80211_stop_mesh()
1254 del_timer_sync(&sdata->u.mesh.housekeeping_timer); in ieee80211_stop_mesh()
1255 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer); in ieee80211_stop_mesh()
1256 del_timer_sync(&sdata->u.mesh.mesh_path_timer); in ieee80211_stop_mesh()
1267 static void ieee80211_mesh_csa_mark_radar(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_csa_mark_radar() argument
1274 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1275 &sdata->vif.bss_conf.chandef, in ieee80211_mesh_csa_mark_radar()
1278 cfg80211_radar_event(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1279 &sdata->vif.bss_conf.chandef, GFP_ATOMIC); in ieee80211_mesh_csa_mark_radar()
1283 ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_process_chnswitch() argument
1288 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_process_chnswitch()
1294 sdata_assert_lock(sdata); in ieee80211_mesh_process_chnswitch()
1296 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_process_chnswitch()
1300 switch (sdata->vif.bss_conf.chandef.width) { in ieee80211_mesh_process_chnswitch()
1319 err = ieee80211_parse_ch_switch_ie(sdata, elems, sband->band, in ieee80211_mesh_process_chnswitch()
1321 conn_flags, sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1332 ieee80211_mesh_csa_mark_radar(sdata); in ieee80211_mesh_process_chnswitch()
1337 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, ¶ms.chandef, in ieee80211_mesh_process_chnswitch()
1339 !cfg80211_reg_can_beacon(sdata->local->hw.wiphy, ¶ms.chandef, in ieee80211_mesh_process_chnswitch()
1341 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1343 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1351 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_process_chnswitch()
1357 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1359 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1370 &sdata->vif.bss_conf.chandef)) { in ieee80211_mesh_process_chnswitch()
1371 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1376 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1393 if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, in ieee80211_mesh_process_chnswitch()
1401 ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_probe_req() argument
1404 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_probe_req()
1405 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_probe_req()
1426 if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) && in ieee80211_mesh_rx_probe_req()
1455 ieee80211_tx_skb(sdata, presp); in ieee80211_mesh_rx_probe_req()
1462 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_bcn_presp() argument
1468 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_bcn_presp()
1469 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_bcn_presp()
1478 !ether_addr_equal(mgmt->da, sdata->vif.addr)) in ieee80211_mesh_rx_bcn_presp()
1493 (elems->rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) || in ieee80211_mesh_rx_bcn_presp()
1494 (!elems->rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) in ieee80211_mesh_rx_bcn_presp()
1507 if (mesh_matches_local(sdata, elems)) { in ieee80211_mesh_rx_bcn_presp()
1508 mpl_dbg(sdata, "rssi_threshold=%d,rx_status->signal=%d\n", in ieee80211_mesh_rx_bcn_presp()
1509 sdata->u.mesh.mshcfg.rssi_threshold, rx_status->signal); in ieee80211_mesh_rx_bcn_presp()
1510 if (!sdata->u.mesh.user_mpm || in ieee80211_mesh_rx_bcn_presp()
1511 sdata->u.mesh.mshcfg.rssi_threshold == 0 || in ieee80211_mesh_rx_bcn_presp()
1512 sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal) in ieee80211_mesh_rx_bcn_presp()
1513 mesh_neighbour_update(sdata, mgmt->sa, elems, in ieee80211_mesh_rx_bcn_presp()
1517 !sdata->vif.bss_conf.csa_active) in ieee80211_mesh_rx_bcn_presp()
1518 ieee80211_mesh_process_chnswitch(sdata, elems, true); in ieee80211_mesh_rx_bcn_presp()
1522 ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len, in ieee80211_mesh_rx_bcn_presp()
1528 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata, u64 *changed) in ieee80211_mesh_finish_csa() argument
1530 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_finish_csa()
1539 tmp_csa_settings = sdata_dereference(ifmsh->csa, sdata); in ieee80211_mesh_finish_csa()
1543 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_finish_csa()
1549 mcsa_dbg(sdata, "complete switching to center freq %d MHz", in ieee80211_mesh_finish_csa()
1550 sdata->vif.bss_conf.chandef.chan->center_freq); in ieee80211_mesh_finish_csa()
1554 int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_csa_beacon() argument
1558 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_csa_beacon()
1562 lockdep_assert_held(&sdata->wdev.mtx); in ieee80211_mesh_csa_beacon()
1574 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_csa_beacon()
1586 static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_fwd_csa_frame() argument
1592 struct ieee80211_local *local = sdata->local; in mesh_fwd_csa_frame()
1606 memcpy(mgmt_fwd->sa, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1607 memcpy(mgmt_fwd->bssid, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1609 ieee80211_tx_skb(sdata, skb); in mesh_fwd_csa_frame()
1613 static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_csa_frame() argument
1616 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_rx_csa_frame()
1634 if (!mesh_matches_local(sdata, elems)) in mesh_rx_csa_frame()
1647 if (!sdata->vif.bss_conf.csa_active && in mesh_rx_csa_frame()
1648 !ieee80211_mesh_process_chnswitch(sdata, elems, false)) { in mesh_rx_csa_frame()
1649 mcsa_dbg(sdata, "Failed to process CSA action frame"); in mesh_rx_csa_frame()
1655 if (mesh_fwd_csa_frame(sdata, mgmt, len, elems) < 0) in mesh_rx_csa_frame()
1656 mcsa_dbg(sdata, "Failed to forward the CSA frame"); in mesh_rx_csa_frame()
1662 static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_mgmt_action() argument
1673 mesh_rx_plink_frame(sdata, mgmt, len, rx_status); in ieee80211_mesh_rx_mgmt_action()
1679 mesh_rx_path_sel_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1682 mesh_rx_csa_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1687 void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_queued_mgmt() argument
1694 sdata_lock(sdata); in ieee80211_mesh_rx_queued_mgmt()
1697 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_rx_queued_mgmt()
1707 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->len, in ieee80211_mesh_rx_queued_mgmt()
1711 ieee80211_mesh_rx_probe_req(sdata, mgmt, skb->len); in ieee80211_mesh_rx_queued_mgmt()
1714 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status); in ieee80211_mesh_rx_queued_mgmt()
1718 sdata_unlock(sdata); in ieee80211_mesh_rx_queued_mgmt()
1721 static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata) in mesh_bss_info_changed() argument
1723 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_bss_info_changed()
1733 if (sdata->vif.bss_conf.enable_beacon && in mesh_bss_info_changed()
1738 if (ieee80211_mesh_rebuild_beacon(sdata)) in mesh_bss_info_changed()
1741 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in mesh_bss_info_changed()
1744 void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_work() argument
1746 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_work()
1748 sdata_lock(sdata); in ieee80211_mesh_work()
1751 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_work()
1757 mesh_path_start_discovery(sdata); in ieee80211_mesh_work()
1760 ieee80211_mesh_housekeeping(sdata); in ieee80211_mesh_work()
1763 ieee80211_mesh_rootpath(sdata); in ieee80211_mesh_work()
1766 mesh_sync_adjust_tsf(sdata); in ieee80211_mesh_work()
1769 mesh_bss_info_changed(sdata); in ieee80211_mesh_work()
1771 sdata_unlock(sdata); in ieee80211_mesh_work()
1775 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_init_sdata() argument
1777 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_init_sdata()
1785 mesh_rmc_init(sdata); in ieee80211_mesh_init_sdata()
1793 mesh_pathtbl_init(sdata); in ieee80211_mesh_init_sdata()
1804 sdata->vif.bss_conf.bssid = zero_addr; in ieee80211_mesh_init_sdata()
1807 void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_teardown_sdata() argument
1809 mesh_rmc_free(sdata); in ieee80211_mesh_teardown_sdata()
1810 mesh_pathtbl_unregister(sdata); in ieee80211_mesh_teardown_sdata()