Lines Matching refs:sdata

44 	struct ieee80211_sub_if_data *sdata = (void *) data;  in ieee80211_mesh_housekeeping_timer()  local
45 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_housekeeping_timer()
46 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping_timer()
50 ieee80211_queue_work(&local->hw, &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()
88 ieee80211_sta_get_rates(sdata, ie, ieee80211_get_sdata_band(sdata), in mesh_matches_local()
91 if (sdata->vif.bss_conf.basic_rates != basic_rates) in mesh_matches_local()
94 ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan, in mesh_matches_local()
97 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chandef, in mesh_matches_local()
122 u32 mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) in mesh_accept_plinks_update() argument
133 free_plinks = mesh_plink_availables(sdata); in mesh_accept_plinks_update()
135 if (free_plinks != sdata->u.mesh.accepting_plinks) { in mesh_accept_plinks_update()
136 sdata->u.mesh.accepting_plinks = free_plinks; in mesh_accept_plinks_update()
150 struct ieee80211_sub_if_data *sdata = sta->sdata; in mesh_sta_cleanup() local
158 changed = mesh_accept_plinks_update(sdata); in mesh_sta_cleanup()
159 if (!sdata->u.mesh.user_mpm) { in mesh_sta_cleanup()
169 ieee80211_mbss_info_change_notify(sdata, changed); in mesh_sta_cleanup()
172 int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) in mesh_rmc_init() argument
176 sdata->u.mesh.rmc = kmalloc(sizeof(struct mesh_rmc), GFP_KERNEL); in mesh_rmc_init()
177 if (!sdata->u.mesh.rmc) in mesh_rmc_init()
179 sdata->u.mesh.rmc->idx_mask = RMC_BUCKETS - 1; in mesh_rmc_init()
181 INIT_LIST_HEAD(&sdata->u.mesh.rmc->bucket[i]); in mesh_rmc_init()
185 void mesh_rmc_free(struct ieee80211_sub_if_data *sdata) in mesh_rmc_free() argument
187 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()
252 int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_meshconf_ie() argument
255 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshconf_ie()
299 int mesh_add_meshid_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_meshid_ie() argument
301 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_meshid_ie()
316 static int mesh_add_awake_window_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_awake_window_ie() argument
319 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_awake_window_ie()
339 int mesh_add_vendor_ies(struct ieee80211_sub_if_data *sdata, in mesh_add_vendor_ies() argument
342 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_vendor_ies()
363 int mesh_add_rsn_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) in mesh_add_rsn_ie() argument
365 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_add_rsn_ie()
386 static int mesh_add_ds_params_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ds_params_ie() argument
397 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); in mesh_add_ds_params_ie()
413 int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_cap_ie() argument
416 struct ieee80211_local *local = sdata->local; in mesh_add_ht_cap_ie()
417 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in mesh_add_ht_cap_ie()
423 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT || in mesh_add_ht_cap_ie()
424 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 || in mesh_add_ht_cap_ie()
425 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10) in mesh_add_ht_cap_ie()
437 int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata, in mesh_add_ht_oper_ie() argument
440 struct ieee80211_local *local = sdata->local; in mesh_add_ht_oper_ie()
444 cfg80211_get_chandef_type(&sdata->vif.bss_conf.chandef); in mesh_add_ht_oper_ie()
450 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); in mesh_add_ht_oper_ie()
468 ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chandef, in mesh_add_ht_oper_ie()
469 sdata->vif.bss_conf.ht_operation_mode); in mesh_add_ht_oper_ie()
476 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_timer() local
479 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in ieee80211_mesh_path_timer()
484 struct ieee80211_sub_if_data *sdata = in ieee80211_mesh_path_root_timer() local
486 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_path_root_timer()
490 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in ieee80211_mesh_path_root_timer()
547 int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, in ieee80211_new_mesh_header() argument
556 meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL; in ieee80211_new_mesh_header()
559 put_unaligned(cpu_to_le32(sdata->u.mesh.mesh_seqnum), &meshhdr->seqnum); in ieee80211_new_mesh_header()
560 sdata->u.mesh.mesh_seqnum++; in ieee80211_new_mesh_header()
576 static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_housekeeping() argument
578 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_housekeeping()
582 ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); in ieee80211_mesh_housekeeping()
583 mesh_path_expire(sdata); in ieee80211_mesh_housekeeping()
585 changed = mesh_accept_plinks_update(sdata); in ieee80211_mesh_housekeeping()
586 ieee80211_mbss_info_change_notify(sdata, changed); in ieee80211_mesh_housekeeping()
593 static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rootpath() argument
595 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rootpath()
598 mesh_path_tx_root_frame(sdata); in ieee80211_mesh_rootpath()
620 struct ieee80211_sub_if_data *sdata; in ieee80211_mesh_build_beacon() local
624 sdata = container_of(ifmsh, struct ieee80211_sub_if_data, u.mesh); in ieee80211_mesh_build_beacon()
626 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); in ieee80211_mesh_build_beacon()
665 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
666 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in ieee80211_mesh_build_beacon()
667 ieee80211_mps_set_frame_flags(sdata, NULL, (void *) mgmt); in ieee80211_mesh_build_beacon()
669 cpu_to_le16(sdata->vif.bss_conf.beacon_int); in ieee80211_mesh_build_beacon()
671 sdata->u.mesh.security ? WLAN_CAPABILITY_PRIVACY : 0); in ieee80211_mesh_build_beacon()
707 if (ieee80211_add_srates_ie(sdata, skb, true, band) || in ieee80211_mesh_build_beacon()
708 mesh_add_ds_params_ie(sdata, skb)) in ieee80211_mesh_build_beacon()
718 if (ieee80211_add_ext_srates_ie(sdata, skb, true, band) || in ieee80211_mesh_build_beacon()
719 mesh_add_rsn_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
720 mesh_add_ht_cap_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
721 mesh_add_ht_oper_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
722 mesh_add_meshid_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
723 mesh_add_meshconf_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
724 mesh_add_awake_window_ie(sdata, skb) || in ieee80211_mesh_build_beacon()
725 mesh_add_vendor_ies(sdata, skb)) in ieee80211_mesh_build_beacon()
743 ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_rebuild_beacon() argument
748 old_bcn = rcu_dereference_protected(sdata->u.mesh.beacon, in ieee80211_mesh_rebuild_beacon()
749 lockdep_is_held(&sdata->wdev.mtx)); in ieee80211_mesh_rebuild_beacon()
750 ret = ieee80211_mesh_build_beacon(&sdata->u.mesh); in ieee80211_mesh_rebuild_beacon()
760 void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata, in ieee80211_mbss_info_change_notify() argument
763 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mbss_info_change_notify()
774 ieee80211_queue_work(&sdata->local->hw, &sdata->work); in ieee80211_mbss_info_change_notify()
777 int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_start_mesh() argument
779 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_start_mesh()
780 struct ieee80211_local *local = sdata->local; in ieee80211_start_mesh()
799 ieee80211_queue_work(&local->hw, &sdata->work); in ieee80211_start_mesh()
800 sdata->vif.bss_conf.ht_operation_mode = in ieee80211_start_mesh()
802 sdata->vif.bss_conf.enable_beacon = true; in ieee80211_start_mesh()
804 changed |= ieee80211_mps_local_status_update(sdata); in ieee80211_start_mesh()
807 ieee80211_stop_mesh(sdata); in ieee80211_start_mesh()
811 ieee80211_recalc_dtim(local, sdata); in ieee80211_start_mesh()
812 ieee80211_bss_info_change_notify(sdata, changed); in ieee80211_start_mesh()
814 netif_carrier_on(sdata->dev); in ieee80211_start_mesh()
818 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) in ieee80211_stop_mesh() argument
820 struct ieee80211_local *local = sdata->local; in ieee80211_stop_mesh()
821 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_stop_mesh()
824 netif_carrier_off(sdata->dev); in ieee80211_stop_mesh()
828 sdata->vif.bss_conf.enable_beacon = false; in ieee80211_stop_mesh()
829 clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); in ieee80211_stop_mesh()
830 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); in ieee80211_stop_mesh()
832 lockdep_is_held(&sdata->wdev.mtx)); in ieee80211_stop_mesh()
837 sta_info_flush(sdata); in ieee80211_stop_mesh()
838 mesh_path_flush_by_iface(sdata); in ieee80211_stop_mesh()
844 del_timer_sync(&sdata->u.mesh.housekeeping_timer); in ieee80211_stop_mesh()
845 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer); in ieee80211_stop_mesh()
846 del_timer_sync(&sdata->u.mesh.mesh_path_timer); in ieee80211_stop_mesh()
858 ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_process_chnswitch() argument
863 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_process_chnswitch()
864 enum ieee80211_band band = ieee80211_get_sdata_band(sdata); in ieee80211_mesh_process_chnswitch()
868 sdata_assert_lock(sdata); in ieee80211_mesh_process_chnswitch()
871 switch (sdata->vif.bss_conf.chandef.width) { in ieee80211_mesh_process_chnswitch()
883 err = ieee80211_parse_ch_switch_ie(sdata, elems, band, in ieee80211_mesh_process_chnswitch()
884 sta_flags, sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
894 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, &params.chandef, in ieee80211_mesh_process_chnswitch()
896 sdata_info(sdata, in ieee80211_mesh_process_chnswitch()
898 sdata->vif.addr, in ieee80211_mesh_process_chnswitch()
906 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, in ieee80211_mesh_process_chnswitch()
918 &sdata->vif.bss_conf.chandef)) { in ieee80211_mesh_process_chnswitch()
919 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
924 mcsa_dbg(sdata, in ieee80211_mesh_process_chnswitch()
941 if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, in ieee80211_mesh_process_chnswitch()
949 ieee80211_mesh_rx_probe_req(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_probe_req() argument
952 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_probe_req()
953 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_probe_req()
972 if ((!ether_addr_equal(mgmt->da, sdata->vif.addr) && in ieee80211_mesh_rx_probe_req()
1001 ieee80211_tx_skb(sdata, presp); in ieee80211_mesh_rx_probe_req()
1006 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_bcn_presp() argument
1012 struct ieee80211_local *local = sdata->local; in ieee80211_mesh_rx_bcn_presp()
1013 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_rx_bcn_presp()
1022 !ether_addr_equal(mgmt->da, sdata->vif.addr)) in ieee80211_mesh_rx_bcn_presp()
1034 (elems.rsn && sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) || in ieee80211_mesh_rx_bcn_presp()
1035 (!elems.rsn && sdata->u.mesh.security != IEEE80211_MESH_SEC_NONE)) in ieee80211_mesh_rx_bcn_presp()
1048 if (mesh_matches_local(sdata, &elems)) in ieee80211_mesh_rx_bcn_presp()
1049 mesh_neighbour_update(sdata, mgmt->sa, &elems); in ieee80211_mesh_rx_bcn_presp()
1052 ifmsh->sync_ops->rx_bcn_presp(sdata, in ieee80211_mesh_rx_bcn_presp()
1056 !sdata->vif.csa_active) in ieee80211_mesh_rx_bcn_presp()
1057 ieee80211_mesh_process_chnswitch(sdata, &elems, true); in ieee80211_mesh_rx_bcn_presp()
1060 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_finish_csa() argument
1062 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_finish_csa()
1076 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_finish_csa()
1082 mcsa_dbg(sdata, "complete switching to center freq %d MHz", in ieee80211_mesh_finish_csa()
1083 sdata->vif.bss_conf.chandef.chan->center_freq); in ieee80211_mesh_finish_csa()
1087 int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_csa_beacon() argument
1090 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_csa_beacon()
1104 ret = ieee80211_mesh_rebuild_beacon(sdata); in ieee80211_mesh_csa_beacon()
1115 static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_fwd_csa_frame() argument
1120 struct ieee80211_local *local = sdata->local; in mesh_fwd_csa_frame()
1140 memcpy(mgmt_fwd->sa, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1141 memcpy(mgmt_fwd->bssid, sdata->vif.addr, ETH_ALEN); in mesh_fwd_csa_frame()
1143 ieee80211_tx_skb(sdata, skb); in mesh_fwd_csa_frame()
1147 static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, in mesh_rx_csa_frame() argument
1150 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_rx_csa_frame()
1176 if (!sdata->vif.csa_active && in mesh_rx_csa_frame()
1177 !ieee80211_mesh_process_chnswitch(sdata, &elems, false)) { in mesh_rx_csa_frame()
1178 mcsa_dbg(sdata, "Failed to process CSA action frame"); in mesh_rx_csa_frame()
1184 if (mesh_fwd_csa_frame(sdata, mgmt, len) < 0) in mesh_rx_csa_frame()
1185 mcsa_dbg(sdata, "Failed to forward the CSA frame"); in mesh_rx_csa_frame()
1189 static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_mgmt_action() argument
1200 mesh_rx_plink_frame(sdata, mgmt, len, rx_status); in ieee80211_mesh_rx_mgmt_action()
1206 mesh_rx_path_sel_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1209 mesh_rx_csa_frame(sdata, mgmt, len); in ieee80211_mesh_rx_mgmt_action()
1214 void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, in ieee80211_mesh_rx_queued_mgmt() argument
1221 sdata_lock(sdata); in ieee80211_mesh_rx_queued_mgmt()
1224 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_rx_queued_mgmt()
1234 ieee80211_mesh_rx_bcn_presp(sdata, stype, mgmt, skb->len, in ieee80211_mesh_rx_queued_mgmt()
1238 ieee80211_mesh_rx_probe_req(sdata, mgmt, skb->len); in ieee80211_mesh_rx_queued_mgmt()
1241 ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status); in ieee80211_mesh_rx_queued_mgmt()
1245 sdata_unlock(sdata); in ieee80211_mesh_rx_queued_mgmt()
1248 static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata) in mesh_bss_info_changed() argument
1250 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in mesh_bss_info_changed()
1259 if (sdata->vif.bss_conf.enable_beacon && in mesh_bss_info_changed()
1264 if (ieee80211_mesh_rebuild_beacon(sdata)) in mesh_bss_info_changed()
1267 ieee80211_bss_info_change_notify(sdata, changed); in mesh_bss_info_changed()
1270 void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_work() argument
1272 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_work()
1274 sdata_lock(sdata); in ieee80211_mesh_work()
1277 if (!sdata->u.mesh.mesh_id_len) in ieee80211_mesh_work()
1283 mesh_path_start_discovery(sdata); in ieee80211_mesh_work()
1292 ieee80211_mesh_housekeeping(sdata); in ieee80211_mesh_work()
1295 ieee80211_mesh_rootpath(sdata); in ieee80211_mesh_work()
1298 mesh_sync_adjust_tbtt(sdata); in ieee80211_mesh_work()
1301 mesh_bss_info_changed(sdata); in ieee80211_mesh_work()
1303 sdata_unlock(sdata); in ieee80211_mesh_work()
1307 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) in ieee80211_mesh_init_sdata() argument
1309 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; in ieee80211_mesh_init_sdata()
1314 (unsigned long) sdata); in ieee80211_mesh_init_sdata()
1318 mesh_rmc_init(sdata); in ieee80211_mesh_init_sdata()
1327 (unsigned long) sdata); in ieee80211_mesh_init_sdata()
1330 (unsigned long) sdata); in ieee80211_mesh_init_sdata()
1337 sdata->vif.bss_conf.bssid = zero_addr; in ieee80211_mesh_init_sdata()