Lines Matching refs:sdata

42 	struct ieee80211_sub_if_data *sdata =  in ieee80211_mesh_housekeeping_timer()  local
43 timer_container_of(sdata, t, u.mesh.housekeeping_timer); in ieee80211_mesh_housekeeping_timer()
44 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_housekeeping_timer()
45 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping_timer()
49 wiphy_work_queue(local->hw.wiphy, &sdata->work); in ieee80211_mesh_housekeeping_timer()
63 bool mesh_matches_local(struct ieee80211_sub_if_data *sdata, in mesh_matches_local() argument
66 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_matches_local()
91 sband = ieee80211_get_sband(sdata); in mesh_matches_local()
95 ieee80211_sta_get_rates(sdata, ie, sband->band, in mesh_matches_local()
98 if (sdata->vif.bss_conf.basic_rates != basic_rates) in mesh_matches_local()
101 cfg80211_chandef_create(&sta_chan_def, sdata->vif.bss_conf.chanreq.oper.chan, in mesh_matches_local()
108 ieee80211_chandef_vht_oper(&sdata->local->hw, vht_cap_info, in mesh_matches_local()
111 ieee80211_chandef_he_6ghz_oper(sdata->local, ie->he_operation, in mesh_matches_local()
115 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chanreq.oper, in mesh_matches_local()
142 u64 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) in mesh_accept_plinks_update() argument
153 free_plinks = mesh_plink_availables(sdata); in mesh_accept_plinks_update()
155 if (free_plinks != sdata->u.mesh.accepting_plinks) { in mesh_accept_plinks_update()
156 sdata->u.mesh.accepting_plinks = free_plinks; in mesh_accept_plinks_update()
170 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_sta_cleanup() local
174 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_sta_cleanup()
177 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) in mesh_rmc_init() argument
181 sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); in mesh_rmc_init()
182 if (!sdata->u.mesh.rmc) in mesh_rmc_init()
184 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; in mesh_rmc_init()
186 INIT_HLIST_HEAD(&sdata->u.mesh.rmc->bucket[i]); in mesh_rmc_init()
190 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata) in mesh_rmc_free() argument
192 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_free()
197 if (!sdata->u.mesh.rmc) in mesh_rmc_free()
208 sdata->u.mesh.rmc = NULL; in mesh_rmc_free()
224 int mesh_rmc_check(struct ieee80211_sub_if_data *sdata, in mesh_rmc_check() argument
227 struct mesh_rmc *rmc = sdata->u.mesh.rmc; in mesh_rmc_check()
262 int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_meshconf_ie() argument
265 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshconf_ie()
311 int mesh_add_meshid_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_meshid_ie() argument
313 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshid_ie()
328 static int mesh_add_awake_window_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_awake_window_ie() argument
331 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_awake_window_ie()
351 int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata, in mesh_add_vendor_ies() argument
354 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_vendor_ies()
375 int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_rsn_ie() argument
377 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_rsn_ie()
398 static int mesh_add_ds_params_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ds_params_ie() argument
409 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ds_params_ie()
425 int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_cap_ie() argument
431 sband = ieee80211_get_sband(sdata); in mesh_add_ht_cap_ie()
440 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_cap_ie()
441 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_cap_ie()
442 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_cap_ie()
454 int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_oper_ie() argument
457 struct ieee80211_local *local = sdata->local; in mesh_add_ht_oper_ie()
465 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_ht_oper_ie()
481 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_oper_ie()
482 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_oper_ie()
483 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_oper_ie()
490 ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chanreq.oper, in mesh_add_ht_oper_ie()
491 sdata->vif.bss_conf.ht_operation_mode, in mesh_add_ht_oper_ie()
497 int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_cap_ie() argument
503 sband = ieee80211_get_sband(sdata); in mesh_add_vht_cap_ie()
512 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_cap_ie()
513 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_cap_ie()
514 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_cap_ie()
526 int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_vht_oper_ie() argument
529 struct ieee80211_local *local = sdata->local; in mesh_add_vht_oper_ie()
537 chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); in mesh_add_vht_oper_ie()
553 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_vht_oper_ie()
554 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_vht_oper_ie()
555 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_vht_oper_ie()
563 &sdata->vif.bss_conf.chanreq.oper); in mesh_add_vht_oper_ie()
568 int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_cap_ie() argument
573 sband = ieee80211_get_sband(sdata); in mesh_add_he_cap_ie()
577 if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_cap_ie()
578 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_cap_ie()
579 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_cap_ie()
582 return ieee80211_put_he_cap(skb, sdata, sband, NULL); in mesh_add_he_cap_ie()
585 int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_oper_ie() argument
593 sband = ieee80211_get_sband(sdata); in mesh_add_he_oper_ie()
599 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_he_oper_ie()
600 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_he_oper_ie()
601 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_he_oper_ie()
605 if (sdata->vif.bss_conf.chanreq.oper.chan->band == NL80211_BAND_6GHZ) in mesh_add_he_oper_ie()
612 ieee80211_ie_build_he_oper(pos, &sdata->vif.bss_conf.chanreq.oper); in mesh_add_he_oper_ie()
617 int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_he_6ghz_cap_ie() argument
623 sband = ieee80211_get_sband(sdata); in mesh_add_he_6ghz_cap_ie()
633 ieee80211_put_he_6ghz_cap(skb, sdata, sdata->deflink.smps_mode); in mesh_add_he_6ghz_cap_ie()
637 int mesh_add_eht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_eht_cap_ie() argument
642 sband = ieee80211_get_sband(sdata); in mesh_add_eht_cap_ie()
646 if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_cap_ie()
647 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_cap_ie()
648 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_cap_ie()
651 return ieee80211_put_eht_cap(skb, sdata, sband, NULL); in mesh_add_eht_cap_ie()
654 int mesh_add_eht_oper_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_eht_oper_ie() argument
661 sband = ieee80211_get_sband(sdata); in mesh_add_eht_oper_ie()
667 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_eht_oper_ie()
668 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in mesh_add_eht_oper_ie()
669 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in mesh_add_eht_oper_ie()
679 ieee80211_ie_build_eht_oper(pos, &sdata->vif.bss_conf.chanreq.oper, eht_cap); in mesh_add_eht_oper_ie()
686 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_timer() local
687 timer_container_of(sdata, t, u.mesh.mesh_path_timer); in ieee80211_mesh_path_timer()
689 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_timer()
694 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_root_timer() local
695 timer_container_of(sdata, t, u.mesh.mesh_path_root_timer); in ieee80211_mesh_path_root_timer()
696 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_path_root_timer()
700 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mesh_path_root_timer()
715 ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_update_bss_params() argument
722 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_update_bss_params()
727 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT || in ieee80211_mesh_update_bss_params()
728 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 || in ieee80211_mesh_update_bss_params()
729 sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10) in ieee80211_mesh_update_bss_params()
732 sdata->vif.bss_conf.he_support = true; in ieee80211_mesh_update_bss_params()
740 sdata->vif.bss_conf.he_oper.params = in ieee80211_mesh_update_bss_params()
743 sdata->vif.bss_conf.eht_support = in ieee80211_mesh_update_bss_params()
747 bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_xmit_fast() argument
750 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_xmit_fast()
790 if (!ether_addr_equal(skb->data + ETH_ALEN, sdata->vif.addr)) in ieee80211_mesh_xmit_fast()
792 entry = mesh_fast_tx_get(sdata, &key); in ieee80211_mesh_xmit_fast()
816 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb)); in ieee80211_mesh_xmit_fast()
829 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_mesh_xmit_fast()
831 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_mesh_xmit_fast()
836 __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx, in ieee80211_mesh_xmit_fast()
837 entry->mpath->dst, sdata->vif.addr); in ieee80211_mesh_xmit_fast()
885 unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, in ieee80211_new_mesh_header() argument
894 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_new_mesh_header()
896 put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum), in ieee80211_new_mesh_header()
912 static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_housekeeping() argument
914 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping()
918 ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); in ieee80211_mesh_housekeeping()
919 mesh_path_expire(sdata); in ieee80211_mesh_housekeeping()
921 changed = mesh_accept_plinks_update(sdata); in ieee80211_mesh_housekeeping()
922 ieee80211_mbss_info_change_notify(sdata, changed); in ieee80211_mesh_housekeeping()
924 mesh_fast_tx_gc(sdata); in ieee80211_mesh_housekeeping()
931 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rootpath() argument
933 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rootpath()
936 mesh_path_tx_root_frame(sdata); in ieee80211_mesh_rootpath()
958 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 ie_len_he_cap = ieee80211_ie_len_he_cap(sdata); in ieee80211_mesh_build_beacon()
966 ie_len_eht_cap = ieee80211_ie_len_eht_cap(sdata); in ieee80211_mesh_build_beacon()
1013 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1014 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
1015 ieee80211_mps_set_frame_flags(sdata, NULL, (void *) mgmt); in ieee80211_mesh_build_beacon()
1017 cpu_to_le16(sdata->vif.bss_conf.beacon_int); in ieee80211_mesh_build_beacon()
1019 sdata->u.mesh.security ? WLAN_CAPABILITY_PRIVACY : 0); in ieee80211_mesh_build_beacon()
1091 sdata->vif.bss_conf.basic_rates, in ieee80211_mesh_build_beacon()
1093 mesh_add_ds_params_ie(sdata, skb)) in ieee80211_mesh_build_beacon()
1104 sdata->vif.bss_conf.basic_rates, in ieee80211_mesh_build_beacon()
1106 mesh_add_rsn_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1107 mesh_add_ht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1108 mesh_add_ht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1109 mesh_add_meshid_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1110 mesh_add_meshconf_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1111 mesh_add_awake_window_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1112 mesh_add_vht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1113 mesh_add_vht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1114 mesh_add_he_cap_ie(sdata, skb, ie_len_he_cap) || in ieee80211_mesh_build_beacon()
1115 mesh_add_he_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1116 mesh_add_he_6ghz_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1117 mesh_add_eht_cap_ie(sdata, skb, ie_len_eht_cap) || in ieee80211_mesh_build_beacon()
1118 mesh_add_eht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
1119 mesh_add_vendor_ies(sdata, skb)) in ieee80211_mesh_build_beacon()
1124 ieee80211_mesh_update_bss_params(sdata, bcn->tail, bcn->tail_len); in ieee80211_mesh_build_beacon()
1138 ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rebuild_beacon() argument
1143 old_bcn = sdata_dereference(sdata->u.mesh.beacon, sdata); in ieee80211_mesh_rebuild_beacon()
1144 ret = ieee80211_mesh_build_beacon(&sdata->u.mesh); in ieee80211_mesh_rebuild_beacon()
1154 void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata, in ieee80211_mbss_info_change_notify() argument
1157 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mbss_info_change_notify()
1168 wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work); in ieee80211_mbss_info_change_notify()
1171 int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_start_mesh() argument
1173 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_start_mesh()
1174 struct ieee80211_local *local = sdata->local; in ieee80211_start_mesh()
1193 wiphy_work_queue(local->hw.wiphy, &sdata->work); in ieee80211_start_mesh()
1194 sdata->vif.bss_conf.ht_operation_mode = in ieee80211_start_mesh()
1196 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_start_mesh()
1198 changed |= ieee80211_mps_local_status_update(sdata); in ieee80211_start_mesh()
1201 ieee80211_stop_mesh(sdata); in ieee80211_start_mesh()
1205 ieee80211_recalc_dtim(sdata, drv_get_tsf(local, sdata)); in ieee80211_start_mesh()
1206 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in ieee80211_start_mesh()
1208 netif_carrier_on(sdata->dev); in ieee80211_start_mesh()
1212 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_stop_mesh() argument
1214 struct ieee80211_local *local = sdata->local; in ieee80211_stop_mesh()
1215 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_stop_mesh()
1218 netif_carrier_off(sdata->dev); in ieee80211_stop_mesh()
1221 sta_info_flush(sdata, -1); in ieee80211_stop_mesh()
1222 ieee80211_free_keys(sdata, true); in ieee80211_stop_mesh()
1223 mesh_path_flush_by_iface(sdata); in ieee80211_stop_mesh()
1227 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_stop_mesh()
1228 sdata->beacon_rate_set = false; in ieee80211_stop_mesh()
1229 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); in ieee80211_stop_mesh()
1230 ieee80211_link_info_change_notify(sdata, &sdata->deflink, in ieee80211_stop_mesh()
1234 bcn = sdata_dereference(ifmsh->beacon, sdata); in ieee80211_stop_mesh()
1242 timer_delete_sync(&sdata->u.mesh.housekeeping_timer); in ieee80211_stop_mesh()
1243 timer_delete_sync(&sdata->u.mesh.mesh_path_root_timer); in ieee80211_stop_mesh()
1244 timer_delete_sync(&sdata->u.mesh.mesh_path_timer); in ieee80211_stop_mesh()
1255 static void ieee80211_mesh_csa_mark_radar(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_csa_mark_radar() argument
1262 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1263 &sdata->vif.bss_conf.chanreq.oper, in ieee80211_mesh_csa_mark_radar()
1266 cfg80211_radar_event(sdata->local->hw.wiphy, in ieee80211_mesh_csa_mark_radar()
1267 &sdata->vif.bss_conf.chanreq.oper, in ieee80211_mesh_csa_mark_radar()
1272 ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_process_chnswitch() argument
1277 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_process_chnswitch()
1283 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_process_chnswitch()
1285 sband = ieee80211_get_sband(sdata); in ieee80211_mesh_process_chnswitch()
1289 switch (sdata->vif.bss_conf.chanreq.oper.width) { in ieee80211_mesh_process_chnswitch()
1311 err = ieee80211_parse_ch_switch_ie(sdata, elems, sband->band, in ieee80211_mesh_process_chnswitch()
1313 sdata->vif.addr, false, in ieee80211_mesh_process_chnswitch()
1324 ieee80211_mesh_csa_mark_radar(sdata); in ieee80211_mesh_process_chnswitch()
1329 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, &params.chandef, in ieee80211_mesh_process_chnswitch()
1331 !cfg80211_reg_can_beacon(sdata->local->hw.wiphy, &params.chandef, in ieee80211_mesh_process_chnswitch()
1333 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1335 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1343 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_process_chnswitch()
1349 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
1351 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
1362 &sdata->vif.bss_conf.chanreq.oper)) { in ieee80211_mesh_process_chnswitch()
1363 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1368 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
1385 if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, in ieee80211_mesh_process_chnswitch()
1393 ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_probe_req() argument
1396 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_probe_req()
1397 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_probe_req()
1418 if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) && in ieee80211_mesh_rx_probe_req()
1447 ieee80211_tx_skb(sdata, presp); in ieee80211_mesh_rx_probe_req()
1454 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_bcn_presp() argument
1460 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_bcn_presp()
1461 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_bcn_presp()
1470 !ether_addr_equal(mgmt->da, sdata->vif.addr)) in ieee80211_mesh_rx_bcn_presp()
1485 (elems->rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) || in ieee80211_mesh_rx_bcn_presp()
1486 (!elems->rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) in ieee80211_mesh_rx_bcn_presp()
1499 if (mesh_matches_local(sdata, elems)) { in ieee80211_mesh_rx_bcn_presp()
1500 mpl_dbg(sdata, "rssi_threshold=%d,rx_status->signal=%d\n", in ieee80211_mesh_rx_bcn_presp()
1501 sdata->u.mesh.mshcfg.rssi_threshold, rx_status->signal); in ieee80211_mesh_rx_bcn_presp()
1502 if (!sdata->u.mesh.user_mpm || in ieee80211_mesh_rx_bcn_presp()
1503 sdata->u.mesh.mshcfg.rssi_threshold == 0 || in ieee80211_mesh_rx_bcn_presp()
1504 sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal) in ieee80211_mesh_rx_bcn_presp()
1505 mesh_neighbour_update(sdata, mgmt->sa, elems, in ieee80211_mesh_rx_bcn_presp()
1509 !sdata->vif.bss_conf.csa_active) in ieee80211_mesh_rx_bcn_presp()
1510 ieee80211_mesh_process_chnswitch(sdata, elems, true); in ieee80211_mesh_rx_bcn_presp()
1514 ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len, in ieee80211_mesh_rx_bcn_presp()
1520 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata, u64 *changed) in ieee80211_mesh_finish_csa() argument
1522 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_finish_csa()
1531 tmp_csa_settings = sdata_dereference(ifmsh->csa, sdata); in ieee80211_mesh_finish_csa()
1535 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_finish_csa()
1541 mcsa_dbg(sdata, "complete switching to center freq %d MHz", in ieee80211_mesh_finish_csa()
1542 sdata->vif.bss_conf.chanreq.oper.chan->center_freq); in ieee80211_mesh_finish_csa()
1546 int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_csa_beacon() argument
1550 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_csa_beacon()
1554 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_csa_beacon()
1566 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_csa_beacon()
1578 static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_fwd_csa_frame() argument
1584 struct ieee80211_local *local = sdata->local; in mesh_fwd_csa_frame()
1598 memcpy(mgmt_fwd->sa, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1599 memcpy(mgmt_fwd->bssid, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1601 ieee80211_tx_skb(sdata, skb); in mesh_fwd_csa_frame()
1605 static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_csa_frame() argument
1608 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_rx_csa_frame()
1626 if (!mesh_matches_local(sdata, elems)) in mesh_rx_csa_frame()
1639 if (!sdata->vif.bss_conf.csa_active && in mesh_rx_csa_frame()
1640 !ieee80211_mesh_process_chnswitch(sdata, elems, false)) { in mesh_rx_csa_frame()
1641 mcsa_dbg(sdata, "Failed to process CSA action frame"); in mesh_rx_csa_frame()
1647 if (mesh_fwd_csa_frame(sdata, mgmt, len, elems) < 0) in mesh_rx_csa_frame()
1648 mcsa_dbg(sdata, "Failed to forward the CSA frame"); in mesh_rx_csa_frame()
1654 static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_mgmt_action() argument
1665 mesh_rx_plink_frame(sdata, mgmt, len, rx_status); in ieee80211_mesh_rx_mgmt_action()
1671 mesh_rx_path_sel_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1674 mesh_rx_csa_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1679 void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_queued_mgmt() argument
1686 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_rx_queued_mgmt()
1689 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_rx_queued_mgmt()
1699 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->len, in ieee80211_mesh_rx_queued_mgmt()
1703 ieee80211_mesh_rx_probe_req(sdata, mgmt, skb->len); in ieee80211_mesh_rx_queued_mgmt()
1706 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status); in ieee80211_mesh_rx_queued_mgmt()
1711 static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata) in mesh_bss_info_changed() argument
1713 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_bss_info_changed()
1723 if (sdata->vif.bss_conf.enable_beacon && in mesh_bss_info_changed()
1728 if (ieee80211_mesh_rebuild_beacon(sdata)) in mesh_bss_info_changed()
1731 ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); in mesh_bss_info_changed()
1734 void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_work() argument
1736 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_work()
1738 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_mesh_work()
1741 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_work()
1747 mesh_path_start_discovery(sdata); in ieee80211_mesh_work()
1750 ieee80211_mesh_housekeeping(sdata); in ieee80211_mesh_work()
1753 ieee80211_mesh_rootpath(sdata); in ieee80211_mesh_work()
1756 mesh_sync_adjust_tsf(sdata); in ieee80211_mesh_work()
1759 mesh_bss_info_changed(sdata); in ieee80211_mesh_work()
1763 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_init_sdata() argument
1765 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_init_sdata()
1773 mesh_rmc_init(sdata); in ieee80211_mesh_init_sdata()
1782 mesh_pathtbl_init(sdata); in ieee80211_mesh_init_sdata()
1793 sdata->vif.bss_conf.bssid = zero_addr; in ieee80211_mesh_init_sdata()
1796 void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_teardown_sdata() argument
1798 mesh_rmc_free(sdata); in ieee80211_mesh_teardown_sdata()
1799 mesh_pathtbl_unregister(sdata); in ieee80211_mesh_teardown_sdata()